blob: bc1ededb443141d1e8c34ab11201c3e572770152 [file] [log] [blame]
Kevin Chan412e9f92012-01-24 10:45:23 -08001/* Copyright (c) 2012, Code Aurora Forum. All rights reserved.
2 *
3 * This program is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License version 2 and
5 * only version 2 as published by the Free Software Foundation.
6 *
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
11 *
12 */
13
Kevin Chan412e9f92012-01-24 10:45:23 -080014#include <linux/i2c.h>
Kevin Chaneb6b6072012-01-17 11:54:54 -080015#include <linux/gpio.h>
Steve Mucklef132c6c2012-06-06 18:30:57 -070016
17#include <asm/mach-types.h>
18
Jack Wangb88c8c22012-07-26 11:33:36 -070019#include <mach/camera.h>
Kevin Chan412e9f92012-01-24 10:45:23 -080020#include <mach/msm_bus_board.h>
Kevin Chan412e9f92012-01-24 10:45:23 -080021#include <mach/gpiomux.h>
22
23#include "devices.h"
24#include "board-8064.h"
25
Steve Mucklef132c6c2012-06-06 18:30:57 -070026#ifdef CONFIG_MSM_CAMERA
27
Kevin Chan412e9f92012-01-24 10:45:23 -080028static struct gpiomux_setting cam_settings[] = {
29 {
30 .func = GPIOMUX_FUNC_GPIO, /*suspend*/
31 .drv = GPIOMUX_DRV_2MA,
32 .pull = GPIOMUX_PULL_DOWN,
33 },
34
35 {
36 .func = GPIOMUX_FUNC_1, /*active 1*/
37 .drv = GPIOMUX_DRV_2MA,
38 .pull = GPIOMUX_PULL_NONE,
39 },
40
41 {
42 .func = GPIOMUX_FUNC_GPIO, /*active 2*/
43 .drv = GPIOMUX_DRV_2MA,
44 .pull = GPIOMUX_PULL_NONE,
45 },
46
47 {
Kevin Chand07220e2012-02-13 15:52:22 -080048 .func = GPIOMUX_FUNC_2, /*active 3*/
49 .drv = GPIOMUX_DRV_2MA,
Kevin Chan412e9f92012-01-24 10:45:23 -080050 .pull = GPIOMUX_PULL_NONE,
51 },
52
53 {
54 .func = GPIOMUX_FUNC_5, /*active 4*/
55 .drv = GPIOMUX_DRV_8MA,
56 .pull = GPIOMUX_PULL_UP,
57 },
58
59 {
60 .func = GPIOMUX_FUNC_6, /*active 5*/
61 .drv = GPIOMUX_DRV_8MA,
62 .pull = GPIOMUX_PULL_UP,
63 },
64
65 {
66 .func = GPIOMUX_FUNC_2, /*active 6*/
67 .drv = GPIOMUX_DRV_2MA,
68 .pull = GPIOMUX_PULL_UP,
69 },
70
71 {
72 .func = GPIOMUX_FUNC_3, /*active 7*/
73 .drv = GPIOMUX_DRV_8MA,
74 .pull = GPIOMUX_PULL_UP,
75 },
76
77 {
78 .func = GPIOMUX_FUNC_GPIO, /*i2c suspend*/
79 .drv = GPIOMUX_DRV_2MA,
80 .pull = GPIOMUX_PULL_KEEPER,
81 },
82
Kevin Chand07220e2012-02-13 15:52:22 -080083 {
84 .func = GPIOMUX_FUNC_9, /*active 9*/
85 .drv = GPIOMUX_DRV_8MA,
86 .pull = GPIOMUX_PULL_NONE,
87 },
88 {
89 .func = GPIOMUX_FUNC_A, /*active 10*/
90 .drv = GPIOMUX_DRV_8MA,
91 .pull = GPIOMUX_PULL_NONE,
92 },
93 {
94 .func = GPIOMUX_FUNC_6, /*active 11*/
95 .drv = GPIOMUX_DRV_8MA,
96 .pull = GPIOMUX_PULL_NONE,
97 },
98 {
99 .func = GPIOMUX_FUNC_4, /*active 12*/
100 .drv = GPIOMUX_DRV_2MA,
101 .pull = GPIOMUX_PULL_NONE,
102 },
103
Kevin Chan412e9f92012-01-24 10:45:23 -0800104};
105
Kevin Chan412e9f92012-01-24 10:45:23 -0800106static struct msm_gpiomux_config apq8064_cam_common_configs[] = {
107 {
Jeyaprakash Soundrapandiana1b3c532012-02-29 20:33:30 -0800108 .gpio = 1,
109 .settings = {
110 [GPIOMUX_ACTIVE] = &cam_settings[2],
111 [GPIOMUX_SUSPENDED] = &cam_settings[0],
112 },
113 },
114 {
Kevin Chan412e9f92012-01-24 10:45:23 -0800115 .gpio = 2,
116 .settings = {
Kevin Chand07220e2012-02-13 15:52:22 -0800117 [GPIOMUX_ACTIVE] = &cam_settings[12],
Kevin Chan412e9f92012-01-24 10:45:23 -0800118 [GPIOMUX_SUSPENDED] = &cam_settings[0],
119 },
120 },
121 {
122 .gpio = 3,
123 .settings = {
Jeyaprakash Soundrapandiana1b3c532012-02-29 20:33:30 -0800124 [GPIOMUX_ACTIVE] = &cam_settings[2],
Kevin Chan412e9f92012-01-24 10:45:23 -0800125 [GPIOMUX_SUSPENDED] = &cam_settings[0],
126 },
127 },
128 {
129 .gpio = 4,
130 .settings = {
Kevin Chand07220e2012-02-13 15:52:22 -0800131 [GPIOMUX_ACTIVE] = &cam_settings[3],
Kevin Chan412e9f92012-01-24 10:45:23 -0800132 [GPIOMUX_SUSPENDED] = &cam_settings[0],
133 },
134 },
135 {
136 .gpio = 5,
137 .settings = {
138 [GPIOMUX_ACTIVE] = &cam_settings[1],
139 [GPIOMUX_SUSPENDED] = &cam_settings[0],
140 },
141 },
142 {
Kevin Chand07220e2012-02-13 15:52:22 -0800143 .gpio = 34,
Kevin Chan412e9f92012-01-24 10:45:23 -0800144 .settings = {
145 [GPIOMUX_ACTIVE] = &cam_settings[2],
146 [GPIOMUX_SUSPENDED] = &cam_settings[0],
147 },
148 },
149 {
150 .gpio = 107,
151 .settings = {
152 [GPIOMUX_ACTIVE] = &cam_settings[2],
153 [GPIOMUX_SUSPENDED] = &cam_settings[0],
154 },
155 },
Kevin Chan412e9f92012-01-24 10:45:23 -0800156 {
157 .gpio = 10,
158 .settings = {
Kevin Chand07220e2012-02-13 15:52:22 -0800159 [GPIOMUX_ACTIVE] = &cam_settings[9],
Kevin Chan412e9f92012-01-24 10:45:23 -0800160 [GPIOMUX_SUSPENDED] = &cam_settings[8],
161 },
162 },
163 {
164 .gpio = 11,
165 .settings = {
Kevin Chand07220e2012-02-13 15:52:22 -0800166 [GPIOMUX_ACTIVE] = &cam_settings[10],
Kevin Chan412e9f92012-01-24 10:45:23 -0800167 [GPIOMUX_SUSPENDED] = &cam_settings[8],
168 },
169 },
170 {
171 .gpio = 12,
172 .settings = {
Kevin Chand07220e2012-02-13 15:52:22 -0800173 [GPIOMUX_ACTIVE] = &cam_settings[11],
Kevin Chan412e9f92012-01-24 10:45:23 -0800174 [GPIOMUX_SUSPENDED] = &cam_settings[8],
175 },
176 },
177 {
178 .gpio = 13,
179 .settings = {
Kevin Chand07220e2012-02-13 15:52:22 -0800180 [GPIOMUX_ACTIVE] = &cam_settings[11],
Kevin Chan412e9f92012-01-24 10:45:23 -0800181 [GPIOMUX_SUSPENDED] = &cam_settings[8],
182 },
183 },
184};
185
Jeyaprakash Soundrapandiana1b3c532012-02-29 20:33:30 -0800186
187#define VFE_CAMIF_TIMER1_GPIO 3
188#define VFE_CAMIF_TIMER2_GPIO 1
189
190static struct msm_camera_sensor_flash_src msm_flash_src = {
191 .flash_sr_type = MSM_CAMERA_FLASH_SRC_EXT,
192 ._fsrc.ext_driver_src.led_en = VFE_CAMIF_TIMER1_GPIO,
193 ._fsrc.ext_driver_src.led_flash_en = VFE_CAMIF_TIMER2_GPIO,
Jeyaprakash Soundrapandian85099fe2012-05-15 17:09:51 -0700194 ._fsrc.ext_driver_src.flash_id = MAM_CAMERA_EXT_LED_FLASH_SC628A,
Jeyaprakash Soundrapandiana1b3c532012-02-29 20:33:30 -0800195};
196
Kevin Chand07220e2012-02-13 15:52:22 -0800197static struct msm_gpiomux_config apq8064_cam_2d_configs[] = {
198};
199
Kevin Chan412e9f92012-01-24 10:45:23 -0800200static struct msm_bus_vectors cam_init_vectors[] = {
201 {
202 .src = MSM_BUS_MASTER_VFE,
203 .dst = MSM_BUS_SLAVE_EBI_CH0,
204 .ab = 0,
205 .ib = 0,
206 },
207 {
208 .src = MSM_BUS_MASTER_VPE,
209 .dst = MSM_BUS_SLAVE_EBI_CH0,
210 .ab = 0,
211 .ib = 0,
212 },
213 {
214 .src = MSM_BUS_MASTER_JPEG_ENC,
215 .dst = MSM_BUS_SLAVE_EBI_CH0,
216 .ab = 0,
217 .ib = 0,
218 },
219};
220
221static struct msm_bus_vectors cam_preview_vectors[] = {
222 {
223 .src = MSM_BUS_MASTER_VFE,
224 .dst = MSM_BUS_SLAVE_EBI_CH0,
225 .ab = 27648000,
226 .ib = 110592000,
227 },
228 {
229 .src = MSM_BUS_MASTER_VPE,
230 .dst = MSM_BUS_SLAVE_EBI_CH0,
231 .ab = 0,
232 .ib = 0,
233 },
234 {
235 .src = MSM_BUS_MASTER_JPEG_ENC,
236 .dst = MSM_BUS_SLAVE_EBI_CH0,
237 .ab = 0,
238 .ib = 0,
239 },
240};
241
242static struct msm_bus_vectors cam_video_vectors[] = {
243 {
244 .src = MSM_BUS_MASTER_VFE,
245 .dst = MSM_BUS_SLAVE_EBI_CH0,
Kiran Kumar H N1d1d3072012-07-05 13:40:13 -0700246 .ab = 274406400,
Kevin Chan412e9f92012-01-24 10:45:23 -0800247 .ib = 561807360,
248 },
249 {
250 .src = MSM_BUS_MASTER_VPE,
251 .dst = MSM_BUS_SLAVE_EBI_CH0,
252 .ab = 206807040,
253 .ib = 488816640,
254 },
255 {
256 .src = MSM_BUS_MASTER_JPEG_ENC,
257 .dst = MSM_BUS_SLAVE_EBI_CH0,
258 .ab = 0,
259 .ib = 0,
260 },
261};
262
263static struct msm_bus_vectors cam_snapshot_vectors[] = {
264 {
265 .src = MSM_BUS_MASTER_VFE,
266 .dst = MSM_BUS_SLAVE_EBI_CH0,
267 .ab = 274423680,
268 .ib = 1097694720,
269 },
270 {
271 .src = MSM_BUS_MASTER_VPE,
272 .dst = MSM_BUS_SLAVE_EBI_CH0,
273 .ab = 0,
274 .ib = 0,
275 },
276 {
277 .src = MSM_BUS_MASTER_JPEG_ENC,
278 .dst = MSM_BUS_SLAVE_EBI_CH0,
279 .ab = 540000000,
280 .ib = 1350000000,
281 },
282};
283
284static struct msm_bus_vectors cam_zsl_vectors[] = {
285 {
286 .src = MSM_BUS_MASTER_VFE,
287 .dst = MSM_BUS_SLAVE_EBI_CH0,
288 .ab = 302071680,
289 .ib = 1208286720,
290 },
291 {
292 .src = MSM_BUS_MASTER_VPE,
293 .dst = MSM_BUS_SLAVE_EBI_CH0,
294 .ab = 0,
295 .ib = 0,
296 },
297 {
298 .src = MSM_BUS_MASTER_JPEG_ENC,
299 .dst = MSM_BUS_SLAVE_EBI_CH0,
300 .ab = 540000000,
301 .ib = 1350000000,
302 },
303};
304
Kiran Kumar H N1d1d3072012-07-05 13:40:13 -0700305static struct msm_bus_vectors cam_video_ls_vectors[] = {
306 {
307 .src = MSM_BUS_MASTER_VFE,
308 .dst = MSM_BUS_SLAVE_EBI_CH0,
309 .ab = 348192000,
310 .ib = 617103360,
311 },
312 {
313 .src = MSM_BUS_MASTER_VPE,
314 .dst = MSM_BUS_SLAVE_EBI_CH0,
315 .ab = 206807040,
316 .ib = 488816640,
317 },
318 {
319 .src = MSM_BUS_MASTER_JPEG_ENC,
320 .dst = MSM_BUS_SLAVE_EBI_CH0,
321 .ab = 540000000,
322 .ib = 1350000000,
323 },
324};
325
Nishant Pandit221a9482012-09-03 05:36:04 +0530326static struct msm_bus_vectors cam_dual_vectors[] = {
327 {
328 .src = MSM_BUS_MASTER_VFE,
329 .dst = MSM_BUS_SLAVE_EBI_CH0,
330 .ab = 348192000,
331 .ib = 1208286720,
332 },
333 {
334 .src = MSM_BUS_MASTER_VPE,
335 .dst = MSM_BUS_SLAVE_EBI_CH0,
336 .ab = 206807040,
337 .ib = 488816640,
338 },
339 {
340 .src = MSM_BUS_MASTER_JPEG_ENC,
341 .dst = MSM_BUS_SLAVE_EBI_CH0,
342 .ab = 540000000,
343 .ib = 1350000000,
344 },
345 {
346 .src = MSM_BUS_MASTER_JPEG_ENC,
347 .dst = MSM_BUS_SLAVE_MM_IMEM,
348 .ab = 43200000,
349 .ib = 69120000,
350 },
351 {
352 .src = MSM_BUS_MASTER_VFE,
353 .dst = MSM_BUS_SLAVE_MM_IMEM,
354 .ab = 43200000,
355 .ib = 69120000,
356 },
357};
358
359
Kevin Chan412e9f92012-01-24 10:45:23 -0800360static struct msm_bus_paths cam_bus_client_config[] = {
361 {
362 ARRAY_SIZE(cam_init_vectors),
363 cam_init_vectors,
364 },
365 {
366 ARRAY_SIZE(cam_preview_vectors),
367 cam_preview_vectors,
368 },
369 {
370 ARRAY_SIZE(cam_video_vectors),
371 cam_video_vectors,
372 },
373 {
374 ARRAY_SIZE(cam_snapshot_vectors),
375 cam_snapshot_vectors,
376 },
377 {
378 ARRAY_SIZE(cam_zsl_vectors),
379 cam_zsl_vectors,
380 },
Kiran Kumar H N1d1d3072012-07-05 13:40:13 -0700381 {
382 ARRAY_SIZE(cam_video_ls_vectors),
383 cam_video_ls_vectors,
384 },
Nishant Pandit221a9482012-09-03 05:36:04 +0530385 {
386 ARRAY_SIZE(cam_dual_vectors),
387 cam_dual_vectors,
388 },
Kevin Chan412e9f92012-01-24 10:45:23 -0800389};
390
391static struct msm_bus_scale_pdata cam_bus_client_pdata = {
392 cam_bus_client_config,
393 ARRAY_SIZE(cam_bus_client_config),
394 .name = "msm_camera",
395};
396
397static struct msm_camera_device_platform_data msm_camera_csi_device_data[] = {
398 {
Kevin Chan412e9f92012-01-24 10:45:23 -0800399 .csid_core = 0,
Kevin Chaneb6b6072012-01-17 11:54:54 -0800400 .is_vpe = 1,
Kevin Chan412e9f92012-01-24 10:45:23 -0800401 .cam_bus_scale_table = &cam_bus_client_pdata,
402 },
403 {
Kevin Chan412e9f92012-01-24 10:45:23 -0800404 .csid_core = 1,
Kevin Chaneb6b6072012-01-17 11:54:54 -0800405 .is_vpe = 1,
Kevin Chan412e9f92012-01-24 10:45:23 -0800406 .cam_bus_scale_table = &cam_bus_client_pdata,
407 },
408};
409
Sreesudhan Ramakrish Ramkumar923fbad2012-07-26 17:31:42 -0700410static struct camera_vreg_t apq_8064_cam_vreg[] = {
Kevin Chaneb6b6072012-01-17 11:54:54 -0800411 {"cam_vdig", REG_LDO, 1200000, 1200000, 105000},
Sreesudhan Ramakrish Ramkumar6c6f57c2012-02-21 15:12:44 -0800412 {"cam_vio", REG_VS, 0, 0, 0},
413 {"cam_vana", REG_LDO, 2800000, 2850000, 85600},
Kevin Chaneb6b6072012-01-17 11:54:54 -0800414 {"cam_vaf", REG_LDO, 2800000, 2850000, 300000},
415};
416
Kevin Chand07220e2012-02-13 15:52:22 -0800417#define CAML_RSTN PM8921_GPIO_PM_TO_SYS(28)
418#define CAMR_RSTN 34
419
Kevin Chaneb6b6072012-01-17 11:54:54 -0800420static struct gpio apq8064_common_cam_gpio[] = {
Kevin Chaneb6b6072012-01-17 11:54:54 -0800421};
422
423static struct gpio apq8064_back_cam_gpio[] = {
Kevin Chand07220e2012-02-13 15:52:22 -0800424 {5, GPIOF_DIR_IN, "CAMIF_MCLK"},
425 {CAML_RSTN, GPIOF_DIR_OUT, "CAM_RESET"},
Kevin Chaneb6b6072012-01-17 11:54:54 -0800426};
427
428static struct msm_gpio_set_tbl apq8064_back_cam_gpio_set_tbl[] = {
Kevin Chand07220e2012-02-13 15:52:22 -0800429 {CAML_RSTN, GPIOF_OUT_INIT_LOW, 10000},
430 {CAML_RSTN, GPIOF_OUT_INIT_HIGH, 10000},
Kevin Chaneb6b6072012-01-17 11:54:54 -0800431};
432
433static struct msm_camera_gpio_conf apq8064_back_cam_gpio_conf = {
434 .cam_gpiomux_conf_tbl = apq8064_cam_2d_configs,
435 .cam_gpiomux_conf_tbl_size = ARRAY_SIZE(apq8064_cam_2d_configs),
436 .cam_gpio_common_tbl = apq8064_common_cam_gpio,
437 .cam_gpio_common_tbl_size = ARRAY_SIZE(apq8064_common_cam_gpio),
438 .cam_gpio_req_tbl = apq8064_back_cam_gpio,
439 .cam_gpio_req_tbl_size = ARRAY_SIZE(apq8064_back_cam_gpio),
440 .cam_gpio_set_tbl = apq8064_back_cam_gpio_set_tbl,
441 .cam_gpio_set_tbl_size = ARRAY_SIZE(apq8064_back_cam_gpio_set_tbl),
442};
443
Kevin Chand07220e2012-02-13 15:52:22 -0800444static struct gpio apq8064_front_cam_gpio[] = {
445 {4, GPIOF_DIR_IN, "CAMIF_MCLK"},
446 {12, GPIOF_DIR_IN, "CAMIF_I2C_DATA"},
447 {13, GPIOF_DIR_IN, "CAMIF_I2C_CLK"},
448 {CAMR_RSTN, GPIOF_DIR_OUT, "CAM_RESET"},
449};
450
451static struct msm_gpio_set_tbl apq8064_front_cam_gpio_set_tbl[] = {
452 {CAMR_RSTN, GPIOF_OUT_INIT_LOW, 10000},
453 {CAMR_RSTN, GPIOF_OUT_INIT_HIGH, 10000},
454};
455
456static struct msm_camera_gpio_conf apq8064_front_cam_gpio_conf = {
457 .cam_gpiomux_conf_tbl = apq8064_cam_2d_configs,
458 .cam_gpiomux_conf_tbl_size = ARRAY_SIZE(apq8064_cam_2d_configs),
459 .cam_gpio_common_tbl = apq8064_common_cam_gpio,
460 .cam_gpio_common_tbl_size = ARRAY_SIZE(apq8064_common_cam_gpio),
461 .cam_gpio_req_tbl = apq8064_front_cam_gpio,
462 .cam_gpio_req_tbl_size = ARRAY_SIZE(apq8064_front_cam_gpio),
463 .cam_gpio_set_tbl = apq8064_front_cam_gpio_set_tbl,
464 .cam_gpio_set_tbl_size = ARRAY_SIZE(apq8064_front_cam_gpio_set_tbl),
465};
466
467static struct msm_camera_i2c_conf apq8064_back_cam_i2c_conf = {
468 .use_i2c_mux = 1,
469 .mux_dev = &msm8960_device_i2c_mux_gsbi4,
470 .i2c_mux_mode = MODE_L,
471};
472
Rajakumar Govindaram6627b362012-01-29 19:00:30 -0800473static struct i2c_board_info msm_act_main_cam_i2c_info = {
474 I2C_BOARD_INFO("msm_actuator", 0x11),
Jignesh Mehta33394572012-02-21 19:57:41 -0800475};
476
Rajakumar Govindaram6627b362012-01-29 19:00:30 -0800477static struct msm_actuator_info msm_act_main_cam_0_info = {
478 .board_info = &msm_act_main_cam_i2c_info,
479 .cam_name = MSM_ACTUATOR_MAIN_CAM_0,
Jignesh Mehta33394572012-02-21 19:57:41 -0800480 .bus_id = APQ_8064_GSBI4_QUP_I2C_BUS_ID,
481 .vcm_pwd = 0,
Rajakumar Govindaram6627b362012-01-29 19:00:30 -0800482 .vcm_enable = 0,
Jignesh Mehta33394572012-02-21 19:57:41 -0800483};
484
Jeyaprakash Soundrapandian3040c032012-04-21 01:13:29 -0700485static struct i2c_board_info msm_act_main_cam1_i2c_info = {
486 I2C_BOARD_INFO("msm_actuator", 0x18),
487};
488
489static struct msm_actuator_info msm_act_main_cam_1_info = {
490 .board_info = &msm_act_main_cam1_i2c_info,
491 .cam_name = MSM_ACTUATOR_MAIN_CAM_1,
492 .bus_id = APQ_8064_GSBI4_QUP_I2C_BUS_ID,
493 .vcm_pwd = 0,
494 .vcm_enable = 0,
495};
496
497
Kevin Chand07220e2012-02-13 15:52:22 -0800498static struct msm_camera_i2c_conf apq8064_front_cam_i2c_conf = {
499 .use_i2c_mux = 1,
500 .mux_dev = &msm8960_device_i2c_mux_gsbi4,
501 .i2c_mux_mode = MODE_L,
502};
503
Kevin Chan412e9f92012-01-24 10:45:23 -0800504static struct msm_camera_sensor_flash_data flash_imx074 = {
Jeyaprakash Soundrapandiana1b3c532012-02-29 20:33:30 -0800505 .flash_type = MSM_CAMERA_FLASH_LED,
506 .flash_src = &msm_flash_src
Kevin Chan412e9f92012-01-24 10:45:23 -0800507};
508
Hody Hung9ba65cf2012-01-17 17:34:51 -0800509static struct msm_camera_csi_lane_params imx074_csi_lane_params = {
510 .csi_lane_assign = 0xE4,
511 .csi_lane_mask = 0xF,
512};
513
Kevin Chan412e9f92012-01-24 10:45:23 -0800514static struct msm_camera_sensor_platform_info sensor_board_info_imx074 = {
515 .mount_angle = 90,
Sreesudhan Ramakrish Ramkumar923fbad2012-07-26 17:31:42 -0700516 .cam_vreg = apq_8064_cam_vreg,
517 .num_vreg = ARRAY_SIZE(apq_8064_cam_vreg),
Kevin Chaneb6b6072012-01-17 11:54:54 -0800518 .gpio_conf = &apq8064_back_cam_gpio_conf,
Kevin Chand07220e2012-02-13 15:52:22 -0800519 .i2c_conf = &apq8064_back_cam_i2c_conf,
Hody Hung9ba65cf2012-01-17 17:34:51 -0800520 .csi_lane_params = &imx074_csi_lane_params,
Kevin Chan412e9f92012-01-24 10:45:23 -0800521};
522
Jeyaprakash Soundrapandian734476b2012-05-03 20:08:15 -0700523static struct i2c_board_info imx074_eeprom_i2c_info = {
524 I2C_BOARD_INFO("imx074_eeprom", 0x34 << 1),
525};
526
527static struct msm_eeprom_info imx074_eeprom_info = {
528 .board_info = &imx074_eeprom_i2c_info,
529 .bus_id = APQ_8064_GSBI4_QUP_I2C_BUS_ID,
530};
531
Kevin Chan412e9f92012-01-24 10:45:23 -0800532static struct msm_camera_sensor_info msm_camera_sensor_imx074_data = {
533 .sensor_name = "imx074",
534 .pdata = &msm_camera_csi_device_data[0],
535 .flash_data = &flash_imx074,
536 .sensor_platform_info = &sensor_board_info_imx074,
Kevin Chan412e9f92012-01-24 10:45:23 -0800537 .csi_if = 1,
538 .camera_type = BACK_CAMERA_2D,
Raju P.L.S.S.S.N3f4b3022012-03-29 10:09:01 +0530539 .sensor_type = BAYER_SENSOR,
Rajakumar Govindaram6627b362012-01-29 19:00:30 -0800540 .actuator_info = &msm_act_main_cam_0_info,
Jeyaprakash Soundrapandian734476b2012-05-03 20:08:15 -0700541 .eeprom_info = &imx074_eeprom_info,
Kevin Chan412e9f92012-01-24 10:45:23 -0800542};
Jeyaprakash Soundrapandian734476b2012-05-03 20:08:15 -0700543
Sreesudhan Ramakrish Ramkumar3381da72012-01-27 08:08:32 -0800544static struct msm_camera_csi_lane_params imx091_csi_lane_params = {
545 .csi_lane_assign = 0xE4,
546 .csi_lane_mask = 0xF,
547};
548
Sreesudhan Ramakrish Ramkumar3381da72012-01-27 08:08:32 -0800549static struct msm_camera_sensor_flash_data flash_imx091 = {
550 .flash_type = MSM_CAMERA_FLASH_NONE,
551};
552
553static struct msm_camera_sensor_platform_info sensor_board_info_imx091 = {
554 .mount_angle = 0,
Sreesudhan Ramakrish Ramkumar923fbad2012-07-26 17:31:42 -0700555 .cam_vreg = apq_8064_cam_vreg,
556 .num_vreg = ARRAY_SIZE(apq_8064_cam_vreg),
Sreesudhan Ramakrish Ramkumar3381da72012-01-27 08:08:32 -0800557 .gpio_conf = &apq8064_back_cam_gpio_conf,
558 .i2c_conf = &apq8064_back_cam_i2c_conf,
559 .csi_lane_params = &imx091_csi_lane_params,
560};
561
Jeyaprakash Soundrapandian734476b2012-05-03 20:08:15 -0700562static struct i2c_board_info imx091_eeprom_i2c_info = {
563 I2C_BOARD_INFO("imx091_eeprom", 0x21),
564};
565
566static struct msm_eeprom_info imx091_eeprom_info = {
567 .board_info = &imx091_eeprom_i2c_info,
568 .bus_id = APQ_8064_GSBI4_QUP_I2C_BUS_ID,
569};
570
Sreesudhan Ramakrish Ramkumar3381da72012-01-27 08:08:32 -0800571static struct msm_camera_sensor_info msm_camera_sensor_imx091_data = {
572 .sensor_name = "imx091",
573 .pdata = &msm_camera_csi_device_data[0],
574 .flash_data = &flash_imx091,
575 .sensor_platform_info = &sensor_board_info_imx091,
576 .csi_if = 1,
577 .camera_type = BACK_CAMERA_2D,
Raju P.L.S.S.S.N3f4b3022012-03-29 10:09:01 +0530578 .sensor_type = BAYER_SENSOR,
Jeyaprakash Soundrapandian3040c032012-04-21 01:13:29 -0700579 .actuator_info = &msm_act_main_cam_1_info,
Jeyaprakash Soundrapandian734476b2012-05-03 20:08:15 -0700580 .eeprom_info = &imx091_eeprom_info,
Sreesudhan Ramakrish Ramkumar3381da72012-01-27 08:08:32 -0800581};
Kevin Chan412e9f92012-01-24 10:45:23 -0800582
Sreesudhan Ramakrish Ramkumar8002a792012-04-09 17:42:58 -0700583static struct msm_camera_sensor_flash_data flash_s5k3l1yx = {
584 .flash_type = MSM_CAMERA_FLASH_NONE,
585};
586
587static struct msm_camera_csi_lane_params s5k3l1yx_csi_lane_params = {
588 .csi_lane_assign = 0xE4,
589 .csi_lane_mask = 0xF,
590};
591
592static struct msm_camera_sensor_platform_info sensor_board_info_s5k3l1yx = {
593 .mount_angle = 90,
Sreesudhan Ramakrish Ramkumar923fbad2012-07-26 17:31:42 -0700594 .cam_vreg = apq_8064_cam_vreg,
595 .num_vreg = ARRAY_SIZE(apq_8064_cam_vreg),
Sreesudhan Ramakrish Ramkumar8002a792012-04-09 17:42:58 -0700596 .gpio_conf = &apq8064_back_cam_gpio_conf,
597 .i2c_conf = &apq8064_back_cam_i2c_conf,
598 .csi_lane_params = &s5k3l1yx_csi_lane_params,
599};
600
601static struct msm_camera_sensor_info msm_camera_sensor_s5k3l1yx_data = {
602 .sensor_name = "s5k3l1yx",
603 .pdata = &msm_camera_csi_device_data[0],
604 .flash_data = &flash_s5k3l1yx,
605 .sensor_platform_info = &sensor_board_info_s5k3l1yx,
606 .csi_if = 1,
607 .camera_type = BACK_CAMERA_2D,
608 .sensor_type = BAYER_SENSOR,
609};
610
Sreesudhan Ramakrish Ramkumar6c6f57c2012-02-21 15:12:44 -0800611static struct msm_camera_sensor_flash_data flash_mt9m114 = {
612 .flash_type = MSM_CAMERA_FLASH_NONE
613};
614
Hody Hung9ba65cf2012-01-17 17:34:51 -0800615static struct msm_camera_csi_lane_params mt9m114_csi_lane_params = {
616 .csi_lane_assign = 0xE4,
617 .csi_lane_mask = 0x1,
618};
619
Sreesudhan Ramakrish Ramkumar6c6f57c2012-02-21 15:12:44 -0800620static struct msm_camera_sensor_platform_info sensor_board_info_mt9m114 = {
621 .mount_angle = 90,
Sreesudhan Ramakrish Ramkumar923fbad2012-07-26 17:31:42 -0700622 .cam_vreg = apq_8064_cam_vreg,
623 .num_vreg = ARRAY_SIZE(apq_8064_cam_vreg),
Sreesudhan Ramakrish Ramkumar6c6f57c2012-02-21 15:12:44 -0800624 .gpio_conf = &apq8064_front_cam_gpio_conf,
625 .i2c_conf = &apq8064_front_cam_i2c_conf,
Hody Hung9ba65cf2012-01-17 17:34:51 -0800626 .csi_lane_params = &mt9m114_csi_lane_params,
Sreesudhan Ramakrish Ramkumar6c6f57c2012-02-21 15:12:44 -0800627};
628
629static struct msm_camera_sensor_info msm_camera_sensor_mt9m114_data = {
630 .sensor_name = "mt9m114",
631 .pdata = &msm_camera_csi_device_data[1],
632 .flash_data = &flash_mt9m114,
633 .sensor_platform_info = &sensor_board_info_mt9m114,
634 .csi_if = 1,
635 .camera_type = FRONT_CAMERA_2D,
Raju P.L.S.S.S.N3f4b3022012-03-29 10:09:01 +0530636 .sensor_type = YUV_SENSOR,
Sreesudhan Ramakrish Ramkumar6c6f57c2012-02-21 15:12:44 -0800637};
638
Kevin Chand07220e2012-02-13 15:52:22 -0800639static struct msm_camera_sensor_flash_data flash_ov2720 = {
640 .flash_type = MSM_CAMERA_FLASH_NONE,
641};
642
Hody Hung9ba65cf2012-01-17 17:34:51 -0800643static struct msm_camera_csi_lane_params ov2720_csi_lane_params = {
644 .csi_lane_assign = 0xE4,
645 .csi_lane_mask = 0x3,
646};
647
Kevin Chand07220e2012-02-13 15:52:22 -0800648static struct msm_camera_sensor_platform_info sensor_board_info_ov2720 = {
649 .mount_angle = 0,
Sreesudhan Ramakrish Ramkumar923fbad2012-07-26 17:31:42 -0700650 .cam_vreg = apq_8064_cam_vreg,
651 .num_vreg = ARRAY_SIZE(apq_8064_cam_vreg),
Kevin Chand07220e2012-02-13 15:52:22 -0800652 .gpio_conf = &apq8064_front_cam_gpio_conf,
653 .i2c_conf = &apq8064_front_cam_i2c_conf,
Hody Hung9ba65cf2012-01-17 17:34:51 -0800654 .csi_lane_params = &ov2720_csi_lane_params,
Kevin Chand07220e2012-02-13 15:52:22 -0800655};
656
657static struct msm_camera_sensor_info msm_camera_sensor_ov2720_data = {
658 .sensor_name = "ov2720",
659 .pdata = &msm_camera_csi_device_data[1],
660 .flash_data = &flash_ov2720,
661 .sensor_platform_info = &sensor_board_info_ov2720,
662 .csi_if = 1,
663 .camera_type = FRONT_CAMERA_2D,
Raju P.L.S.S.S.N3f4b3022012-03-29 10:09:01 +0530664 .sensor_type = BAYER_SENSOR,
Kevin Chand07220e2012-02-13 15:52:22 -0800665};
Kevin Chand07220e2012-02-13 15:52:22 -0800666
Kevin Chan94b4c832012-03-02 21:27:16 -0800667static struct platform_device msm_camera_server = {
668 .name = "msm_cam_server",
669 .id = 0,
670};
671
Kevin Chan412e9f92012-01-24 10:45:23 -0800672void __init apq8064_init_cam(void)
673{
674 msm_gpiomux_install(apq8064_cam_common_configs,
675 ARRAY_SIZE(apq8064_cam_common_configs));
676
Sreesudhan Ramakrish Ramkumar6f25eb92012-04-10 09:49:47 -0700677 if (machine_is_apq8064_cdp()) {
Sreesudhan Ramakrish Ramkumar3f06a1b2012-03-15 18:44:56 -0700678 sensor_board_info_imx074.mount_angle = 0;
Sreesudhan Ramakrish Ramkumar6f25eb92012-04-10 09:49:47 -0700679 sensor_board_info_mt9m114.mount_angle = 0;
680 } else if (machine_is_apq8064_liquid())
Jignesh Mehtabfb1aa32012-03-16 17:23:23 -0700681 sensor_board_info_imx074.mount_angle = 180;
Sreesudhan Ramakrish Ramkumar3f06a1b2012-03-15 18:44:56 -0700682
Kevin Chan94b4c832012-03-02 21:27:16 -0800683 platform_device_register(&msm_camera_server);
Kevin Chand07220e2012-02-13 15:52:22 -0800684 platform_device_register(&msm8960_device_i2c_mux_gsbi4);
Kevin Chan412e9f92012-01-24 10:45:23 -0800685 platform_device_register(&msm8960_device_csiphy0);
686 platform_device_register(&msm8960_device_csiphy1);
687 platform_device_register(&msm8960_device_csid0);
688 platform_device_register(&msm8960_device_csid1);
689 platform_device_register(&msm8960_device_ispif);
690 platform_device_register(&msm8960_device_vfe);
691 platform_device_register(&msm8960_device_vpe);
692}
693
694#ifdef CONFIG_I2C
695static struct i2c_board_info apq8064_camera_i2c_boardinfo[] = {
Kevin Chan412e9f92012-01-24 10:45:23 -0800696 {
697 I2C_BOARD_INFO("imx074", 0x1A),
698 .platform_data = &msm_camera_sensor_imx074_data,
699 },
Sreesudhan Ramakrish Ramkumar6c6f57c2012-02-21 15:12:44 -0800700 {
701 I2C_BOARD_INFO("mt9m114", 0x48),
702 .platform_data = &msm_camera_sensor_mt9m114_data,
703 },
Kevin Chand07220e2012-02-13 15:52:22 -0800704 {
705 I2C_BOARD_INFO("ov2720", 0x6C),
706 .platform_data = &msm_camera_sensor_ov2720_data,
707 },
Jeyaprakash Soundrapandiana1b3c532012-02-29 20:33:30 -0800708 {
709 I2C_BOARD_INFO("sc628a", 0x6E),
710 },
Sreesudhan Ramakrish Ramkumar3381da72012-01-27 08:08:32 -0800711 {
712 I2C_BOARD_INFO("imx091", 0x34),
713 .platform_data = &msm_camera_sensor_imx091_data,
714 },
Sreesudhan Ramakrish Ramkumar8002a792012-04-09 17:42:58 -0700715 {
716 I2C_BOARD_INFO("s5k3l1yx", 0x20),
717 .platform_data = &msm_camera_sensor_s5k3l1yx_data,
718 },
Kevin Chan412e9f92012-01-24 10:45:23 -0800719};
720
721struct msm_camera_board_info apq8064_camera_board_info = {
722 .board_info = apq8064_camera_i2c_boardinfo,
723 .num_i2c_board_info = ARRAY_SIZE(apq8064_camera_i2c_boardinfo),
724};
725#endif
726#endif