Sreesudhan Ramakrish Ramkumar | 7f723dc | 2012-10-12 22:58:13 -0700 | [diff] [blame] | 1 | /* Copyright (c) 2012, The Linux Foundation. All rights reserved. |
Kevin Chan | 412e9f9 | 2012-01-24 10:45:23 -0800 | [diff] [blame] | 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 Chan | 412e9f9 | 2012-01-24 10:45:23 -0800 | [diff] [blame] | 14 | #include <linux/i2c.h> |
Kevin Chan | eb6b607 | 2012-01-17 11:54:54 -0800 | [diff] [blame] | 15 | #include <linux/gpio.h> |
Steve Muckle | f132c6c | 2012-06-06 18:30:57 -0700 | [diff] [blame] | 16 | |
| 17 | #include <asm/mach-types.h> |
| 18 | |
Jack Wang | b88c8c2 | 2012-07-26 11:33:36 -0700 | [diff] [blame] | 19 | #include <mach/camera.h> |
Kevin Chan | 412e9f9 | 2012-01-24 10:45:23 -0800 | [diff] [blame] | 20 | #include <mach/msm_bus_board.h> |
Kevin Chan | 412e9f9 | 2012-01-24 10:45:23 -0800 | [diff] [blame] | 21 | #include <mach/gpiomux.h> |
| 22 | |
| 23 | #include "devices.h" |
| 24 | #include "board-8064.h" |
| 25 | |
Steve Muckle | f132c6c | 2012-06-06 18:30:57 -0700 | [diff] [blame] | 26 | #ifdef CONFIG_MSM_CAMERA |
| 27 | |
Kevin Chan | 412e9f9 | 2012-01-24 10:45:23 -0800 | [diff] [blame] | 28 | static 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 Chan | d07220e | 2012-02-13 15:52:22 -0800 | [diff] [blame] | 48 | .func = GPIOMUX_FUNC_2, /*active 3*/ |
| 49 | .drv = GPIOMUX_DRV_2MA, |
Kevin Chan | 412e9f9 | 2012-01-24 10:45:23 -0800 | [diff] [blame] | 50 | .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 Chan | d07220e | 2012-02-13 15:52:22 -0800 | [diff] [blame] | 83 | { |
| 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 Chan | 412e9f9 | 2012-01-24 10:45:23 -0800 | [diff] [blame] | 104 | }; |
| 105 | |
Kevin Chan | 412e9f9 | 2012-01-24 10:45:23 -0800 | [diff] [blame] | 106 | static struct msm_gpiomux_config apq8064_cam_common_configs[] = { |
| 107 | { |
Jeyaprakash Soundrapandian | a1b3c53 | 2012-02-29 20:33:30 -0800 | [diff] [blame] | 108 | .gpio = 1, |
| 109 | .settings = { |
| 110 | [GPIOMUX_ACTIVE] = &cam_settings[2], |
| 111 | [GPIOMUX_SUSPENDED] = &cam_settings[0], |
| 112 | }, |
| 113 | }, |
| 114 | { |
Kevin Chan | 412e9f9 | 2012-01-24 10:45:23 -0800 | [diff] [blame] | 115 | .gpio = 2, |
| 116 | .settings = { |
Kevin Chan | d07220e | 2012-02-13 15:52:22 -0800 | [diff] [blame] | 117 | [GPIOMUX_ACTIVE] = &cam_settings[12], |
Kevin Chan | 412e9f9 | 2012-01-24 10:45:23 -0800 | [diff] [blame] | 118 | [GPIOMUX_SUSPENDED] = &cam_settings[0], |
| 119 | }, |
| 120 | }, |
| 121 | { |
| 122 | .gpio = 3, |
| 123 | .settings = { |
Jeyaprakash Soundrapandian | a1b3c53 | 2012-02-29 20:33:30 -0800 | [diff] [blame] | 124 | [GPIOMUX_ACTIVE] = &cam_settings[2], |
Kevin Chan | 412e9f9 | 2012-01-24 10:45:23 -0800 | [diff] [blame] | 125 | [GPIOMUX_SUSPENDED] = &cam_settings[0], |
| 126 | }, |
| 127 | }, |
| 128 | { |
| 129 | .gpio = 4, |
| 130 | .settings = { |
Kevin Chan | d07220e | 2012-02-13 15:52:22 -0800 | [diff] [blame] | 131 | [GPIOMUX_ACTIVE] = &cam_settings[3], |
Kevin Chan | 412e9f9 | 2012-01-24 10:45:23 -0800 | [diff] [blame] | 132 | [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 Chan | d07220e | 2012-02-13 15:52:22 -0800 | [diff] [blame] | 143 | .gpio = 34, |
Kevin Chan | 412e9f9 | 2012-01-24 10:45:23 -0800 | [diff] [blame] | 144 | .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 Chan | 412e9f9 | 2012-01-24 10:45:23 -0800 | [diff] [blame] | 156 | { |
| 157 | .gpio = 10, |
| 158 | .settings = { |
Kevin Chan | d07220e | 2012-02-13 15:52:22 -0800 | [diff] [blame] | 159 | [GPIOMUX_ACTIVE] = &cam_settings[9], |
Kevin Chan | 412e9f9 | 2012-01-24 10:45:23 -0800 | [diff] [blame] | 160 | [GPIOMUX_SUSPENDED] = &cam_settings[8], |
| 161 | }, |
| 162 | }, |
| 163 | { |
| 164 | .gpio = 11, |
| 165 | .settings = { |
Kevin Chan | d07220e | 2012-02-13 15:52:22 -0800 | [diff] [blame] | 166 | [GPIOMUX_ACTIVE] = &cam_settings[10], |
Kevin Chan | 412e9f9 | 2012-01-24 10:45:23 -0800 | [diff] [blame] | 167 | [GPIOMUX_SUSPENDED] = &cam_settings[8], |
| 168 | }, |
| 169 | }, |
| 170 | { |
| 171 | .gpio = 12, |
| 172 | .settings = { |
Kevin Chan | d07220e | 2012-02-13 15:52:22 -0800 | [diff] [blame] | 173 | [GPIOMUX_ACTIVE] = &cam_settings[11], |
Kevin Chan | 412e9f9 | 2012-01-24 10:45:23 -0800 | [diff] [blame] | 174 | [GPIOMUX_SUSPENDED] = &cam_settings[8], |
| 175 | }, |
| 176 | }, |
| 177 | { |
| 178 | .gpio = 13, |
| 179 | .settings = { |
Kevin Chan | d07220e | 2012-02-13 15:52:22 -0800 | [diff] [blame] | 180 | [GPIOMUX_ACTIVE] = &cam_settings[11], |
Kevin Chan | 412e9f9 | 2012-01-24 10:45:23 -0800 | [diff] [blame] | 181 | [GPIOMUX_SUSPENDED] = &cam_settings[8], |
| 182 | }, |
| 183 | }, |
| 184 | }; |
| 185 | |
Jeyaprakash Soundrapandian | a1b3c53 | 2012-02-29 20:33:30 -0800 | [diff] [blame] | 186 | |
| 187 | #define VFE_CAMIF_TIMER1_GPIO 3 |
| 188 | #define VFE_CAMIF_TIMER2_GPIO 1 |
| 189 | |
Sreesudhan Ramakrish Ramkumar | 7f723dc | 2012-10-12 22:58:13 -0700 | [diff] [blame] | 190 | static 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 | |
| 195 | static 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 Soundrapandian | a1b3c53 | 2012-02-29 20:33:30 -0800 | [diff] [blame] | 200 | static struct msm_camera_sensor_flash_src msm_flash_src = { |
| 201 | .flash_sr_type = MSM_CAMERA_FLASH_SRC_EXT, |
Sreesudhan Ramakrish Ramkumar | 7f723dc | 2012-10-12 22:58:13 -0700 | [diff] [blame] | 202 | .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 Soundrapandian | a1b3c53 | 2012-02-29 20:33:30 -0800 | [diff] [blame] | 206 | ._fsrc.ext_driver_src.led_en = VFE_CAMIF_TIMER1_GPIO, |
| 207 | ._fsrc.ext_driver_src.led_flash_en = VFE_CAMIF_TIMER2_GPIO, |
Jeyaprakash Soundrapandian | 85099fe | 2012-05-15 17:09:51 -0700 | [diff] [blame] | 208 | ._fsrc.ext_driver_src.flash_id = MAM_CAMERA_EXT_LED_FLASH_SC628A, |
Jeyaprakash Soundrapandian | a1b3c53 | 2012-02-29 20:33:30 -0800 | [diff] [blame] | 209 | }; |
| 210 | |
Kevin Chan | d07220e | 2012-02-13 15:52:22 -0800 | [diff] [blame] | 211 | static struct msm_gpiomux_config apq8064_cam_2d_configs[] = { |
| 212 | }; |
| 213 | |
Kevin Chan | 412e9f9 | 2012-01-24 10:45:23 -0800 | [diff] [blame] | 214 | static 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 | |
| 235 | static 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 | |
| 256 | static struct msm_bus_vectors cam_video_vectors[] = { |
| 257 | { |
| 258 | .src = MSM_BUS_MASTER_VFE, |
| 259 | .dst = MSM_BUS_SLAVE_EBI_CH0, |
Kiran Kumar H N | 1d1d307 | 2012-07-05 13:40:13 -0700 | [diff] [blame] | 260 | .ab = 274406400, |
Kevin Chan | 412e9f9 | 2012-01-24 10:45:23 -0800 | [diff] [blame] | 261 | .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 | |
| 277 | static 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 | |
| 298 | static 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 N | 1d1d307 | 2012-07-05 13:40:13 -0700 | [diff] [blame] | 319 | static 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 Pandit | 221a948 | 2012-09-03 05:36:04 +0530 | [diff] [blame] | 340 | static 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 Chan | 412e9f9 | 2012-01-24 10:45:23 -0800 | [diff] [blame] | 374 | static 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 N | 1d1d307 | 2012-07-05 13:40:13 -0700 | [diff] [blame] | 395 | { |
| 396 | ARRAY_SIZE(cam_video_ls_vectors), |
| 397 | cam_video_ls_vectors, |
| 398 | }, |
Nishant Pandit | 221a948 | 2012-09-03 05:36:04 +0530 | [diff] [blame] | 399 | { |
| 400 | ARRAY_SIZE(cam_dual_vectors), |
| 401 | cam_dual_vectors, |
| 402 | }, |
Kevin Chan | 412e9f9 | 2012-01-24 10:45:23 -0800 | [diff] [blame] | 403 | }; |
| 404 | |
| 405 | static 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 | |
| 411 | static struct msm_camera_device_platform_data msm_camera_csi_device_data[] = { |
| 412 | { |
Sreesudhan Ramakrish Ramkumar | 5ad18cd | 2012-09-07 23:22:34 -0700 | [diff] [blame] | 413 | .csiphy_core = 0, |
Kevin Chan | 412e9f9 | 2012-01-24 10:45:23 -0800 | [diff] [blame] | 414 | .csid_core = 0, |
Kevin Chan | eb6b607 | 2012-01-17 11:54:54 -0800 | [diff] [blame] | 415 | .is_vpe = 1, |
Kevin Chan | 412e9f9 | 2012-01-24 10:45:23 -0800 | [diff] [blame] | 416 | .cam_bus_scale_table = &cam_bus_client_pdata, |
| 417 | }, |
| 418 | { |
Sreesudhan Ramakrish Ramkumar | 5ad18cd | 2012-09-07 23:22:34 -0700 | [diff] [blame] | 419 | .csiphy_core = 1, |
Kevin Chan | 412e9f9 | 2012-01-24 10:45:23 -0800 | [diff] [blame] | 420 | .csid_core = 1, |
Kevin Chan | eb6b607 | 2012-01-17 11:54:54 -0800 | [diff] [blame] | 421 | .is_vpe = 1, |
Kevin Chan | 412e9f9 | 2012-01-24 10:45:23 -0800 | [diff] [blame] | 422 | .cam_bus_scale_table = &cam_bus_client_pdata, |
| 423 | }, |
| 424 | }; |
| 425 | |
Sreesudhan Ramakrish Ramkumar | 923fbad | 2012-07-26 17:31:42 -0700 | [diff] [blame] | 426 | static struct camera_vreg_t apq_8064_cam_vreg[] = { |
Kevin Chan | eb6b607 | 2012-01-17 11:54:54 -0800 | [diff] [blame] | 427 | {"cam_vdig", REG_LDO, 1200000, 1200000, 105000}, |
Sreesudhan Ramakrish Ramkumar | 6c6f57c | 2012-02-21 15:12:44 -0800 | [diff] [blame] | 428 | {"cam_vio", REG_VS, 0, 0, 0}, |
| 429 | {"cam_vana", REG_LDO, 2800000, 2850000, 85600}, |
Kevin Chan | eb6b607 | 2012-01-17 11:54:54 -0800 | [diff] [blame] | 430 | {"cam_vaf", REG_LDO, 2800000, 2850000, 300000}, |
| 431 | }; |
| 432 | |
Kevin Chan | d07220e | 2012-02-13 15:52:22 -0800 | [diff] [blame] | 433 | #define CAML_RSTN PM8921_GPIO_PM_TO_SYS(28) |
| 434 | #define CAMR_RSTN 34 |
| 435 | |
Kevin Chan | eb6b607 | 2012-01-17 11:54:54 -0800 | [diff] [blame] | 436 | static struct gpio apq8064_common_cam_gpio[] = { |
Kevin Chan | eb6b607 | 2012-01-17 11:54:54 -0800 | [diff] [blame] | 437 | }; |
| 438 | |
| 439 | static struct gpio apq8064_back_cam_gpio[] = { |
Kevin Chan | d07220e | 2012-02-13 15:52:22 -0800 | [diff] [blame] | 440 | {5, GPIOF_DIR_IN, "CAMIF_MCLK"}, |
| 441 | {CAML_RSTN, GPIOF_DIR_OUT, "CAM_RESET"}, |
Kevin Chan | eb6b607 | 2012-01-17 11:54:54 -0800 | [diff] [blame] | 442 | }; |
| 443 | |
| 444 | static struct msm_gpio_set_tbl apq8064_back_cam_gpio_set_tbl[] = { |
Kevin Chan | d07220e | 2012-02-13 15:52:22 -0800 | [diff] [blame] | 445 | {CAML_RSTN, GPIOF_OUT_INIT_LOW, 10000}, |
| 446 | {CAML_RSTN, GPIOF_OUT_INIT_HIGH, 10000}, |
Kevin Chan | eb6b607 | 2012-01-17 11:54:54 -0800 | [diff] [blame] | 447 | }; |
| 448 | |
| 449 | static 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 Chan | d07220e | 2012-02-13 15:52:22 -0800 | [diff] [blame] | 460 | static 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 | |
| 467 | static 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 | |
| 472 | static 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 | |
| 483 | static 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 Govindaram | 6627b36 | 2012-01-29 19:00:30 -0800 | [diff] [blame] | 489 | static struct i2c_board_info msm_act_main_cam_i2c_info = { |
| 490 | I2C_BOARD_INFO("msm_actuator", 0x11), |
Jignesh Mehta | 3339457 | 2012-02-21 19:57:41 -0800 | [diff] [blame] | 491 | }; |
| 492 | |
Rajakumar Govindaram | 6627b36 | 2012-01-29 19:00:30 -0800 | [diff] [blame] | 493 | static 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 Mehta | 3339457 | 2012-02-21 19:57:41 -0800 | [diff] [blame] | 496 | .bus_id = APQ_8064_GSBI4_QUP_I2C_BUS_ID, |
| 497 | .vcm_pwd = 0, |
Rajakumar Govindaram | 6627b36 | 2012-01-29 19:00:30 -0800 | [diff] [blame] | 498 | .vcm_enable = 0, |
Jignesh Mehta | 3339457 | 2012-02-21 19:57:41 -0800 | [diff] [blame] | 499 | }; |
| 500 | |
Jeyaprakash Soundrapandian | 3040c03 | 2012-04-21 01:13:29 -0700 | [diff] [blame] | 501 | static struct i2c_board_info msm_act_main_cam1_i2c_info = { |
| 502 | I2C_BOARD_INFO("msm_actuator", 0x18), |
| 503 | }; |
| 504 | |
| 505 | static 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 Chan | d07220e | 2012-02-13 15:52:22 -0800 | [diff] [blame] | 514 | static 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 Soni | 5785010 | 2012-09-26 11:31:27 -0700 | [diff] [blame] | 520 | static struct msm_camera_sensor_flash_data flash_imx135 = { |
| 521 | .flash_type = MSM_CAMERA_FLASH_NONE, |
| 522 | }; |
| 523 | |
| 524 | static struct msm_camera_csi_lane_params imx135_csi_lane_params = { |
| 525 | .csi_lane_assign = 0xE4, |
| 526 | .csi_lane_mask = 0xF, |
| 527 | }; |
| 528 | |
| 529 | static 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 | |
| 538 | static 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 Soni | 3333c85 | 2012-10-10 16:51:52 -0700 | [diff] [blame] | 546 | .actuator_info = &msm_act_main_cam_1_info, |
Punit Soni | 5785010 | 2012-09-26 11:31:27 -0700 | [diff] [blame] | 547 | }; |
| 548 | |
Sreesudhan Ramakrish Ramkumar | 7f723dc | 2012-10-12 22:58:13 -0700 | [diff] [blame] | 549 | static struct i2c_board_info sc628a_flash_i2c_info = { |
| 550 | I2C_BOARD_INFO("sc628a", 0x6E), |
| 551 | }; |
| 552 | |
Kevin Chan | 412e9f9 | 2012-01-24 10:45:23 -0800 | [diff] [blame] | 553 | static struct msm_camera_sensor_flash_data flash_imx074 = { |
Jeyaprakash Soundrapandian | a1b3c53 | 2012-02-29 20:33:30 -0800 | [diff] [blame] | 554 | .flash_type = MSM_CAMERA_FLASH_LED, |
Sreesudhan Ramakrish Ramkumar | 7f723dc | 2012-10-12 22:58:13 -0700 | [diff] [blame] | 555 | .flash_src = &msm_flash_src, |
| 556 | .board_info = &sc628a_flash_i2c_info, |
| 557 | .bus_id = APQ_8064_GSBI4_QUP_I2C_BUS_ID, |
Kevin Chan | 412e9f9 | 2012-01-24 10:45:23 -0800 | [diff] [blame] | 558 | }; |
| 559 | |
Hody Hung | 9ba65cf | 2012-01-17 17:34:51 -0800 | [diff] [blame] | 560 | static struct msm_camera_csi_lane_params imx074_csi_lane_params = { |
| 561 | .csi_lane_assign = 0xE4, |
| 562 | .csi_lane_mask = 0xF, |
| 563 | }; |
| 564 | |
Kevin Chan | 412e9f9 | 2012-01-24 10:45:23 -0800 | [diff] [blame] | 565 | static struct msm_camera_sensor_platform_info sensor_board_info_imx074 = { |
| 566 | .mount_angle = 90, |
Sreesudhan Ramakrish Ramkumar | 923fbad | 2012-07-26 17:31:42 -0700 | [diff] [blame] | 567 | .cam_vreg = apq_8064_cam_vreg, |
| 568 | .num_vreg = ARRAY_SIZE(apq_8064_cam_vreg), |
Kevin Chan | eb6b607 | 2012-01-17 11:54:54 -0800 | [diff] [blame] | 569 | .gpio_conf = &apq8064_back_cam_gpio_conf, |
Kevin Chan | d07220e | 2012-02-13 15:52:22 -0800 | [diff] [blame] | 570 | .i2c_conf = &apq8064_back_cam_i2c_conf, |
Hody Hung | 9ba65cf | 2012-01-17 17:34:51 -0800 | [diff] [blame] | 571 | .csi_lane_params = &imx074_csi_lane_params, |
Kevin Chan | 412e9f9 | 2012-01-24 10:45:23 -0800 | [diff] [blame] | 572 | }; |
| 573 | |
Jeyaprakash Soundrapandian | 734476b | 2012-05-03 20:08:15 -0700 | [diff] [blame] | 574 | static struct i2c_board_info imx074_eeprom_i2c_info = { |
| 575 | I2C_BOARD_INFO("imx074_eeprom", 0x34 << 1), |
| 576 | }; |
| 577 | |
| 578 | static 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 Chan | 412e9f9 | 2012-01-24 10:45:23 -0800 | [diff] [blame] | 583 | static 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 Chan | 412e9f9 | 2012-01-24 10:45:23 -0800 | [diff] [blame] | 588 | .csi_if = 1, |
| 589 | .camera_type = BACK_CAMERA_2D, |
Raju P.L.S.S.S.N | 3f4b302 | 2012-03-29 10:09:01 +0530 | [diff] [blame] | 590 | .sensor_type = BAYER_SENSOR, |
Rajakumar Govindaram | 6627b36 | 2012-01-29 19:00:30 -0800 | [diff] [blame] | 591 | .actuator_info = &msm_act_main_cam_0_info, |
Jeyaprakash Soundrapandian | 734476b | 2012-05-03 20:08:15 -0700 | [diff] [blame] | 592 | .eeprom_info = &imx074_eeprom_info, |
Kevin Chan | 412e9f9 | 2012-01-24 10:45:23 -0800 | [diff] [blame] | 593 | }; |
Jeyaprakash Soundrapandian | 734476b | 2012-05-03 20:08:15 -0700 | [diff] [blame] | 594 | |
Sreesudhan Ramakrish Ramkumar | 3381da7 | 2012-01-27 08:08:32 -0800 | [diff] [blame] | 595 | static struct msm_camera_csi_lane_params imx091_csi_lane_params = { |
| 596 | .csi_lane_assign = 0xE4, |
| 597 | .csi_lane_mask = 0xF, |
| 598 | }; |
| 599 | |
Sreesudhan Ramakrish Ramkumar | 3381da7 | 2012-01-27 08:08:32 -0800 | [diff] [blame] | 600 | static struct msm_camera_sensor_flash_data flash_imx091 = { |
| 601 | .flash_type = MSM_CAMERA_FLASH_NONE, |
| 602 | }; |
| 603 | |
| 604 | static struct msm_camera_sensor_platform_info sensor_board_info_imx091 = { |
| 605 | .mount_angle = 0, |
Sreesudhan Ramakrish Ramkumar | 923fbad | 2012-07-26 17:31:42 -0700 | [diff] [blame] | 606 | .cam_vreg = apq_8064_cam_vreg, |
| 607 | .num_vreg = ARRAY_SIZE(apq_8064_cam_vreg), |
Sreesudhan Ramakrish Ramkumar | 3381da7 | 2012-01-27 08:08:32 -0800 | [diff] [blame] | 608 | .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 Soundrapandian | 734476b | 2012-05-03 20:08:15 -0700 | [diff] [blame] | 613 | static struct i2c_board_info imx091_eeprom_i2c_info = { |
| 614 | I2C_BOARD_INFO("imx091_eeprom", 0x21), |
| 615 | }; |
| 616 | |
| 617 | static 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 Ramkumar | 3381da7 | 2012-01-27 08:08:32 -0800 | [diff] [blame] | 622 | static 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.N | 3f4b302 | 2012-03-29 10:09:01 +0530 | [diff] [blame] | 629 | .sensor_type = BAYER_SENSOR, |
Jeyaprakash Soundrapandian | 3040c03 | 2012-04-21 01:13:29 -0700 | [diff] [blame] | 630 | .actuator_info = &msm_act_main_cam_1_info, |
Jeyaprakash Soundrapandian | 734476b | 2012-05-03 20:08:15 -0700 | [diff] [blame] | 631 | .eeprom_info = &imx091_eeprom_info, |
Sreesudhan Ramakrish Ramkumar | 3381da7 | 2012-01-27 08:08:32 -0800 | [diff] [blame] | 632 | }; |
Kevin Chan | 412e9f9 | 2012-01-24 10:45:23 -0800 | [diff] [blame] | 633 | |
Sreesudhan Ramakrish Ramkumar | 8002a79 | 2012-04-09 17:42:58 -0700 | [diff] [blame] | 634 | static struct msm_camera_sensor_flash_data flash_s5k3l1yx = { |
| 635 | .flash_type = MSM_CAMERA_FLASH_NONE, |
| 636 | }; |
| 637 | |
| 638 | static struct msm_camera_csi_lane_params s5k3l1yx_csi_lane_params = { |
| 639 | .csi_lane_assign = 0xE4, |
| 640 | .csi_lane_mask = 0xF, |
| 641 | }; |
| 642 | |
| 643 | static struct msm_camera_sensor_platform_info sensor_board_info_s5k3l1yx = { |
| 644 | .mount_angle = 90, |
Sreesudhan Ramakrish Ramkumar | 923fbad | 2012-07-26 17:31:42 -0700 | [diff] [blame] | 645 | .cam_vreg = apq_8064_cam_vreg, |
| 646 | .num_vreg = ARRAY_SIZE(apq_8064_cam_vreg), |
Sreesudhan Ramakrish Ramkumar | 8002a79 | 2012-04-09 17:42:58 -0700 | [diff] [blame] | 647 | .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 | |
| 652 | static 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 Ramkumar | 6c6f57c | 2012-02-21 15:12:44 -0800 | [diff] [blame] | 662 | static struct msm_camera_sensor_flash_data flash_mt9m114 = { |
| 663 | .flash_type = MSM_CAMERA_FLASH_NONE |
| 664 | }; |
| 665 | |
Hody Hung | 9ba65cf | 2012-01-17 17:34:51 -0800 | [diff] [blame] | 666 | static struct msm_camera_csi_lane_params mt9m114_csi_lane_params = { |
| 667 | .csi_lane_assign = 0xE4, |
| 668 | .csi_lane_mask = 0x1, |
| 669 | }; |
| 670 | |
Sreesudhan Ramakrish Ramkumar | 6c6f57c | 2012-02-21 15:12:44 -0800 | [diff] [blame] | 671 | static struct msm_camera_sensor_platform_info sensor_board_info_mt9m114 = { |
| 672 | .mount_angle = 90, |
Sreesudhan Ramakrish Ramkumar | 923fbad | 2012-07-26 17:31:42 -0700 | [diff] [blame] | 673 | .cam_vreg = apq_8064_cam_vreg, |
| 674 | .num_vreg = ARRAY_SIZE(apq_8064_cam_vreg), |
Sreesudhan Ramakrish Ramkumar | 6c6f57c | 2012-02-21 15:12:44 -0800 | [diff] [blame] | 675 | .gpio_conf = &apq8064_front_cam_gpio_conf, |
| 676 | .i2c_conf = &apq8064_front_cam_i2c_conf, |
Hody Hung | 9ba65cf | 2012-01-17 17:34:51 -0800 | [diff] [blame] | 677 | .csi_lane_params = &mt9m114_csi_lane_params, |
Sreesudhan Ramakrish Ramkumar | 6c6f57c | 2012-02-21 15:12:44 -0800 | [diff] [blame] | 678 | }; |
| 679 | |
| 680 | static 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.N | 3f4b302 | 2012-03-29 10:09:01 +0530 | [diff] [blame] | 687 | .sensor_type = YUV_SENSOR, |
Sreesudhan Ramakrish Ramkumar | 6c6f57c | 2012-02-21 15:12:44 -0800 | [diff] [blame] | 688 | }; |
| 689 | |
Kevin Chan | d07220e | 2012-02-13 15:52:22 -0800 | [diff] [blame] | 690 | static struct msm_camera_sensor_flash_data flash_ov2720 = { |
| 691 | .flash_type = MSM_CAMERA_FLASH_NONE, |
| 692 | }; |
| 693 | |
Hody Hung | 9ba65cf | 2012-01-17 17:34:51 -0800 | [diff] [blame] | 694 | static struct msm_camera_csi_lane_params ov2720_csi_lane_params = { |
| 695 | .csi_lane_assign = 0xE4, |
| 696 | .csi_lane_mask = 0x3, |
| 697 | }; |
| 698 | |
Kevin Chan | d07220e | 2012-02-13 15:52:22 -0800 | [diff] [blame] | 699 | static struct msm_camera_sensor_platform_info sensor_board_info_ov2720 = { |
| 700 | .mount_angle = 0, |
Sreesudhan Ramakrish Ramkumar | 923fbad | 2012-07-26 17:31:42 -0700 | [diff] [blame] | 701 | .cam_vreg = apq_8064_cam_vreg, |
| 702 | .num_vreg = ARRAY_SIZE(apq_8064_cam_vreg), |
Kevin Chan | d07220e | 2012-02-13 15:52:22 -0800 | [diff] [blame] | 703 | .gpio_conf = &apq8064_front_cam_gpio_conf, |
| 704 | .i2c_conf = &apq8064_front_cam_i2c_conf, |
Hody Hung | 9ba65cf | 2012-01-17 17:34:51 -0800 | [diff] [blame] | 705 | .csi_lane_params = &ov2720_csi_lane_params, |
Kevin Chan | d07220e | 2012-02-13 15:52:22 -0800 | [diff] [blame] | 706 | }; |
| 707 | |
| 708 | static 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.N | 3f4b302 | 2012-03-29 10:09:01 +0530 | [diff] [blame] | 715 | .sensor_type = BAYER_SENSOR, |
Kevin Chan | d07220e | 2012-02-13 15:52:22 -0800 | [diff] [blame] | 716 | }; |
Kevin Chan | d07220e | 2012-02-13 15:52:22 -0800 | [diff] [blame] | 717 | |
Kevin Chan | 94b4c83 | 2012-03-02 21:27:16 -0800 | [diff] [blame] | 718 | static struct platform_device msm_camera_server = { |
| 719 | .name = "msm_cam_server", |
| 720 | .id = 0, |
| 721 | }; |
| 722 | |
Kevin Chan | 412e9f9 | 2012-01-24 10:45:23 -0800 | [diff] [blame] | 723 | void __init apq8064_init_cam(void) |
| 724 | { |
| 725 | msm_gpiomux_install(apq8064_cam_common_configs, |
| 726 | ARRAY_SIZE(apq8064_cam_common_configs)); |
| 727 | |
Sreesudhan Ramakrish Ramkumar | 6f25eb9 | 2012-04-10 09:49:47 -0700 | [diff] [blame] | 728 | if (machine_is_apq8064_cdp()) { |
Sreesudhan Ramakrish Ramkumar | 3f06a1b | 2012-03-15 18:44:56 -0700 | [diff] [blame] | 729 | sensor_board_info_imx074.mount_angle = 0; |
Sreesudhan Ramakrish Ramkumar | 6f25eb9 | 2012-04-10 09:49:47 -0700 | [diff] [blame] | 730 | sensor_board_info_mt9m114.mount_angle = 0; |
| 731 | } else if (machine_is_apq8064_liquid()) |
Jignesh Mehta | bfb1aa3 | 2012-03-16 17:23:23 -0700 | [diff] [blame] | 732 | sensor_board_info_imx074.mount_angle = 180; |
Sreesudhan Ramakrish Ramkumar | 3f06a1b | 2012-03-15 18:44:56 -0700 | [diff] [blame] | 733 | |
Kevin Chan | 94b4c83 | 2012-03-02 21:27:16 -0800 | [diff] [blame] | 734 | platform_device_register(&msm_camera_server); |
Kevin Chan | d07220e | 2012-02-13 15:52:22 -0800 | [diff] [blame] | 735 | platform_device_register(&msm8960_device_i2c_mux_gsbi4); |
Kevin Chan | 412e9f9 | 2012-01-24 10:45:23 -0800 | [diff] [blame] | 736 | 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 |
| 746 | static struct i2c_board_info apq8064_camera_i2c_boardinfo[] = { |
Kevin Chan | 412e9f9 | 2012-01-24 10:45:23 -0800 | [diff] [blame] | 747 | { |
| 748 | I2C_BOARD_INFO("imx074", 0x1A), |
| 749 | .platform_data = &msm_camera_sensor_imx074_data, |
| 750 | }, |
Sreesudhan Ramakrish Ramkumar | 6c6f57c | 2012-02-21 15:12:44 -0800 | [diff] [blame] | 751 | { |
Punit Soni | 5785010 | 2012-09-26 11:31:27 -0700 | [diff] [blame] | 752 | I2C_BOARD_INFO("imx135", 0x10), |
| 753 | .platform_data = &msm_camera_sensor_imx135_data, |
| 754 | }, |
| 755 | { |
Sreesudhan Ramakrish Ramkumar | 6c6f57c | 2012-02-21 15:12:44 -0800 | [diff] [blame] | 756 | I2C_BOARD_INFO("mt9m114", 0x48), |
| 757 | .platform_data = &msm_camera_sensor_mt9m114_data, |
| 758 | }, |
Kevin Chan | d07220e | 2012-02-13 15:52:22 -0800 | [diff] [blame] | 759 | { |
| 760 | I2C_BOARD_INFO("ov2720", 0x6C), |
| 761 | .platform_data = &msm_camera_sensor_ov2720_data, |
| 762 | }, |
Jeyaprakash Soundrapandian | a1b3c53 | 2012-02-29 20:33:30 -0800 | [diff] [blame] | 763 | { |
Sreesudhan Ramakrish Ramkumar | 3381da7 | 2012-01-27 08:08:32 -0800 | [diff] [blame] | 764 | I2C_BOARD_INFO("imx091", 0x34), |
| 765 | .platform_data = &msm_camera_sensor_imx091_data, |
| 766 | }, |
Sreesudhan Ramakrish Ramkumar | 8002a79 | 2012-04-09 17:42:58 -0700 | [diff] [blame] | 767 | { |
| 768 | I2C_BOARD_INFO("s5k3l1yx", 0x20), |
| 769 | .platform_data = &msm_camera_sensor_s5k3l1yx_data, |
| 770 | }, |
Kevin Chan | 412e9f9 | 2012-01-24 10:45:23 -0800 | [diff] [blame] | 771 | }; |
| 772 | |
| 773 | struct 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 |