Suresh Vankadara | 8df2c75 | 2012-01-18 00:18:03 +0530 | [diff] [blame] | 1 | /* Copyright (c) 2011-2012, Code Aurora Forum. All rights reserved. |
Stepan Moskovchenko | c6ada42 | 2011-11-28 19:31:16 -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 | |
Stepan Moskovchenko | c6ada42 | 2011-11-28 19:31:16 -0800 | [diff] [blame] | 14 | #include <asm/mach-types.h> |
Kevin Chan | eb6b607 | 2012-01-17 11:54:54 -0800 | [diff] [blame] | 15 | #include <linux/gpio.h> |
Jack Wang | b88c8c2 | 2012-07-26 11:33:36 -0700 | [diff] [blame] | 16 | #include <mach/camera.h> |
Stepan Moskovchenko | c6ada42 | 2011-11-28 19:31:16 -0800 | [diff] [blame] | 17 | #include <mach/msm_bus_board.h> |
Stepan Moskovchenko | c6ada42 | 2011-11-28 19:31:16 -0800 | [diff] [blame] | 18 | #include <mach/gpiomux.h> |
| 19 | #include "devices.h" |
Stepan Moskovchenko | 5a83dba | 2011-12-05 17:30:17 -0800 | [diff] [blame] | 20 | #include "board-8960.h" |
Stepan Moskovchenko | c6ada42 | 2011-11-28 19:31:16 -0800 | [diff] [blame] | 21 | |
Steve Muckle | f132c6c | 2012-06-06 18:30:57 -0700 | [diff] [blame] | 22 | #ifdef CONFIG_MSM_CAMERA |
| 23 | |
Stepan Moskovchenko | c6ada42 | 2011-11-28 19:31:16 -0800 | [diff] [blame] | 24 | #if (defined(CONFIG_GPIO_SX150X) || defined(CONFIG_GPIO_SX150X_MODULE)) && \ |
| 25 | defined(CONFIG_I2C) |
| 26 | |
| 27 | static struct i2c_board_info cam_expander_i2c_info[] = { |
| 28 | { |
| 29 | I2C_BOARD_INFO("sx1508q", 0x22), |
| 30 | .platform_data = &msm8960_sx150x_data[SX150X_CAM] |
| 31 | }, |
| 32 | }; |
| 33 | |
| 34 | static struct msm_cam_expander_info cam_expander_info[] = { |
| 35 | { |
| 36 | cam_expander_i2c_info, |
| 37 | MSM_8960_GSBI4_QUP_I2C_BUS_ID, |
| 38 | }, |
| 39 | }; |
| 40 | #endif |
| 41 | |
| 42 | static struct gpiomux_setting cam_settings[] = { |
| 43 | { |
| 44 | .func = GPIOMUX_FUNC_GPIO, /*suspend*/ |
| 45 | .drv = GPIOMUX_DRV_2MA, |
| 46 | .pull = GPIOMUX_PULL_DOWN, |
| 47 | }, |
| 48 | |
| 49 | { |
| 50 | .func = GPIOMUX_FUNC_1, /*active 1*/ |
| 51 | .drv = GPIOMUX_DRV_2MA, |
| 52 | .pull = GPIOMUX_PULL_NONE, |
| 53 | }, |
| 54 | |
| 55 | { |
| 56 | .func = GPIOMUX_FUNC_GPIO, /*active 2*/ |
| 57 | .drv = GPIOMUX_DRV_2MA, |
| 58 | .pull = GPIOMUX_PULL_NONE, |
| 59 | }, |
| 60 | |
| 61 | { |
| 62 | .func = GPIOMUX_FUNC_1, /*active 3*/ |
| 63 | .drv = GPIOMUX_DRV_8MA, |
| 64 | .pull = GPIOMUX_PULL_NONE, |
| 65 | }, |
| 66 | |
| 67 | { |
| 68 | .func = GPIOMUX_FUNC_5, /*active 4*/ |
| 69 | .drv = GPIOMUX_DRV_8MA, |
| 70 | .pull = GPIOMUX_PULL_UP, |
| 71 | }, |
| 72 | |
| 73 | { |
| 74 | .func = GPIOMUX_FUNC_6, /*active 5*/ |
| 75 | .drv = GPIOMUX_DRV_8MA, |
| 76 | .pull = GPIOMUX_PULL_UP, |
| 77 | }, |
| 78 | |
| 79 | { |
| 80 | .func = GPIOMUX_FUNC_2, /*active 6*/ |
| 81 | .drv = GPIOMUX_DRV_2MA, |
| 82 | .pull = GPIOMUX_PULL_UP, |
| 83 | }, |
| 84 | |
| 85 | { |
| 86 | .func = GPIOMUX_FUNC_3, /*active 7*/ |
| 87 | .drv = GPIOMUX_DRV_8MA, |
| 88 | .pull = GPIOMUX_PULL_UP, |
| 89 | }, |
| 90 | |
| 91 | { |
| 92 | .func = GPIOMUX_FUNC_GPIO, /*i2c suspend*/ |
| 93 | .drv = GPIOMUX_DRV_2MA, |
| 94 | .pull = GPIOMUX_PULL_KEEPER, |
| 95 | }, |
| 96 | |
| 97 | }; |
| 98 | |
Kevin Chan | cfab2f7 | 2011-12-02 13:05:51 -0800 | [diff] [blame] | 99 | static struct msm_gpiomux_config msm8960_cdp_flash_configs[] = { |
| 100 | { |
| 101 | .gpio = 3, |
| 102 | .settings = { |
| 103 | [GPIOMUX_ACTIVE] = &cam_settings[1], |
| 104 | [GPIOMUX_SUSPENDED] = &cam_settings[0], |
| 105 | }, |
| 106 | }, |
| 107 | }; |
Stepan Moskovchenko | c6ada42 | 2011-11-28 19:31:16 -0800 | [diff] [blame] | 108 | |
| 109 | static struct msm_gpiomux_config msm8960_cam_common_configs[] = { |
| 110 | { |
| 111 | .gpio = 2, |
| 112 | .settings = { |
| 113 | [GPIOMUX_ACTIVE] = &cam_settings[2], |
| 114 | [GPIOMUX_SUSPENDED] = &cam_settings[0], |
| 115 | }, |
| 116 | }, |
| 117 | { |
| 118 | .gpio = 3, |
| 119 | .settings = { |
Kevin Chan | cfab2f7 | 2011-12-02 13:05:51 -0800 | [diff] [blame] | 120 | [GPIOMUX_ACTIVE] = &cam_settings[2], |
Stepan Moskovchenko | c6ada42 | 2011-11-28 19:31:16 -0800 | [diff] [blame] | 121 | [GPIOMUX_SUSPENDED] = &cam_settings[0], |
| 122 | }, |
| 123 | }, |
| 124 | { |
| 125 | .gpio = 4, |
| 126 | .settings = { |
| 127 | [GPIOMUX_ACTIVE] = &cam_settings[1], |
| 128 | [GPIOMUX_SUSPENDED] = &cam_settings[0], |
| 129 | }, |
| 130 | }, |
| 131 | { |
| 132 | .gpio = 5, |
| 133 | .settings = { |
Rajakumar Govindaram | 7fb409e | 2011-11-23 13:58:36 -0800 | [diff] [blame] | 134 | [GPIOMUX_ACTIVE] = &cam_settings[3], |
Stepan Moskovchenko | c6ada42 | 2011-11-28 19:31:16 -0800 | [diff] [blame] | 135 | [GPIOMUX_SUSPENDED] = &cam_settings[0], |
| 136 | }, |
| 137 | }, |
| 138 | { |
| 139 | .gpio = 76, |
| 140 | .settings = { |
| 141 | [GPIOMUX_ACTIVE] = &cam_settings[2], |
| 142 | [GPIOMUX_SUSPENDED] = &cam_settings[0], |
| 143 | }, |
| 144 | }, |
| 145 | { |
| 146 | .gpio = 107, |
| 147 | .settings = { |
| 148 | [GPIOMUX_ACTIVE] = &cam_settings[2], |
| 149 | [GPIOMUX_SUSPENDED] = &cam_settings[0], |
| 150 | }, |
| 151 | }, |
| 152 | }; |
| 153 | |
| 154 | static struct msm_gpiomux_config msm8960_cam_2d_configs[] = { |
| 155 | { |
| 156 | .gpio = 18, |
| 157 | .settings = { |
| 158 | [GPIOMUX_ACTIVE] = &cam_settings[3], |
| 159 | [GPIOMUX_SUSPENDED] = &cam_settings[8], |
| 160 | }, |
| 161 | }, |
| 162 | { |
| 163 | .gpio = 19, |
| 164 | .settings = { |
| 165 | [GPIOMUX_ACTIVE] = &cam_settings[3], |
| 166 | [GPIOMUX_SUSPENDED] = &cam_settings[8], |
| 167 | }, |
| 168 | }, |
| 169 | { |
| 170 | .gpio = 20, |
| 171 | .settings = { |
| 172 | [GPIOMUX_ACTIVE] = &cam_settings[3], |
| 173 | [GPIOMUX_SUSPENDED] = &cam_settings[8], |
| 174 | }, |
| 175 | }, |
| 176 | { |
| 177 | .gpio = 21, |
| 178 | .settings = { |
| 179 | [GPIOMUX_ACTIVE] = &cam_settings[3], |
| 180 | [GPIOMUX_SUSPENDED] = &cam_settings[8], |
| 181 | }, |
| 182 | }, |
| 183 | }; |
| 184 | |
Stepan Moskovchenko | c6ada42 | 2011-11-28 19:31:16 -0800 | [diff] [blame] | 185 | #define VFE_CAMIF_TIMER1_GPIO 2 |
| 186 | #define VFE_CAMIF_TIMER2_GPIO 3 |
| 187 | #define VFE_CAMIF_TIMER3_GPIO_INT 4 |
Stepan Moskovchenko | fc70d90 | 2011-11-30 12:39:36 -0800 | [diff] [blame] | 188 | static struct msm_camera_sensor_strobe_flash_data strobe_flash_xenon = { |
Stepan Moskovchenko | c6ada42 | 2011-11-28 19:31:16 -0800 | [diff] [blame] | 189 | .flash_trigger = VFE_CAMIF_TIMER2_GPIO, |
| 190 | .flash_charge = VFE_CAMIF_TIMER1_GPIO, |
| 191 | .flash_charge_done = VFE_CAMIF_TIMER3_GPIO_INT, |
| 192 | .flash_recharge_duration = 50000, |
| 193 | .irq = MSM_GPIO_TO_INT(VFE_CAMIF_TIMER3_GPIO_INT), |
| 194 | }; |
| 195 | |
| 196 | #ifdef CONFIG_MSM_CAMERA_FLASH |
| 197 | static struct msm_camera_sensor_flash_src msm_flash_src = { |
| 198 | .flash_sr_type = MSM_CAMERA_FLASH_SRC_EXT, |
Kevin Chan | cfab2f7 | 2011-12-02 13:05:51 -0800 | [diff] [blame] | 199 | ._fsrc.ext_driver_src.led_en = VFE_CAMIF_TIMER1_GPIO, |
| 200 | ._fsrc.ext_driver_src.led_flash_en = VFE_CAMIF_TIMER2_GPIO, |
Jeyaprakash Soundrapandian | 85099fe | 2012-05-15 17:09:51 -0700 | [diff] [blame] | 201 | ._fsrc.ext_driver_src.flash_id = MAM_CAMERA_EXT_LED_FLASH_SC628A, |
Stepan Moskovchenko | c6ada42 | 2011-11-28 19:31:16 -0800 | [diff] [blame] | 202 | }; |
| 203 | #endif |
| 204 | |
| 205 | static struct msm_bus_vectors cam_init_vectors[] = { |
| 206 | { |
| 207 | .src = MSM_BUS_MASTER_VFE, |
| 208 | .dst = MSM_BUS_SLAVE_EBI_CH0, |
| 209 | .ab = 0, |
| 210 | .ib = 0, |
| 211 | }, |
| 212 | { |
| 213 | .src = MSM_BUS_MASTER_VPE, |
| 214 | .dst = MSM_BUS_SLAVE_EBI_CH0, |
| 215 | .ab = 0, |
| 216 | .ib = 0, |
| 217 | }, |
| 218 | { |
| 219 | .src = MSM_BUS_MASTER_JPEG_ENC, |
| 220 | .dst = MSM_BUS_SLAVE_EBI_CH0, |
| 221 | .ab = 0, |
| 222 | .ib = 0, |
| 223 | }, |
Jignesh Mehta | 95dd6e1 | 2011-11-18 17:21:16 -0800 | [diff] [blame] | 224 | { |
| 225 | .src = MSM_BUS_MASTER_JPEG_ENC, |
| 226 | .dst = MSM_BUS_SLAVE_MM_IMEM, |
| 227 | .ab = 0, |
| 228 | .ib = 0, |
| 229 | }, |
| 230 | { |
| 231 | .src = MSM_BUS_MASTER_VFE, |
| 232 | .dst = MSM_BUS_SLAVE_MM_IMEM, |
| 233 | .ab = 0, |
| 234 | .ib = 0, |
| 235 | }, |
Stepan Moskovchenko | c6ada42 | 2011-11-28 19:31:16 -0800 | [diff] [blame] | 236 | }; |
| 237 | |
| 238 | static struct msm_bus_vectors cam_preview_vectors[] = { |
| 239 | { |
| 240 | .src = MSM_BUS_MASTER_VFE, |
| 241 | .dst = MSM_BUS_SLAVE_EBI_CH0, |
| 242 | .ab = 27648000, |
| 243 | .ib = 110592000, |
| 244 | }, |
| 245 | { |
| 246 | .src = MSM_BUS_MASTER_VPE, |
| 247 | .dst = MSM_BUS_SLAVE_EBI_CH0, |
| 248 | .ab = 0, |
| 249 | .ib = 0, |
| 250 | }, |
| 251 | { |
| 252 | .src = MSM_BUS_MASTER_JPEG_ENC, |
| 253 | .dst = MSM_BUS_SLAVE_EBI_CH0, |
| 254 | .ab = 0, |
| 255 | .ib = 0, |
| 256 | }, |
Jignesh Mehta | 95dd6e1 | 2011-11-18 17:21:16 -0800 | [diff] [blame] | 257 | { |
| 258 | .src = MSM_BUS_MASTER_JPEG_ENC, |
| 259 | .dst = MSM_BUS_SLAVE_MM_IMEM, |
| 260 | .ab = 0, |
| 261 | .ib = 0, |
| 262 | }, |
| 263 | { |
| 264 | .src = MSM_BUS_MASTER_VFE, |
| 265 | .dst = MSM_BUS_SLAVE_MM_IMEM, |
| 266 | .ab = 0, |
| 267 | .ib = 0, |
| 268 | }, |
Stepan Moskovchenko | c6ada42 | 2011-11-28 19:31:16 -0800 | [diff] [blame] | 269 | }; |
| 270 | |
| 271 | static struct msm_bus_vectors cam_video_vectors[] = { |
| 272 | { |
| 273 | .src = MSM_BUS_MASTER_VFE, |
| 274 | .dst = MSM_BUS_SLAVE_EBI_CH0, |
Kiran Kumar H N | 1d1d307 | 2012-07-05 13:40:13 -0700 | [diff] [blame] | 275 | .ab = 274406400, |
Mingcheng Zhu | d5ec60e | 2011-12-16 23:02:53 -0800 | [diff] [blame] | 276 | .ib = 617103360, |
Stepan Moskovchenko | c6ada42 | 2011-11-28 19:31:16 -0800 | [diff] [blame] | 277 | }, |
| 278 | { |
| 279 | .src = MSM_BUS_MASTER_VPE, |
| 280 | .dst = MSM_BUS_SLAVE_EBI_CH0, |
| 281 | .ab = 206807040, |
| 282 | .ib = 488816640, |
| 283 | }, |
| 284 | { |
| 285 | .src = MSM_BUS_MASTER_JPEG_ENC, |
| 286 | .dst = MSM_BUS_SLAVE_EBI_CH0, |
| 287 | .ab = 0, |
| 288 | .ib = 0, |
| 289 | }, |
Jignesh Mehta | 95dd6e1 | 2011-11-18 17:21:16 -0800 | [diff] [blame] | 290 | { |
| 291 | .src = MSM_BUS_MASTER_JPEG_ENC, |
| 292 | .dst = MSM_BUS_SLAVE_MM_IMEM, |
| 293 | .ab = 0, |
| 294 | .ib = 0, |
| 295 | }, |
| 296 | { |
| 297 | .src = MSM_BUS_MASTER_VFE, |
| 298 | .dst = MSM_BUS_SLAVE_MM_IMEM, |
| 299 | .ab = 0, |
| 300 | .ib = 0, |
| 301 | }, |
Stepan Moskovchenko | c6ada42 | 2011-11-28 19:31:16 -0800 | [diff] [blame] | 302 | }; |
| 303 | |
| 304 | static struct msm_bus_vectors cam_snapshot_vectors[] = { |
| 305 | { |
| 306 | .src = MSM_BUS_MASTER_VFE, |
| 307 | .dst = MSM_BUS_SLAVE_EBI_CH0, |
| 308 | .ab = 274423680, |
| 309 | .ib = 1097694720, |
| 310 | }, |
| 311 | { |
| 312 | .src = MSM_BUS_MASTER_VPE, |
| 313 | .dst = MSM_BUS_SLAVE_EBI_CH0, |
| 314 | .ab = 0, |
| 315 | .ib = 0, |
| 316 | }, |
| 317 | { |
| 318 | .src = MSM_BUS_MASTER_JPEG_ENC, |
| 319 | .dst = MSM_BUS_SLAVE_EBI_CH0, |
| 320 | .ab = 540000000, |
| 321 | .ib = 1350000000, |
| 322 | }, |
Jignesh Mehta | 95dd6e1 | 2011-11-18 17:21:16 -0800 | [diff] [blame] | 323 | { |
| 324 | .src = MSM_BUS_MASTER_JPEG_ENC, |
| 325 | .dst = MSM_BUS_SLAVE_MM_IMEM, |
| 326 | .ab = 43200000, |
| 327 | .ib = 69120000, |
| 328 | }, |
| 329 | { |
| 330 | .src = MSM_BUS_MASTER_VFE, |
| 331 | .dst = MSM_BUS_SLAVE_MM_IMEM, |
| 332 | .ab = 43200000, |
| 333 | .ib = 69120000, |
| 334 | }, |
Stepan Moskovchenko | c6ada42 | 2011-11-28 19:31:16 -0800 | [diff] [blame] | 335 | }; |
| 336 | |
| 337 | static struct msm_bus_vectors cam_zsl_vectors[] = { |
| 338 | { |
| 339 | .src = MSM_BUS_MASTER_VFE, |
| 340 | .dst = MSM_BUS_SLAVE_EBI_CH0, |
| 341 | .ab = 302071680, |
| 342 | .ib = 1208286720, |
| 343 | }, |
| 344 | { |
| 345 | .src = MSM_BUS_MASTER_VPE, |
| 346 | .dst = MSM_BUS_SLAVE_EBI_CH0, |
| 347 | .ab = 0, |
| 348 | .ib = 0, |
| 349 | }, |
| 350 | { |
| 351 | .src = MSM_BUS_MASTER_JPEG_ENC, |
| 352 | .dst = MSM_BUS_SLAVE_EBI_CH0, |
| 353 | .ab = 540000000, |
| 354 | .ib = 1350000000, |
| 355 | }, |
Jignesh Mehta | 95dd6e1 | 2011-11-18 17:21:16 -0800 | [diff] [blame] | 356 | { |
| 357 | .src = MSM_BUS_MASTER_JPEG_ENC, |
| 358 | .dst = MSM_BUS_SLAVE_MM_IMEM, |
| 359 | .ab = 43200000, |
| 360 | .ib = 69120000, |
| 361 | }, |
| 362 | { |
| 363 | .src = MSM_BUS_MASTER_VFE, |
| 364 | .dst = MSM_BUS_SLAVE_MM_IMEM, |
| 365 | .ab = 43200000, |
| 366 | .ib = 69120000, |
| 367 | }, |
Stepan Moskovchenko | c6ada42 | 2011-11-28 19:31:16 -0800 | [diff] [blame] | 368 | }; |
| 369 | |
Kiran Kumar H N | 1d1d307 | 2012-07-05 13:40:13 -0700 | [diff] [blame] | 370 | static struct msm_bus_vectors cam_video_ls_vectors[] = { |
| 371 | { |
| 372 | .src = MSM_BUS_MASTER_VFE, |
| 373 | .dst = MSM_BUS_SLAVE_EBI_CH0, |
| 374 | .ab = 348192000, |
| 375 | .ib = 617103360, |
| 376 | }, |
| 377 | { |
| 378 | .src = MSM_BUS_MASTER_VPE, |
| 379 | .dst = MSM_BUS_SLAVE_EBI_CH0, |
| 380 | .ab = 206807040, |
| 381 | .ib = 488816640, |
| 382 | }, |
| 383 | { |
| 384 | .src = MSM_BUS_MASTER_JPEG_ENC, |
| 385 | .dst = MSM_BUS_SLAVE_EBI_CH0, |
| 386 | .ab = 540000000, |
| 387 | .ib = 1350000000, |
| 388 | }, |
| 389 | { |
| 390 | .src = MSM_BUS_MASTER_JPEG_ENC, |
| 391 | .dst = MSM_BUS_SLAVE_MM_IMEM, |
| 392 | .ab = 0, |
| 393 | .ib = 0, |
| 394 | }, |
| 395 | { |
| 396 | .src = MSM_BUS_MASTER_VFE, |
| 397 | .dst = MSM_BUS_SLAVE_MM_IMEM, |
| 398 | .ab = 0, |
| 399 | .ib = 0, |
| 400 | }, |
| 401 | }; |
| 402 | |
Nishant Pandit | 221a948 | 2012-09-03 05:36:04 +0530 | [diff] [blame] | 403 | static struct msm_bus_vectors cam_dual_vectors[] = { |
| 404 | { |
| 405 | .src = MSM_BUS_MASTER_VFE, |
| 406 | .dst = MSM_BUS_SLAVE_EBI_CH0, |
| 407 | .ab = 348192000, |
| 408 | .ib = 1208286720, |
| 409 | }, |
| 410 | { |
| 411 | .src = MSM_BUS_MASTER_VPE, |
| 412 | .dst = MSM_BUS_SLAVE_EBI_CH0, |
| 413 | .ab = 206807040, |
| 414 | .ib = 488816640, |
| 415 | }, |
| 416 | { |
| 417 | .src = MSM_BUS_MASTER_JPEG_ENC, |
| 418 | .dst = MSM_BUS_SLAVE_EBI_CH0, |
| 419 | .ab = 540000000, |
| 420 | .ib = 1350000000, |
| 421 | }, |
| 422 | { |
| 423 | .src = MSM_BUS_MASTER_JPEG_ENC, |
| 424 | .dst = MSM_BUS_SLAVE_MM_IMEM, |
| 425 | .ab = 43200000, |
| 426 | .ib = 69120000, |
| 427 | }, |
| 428 | { |
| 429 | .src = MSM_BUS_MASTER_VFE, |
| 430 | .dst = MSM_BUS_SLAVE_MM_IMEM, |
| 431 | .ab = 43200000, |
| 432 | .ib = 69120000, |
| 433 | }, |
| 434 | }; |
| 435 | |
| 436 | |
Kiran Kumar H N | 1d1d307 | 2012-07-05 13:40:13 -0700 | [diff] [blame] | 437 | |
Stepan Moskovchenko | c6ada42 | 2011-11-28 19:31:16 -0800 | [diff] [blame] | 438 | static struct msm_bus_paths cam_bus_client_config[] = { |
| 439 | { |
| 440 | ARRAY_SIZE(cam_init_vectors), |
| 441 | cam_init_vectors, |
| 442 | }, |
| 443 | { |
| 444 | ARRAY_SIZE(cam_preview_vectors), |
| 445 | cam_preview_vectors, |
| 446 | }, |
| 447 | { |
| 448 | ARRAY_SIZE(cam_video_vectors), |
| 449 | cam_video_vectors, |
| 450 | }, |
| 451 | { |
| 452 | ARRAY_SIZE(cam_snapshot_vectors), |
| 453 | cam_snapshot_vectors, |
| 454 | }, |
| 455 | { |
| 456 | ARRAY_SIZE(cam_zsl_vectors), |
| 457 | cam_zsl_vectors, |
| 458 | }, |
Kiran Kumar H N | 1d1d307 | 2012-07-05 13:40:13 -0700 | [diff] [blame] | 459 | { |
| 460 | ARRAY_SIZE(cam_video_ls_vectors), |
| 461 | cam_video_ls_vectors, |
| 462 | }, |
Nishant Pandit | 221a948 | 2012-09-03 05:36:04 +0530 | [diff] [blame] | 463 | { |
| 464 | ARRAY_SIZE(cam_dual_vectors), |
| 465 | cam_dual_vectors, |
| 466 | }, |
Stepan Moskovchenko | c6ada42 | 2011-11-28 19:31:16 -0800 | [diff] [blame] | 467 | }; |
| 468 | |
| 469 | static struct msm_bus_scale_pdata cam_bus_client_pdata = { |
| 470 | cam_bus_client_config, |
| 471 | ARRAY_SIZE(cam_bus_client_config), |
| 472 | .name = "msm_camera", |
| 473 | }; |
| 474 | |
Stepan Moskovchenko | fc70d90 | 2011-11-30 12:39:36 -0800 | [diff] [blame] | 475 | static struct msm_camera_device_platform_data msm_camera_csi_device_data[] = { |
Stepan Moskovchenko | c6ada42 | 2011-11-28 19:31:16 -0800 | [diff] [blame] | 476 | { |
Sreesudhan Ramakrish Ramkumar | 5ad18cd | 2012-09-07 23:22:34 -0700 | [diff] [blame] | 477 | .csiphy_core = 0, |
Stepan Moskovchenko | c6ada42 | 2011-11-28 19:31:16 -0800 | [diff] [blame] | 478 | .csid_core = 0, |
Suresh Vankadara | 8df2c75 | 2012-01-18 00:18:03 +0530 | [diff] [blame] | 479 | .is_vpe = 1, |
Stepan Moskovchenko | c6ada42 | 2011-11-28 19:31:16 -0800 | [diff] [blame] | 480 | .cam_bus_scale_table = &cam_bus_client_pdata, |
| 481 | }, |
| 482 | { |
Sreesudhan Ramakrish Ramkumar | 5ad18cd | 2012-09-07 23:22:34 -0700 | [diff] [blame] | 483 | .csiphy_core = 1, |
Stepan Moskovchenko | c6ada42 | 2011-11-28 19:31:16 -0800 | [diff] [blame] | 484 | .csid_core = 1, |
Suresh Vankadara | 8df2c75 | 2012-01-18 00:18:03 +0530 | [diff] [blame] | 485 | .is_vpe = 1, |
Stepan Moskovchenko | c6ada42 | 2011-11-28 19:31:16 -0800 | [diff] [blame] | 486 | .cam_bus_scale_table = &cam_bus_client_pdata, |
| 487 | }, |
Sreesudhan Ramakrish Ramkumar | b1edcd0 | 2012-01-17 11:33:05 -0800 | [diff] [blame] | 488 | { |
Sreesudhan Ramakrish Ramkumar | 5ad18cd | 2012-09-07 23:22:34 -0700 | [diff] [blame] | 489 | .csiphy_core = 2, |
Sreesudhan Ramakrish Ramkumar | b1edcd0 | 2012-01-17 11:33:05 -0800 | [diff] [blame] | 490 | .csid_core = 2, |
Sreesudhan Ramakrish Ramkumar | 0ce73bc | 2012-04-17 09:59:29 -0700 | [diff] [blame] | 491 | .is_vpe = 1, |
Sreesudhan Ramakrish Ramkumar | b1edcd0 | 2012-01-17 11:33:05 -0800 | [diff] [blame] | 492 | .cam_bus_scale_table = &cam_bus_client_pdata, |
| 493 | }, |
Stepan Moskovchenko | c6ada42 | 2011-11-28 19:31:16 -0800 | [diff] [blame] | 494 | }; |
| 495 | |
Sreesudhan Ramakrish Ramkumar | 923fbad | 2012-07-26 17:31:42 -0700 | [diff] [blame] | 496 | static struct camera_vreg_t msm_8960_cam_vreg[] = { |
Kevin Chan | eb6b607 | 2012-01-17 11:54:54 -0800 | [diff] [blame] | 497 | {"cam_vdig", REG_LDO, 1200000, 1200000, 105000}, |
Sreesudhan Ramakrish Ramkumar | ec27a6e | 2012-02-11 20:41:19 -0800 | [diff] [blame] | 498 | {"cam_vio", REG_VS, 0, 0, 0}, |
| 499 | {"cam_vana", REG_LDO, 2800000, 2850000, 85600}, |
Kevin Chan | eb6b607 | 2012-01-17 11:54:54 -0800 | [diff] [blame] | 500 | {"cam_vaf", REG_LDO, 2800000, 2800000, 300000}, |
| 501 | }; |
| 502 | |
Kevin Chan | eb6b607 | 2012-01-17 11:54:54 -0800 | [diff] [blame] | 503 | static struct gpio msm8960_common_cam_gpio[] = { |
| 504 | {5, GPIOF_DIR_IN, "CAMIF_MCLK"}, |
| 505 | {20, GPIOF_DIR_IN, "CAMIF_I2C_DATA"}, |
| 506 | {21, GPIOF_DIR_IN, "CAMIF_I2C_CLK"}, |
| 507 | }; |
| 508 | |
| 509 | static struct gpio msm8960_front_cam_gpio[] = { |
| 510 | {76, GPIOF_DIR_OUT, "CAM_RESET"}, |
| 511 | }; |
| 512 | |
| 513 | static struct gpio msm8960_back_cam_gpio[] = { |
| 514 | {107, GPIOF_DIR_OUT, "CAM_RESET"}, |
| 515 | }; |
| 516 | |
| 517 | static struct msm_gpio_set_tbl msm8960_front_cam_gpio_set_tbl[] = { |
| 518 | {76, GPIOF_OUT_INIT_LOW, 1000}, |
| 519 | {76, GPIOF_OUT_INIT_HIGH, 4000}, |
| 520 | }; |
| 521 | |
| 522 | static struct msm_gpio_set_tbl msm8960_back_cam_gpio_set_tbl[] = { |
| 523 | {107, GPIOF_OUT_INIT_LOW, 1000}, |
| 524 | {107, GPIOF_OUT_INIT_HIGH, 4000}, |
| 525 | }; |
| 526 | |
| 527 | static struct msm_camera_gpio_conf msm_8960_front_cam_gpio_conf = { |
| 528 | .cam_gpiomux_conf_tbl = msm8960_cam_2d_configs, |
| 529 | .cam_gpiomux_conf_tbl_size = ARRAY_SIZE(msm8960_cam_2d_configs), |
| 530 | .cam_gpio_common_tbl = msm8960_common_cam_gpio, |
| 531 | .cam_gpio_common_tbl_size = ARRAY_SIZE(msm8960_common_cam_gpio), |
| 532 | .cam_gpio_req_tbl = msm8960_front_cam_gpio, |
| 533 | .cam_gpio_req_tbl_size = ARRAY_SIZE(msm8960_front_cam_gpio), |
| 534 | .cam_gpio_set_tbl = msm8960_front_cam_gpio_set_tbl, |
| 535 | .cam_gpio_set_tbl_size = ARRAY_SIZE(msm8960_front_cam_gpio_set_tbl), |
| 536 | }; |
| 537 | |
| 538 | static struct msm_camera_gpio_conf msm_8960_back_cam_gpio_conf = { |
| 539 | .cam_gpiomux_conf_tbl = msm8960_cam_2d_configs, |
| 540 | .cam_gpiomux_conf_tbl_size = ARRAY_SIZE(msm8960_cam_2d_configs), |
| 541 | .cam_gpio_common_tbl = msm8960_common_cam_gpio, |
| 542 | .cam_gpio_common_tbl_size = ARRAY_SIZE(msm8960_common_cam_gpio), |
| 543 | .cam_gpio_req_tbl = msm8960_back_cam_gpio, |
| 544 | .cam_gpio_req_tbl_size = ARRAY_SIZE(msm8960_back_cam_gpio), |
| 545 | .cam_gpio_set_tbl = msm8960_back_cam_gpio_set_tbl, |
| 546 | .cam_gpio_set_tbl_size = ARRAY_SIZE(msm8960_back_cam_gpio_set_tbl), |
| 547 | }; |
| 548 | |
Rajakumar Govindaram | 6627b36 | 2012-01-29 19:00:30 -0800 | [diff] [blame] | 549 | static struct i2c_board_info msm_act_main_cam_i2c_info = { |
| 550 | I2C_BOARD_INFO("msm_actuator", 0x11), |
Stepan Moskovchenko | c6ada42 | 2011-11-28 19:31:16 -0800 | [diff] [blame] | 551 | }; |
| 552 | |
Rajakumar Govindaram | 6627b36 | 2012-01-29 19:00:30 -0800 | [diff] [blame] | 553 | static struct msm_actuator_info msm_act_main_cam_0_info = { |
| 554 | .board_info = &msm_act_main_cam_i2c_info, |
| 555 | .cam_name = MSM_ACTUATOR_MAIN_CAM_0, |
Stepan Moskovchenko | c6ada42 | 2011-11-28 19:31:16 -0800 | [diff] [blame] | 556 | .bus_id = MSM_8960_GSBI4_QUP_I2C_BUS_ID, |
| 557 | .vcm_pwd = 0, |
Rajakumar Govindaram | 6627b36 | 2012-01-29 19:00:30 -0800 | [diff] [blame] | 558 | .vcm_enable = 0, |
Stepan Moskovchenko | c6ada42 | 2011-11-28 19:31:16 -0800 | [diff] [blame] | 559 | }; |
Stepan Moskovchenko | c6ada42 | 2011-11-28 19:31:16 -0800 | [diff] [blame] | 560 | |
Jeyaprakash Soundrapandian | 3040c03 | 2012-04-21 01:13:29 -0700 | [diff] [blame] | 561 | static struct i2c_board_info msm_act_main_cam1_i2c_info = { |
| 562 | I2C_BOARD_INFO("msm_actuator", 0x18), |
| 563 | }; |
| 564 | |
| 565 | static struct msm_actuator_info msm_act_main_cam_1_info = { |
| 566 | .board_info = &msm_act_main_cam1_i2c_info, |
| 567 | .cam_name = MSM_ACTUATOR_MAIN_CAM_1, |
| 568 | .bus_id = MSM_8960_GSBI4_QUP_I2C_BUS_ID, |
| 569 | .vcm_pwd = 0, |
| 570 | .vcm_enable = 0, |
| 571 | }; |
| 572 | |
Stepan Moskovchenko | c6ada42 | 2011-11-28 19:31:16 -0800 | [diff] [blame] | 573 | static struct msm_camera_sensor_flash_data flash_imx074 = { |
| 574 | .flash_type = MSM_CAMERA_FLASH_LED, |
| 575 | #ifdef CONFIG_MSM_CAMERA_FLASH |
| 576 | .flash_src = &msm_flash_src |
| 577 | #endif |
| 578 | }; |
| 579 | |
Hody Hung | 9ba65cf | 2012-01-17 17:34:51 -0800 | [diff] [blame] | 580 | static struct msm_camera_csi_lane_params imx074_csi_lane_params = { |
| 581 | .csi_lane_assign = 0xE4, |
| 582 | .csi_lane_mask = 0xF, |
| 583 | }; |
| 584 | |
Stepan Moskovchenko | c6ada42 | 2011-11-28 19:31:16 -0800 | [diff] [blame] | 585 | static struct msm_camera_sensor_platform_info sensor_board_info_imx074 = { |
| 586 | .mount_angle = 90, |
Sreesudhan Ramakrish Ramkumar | 923fbad | 2012-07-26 17:31:42 -0700 | [diff] [blame] | 587 | .cam_vreg = msm_8960_cam_vreg, |
| 588 | .num_vreg = ARRAY_SIZE(msm_8960_cam_vreg), |
Kevin Chan | eb6b607 | 2012-01-17 11:54:54 -0800 | [diff] [blame] | 589 | .gpio_conf = &msm_8960_back_cam_gpio_conf, |
Hody Hung | 9ba65cf | 2012-01-17 17:34:51 -0800 | [diff] [blame] | 590 | .csi_lane_params = &imx074_csi_lane_params, |
Stepan Moskovchenko | c6ada42 | 2011-11-28 19:31:16 -0800 | [diff] [blame] | 591 | }; |
| 592 | |
Jeyaprakash Soundrapandian | 734476b | 2012-05-03 20:08:15 -0700 | [diff] [blame] | 593 | static struct i2c_board_info imx074_eeprom_i2c_info = { |
| 594 | I2C_BOARD_INFO("imx074_eeprom", 0x34 << 1), |
| 595 | }; |
| 596 | |
| 597 | static struct msm_eeprom_info imx074_eeprom_info = { |
| 598 | .board_info = &imx074_eeprom_i2c_info, |
| 599 | .bus_id = MSM_8960_GSBI4_QUP_I2C_BUS_ID, |
| 600 | }; |
| 601 | |
Stepan Moskovchenko | c6ada42 | 2011-11-28 19:31:16 -0800 | [diff] [blame] | 602 | static struct msm_camera_sensor_info msm_camera_sensor_imx074_data = { |
| 603 | .sensor_name = "imx074", |
| 604 | .pdata = &msm_camera_csi_device_data[0], |
| 605 | .flash_data = &flash_imx074, |
| 606 | .strobe_flash_data = &strobe_flash_xenon, |
| 607 | .sensor_platform_info = &sensor_board_info_imx074, |
Stepan Moskovchenko | c6ada42 | 2011-11-28 19:31:16 -0800 | [diff] [blame] | 608 | .csi_if = 1, |
| 609 | .camera_type = BACK_CAMERA_2D, |
Raju P.L.S.S.S.N | 3f4b302 | 2012-03-29 10:09:01 +0530 | [diff] [blame] | 610 | .sensor_type = BAYER_SENSOR, |
Rajakumar Govindaram | 6627b36 | 2012-01-29 19:00:30 -0800 | [diff] [blame] | 611 | .actuator_info = &msm_act_main_cam_0_info, |
Jeyaprakash Soundrapandian | 734476b | 2012-05-03 20:08:15 -0700 | [diff] [blame] | 612 | .eeprom_info = &imx074_eeprom_info, |
Stepan Moskovchenko | c6ada42 | 2011-11-28 19:31:16 -0800 | [diff] [blame] | 613 | }; |
Rajakumar Govindaram | 6bc004a | 2011-12-05 20:58:19 -0800 | [diff] [blame] | 614 | |
Rajakumar Govindaram | 6bc004a | 2011-12-05 20:58:19 -0800 | [diff] [blame] | 615 | static struct msm_camera_sensor_flash_data flash_mt9m114 = { |
| 616 | .flash_type = MSM_CAMERA_FLASH_NONE |
| 617 | }; |
| 618 | |
Hody Hung | 9ba65cf | 2012-01-17 17:34:51 -0800 | [diff] [blame] | 619 | static struct msm_camera_csi_lane_params mt9m114_csi_lane_params = { |
| 620 | .csi_lane_assign = 0xE4, |
| 621 | .csi_lane_mask = 0x1, |
| 622 | }; |
| 623 | |
Jack Wang | b88c8c2 | 2012-07-26 11:33:36 -0700 | [diff] [blame] | 624 | static struct camera_vreg_t mt9m114_cam_vreg[] = { |
| 625 | {"cam_vdig", REG_LDO, 1200000, 1200000, 105000, 50}, |
| 626 | {"cam_vio", REG_VS, 0, 0, 0, 50}, |
| 627 | {"cam_vana", REG_LDO, 2800000, 2850000, 85600, 50}, |
| 628 | }; |
| 629 | |
Rajakumar Govindaram | 6bc004a | 2011-12-05 20:58:19 -0800 | [diff] [blame] | 630 | static struct msm_camera_sensor_platform_info sensor_board_info_mt9m114 = { |
| 631 | .mount_angle = 90, |
Jack Wang | b88c8c2 | 2012-07-26 11:33:36 -0700 | [diff] [blame] | 632 | .cam_vreg = mt9m114_cam_vreg, |
| 633 | .num_vreg = ARRAY_SIZE(mt9m114_cam_vreg), |
Sreesudhan Ramakrish Ramkumar | 61c877d | 2012-02-23 22:22:19 -0800 | [diff] [blame] | 634 | .gpio_conf = &msm_8960_front_cam_gpio_conf, |
Hody Hung | 9ba65cf | 2012-01-17 17:34:51 -0800 | [diff] [blame] | 635 | .csi_lane_params = &mt9m114_csi_lane_params, |
Rajakumar Govindaram | 6bc004a | 2011-12-05 20:58:19 -0800 | [diff] [blame] | 636 | }; |
| 637 | |
| 638 | static struct msm_camera_sensor_info msm_camera_sensor_mt9m114_data = { |
| 639 | .sensor_name = "mt9m114", |
Sreesudhan Ramakrish Ramkumar | 61c877d | 2012-02-23 22:22:19 -0800 | [diff] [blame] | 640 | .pdata = &msm_camera_csi_device_data[1], |
Rajakumar Govindaram | 6bc004a | 2011-12-05 20:58:19 -0800 | [diff] [blame] | 641 | .flash_data = &flash_mt9m114, |
| 642 | .sensor_platform_info = &sensor_board_info_mt9m114, |
Rajakumar Govindaram | 6bc004a | 2011-12-05 20:58:19 -0800 | [diff] [blame] | 643 | .csi_if = 1, |
Sreesudhan Ramakrish Ramkumar | 61c877d | 2012-02-23 22:22:19 -0800 | [diff] [blame] | 644 | .camera_type = FRONT_CAMERA_2D, |
Raju P.L.S.S.S.N | 3f4b302 | 2012-03-29 10:09:01 +0530 | [diff] [blame] | 645 | .sensor_type = YUV_SENSOR, |
Rajakumar Govindaram | 6bc004a | 2011-12-05 20:58:19 -0800 | [diff] [blame] | 646 | }; |
Rajakumar Govindaram | 6bc004a | 2011-12-05 20:58:19 -0800 | [diff] [blame] | 647 | |
Stepan Moskovchenko | c6ada42 | 2011-11-28 19:31:16 -0800 | [diff] [blame] | 648 | static struct msm_camera_sensor_flash_data flash_ov2720 = { |
| 649 | .flash_type = MSM_CAMERA_FLASH_NONE, |
| 650 | }; |
| 651 | |
Hody Hung | 9ba65cf | 2012-01-17 17:34:51 -0800 | [diff] [blame] | 652 | static struct msm_camera_csi_lane_params ov2720_csi_lane_params = { |
| 653 | .csi_lane_assign = 0xE4, |
| 654 | .csi_lane_mask = 0x3, |
| 655 | }; |
| 656 | |
Stepan Moskovchenko | c6ada42 | 2011-11-28 19:31:16 -0800 | [diff] [blame] | 657 | static struct msm_camera_sensor_platform_info sensor_board_info_ov2720 = { |
| 658 | .mount_angle = 0, |
Sreesudhan Ramakrish Ramkumar | 923fbad | 2012-07-26 17:31:42 -0700 | [diff] [blame] | 659 | .cam_vreg = msm_8960_cam_vreg, |
| 660 | .num_vreg = ARRAY_SIZE(msm_8960_cam_vreg), |
Kevin Chan | eb6b607 | 2012-01-17 11:54:54 -0800 | [diff] [blame] | 661 | .gpio_conf = &msm_8960_front_cam_gpio_conf, |
Hody Hung | 9ba65cf | 2012-01-17 17:34:51 -0800 | [diff] [blame] | 662 | .csi_lane_params = &ov2720_csi_lane_params, |
Stepan Moskovchenko | c6ada42 | 2011-11-28 19:31:16 -0800 | [diff] [blame] | 663 | }; |
| 664 | |
| 665 | static struct msm_camera_sensor_info msm_camera_sensor_ov2720_data = { |
| 666 | .sensor_name = "ov2720", |
| 667 | .pdata = &msm_camera_csi_device_data[1], |
| 668 | .flash_data = &flash_ov2720, |
| 669 | .sensor_platform_info = &sensor_board_info_ov2720, |
Stepan Moskovchenko | c6ada42 | 2011-11-28 19:31:16 -0800 | [diff] [blame] | 670 | .csi_if = 1, |
| 671 | .camera_type = FRONT_CAMERA_2D, |
Raju P.L.S.S.S.N | 3f4b302 | 2012-03-29 10:09:01 +0530 | [diff] [blame] | 672 | .sensor_type = BAYER_SENSOR, |
Stepan Moskovchenko | c6ada42 | 2011-11-28 19:31:16 -0800 | [diff] [blame] | 673 | }; |
Stepan Moskovchenko | c6ada42 | 2011-11-28 19:31:16 -0800 | [diff] [blame] | 674 | |
Sreesudhan Ramakrish Ramkumar | 8f11b8b | 2012-01-04 17:09:05 -0800 | [diff] [blame] | 675 | static struct msm_camera_sensor_flash_data flash_s5k3l1yx = { |
| 676 | .flash_type = MSM_CAMERA_FLASH_NONE, |
| 677 | }; |
| 678 | |
Hody Hung | 9ba65cf | 2012-01-17 17:34:51 -0800 | [diff] [blame] | 679 | static struct msm_camera_csi_lane_params s5k3l1yx_csi_lane_params = { |
| 680 | .csi_lane_assign = 0xE4, |
| 681 | .csi_lane_mask = 0xF, |
| 682 | }; |
| 683 | |
Sreesudhan Ramakrish Ramkumar | 8f11b8b | 2012-01-04 17:09:05 -0800 | [diff] [blame] | 684 | static struct msm_camera_sensor_platform_info sensor_board_info_s5k3l1yx = { |
| 685 | .mount_angle = 0, |
Sreesudhan Ramakrish Ramkumar | 923fbad | 2012-07-26 17:31:42 -0700 | [diff] [blame] | 686 | .cam_vreg = msm_8960_cam_vreg, |
| 687 | .num_vreg = ARRAY_SIZE(msm_8960_cam_vreg), |
Sreesudhan Ramakrish Ramkumar | 8f11b8b | 2012-01-04 17:09:05 -0800 | [diff] [blame] | 688 | .gpio_conf = &msm_8960_back_cam_gpio_conf, |
Hody Hung | 9ba65cf | 2012-01-17 17:34:51 -0800 | [diff] [blame] | 689 | .csi_lane_params = &s5k3l1yx_csi_lane_params, |
Sreesudhan Ramakrish Ramkumar | 8f11b8b | 2012-01-04 17:09:05 -0800 | [diff] [blame] | 690 | }; |
| 691 | |
Rajakumar Govindaram | 18ef38e | 2012-04-23 10:45:21 -0700 | [diff] [blame] | 692 | static struct msm_actuator_info msm_act_main_cam_2_info = { |
| 693 | .board_info = &msm_act_main_cam_i2c_info, |
| 694 | .cam_name = MSM_ACTUATOR_MAIN_CAM_2, |
| 695 | .bus_id = MSM_8960_GSBI4_QUP_I2C_BUS_ID, |
| 696 | .vcm_pwd = 0, |
| 697 | .vcm_enable = 0, |
| 698 | }; |
| 699 | |
Sreesudhan Ramakrish Ramkumar | 8f11b8b | 2012-01-04 17:09:05 -0800 | [diff] [blame] | 700 | static struct msm_camera_sensor_info msm_camera_sensor_s5k3l1yx_data = { |
| 701 | .sensor_name = "s5k3l1yx", |
| 702 | .pdata = &msm_camera_csi_device_data[0], |
| 703 | .flash_data = &flash_s5k3l1yx, |
| 704 | .sensor_platform_info = &sensor_board_info_s5k3l1yx, |
| 705 | .csi_if = 1, |
| 706 | .camera_type = BACK_CAMERA_2D, |
Raju P.L.S.S.S.N | 3f4b302 | 2012-03-29 10:09:01 +0530 | [diff] [blame] | 707 | .sensor_type = BAYER_SENSOR, |
Rajakumar Govindaram | 18ef38e | 2012-04-23 10:45:21 -0700 | [diff] [blame] | 708 | .actuator_info = &msm_act_main_cam_2_info, |
Sreesudhan Ramakrish Ramkumar | 8f11b8b | 2012-01-04 17:09:05 -0800 | [diff] [blame] | 709 | }; |
| 710 | |
Sreesudhan Ramakrish Ramkumar | 3381da7 | 2012-01-27 08:08:32 -0800 | [diff] [blame] | 711 | static struct msm_camera_csi_lane_params imx091_csi_lane_params = { |
| 712 | .csi_lane_assign = 0xE4, |
| 713 | .csi_lane_mask = 0xF, |
| 714 | }; |
| 715 | |
Sreesudhan Ramakrish Ramkumar | 3381da7 | 2012-01-27 08:08:32 -0800 | [diff] [blame] | 716 | static struct msm_camera_sensor_flash_data flash_imx091 = { |
Sreesudhan Ramakrish Ramkumar | 6c56b61 | 2012-04-17 18:14:13 -0700 | [diff] [blame] | 717 | .flash_type = MSM_CAMERA_FLASH_LED, |
| 718 | #ifdef CONFIG_MSM_CAMERA_FLASH |
| 719 | .flash_src = &msm_flash_src |
| 720 | #endif |
Sreesudhan Ramakrish Ramkumar | 3381da7 | 2012-01-27 08:08:32 -0800 | [diff] [blame] | 721 | }; |
| 722 | |
| 723 | static struct msm_camera_sensor_platform_info sensor_board_info_imx091 = { |
| 724 | .mount_angle = 0, |
Sreesudhan Ramakrish Ramkumar | 923fbad | 2012-07-26 17:31:42 -0700 | [diff] [blame] | 725 | .cam_vreg = msm_8960_cam_vreg, |
| 726 | .num_vreg = ARRAY_SIZE(msm_8960_cam_vreg), |
Sreesudhan Ramakrish Ramkumar | 3381da7 | 2012-01-27 08:08:32 -0800 | [diff] [blame] | 727 | .gpio_conf = &msm_8960_back_cam_gpio_conf, |
| 728 | .csi_lane_params = &imx091_csi_lane_params, |
| 729 | }; |
| 730 | |
Jeyaprakash Soundrapandian | 734476b | 2012-05-03 20:08:15 -0700 | [diff] [blame] | 731 | static struct i2c_board_info imx091_eeprom_i2c_info = { |
| 732 | I2C_BOARD_INFO("imx091_eeprom", 0x21), |
| 733 | }; |
| 734 | |
| 735 | static struct msm_eeprom_info imx091_eeprom_info = { |
| 736 | .board_info = &imx091_eeprom_i2c_info, |
| 737 | .bus_id = MSM_8960_GSBI4_QUP_I2C_BUS_ID, |
Jack Wang | b88c8c2 | 2012-07-26 11:33:36 -0700 | [diff] [blame] | 738 | .eeprom_i2c_slave_addr = 0xA1, |
| 739 | .eeprom_reg_addr = 0x05, |
| 740 | .eeprom_read_length = 6, |
Jeyaprakash Soundrapandian | 734476b | 2012-05-03 20:08:15 -0700 | [diff] [blame] | 741 | }; |
| 742 | |
Sreesudhan Ramakrish Ramkumar | 3381da7 | 2012-01-27 08:08:32 -0800 | [diff] [blame] | 743 | static struct msm_camera_sensor_info msm_camera_sensor_imx091_data = { |
| 744 | .sensor_name = "imx091", |
| 745 | .pdata = &msm_camera_csi_device_data[0], |
| 746 | .flash_data = &flash_imx091, |
| 747 | .sensor_platform_info = &sensor_board_info_imx091, |
| 748 | .csi_if = 1, |
| 749 | .camera_type = BACK_CAMERA_2D, |
Raju P.L.S.S.S.N | 3f4b302 | 2012-03-29 10:09:01 +0530 | [diff] [blame] | 750 | .sensor_type = BAYER_SENSOR, |
Jeyaprakash Soundrapandian | 3040c03 | 2012-04-21 01:13:29 -0700 | [diff] [blame] | 751 | .actuator_info = &msm_act_main_cam_1_info, |
Jeyaprakash Soundrapandian | 734476b | 2012-05-03 20:08:15 -0700 | [diff] [blame] | 752 | .eeprom_info = &imx091_eeprom_info, |
Sreesudhan Ramakrish Ramkumar | 3381da7 | 2012-01-27 08:08:32 -0800 | [diff] [blame] | 753 | }; |
| 754 | |
Kevin Chan | eb6b607 | 2012-01-17 11:54:54 -0800 | [diff] [blame] | 755 | static struct pm8xxx_mpp_config_data privacy_light_on_config = { |
| 756 | .type = PM8XXX_MPP_TYPE_SINK, |
| 757 | .level = PM8XXX_MPP_CS_OUT_5MA, |
| 758 | .control = PM8XXX_MPP_CS_CTRL_MPP_LOW_EN, |
Stepan Moskovchenko | c6ada42 | 2011-11-28 19:31:16 -0800 | [diff] [blame] | 759 | }; |
| 760 | |
Kevin Chan | eb6b607 | 2012-01-17 11:54:54 -0800 | [diff] [blame] | 761 | static struct pm8xxx_mpp_config_data privacy_light_off_config = { |
| 762 | .type = PM8XXX_MPP_TYPE_SINK, |
| 763 | .level = PM8XXX_MPP_CS_OUT_5MA, |
| 764 | .control = PM8XXX_MPP_CS_CTRL_DISABLE, |
| 765 | }; |
| 766 | |
| 767 | static int32_t msm_camera_8960_ext_power_ctrl(int enable) |
| 768 | { |
| 769 | int rc = 0; |
| 770 | if (enable) { |
| 771 | rc = pm8xxx_mpp_config(PM8921_MPP_PM_TO_SYS(12), |
| 772 | &privacy_light_on_config); |
| 773 | } else { |
| 774 | rc = pm8xxx_mpp_config(PM8921_MPP_PM_TO_SYS(12), |
| 775 | &privacy_light_off_config); |
| 776 | } |
| 777 | return rc; |
| 778 | } |
| 779 | |
Kevin Chan | 94b4c83 | 2012-03-02 21:27:16 -0800 | [diff] [blame] | 780 | static struct platform_device msm_camera_server = { |
| 781 | .name = "msm_cam_server", |
| 782 | .id = 0, |
| 783 | }; |
| 784 | |
Stepan Moskovchenko | c6ada42 | 2011-11-28 19:31:16 -0800 | [diff] [blame] | 785 | void __init msm8960_init_cam(void) |
| 786 | { |
Stepan Moskovchenko | c6ada42 | 2011-11-28 19:31:16 -0800 | [diff] [blame] | 787 | msm_gpiomux_install(msm8960_cam_common_configs, |
| 788 | ARRAY_SIZE(msm8960_cam_common_configs)); |
| 789 | |
Kevin Chan | cfab2f7 | 2011-12-02 13:05:51 -0800 | [diff] [blame] | 790 | if (machine_is_msm8960_cdp()) { |
| 791 | msm_gpiomux_install(msm8960_cdp_flash_configs, |
| 792 | ARRAY_SIZE(msm8960_cdp_flash_configs)); |
| 793 | msm_flash_src._fsrc.ext_driver_src.led_en = |
| 794 | GPIO_CAM_GP_LED_EN1; |
| 795 | msm_flash_src._fsrc.ext_driver_src.led_flash_en = |
| 796 | GPIO_CAM_GP_LED_EN2; |
| 797 | #if defined(CONFIG_I2C) && (defined(CONFIG_GPIO_SX150X) || \ |
| 798 | defined(CONFIG_GPIO_SX150X_MODULE)) |
| 799 | msm_flash_src._fsrc.ext_driver_src.expander_info = |
| 800 | cam_expander_info; |
| 801 | #endif |
| 802 | } |
| 803 | |
Stepan Moskovchenko | c6ada42 | 2011-11-28 19:31:16 -0800 | [diff] [blame] | 804 | if (machine_is_msm8960_liquid()) { |
| 805 | struct msm_camera_sensor_info *s_info; |
Kevin Chan | 09f4e66 | 2011-12-16 08:17:02 -0800 | [diff] [blame] | 806 | s_info = &msm_camera_sensor_imx074_data; |
Stepan Moskovchenko | c6ada42 | 2011-11-28 19:31:16 -0800 | [diff] [blame] | 807 | s_info->sensor_platform_info->mount_angle = 180; |
Kevin Chan | 09f4e66 | 2011-12-16 08:17:02 -0800 | [diff] [blame] | 808 | s_info = &msm_camera_sensor_ov2720_data; |
Kevin Chan | eb6b607 | 2012-01-17 11:54:54 -0800 | [diff] [blame] | 809 | s_info->sensor_platform_info->ext_power_ctrl = |
| 810 | msm_camera_8960_ext_power_ctrl; |
Stepan Moskovchenko | c6ada42 | 2011-11-28 19:31:16 -0800 | [diff] [blame] | 811 | } |
| 812 | |
Sreesudhan Ramakrish Ramkumar | 51f8df1 | 2012-05-01 22:21:48 -0700 | [diff] [blame] | 813 | if (machine_is_msm8960_fluid()) { |
| 814 | msm_camera_sensor_imx091_data.sensor_platform_info-> |
| 815 | mount_angle = 270; |
| 816 | } |
| 817 | |
Kevin Chan | 94b4c83 | 2012-03-02 21:27:16 -0800 | [diff] [blame] | 818 | platform_device_register(&msm_camera_server); |
Stepan Moskovchenko | c6ada42 | 2011-11-28 19:31:16 -0800 | [diff] [blame] | 819 | platform_device_register(&msm8960_device_csiphy0); |
| 820 | platform_device_register(&msm8960_device_csiphy1); |
Sreesudhan Ramakrish Ramkumar | b1edcd0 | 2012-01-17 11:33:05 -0800 | [diff] [blame] | 821 | platform_device_register(&msm8960_device_csiphy2); |
Stepan Moskovchenko | c6ada42 | 2011-11-28 19:31:16 -0800 | [diff] [blame] | 822 | platform_device_register(&msm8960_device_csid0); |
| 823 | platform_device_register(&msm8960_device_csid1); |
Sreesudhan Ramakrish Ramkumar | b1edcd0 | 2012-01-17 11:33:05 -0800 | [diff] [blame] | 824 | platform_device_register(&msm8960_device_csid2); |
Stepan Moskovchenko | c6ada42 | 2011-11-28 19:31:16 -0800 | [diff] [blame] | 825 | platform_device_register(&msm8960_device_ispif); |
| 826 | platform_device_register(&msm8960_device_vfe); |
| 827 | platform_device_register(&msm8960_device_vpe); |
| 828 | } |
Kevin Chan | 09f4e66 | 2011-12-16 08:17:02 -0800 | [diff] [blame] | 829 | |
| 830 | #ifdef CONFIG_I2C |
| 831 | static struct i2c_board_info msm8960_camera_i2c_boardinfo[] = { |
Kevin Chan | 09f4e66 | 2011-12-16 08:17:02 -0800 | [diff] [blame] | 832 | { |
| 833 | I2C_BOARD_INFO("imx074", 0x1A), |
| 834 | .platform_data = &msm_camera_sensor_imx074_data, |
| 835 | }, |
Kevin Chan | 09f4e66 | 2011-12-16 08:17:02 -0800 | [diff] [blame] | 836 | { |
| 837 | I2C_BOARD_INFO("ov2720", 0x6C), |
| 838 | .platform_data = &msm_camera_sensor_ov2720_data, |
| 839 | }, |
Kevin Chan | 09f4e66 | 2011-12-16 08:17:02 -0800 | [diff] [blame] | 840 | { |
| 841 | I2C_BOARD_INFO("mt9m114", 0x48), |
| 842 | .platform_data = &msm_camera_sensor_mt9m114_data, |
| 843 | }, |
Sreesudhan Ramakrish Ramkumar | 8f11b8b | 2012-01-04 17:09:05 -0800 | [diff] [blame] | 844 | { |
| 845 | I2C_BOARD_INFO("s5k3l1yx", 0x20), |
| 846 | .platform_data = &msm_camera_sensor_s5k3l1yx_data, |
| 847 | }, |
Kevin Chan | 09f4e66 | 2011-12-16 08:17:02 -0800 | [diff] [blame] | 848 | #ifdef CONFIG_MSM_CAMERA_FLASH_SC628A |
| 849 | { |
| 850 | I2C_BOARD_INFO("sc628a", 0x6E), |
| 851 | }, |
| 852 | #endif |
Sreesudhan Ramakrish Ramkumar | 3381da7 | 2012-01-27 08:08:32 -0800 | [diff] [blame] | 853 | { |
| 854 | I2C_BOARD_INFO("imx091", 0x34), |
| 855 | .platform_data = &msm_camera_sensor_imx091_data, |
| 856 | }, |
Kevin Chan | 09f4e66 | 2011-12-16 08:17:02 -0800 | [diff] [blame] | 857 | }; |
| 858 | |
| 859 | struct msm_camera_board_info msm8960_camera_board_info = { |
| 860 | .board_info = msm8960_camera_i2c_boardinfo, |
| 861 | .num_i2c_board_info = ARRAY_SIZE(msm8960_camera_i2c_boardinfo), |
| 862 | }; |
| 863 | #endif |
Stepan Moskovchenko | c6ada42 | 2011-11-28 19:31:16 -0800 | [diff] [blame] | 864 | #endif |