ARM: tegra: powermon: Fix copyrights from GPLv3 to GPLv2
[linux-3.10.git] / arch / arm / mach-tegra / board-curacao-sensors.c
1 /*
2  * arch/arm/mach-tegra/board-curacao-sensors.c
3  *
4  * Copyright (c) 2011-2012 NVIDIA CORPORATION, All rights reserved.
5  *
6  * Redistribution and use in source and binary forms, with or without
7  * modification, are permitted provided that the following conditions are
8  * met:
9  *
10  * Redistributions of source code must retain the above copyright notice,
11  * this list of conditions and the following disclaimer.
12  *
13  * Redistributions in binary form must reproduce the above copyright
14  * notice, this list of conditions and the following disclaimer in the
15  * documentation and/or other materials provided with the distribution.
16  *
17  * Neither the name of NVIDIA CORPORATION nor the names of its contributors
18  * may be used to endorse or promote products derived from this software
19  * without specific prior written permission.
20  *
21  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
22  * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
23  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
24  * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
25  * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
26  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
27  * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
28  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
29  * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
30  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
31  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32  */
33
34 #include <linux/i2c.h>
35 #include <linux/delay.h>
36 #include <media/ov5650.h>
37 #include <media/ov14810.h>
38 #include <media/ov2710.h>
39 #include "gpio-names.h"
40 #include "board.h"
41
42 #include "gpio-names.h"
43 #include "board-curacao.h"
44 #include "cpu-tegra.h"
45
46 static struct board_info board_info;
47
48 static int curacao_camera_init(void)
49 {
50         return 0;
51 }
52
53 static int curacao_left_ov5650_power_on(struct device *dev)
54 {
55         return 0;
56 }
57
58 static int curacao_left_ov5650_power_off(struct device *dev)
59 {
60         return 0;
61 }
62
63 struct ov5650_platform_data curacao_ov5650_data = {
64         .power_on = curacao_left_ov5650_power_on,
65         .power_off = curacao_left_ov5650_power_off,
66 };
67
68 #ifdef CONFIG_VIDEO_OV14810
69 static int curacao_ov14810_power_on(struct device *dev)
70 {
71         return 0;
72 }
73
74 static int curacao_ov14810_power_off(struct device *dev)
75 {
76         return 0;
77 }
78
79 struct ov14810_platform_data curacao_ov14810_data = {
80         .power_on = curacao_ov14810_power_on,
81         .power_off = curacao_ov14810_power_off,
82 };
83
84 struct ov14810_platform_data curacao_ov14810uC_data = {
85         .power_on = NULL,
86         .power_off = NULL,
87 };
88
89 struct ov14810_platform_data curacao_ov14810SlaveDev_data = {
90         .power_on = NULL,
91         .power_off = NULL,
92 };
93
94 static struct i2c_board_info curacao_i2c_board_info_e1214[] = {
95         {
96                 I2C_BOARD_INFO("ov14810", 0x36),
97                 .platform_data = &curacao_ov14810_data,
98         },
99         {
100                 I2C_BOARD_INFO("ov14810uC", 0x67),
101                 .platform_data = &curacao_ov14810uC_data,
102         },
103         {
104                 I2C_BOARD_INFO("ov14810SlaveDev", 0x69),
105                 .platform_data = &curacao_ov14810SlaveDev_data,
106         }
107 };
108 #endif
109
110 static int curacao_right_ov5650_power_on(struct device *dev)
111 {
112         return 0;
113 }
114
115 static int curacao_right_ov5650_power_off(struct device *dev)
116 {
117         return 0;
118 }
119
120 static void curacao_ov5650_synchronize_sensors(void)
121 {
122         pr_err("%s: UnSupported BoardId\n", __func__);
123 }
124
125 struct ov5650_platform_data curacao_right_ov5650_data = {
126         .power_on = curacao_right_ov5650_power_on,
127         .power_off = curacao_right_ov5650_power_off,
128         .synchronize_sensors = curacao_ov5650_synchronize_sensors,
129 };
130
131 static int curacao_ov2710_power_on(struct device *dev)
132 {
133         return 0;
134 }
135
136 static int curacao_ov2710_power_off(struct device *dev)
137 {
138         return 0;
139 }
140
141 struct ov2710_platform_data curacao_ov2710_data = {
142         .power_on = curacao_ov2710_power_on,
143         .power_off = curacao_ov2710_power_off,
144 };
145
146 static struct i2c_board_info curacao_i2c2_board_info[] = {
147         {
148                 I2C_BOARD_INFO("ov5650R", 0x36),
149                 .platform_data = &curacao_ov5650_data,
150         },
151 };
152
153 int __init curacao_sensors_init(void)
154 {
155         tegra_get_board_info(&board_info);
156
157         curacao_camera_init();
158
159         i2c_register_board_info(3, curacao_i2c2_board_info,
160                 ARRAY_SIZE(curacao_i2c2_board_info));
161
162 #ifdef CONFIG_VIDEO_OV14810
163         i2c_register_board_info(3, curacao_i2c_board_info_e1214,
164                 ARRAY_SIZE(curacao_i2c_board_info_e1214));
165 #endif
166
167         return 0;
168 }