blob: 6de770841e3a94a5d604db7b63f3e174c3a98234 [file] [log] [blame]
Sreesudhan Ramakrish Ramkumar7f723dc2012-10-12 22:58:13 -07001/* Copyright (c) 2012, The Linux Foundation. All rights reserved.
Kevin Chan412e9f92012-01-24 10:45:23 -08002 *
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
Sreesudhan Ramakrish Ramkumar7f723dc2012-10-12 22:58:13 -0700190static struct gpio flash_init_gpio[] = {
191 {VFE_CAMIF_TIMER1_GPIO, GPIOF_OUT_INIT_LOW, "CAMIF_TIMER1"},
192 {VFE_CAMIF_TIMER2_GPIO, GPIOF_OUT_INIT_LOW, "CAMIF_TIMER2"},
193};
194
195static struct msm_gpio_set_tbl flash_set_gpio[] = {
196 {VFE_CAMIF_TIMER1_GPIO, GPIOF_OUT_INIT_HIGH, 2000},
197 {VFE_CAMIF_TIMER2_GPIO, GPIOF_OUT_INIT_HIGH, 2000},
198};
199
Jeyaprakash Soundrapandiana1b3c532012-02-29 20:33:30 -0800200static struct msm_camera_sensor_flash_src msm_flash_src = {
201 .flash_sr_type = MSM_CAMERA_FLASH_SRC_EXT,
Sreesudhan Ramakrish Ramkumar7f723dc2012-10-12 22:58:13 -0700202 .init_gpio_tbl = flash_init_gpio,
203 .init_gpio_tbl_size = ARRAY_SIZE(flash_init_gpio),
204 .set_gpio_tbl = flash_set_gpio,
205 .set_gpio_tbl_size = ARRAY_SIZE(flash_set_gpio),
Jeyaprakash Soundrapandiana1b3c532012-02-29 20:33:30 -0800206 ._fsrc.ext_driver_src.led_en = VFE_CAMIF_TIMER1_GPIO,
207 ._fsrc.ext_driver_src.led_flash_en = VFE_CAMIF_TIMER2_GPIO,
Jeyaprakash Soundrapandian85099fe2012-05-15 17:09:51 -0700208 ._fsrc.ext_driver_src.flash_id = MAM_CAMERA_EXT_LED_FLASH_SC628A,
Jeyaprakash Soundrapandiana1b3c532012-02-29 20:33:30 -0800209};
210
Kevin Chand07220e2012-02-13 15:52:22 -0800211static struct msm_gpiomux_config apq8064_cam_2d_configs[] = {
212};
213
Kevin Chan412e9f92012-01-24 10:45:23 -0800214static struct msm_bus_vectors cam_init_vectors[] = {
215 {
216 .src = MSM_BUS_MASTER_VFE,
217 .dst = MSM_BUS_SLAVE_EBI_CH0,
218 .ab = 0,
219 .ib = 0,
220 },
221 {
222 .src = MSM_BUS_MASTER_VPE,
223 .dst = MSM_BUS_SLAVE_EBI_CH0,
224 .ab = 0,
225 .ib = 0,
226 },
227 {
228 .src = MSM_BUS_MASTER_JPEG_ENC,
229 .dst = MSM_BUS_SLAVE_EBI_CH0,
230 .ab = 0,
231 .ib = 0,
232 },
233};
234
235static struct msm_bus_vectors cam_preview_vectors[] = {
236 {
237 .src = MSM_BUS_MASTER_VFE,
238 .dst = MSM_BUS_SLAVE_EBI_CH0,
239 .ab = 27648000,
240 .ib = 110592000,
241 },
242 {
243 .src = MSM_BUS_MASTER_VPE,
244 .dst = MSM_BUS_SLAVE_EBI_CH0,
245 .ab = 0,
246 .ib = 0,
247 },
248 {
249 .src = MSM_BUS_MASTER_JPEG_ENC,
250 .dst = MSM_BUS_SLAVE_EBI_CH0,
251 .ab = 0,
252 .ib = 0,
253 },
254};
255
256static struct msm_bus_vectors cam_video_vectors[] = {
257 {
258 .src = MSM_BUS_MASTER_VFE,
259 .dst = MSM_BUS_SLAVE_EBI_CH0,
Kiran Kumar H N1d1d3072012-07-05 13:40:13 -0700260 .ab = 274406400,
Kevin Chan412e9f92012-01-24 10:45:23 -0800261 .ib = 561807360,
262 },
263 {
264 .src = MSM_BUS_MASTER_VPE,
265 .dst = MSM_BUS_SLAVE_EBI_CH0,
266 .ab = 206807040,
267 .ib = 488816640,
268 },
269 {
270 .src = MSM_BUS_MASTER_JPEG_ENC,
271 .dst = MSM_BUS_SLAVE_EBI_CH0,
272 .ab = 0,
273 .ib = 0,
274 },
275};
276
277static struct msm_bus_vectors cam_snapshot_vectors[] = {
278 {
279 .src = MSM_BUS_MASTER_VFE,
280 .dst = MSM_BUS_SLAVE_EBI_CH0,
281 .ab = 274423680,
282 .ib = 1097694720,
283 },
284 {
285 .src = MSM_BUS_MASTER_VPE,
286 .dst = MSM_BUS_SLAVE_EBI_CH0,
287 .ab = 0,
288 .ib = 0,
289 },
290 {
291 .src = MSM_BUS_MASTER_JPEG_ENC,
292 .dst = MSM_BUS_SLAVE_EBI_CH0,
293 .ab = 540000000,
294 .ib = 1350000000,
295 },
296};
297
298static struct msm_bus_vectors cam_zsl_vectors[] = {
299 {
300 .src = MSM_BUS_MASTER_VFE,
301 .dst = MSM_BUS_SLAVE_EBI_CH0,
302 .ab = 302071680,
303 .ib = 1208286720,
304 },
305 {
306 .src = MSM_BUS_MASTER_VPE,
307 .dst = MSM_BUS_SLAVE_EBI_CH0,
308 .ab = 0,
309 .ib = 0,
310 },
311 {
312 .src = MSM_BUS_MASTER_JPEG_ENC,
313 .dst = MSM_BUS_SLAVE_EBI_CH0,
314 .ab = 540000000,
315 .ib = 1350000000,
316 },
317};
318
Kiran Kumar H N1d1d3072012-07-05 13:40:13 -0700319static struct msm_bus_vectors cam_video_ls_vectors[] = {
320 {
321 .src = MSM_BUS_MASTER_VFE,
322 .dst = MSM_BUS_SLAVE_EBI_CH0,
323 .ab = 348192000,
324 .ib = 617103360,
325 },
326 {
327 .src = MSM_BUS_MASTER_VPE,
328 .dst = MSM_BUS_SLAVE_EBI_CH0,
329 .ab = 206807040,
330 .ib = 488816640,
331 },
332 {
333 .src = MSM_BUS_MASTER_JPEG_ENC,
334 .dst = MSM_BUS_SLAVE_EBI_CH0,
335 .ab = 540000000,
336 .ib = 1350000000,
337 },
338};
339
Nishant Pandit221a9482012-09-03 05:36:04 +0530340static struct msm_bus_vectors cam_dual_vectors[] = {
341 {
342 .src = MSM_BUS_MASTER_VFE,
343 .dst = MSM_BUS_SLAVE_EBI_CH0,
344 .ab = 348192000,
345 .ib = 1208286720,
346 },
347 {
348 .src = MSM_BUS_MASTER_VPE,
349 .dst = MSM_BUS_SLAVE_EBI_CH0,
350 .ab = 206807040,
351 .ib = 488816640,
352 },
353 {
354 .src = MSM_BUS_MASTER_JPEG_ENC,
355 .dst = MSM_BUS_SLAVE_EBI_CH0,
356 .ab = 540000000,
357 .ib = 1350000000,
358 },
359 {
360 .src = MSM_BUS_MASTER_JPEG_ENC,
361 .dst = MSM_BUS_SLAVE_MM_IMEM,
362 .ab = 43200000,
363 .ib = 69120000,
364 },
365 {
366 .src = MSM_BUS_MASTER_VFE,
367 .dst = MSM_BUS_SLAVE_MM_IMEM,
368 .ab = 43200000,
369 .ib = 69120000,
370 },
371};
372
373
Kevin Chan412e9f92012-01-24 10:45:23 -0800374static struct msm_bus_paths cam_bus_client_config[] = {
375 {
376 ARRAY_SIZE(cam_init_vectors),
377 cam_init_vectors,
378 },
379 {
380 ARRAY_SIZE(cam_preview_vectors),
381 cam_preview_vectors,
382 },
383 {
384 ARRAY_SIZE(cam_video_vectors),
385 cam_video_vectors,
386 },
387 {
388 ARRAY_SIZE(cam_snapshot_vectors),
389 cam_snapshot_vectors,
390 },
391 {
392 ARRAY_SIZE(cam_zsl_vectors),
393 cam_zsl_vectors,
394 },
Kiran Kumar H N1d1d3072012-07-05 13:40:13 -0700395 {
396 ARRAY_SIZE(cam_video_ls_vectors),
397 cam_video_ls_vectors,
398 },
Nishant Pandit221a9482012-09-03 05:36:04 +0530399 {
400 ARRAY_SIZE(cam_dual_vectors),
401 cam_dual_vectors,
402 },
Kevin Chan412e9f92012-01-24 10:45:23 -0800403};
404
405static struct msm_bus_scale_pdata cam_bus_client_pdata = {
406 cam_bus_client_config,
407 ARRAY_SIZE(cam_bus_client_config),
408 .name = "msm_camera",
409};
410
411static struct msm_camera_device_platform_data msm_camera_csi_device_data[] = {
412 {
Sreesudhan Ramakrish Ramkumar5ad18cd2012-09-07 23:22:34 -0700413 .csiphy_core = 0,
Kevin Chan412e9f92012-01-24 10:45:23 -0800414 .csid_core = 0,
Kevin Chaneb6b6072012-01-17 11:54:54 -0800415 .is_vpe = 1,
Kevin Chan412e9f92012-01-24 10:45:23 -0800416 .cam_bus_scale_table = &cam_bus_client_pdata,
417 },
418 {
Sreesudhan Ramakrish Ramkumar5ad18cd2012-09-07 23:22:34 -0700419 .csiphy_core = 1,
Kevin Chan412e9f92012-01-24 10:45:23 -0800420 .csid_core = 1,
Kevin Chaneb6b6072012-01-17 11:54:54 -0800421 .is_vpe = 1,
Kevin Chan412e9f92012-01-24 10:45:23 -0800422 .cam_bus_scale_table = &cam_bus_client_pdata,
423 },
424};
425
Sreesudhan Ramakrish Ramkumar923fbad2012-07-26 17:31:42 -0700426static struct camera_vreg_t apq_8064_cam_vreg[] = {
Kevin Chaneb6b6072012-01-17 11:54:54 -0800427 {"cam_vdig", REG_LDO, 1200000, 1200000, 105000},
Sreesudhan Ramakrish Ramkumar6c6f57c2012-02-21 15:12:44 -0800428 {"cam_vio", REG_VS, 0, 0, 0},
429 {"cam_vana", REG_LDO, 2800000, 2850000, 85600},
Kevin Chaneb6b6072012-01-17 11:54:54 -0800430 {"cam_vaf", REG_LDO, 2800000, 2850000, 300000},
431};
432
Kevin Chand07220e2012-02-13 15:52:22 -0800433#define CAML_RSTN PM8921_GPIO_PM_TO_SYS(28)
434#define CAMR_RSTN 34
435
Kevin Chaneb6b6072012-01-17 11:54:54 -0800436static struct gpio apq8064_common_cam_gpio[] = {
Kevin Chaneb6b6072012-01-17 11:54:54 -0800437};
438
439static struct gpio apq8064_back_cam_gpio[] = {
Kevin Chand07220e2012-02-13 15:52:22 -0800440 {5, GPIOF_DIR_IN, "CAMIF_MCLK"},
441 {CAML_RSTN, GPIOF_DIR_OUT, "CAM_RESET"},
Kevin Chaneb6b6072012-01-17 11:54:54 -0800442};
443
444static struct msm_gpio_set_tbl apq8064_back_cam_gpio_set_tbl[] = {
Kevin Chand07220e2012-02-13 15:52:22 -0800445 {CAML_RSTN, GPIOF_OUT_INIT_LOW, 10000},
446 {CAML_RSTN, GPIOF_OUT_INIT_HIGH, 10000},
Kevin Chaneb6b6072012-01-17 11:54:54 -0800447};
448
449static struct msm_camera_gpio_conf apq8064_back_cam_gpio_conf = {
450 .cam_gpiomux_conf_tbl = apq8064_cam_2d_configs,
451 .cam_gpiomux_conf_tbl_size = ARRAY_SIZE(apq8064_cam_2d_configs),
452 .cam_gpio_common_tbl = apq8064_common_cam_gpio,
453 .cam_gpio_common_tbl_size = ARRAY_SIZE(apq8064_common_cam_gpio),
454 .cam_gpio_req_tbl = apq8064_back_cam_gpio,
455 .cam_gpio_req_tbl_size = ARRAY_SIZE(apq8064_back_cam_gpio),
456 .cam_gpio_set_tbl = apq8064_back_cam_gpio_set_tbl,
457 .cam_gpio_set_tbl_size = ARRAY_SIZE(apq8064_back_cam_gpio_set_tbl),
458};
459
Kevin Chand07220e2012-02-13 15:52:22 -0800460static struct gpio apq8064_front_cam_gpio[] = {
461 {4, GPIOF_DIR_IN, "CAMIF_MCLK"},
462 {12, GPIOF_DIR_IN, "CAMIF_I2C_DATA"},
463 {13, GPIOF_DIR_IN, "CAMIF_I2C_CLK"},
464 {CAMR_RSTN, GPIOF_DIR_OUT, "CAM_RESET"},
465};
466
467static struct msm_gpio_set_tbl apq8064_front_cam_gpio_set_tbl[] = {
468 {CAMR_RSTN, GPIOF_OUT_INIT_LOW, 10000},
469 {CAMR_RSTN, GPIOF_OUT_INIT_HIGH, 10000},
470};
471
472static struct msm_camera_gpio_conf apq8064_front_cam_gpio_conf = {
473 .cam_gpiomux_conf_tbl = apq8064_cam_2d_configs,
474 .cam_gpiomux_conf_tbl_size = ARRAY_SIZE(apq8064_cam_2d_configs),
475 .cam_gpio_common_tbl = apq8064_common_cam_gpio,
476 .cam_gpio_common_tbl_size = ARRAY_SIZE(apq8064_common_cam_gpio),
477 .cam_gpio_req_tbl = apq8064_front_cam_gpio,
478 .cam_gpio_req_tbl_size = ARRAY_SIZE(apq8064_front_cam_gpio),
479 .cam_gpio_set_tbl = apq8064_front_cam_gpio_set_tbl,
480 .cam_gpio_set_tbl_size = ARRAY_SIZE(apq8064_front_cam_gpio_set_tbl),
481};
482
483static struct msm_camera_i2c_conf apq8064_back_cam_i2c_conf = {
484 .use_i2c_mux = 1,
485 .mux_dev = &msm8960_device_i2c_mux_gsbi4,
486 .i2c_mux_mode = MODE_L,
487};
488
Rajakumar Govindaram6627b362012-01-29 19:00:30 -0800489static struct i2c_board_info msm_act_main_cam_i2c_info = {
490 I2C_BOARD_INFO("msm_actuator", 0x11),
Jignesh Mehta33394572012-02-21 19:57:41 -0800491};
492
Rajakumar Govindaram6627b362012-01-29 19:00:30 -0800493static struct msm_actuator_info msm_act_main_cam_0_info = {
494 .board_info = &msm_act_main_cam_i2c_info,
495 .cam_name = MSM_ACTUATOR_MAIN_CAM_0,
Jignesh Mehta33394572012-02-21 19:57:41 -0800496 .bus_id = APQ_8064_GSBI4_QUP_I2C_BUS_ID,
497 .vcm_pwd = 0,
Rajakumar Govindaram6627b362012-01-29 19:00:30 -0800498 .vcm_enable = 0,
Jignesh Mehta33394572012-02-21 19:57:41 -0800499};
500
Jeyaprakash Soundrapandian3040c032012-04-21 01:13:29 -0700501static struct i2c_board_info msm_act_main_cam1_i2c_info = {
502 I2C_BOARD_INFO("msm_actuator", 0x18),
503};
504
505static struct msm_actuator_info msm_act_main_cam_1_info = {
506 .board_info = &msm_act_main_cam1_i2c_info,
507 .cam_name = MSM_ACTUATOR_MAIN_CAM_1,
508 .bus_id = APQ_8064_GSBI4_QUP_I2C_BUS_ID,
509 .vcm_pwd = 0,
510 .vcm_enable = 0,
511};
512
513
Kevin Chand07220e2012-02-13 15:52:22 -0800514static struct msm_camera_i2c_conf apq8064_front_cam_i2c_conf = {
515 .use_i2c_mux = 1,
516 .mux_dev = &msm8960_device_i2c_mux_gsbi4,
517 .i2c_mux_mode = MODE_L,
518};
519
Punit Soni57850102012-09-26 11:31:27 -0700520static struct msm_camera_sensor_flash_data flash_imx135 = {
521 .flash_type = MSM_CAMERA_FLASH_NONE,
522};
523
524static struct msm_camera_csi_lane_params imx135_csi_lane_params = {
525 .csi_lane_assign = 0xE4,
526 .csi_lane_mask = 0xF,
527};
528
529static struct msm_camera_sensor_platform_info sensor_board_info_imx135 = {
530 .mount_angle = 90,
531 .cam_vreg = apq_8064_cam_vreg,
532 .num_vreg = ARRAY_SIZE(apq_8064_cam_vreg),
533 .gpio_conf = &apq8064_back_cam_gpio_conf,
534 .i2c_conf = &apq8064_back_cam_i2c_conf,
535 .csi_lane_params = &imx135_csi_lane_params,
536};
537
538static struct msm_camera_sensor_info msm_camera_sensor_imx135_data = {
539 .sensor_name = "imx135",
540 .pdata = &msm_camera_csi_device_data[0],
541 .flash_data = &flash_imx135,
542 .sensor_platform_info = &sensor_board_info_imx135,
543 .csi_if = 1,
544 .camera_type = BACK_CAMERA_2D,
545 .sensor_type = BAYER_SENSOR,
Punit Soni3333c852012-10-10 16:51:52 -0700546 .actuator_info = &msm_act_main_cam_1_info,
Punit Soni57850102012-09-26 11:31:27 -0700547};
548
Sreesudhan Ramakrish Ramkumar7f723dc2012-10-12 22:58:13 -0700549static struct i2c_board_info sc628a_flash_i2c_info = {
550 I2C_BOARD_INFO("sc628a", 0x6E),
551};
552
Kevin Chan412e9f92012-01-24 10:45:23 -0800553static struct msm_camera_sensor_flash_data flash_imx074 = {
Jeyaprakash Soundrapandiana1b3c532012-02-29 20:33:30 -0800554 .flash_type = MSM_CAMERA_FLASH_LED,
Sreesudhan Ramakrish Ramkumar7f723dc2012-10-12 22:58:13 -0700555 .flash_src = &msm_flash_src,
556 .board_info = &sc628a_flash_i2c_info,
557 .bus_id = APQ_8064_GSBI4_QUP_I2C_BUS_ID,
Kevin Chan412e9f92012-01-24 10:45:23 -0800558};
559
Hody Hung9ba65cf2012-01-17 17:34:51 -0800560static struct msm_camera_csi_lane_params imx074_csi_lane_params = {
561 .csi_lane_assign = 0xE4,
562 .csi_lane_mask = 0xF,
563};
564
Kevin Chan412e9f92012-01-24 10:45:23 -0800565static struct msm_camera_sensor_platform_info sensor_board_info_imx074 = {
566 .mount_angle = 90,
Sreesudhan Ramakrish Ramkumar923fbad2012-07-26 17:31:42 -0700567 .cam_vreg = apq_8064_cam_vreg,
568 .num_vreg = ARRAY_SIZE(apq_8064_cam_vreg),
Kevin Chaneb6b6072012-01-17 11:54:54 -0800569 .gpio_conf = &apq8064_back_cam_gpio_conf,
Kevin Chand07220e2012-02-13 15:52:22 -0800570 .i2c_conf = &apq8064_back_cam_i2c_conf,
Hody Hung9ba65cf2012-01-17 17:34:51 -0800571 .csi_lane_params = &imx074_csi_lane_params,
Kevin Chan412e9f92012-01-24 10:45:23 -0800572};
573
Jeyaprakash Soundrapandian734476b2012-05-03 20:08:15 -0700574static struct i2c_board_info imx074_eeprom_i2c_info = {
575 I2C_BOARD_INFO("imx074_eeprom", 0x34 << 1),
576};
577
578static struct msm_eeprom_info imx074_eeprom_info = {
579 .board_info = &imx074_eeprom_i2c_info,
580 .bus_id = APQ_8064_GSBI4_QUP_I2C_BUS_ID,
581};
582
Kevin Chan412e9f92012-01-24 10:45:23 -0800583static struct msm_camera_sensor_info msm_camera_sensor_imx074_data = {
584 .sensor_name = "imx074",
585 .pdata = &msm_camera_csi_device_data[0],
586 .flash_data = &flash_imx074,
587 .sensor_platform_info = &sensor_board_info_imx074,
Kevin Chan412e9f92012-01-24 10:45:23 -0800588 .csi_if = 1,
589 .camera_type = BACK_CAMERA_2D,
Raju P.L.S.S.S.N3f4b3022012-03-29 10:09:01 +0530590 .sensor_type = BAYER_SENSOR,
Rajakumar Govindaram6627b362012-01-29 19:00:30 -0800591 .actuator_info = &msm_act_main_cam_0_info,
Jeyaprakash Soundrapandian734476b2012-05-03 20:08:15 -0700592 .eeprom_info = &imx074_eeprom_info,
Kevin Chan412e9f92012-01-24 10:45:23 -0800593};
Jeyaprakash Soundrapandian734476b2012-05-03 20:08:15 -0700594
Sreesudhan Ramakrish Ramkumar3381da72012-01-27 08:08:32 -0800595static struct msm_camera_csi_lane_params imx091_csi_lane_params = {
596 .csi_lane_assign = 0xE4,
597 .csi_lane_mask = 0xF,
598};
599
Sreesudhan Ramakrish Ramkumar3381da72012-01-27 08:08:32 -0800600static struct msm_camera_sensor_flash_data flash_imx091 = {
601 .flash_type = MSM_CAMERA_FLASH_NONE,
602};
603
604static struct msm_camera_sensor_platform_info sensor_board_info_imx091 = {
605 .mount_angle = 0,
Sreesudhan Ramakrish Ramkumar923fbad2012-07-26 17:31:42 -0700606 .cam_vreg = apq_8064_cam_vreg,
607 .num_vreg = ARRAY_SIZE(apq_8064_cam_vreg),
Sreesudhan Ramakrish Ramkumar3381da72012-01-27 08:08:32 -0800608 .gpio_conf = &apq8064_back_cam_gpio_conf,
609 .i2c_conf = &apq8064_back_cam_i2c_conf,
610 .csi_lane_params = &imx091_csi_lane_params,
611};
612
Jeyaprakash Soundrapandian734476b2012-05-03 20:08:15 -0700613static struct i2c_board_info imx091_eeprom_i2c_info = {
614 I2C_BOARD_INFO("imx091_eeprom", 0x21),
615};
616
617static struct msm_eeprom_info imx091_eeprom_info = {
618 .board_info = &imx091_eeprom_i2c_info,
619 .bus_id = APQ_8064_GSBI4_QUP_I2C_BUS_ID,
620};
621
Sreesudhan Ramakrish Ramkumar3381da72012-01-27 08:08:32 -0800622static struct msm_camera_sensor_info msm_camera_sensor_imx091_data = {
623 .sensor_name = "imx091",
624 .pdata = &msm_camera_csi_device_data[0],
625 .flash_data = &flash_imx091,
626 .sensor_platform_info = &sensor_board_info_imx091,
627 .csi_if = 1,
628 .camera_type = BACK_CAMERA_2D,
Raju P.L.S.S.S.N3f4b3022012-03-29 10:09:01 +0530629 .sensor_type = BAYER_SENSOR,
Jeyaprakash Soundrapandian3040c032012-04-21 01:13:29 -0700630 .actuator_info = &msm_act_main_cam_1_info,
Jeyaprakash Soundrapandian734476b2012-05-03 20:08:15 -0700631 .eeprom_info = &imx091_eeprom_info,
Sreesudhan Ramakrish Ramkumar3381da72012-01-27 08:08:32 -0800632};
Kevin Chan412e9f92012-01-24 10:45:23 -0800633
Sreesudhan Ramakrish Ramkumar8002a792012-04-09 17:42:58 -0700634static struct msm_camera_sensor_flash_data flash_s5k3l1yx = {
635 .flash_type = MSM_CAMERA_FLASH_NONE,
636};
637
638static struct msm_camera_csi_lane_params s5k3l1yx_csi_lane_params = {
639 .csi_lane_assign = 0xE4,
640 .csi_lane_mask = 0xF,
641};
642
643static struct msm_camera_sensor_platform_info sensor_board_info_s5k3l1yx = {
644 .mount_angle = 90,
Sreesudhan Ramakrish Ramkumar923fbad2012-07-26 17:31:42 -0700645 .cam_vreg = apq_8064_cam_vreg,
646 .num_vreg = ARRAY_SIZE(apq_8064_cam_vreg),
Sreesudhan Ramakrish Ramkumar8002a792012-04-09 17:42:58 -0700647 .gpio_conf = &apq8064_back_cam_gpio_conf,
648 .i2c_conf = &apq8064_back_cam_i2c_conf,
649 .csi_lane_params = &s5k3l1yx_csi_lane_params,
650};
651
652static struct msm_camera_sensor_info msm_camera_sensor_s5k3l1yx_data = {
653 .sensor_name = "s5k3l1yx",
654 .pdata = &msm_camera_csi_device_data[0],
655 .flash_data = &flash_s5k3l1yx,
656 .sensor_platform_info = &sensor_board_info_s5k3l1yx,
657 .csi_if = 1,
658 .camera_type = BACK_CAMERA_2D,
659 .sensor_type = BAYER_SENSOR,
660};
661
Sreesudhan Ramakrish Ramkumar6c6f57c2012-02-21 15:12:44 -0800662static struct msm_camera_sensor_flash_data flash_mt9m114 = {
663 .flash_type = MSM_CAMERA_FLASH_NONE
664};
665
Hody Hung9ba65cf2012-01-17 17:34:51 -0800666static struct msm_camera_csi_lane_params mt9m114_csi_lane_params = {
667 .csi_lane_assign = 0xE4,
668 .csi_lane_mask = 0x1,
669};
670
Sreesudhan Ramakrish Ramkumar6c6f57c2012-02-21 15:12:44 -0800671static struct msm_camera_sensor_platform_info sensor_board_info_mt9m114 = {
672 .mount_angle = 90,
Sreesudhan Ramakrish Ramkumar923fbad2012-07-26 17:31:42 -0700673 .cam_vreg = apq_8064_cam_vreg,
674 .num_vreg = ARRAY_SIZE(apq_8064_cam_vreg),
Sreesudhan Ramakrish Ramkumar6c6f57c2012-02-21 15:12:44 -0800675 .gpio_conf = &apq8064_front_cam_gpio_conf,
676 .i2c_conf = &apq8064_front_cam_i2c_conf,
Hody Hung9ba65cf2012-01-17 17:34:51 -0800677 .csi_lane_params = &mt9m114_csi_lane_params,
Sreesudhan Ramakrish Ramkumar6c6f57c2012-02-21 15:12:44 -0800678};
679
680static struct msm_camera_sensor_info msm_camera_sensor_mt9m114_data = {
681 .sensor_name = "mt9m114",
682 .pdata = &msm_camera_csi_device_data[1],
683 .flash_data = &flash_mt9m114,
684 .sensor_platform_info = &sensor_board_info_mt9m114,
685 .csi_if = 1,
686 .camera_type = FRONT_CAMERA_2D,
Raju P.L.S.S.S.N3f4b3022012-03-29 10:09:01 +0530687 .sensor_type = YUV_SENSOR,
Sreesudhan Ramakrish Ramkumar6c6f57c2012-02-21 15:12:44 -0800688};
689
Kevin Chand07220e2012-02-13 15:52:22 -0800690static struct msm_camera_sensor_flash_data flash_ov2720 = {
691 .flash_type = MSM_CAMERA_FLASH_NONE,
692};
693
Hody Hung9ba65cf2012-01-17 17:34:51 -0800694static struct msm_camera_csi_lane_params ov2720_csi_lane_params = {
695 .csi_lane_assign = 0xE4,
696 .csi_lane_mask = 0x3,
697};
698
Kevin Chand07220e2012-02-13 15:52:22 -0800699static struct msm_camera_sensor_platform_info sensor_board_info_ov2720 = {
700 .mount_angle = 0,
Sreesudhan Ramakrish Ramkumar923fbad2012-07-26 17:31:42 -0700701 .cam_vreg = apq_8064_cam_vreg,
702 .num_vreg = ARRAY_SIZE(apq_8064_cam_vreg),
Kevin Chand07220e2012-02-13 15:52:22 -0800703 .gpio_conf = &apq8064_front_cam_gpio_conf,
704 .i2c_conf = &apq8064_front_cam_i2c_conf,
Hody Hung9ba65cf2012-01-17 17:34:51 -0800705 .csi_lane_params = &ov2720_csi_lane_params,
Kevin Chand07220e2012-02-13 15:52:22 -0800706};
707
708static struct msm_camera_sensor_info msm_camera_sensor_ov2720_data = {
709 .sensor_name = "ov2720",
710 .pdata = &msm_camera_csi_device_data[1],
711 .flash_data = &flash_ov2720,
712 .sensor_platform_info = &sensor_board_info_ov2720,
713 .csi_if = 1,
714 .camera_type = FRONT_CAMERA_2D,
Raju P.L.S.S.S.N3f4b3022012-03-29 10:09:01 +0530715 .sensor_type = BAYER_SENSOR,
Kevin Chand07220e2012-02-13 15:52:22 -0800716};
Kevin Chand07220e2012-02-13 15:52:22 -0800717
Kevin Chan94b4c832012-03-02 21:27:16 -0800718static struct platform_device msm_camera_server = {
719 .name = "msm_cam_server",
720 .id = 0,
721};
722
Kevin Chan412e9f92012-01-24 10:45:23 -0800723void __init apq8064_init_cam(void)
724{
725 msm_gpiomux_install(apq8064_cam_common_configs,
726 ARRAY_SIZE(apq8064_cam_common_configs));
727
Sreesudhan Ramakrish Ramkumar6f25eb92012-04-10 09:49:47 -0700728 if (machine_is_apq8064_cdp()) {
Sreesudhan Ramakrish Ramkumar3f06a1b2012-03-15 18:44:56 -0700729 sensor_board_info_imx074.mount_angle = 0;
Sreesudhan Ramakrish Ramkumar6f25eb92012-04-10 09:49:47 -0700730 sensor_board_info_mt9m114.mount_angle = 0;
731 } else if (machine_is_apq8064_liquid())
Jignesh Mehtabfb1aa32012-03-16 17:23:23 -0700732 sensor_board_info_imx074.mount_angle = 180;
Sreesudhan Ramakrish Ramkumar3f06a1b2012-03-15 18:44:56 -0700733
Kevin Chan94b4c832012-03-02 21:27:16 -0800734 platform_device_register(&msm_camera_server);
Kevin Chand07220e2012-02-13 15:52:22 -0800735 platform_device_register(&msm8960_device_i2c_mux_gsbi4);
Kevin Chan412e9f92012-01-24 10:45:23 -0800736 platform_device_register(&msm8960_device_csiphy0);
737 platform_device_register(&msm8960_device_csiphy1);
738 platform_device_register(&msm8960_device_csid0);
739 platform_device_register(&msm8960_device_csid1);
740 platform_device_register(&msm8960_device_ispif);
741 platform_device_register(&msm8960_device_vfe);
742 platform_device_register(&msm8960_device_vpe);
743}
744
745#ifdef CONFIG_I2C
746static struct i2c_board_info apq8064_camera_i2c_boardinfo[] = {
Kevin Chan412e9f92012-01-24 10:45:23 -0800747 {
748 I2C_BOARD_INFO("imx074", 0x1A),
749 .platform_data = &msm_camera_sensor_imx074_data,
750 },
Sreesudhan Ramakrish Ramkumar6c6f57c2012-02-21 15:12:44 -0800751 {
Punit Soni57850102012-09-26 11:31:27 -0700752 I2C_BOARD_INFO("imx135", 0x10),
753 .platform_data = &msm_camera_sensor_imx135_data,
754 },
755 {
Sreesudhan Ramakrish Ramkumar6c6f57c2012-02-21 15:12:44 -0800756 I2C_BOARD_INFO("mt9m114", 0x48),
757 .platform_data = &msm_camera_sensor_mt9m114_data,
758 },
Kevin Chand07220e2012-02-13 15:52:22 -0800759 {
760 I2C_BOARD_INFO("ov2720", 0x6C),
761 .platform_data = &msm_camera_sensor_ov2720_data,
762 },
Jeyaprakash Soundrapandiana1b3c532012-02-29 20:33:30 -0800763 {
Sreesudhan Ramakrish Ramkumar3381da72012-01-27 08:08:32 -0800764 I2C_BOARD_INFO("imx091", 0x34),
765 .platform_data = &msm_camera_sensor_imx091_data,
766 },
Sreesudhan Ramakrish Ramkumar8002a792012-04-09 17:42:58 -0700767 {
768 I2C_BOARD_INFO("s5k3l1yx", 0x20),
769 .platform_data = &msm_camera_sensor_s5k3l1yx_data,
770 },
Kevin Chan412e9f92012-01-24 10:45:23 -0800771};
772
773struct msm_camera_board_info apq8064_camera_board_info = {
774 .board_info = apq8064_camera_i2c_boardinfo,
775 .num_i2c_board_info = ARRAY_SIZE(apq8064_camera_i2c_boardinfo),
776};
777#endif
778#endif