ARM: tegra: loki: fix build error due to warning
[linux-3.10.git] / arch / arm / mach-tegra / board-bonaire-sensors.c
1 /*
2  * arch/arm/mach-tegra/board-bonaire-sensors.c
3  *
4  * Copyright (c) 2011-2013 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/imx091.h>
37 #include <media/ov9772.h>
38 #include "board.h"
39 #include "board-bonaire.h"
40
41 static int bonaire_imx091_power_on(struct nvc_regulator *vreg)
42 {
43         return 0;
44 }
45
46 static int bonaire_imx091_power_off(struct nvc_regulator *vreg)
47 {
48         return 0;
49 }
50
51 static struct nvc_imager_cap imx091_cap = {
52         .identifier             = "IMX091",
53         .sensor_nvc_interface   = NVC_IMAGER_SENSOR_INTERFACE_SERIAL_A,
54         .pixel_types[0]         = 0x100,
55         .orientation            = 0,
56         .direction              = 0,
57         .initial_clock_rate_khz = 6000,
58         .clock_profiles[0] = {
59                 .external_clock_khz     = 24000,
60                 .clock_multiplier       = 10416667, /* value / 1,000,000 */
61         },
62         .clock_profiles[1] = {
63                 .external_clock_khz     = 0,
64                 .clock_multiplier       = 0,
65         },
66         .h_sync_edge            = 0,
67         .v_sync_edge            = 0,
68         .mclk_on_vgp0           = 0,
69         .csi_port               = 0,
70         .data_lanes             = 4,
71         .virtual_channel_id     = 0,
72         .discontinuous_clk_mode = 1,
73         .cil_threshold_settle   = 0xc,
74         .min_blank_time_width   = 16,
75         .min_blank_time_height  = 16,
76         .preferred_mode_index   = 0,
77         .focuser_guid           = 0,
78         .torch_guid             = 0,
79         .cap_version            = NVC_IMAGER_CAPABILITIES_VERSION2,
80 };
81
82 static struct imx091_platform_data bonaire_imx091_data = {
83         .num                    = 0,
84         .sync                   = 0,
85         .dev_name               = "camera",
86         .gpio_count             = 0,
87         .gpio                   = 0,
88         .cap                    = &imx091_cap,
89         .power_on               = bonaire_imx091_power_on,
90         .power_off              = bonaire_imx091_power_off,
91 };
92
93 static int bonaire_ov9772_power_on(struct nvc_regulator *vreg)
94 {
95         return 0;
96 }
97
98 static int bonaire_ov9772_power_off(struct nvc_regulator *vreg)
99 {
100         return 0;
101 }
102
103 static struct nvc_imager_cap ov9772_cap = {
104         .identifier             = "OV9772",
105         /* refer to NvOdmImagerSensorInterface enum in ODM nvodm_imager.h */
106         .sensor_nvc_interface   = NVC_IMAGER_SENSOR_INTERFACE_SERIAL_C,
107         /* refer to NvOdmImagerPixelType enum in ODM nvodm_imager.h */
108         .pixel_types[0]         = 0x103,
109         /* refer to NvOdmImagerOrientation enum in ODM nvodm_imager.h */
110         .orientation            = 0,
111         /* refer to NvOdmImagerDirection enum in ODM nvodm_imager.h */
112         .direction              = 0,
113         .initial_clock_rate_khz = 6000,
114         .clock_profiles[0] = {
115                 .external_clock_khz     = 24000,
116                 .clock_multiplier       = 1162020, /* value / 1,000,000 */
117         },
118         .clock_profiles[1] = {
119                 .external_clock_khz     = 0,
120                 .clock_multiplier       = 0,
121         },
122         .h_sync_edge            = 0,
123         .v_sync_edge            = 0,
124         .mclk_on_vgp0           = 0,
125         .csi_port               = 1,
126         .data_lanes             = 1,
127         .virtual_channel_id     = 0,
128         .discontinuous_clk_mode = 0, /* use continuous clock */
129         .cil_threshold_settle   = 0xc,
130         .min_blank_time_width   = 16,
131         .min_blank_time_height  = 16,
132         .preferred_mode_index   = 0,
133         .focuser_guid           = 0,
134         .torch_guid             = 0,
135         .cap_version            = NVC_IMAGER_CAPABILITIES_VERSION2,
136 };
137
138 static struct ov9772_platform_data bonaire_ov9772_data = {
139         .num                    = 1,
140         .sync                   = 0,
141         .dev_name               = "camera",
142         .gpio_count             = 0,
143         .gpio                   = 0,
144         .cap                    = &ov9772_cap,
145         .power_on               = bonaire_ov9772_power_on,
146         .power_off              = bonaire_ov9772_power_off,
147 };
148
149
150 static struct i2c_board_info bonaire_i2c_board_info[] = {
151         {
152                 I2C_BOARD_INFO("imx091", 0x36),
153                 .platform_data = &bonaire_imx091_data,
154         },
155         {
156                 I2C_BOARD_INFO("ov9772", 0x10),
157                 .platform_data = &bonaire_ov9772_data,
158         },
159 };
160
161 int __init bonaire_sensors_init(void)
162 {
163         i2c_register_board_info(4, bonaire_i2c_board_info,
164                 ARRAY_SIZE(bonaire_i2c_board_info));
165         return 0;
166 }