Russell King | a09e64f | 2008-08-05 16:14:15 +0100 | [diff] [blame] | 1 | /* arch/arm/mach-msm/include/mach/board.h |
| 2 | * |
| 3 | * Copyright (C) 2007 Google, Inc. |
Nagamalleswararao Ganji | 70fac1e | 2011-12-29 19:06:37 -0800 | [diff] [blame] | 4 | * Copyright (c) 2008-2012, Code Aurora Forum. All rights reserved. |
Russell King | a09e64f | 2008-08-05 16:14:15 +0100 | [diff] [blame] | 5 | * Author: Brian Swetland <swetland@google.com> |
| 6 | * |
| 7 | * This software is licensed under the terms of the GNU General Public |
| 8 | * License version 2, as published by the Free Software Foundation, and |
| 9 | * may be copied, distributed, and modified under those terms. |
| 10 | * |
| 11 | * This program is distributed in the hope that it will be useful, |
| 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 14 | * GNU General Public License for more details. |
| 15 | * |
| 16 | */ |
| 17 | |
| 18 | #ifndef __ASM_ARCH_MSM_BOARD_H |
| 19 | #define __ASM_ARCH_MSM_BOARD_H |
| 20 | |
| 21 | #include <linux/types.h> |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 22 | #include <linux/input.h> |
| 23 | #include <linux/usb.h> |
| 24 | #include <linux/leds-pmic8058.h> |
| 25 | #include <linux/clkdev.h> |
Sathish Ambley | c58afc2 | 2011-10-09 21:55:39 -0700 | [diff] [blame] | 26 | #include <linux/of_platform.h> |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 27 | #include <linux/msm_ssbi.h> |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 28 | #include <mach/msm_bus.h> |
Russell King | a09e64f | 2008-08-05 16:14:15 +0100 | [diff] [blame] | 29 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 30 | struct msm_camera_io_ext { |
| 31 | uint32_t mdcphy; |
| 32 | uint32_t mdcsz; |
| 33 | uint32_t appphy; |
| 34 | uint32_t appsz; |
| 35 | uint32_t camifpadphy; |
| 36 | uint32_t camifpadsz; |
| 37 | uint32_t csiphy; |
| 38 | uint32_t csisz; |
| 39 | uint32_t csiirq; |
| 40 | uint32_t csiphyphy; |
| 41 | uint32_t csiphysz; |
| 42 | uint32_t csiphyirq; |
| 43 | uint32_t ispifphy; |
| 44 | uint32_t ispifsz; |
| 45 | uint32_t ispifirq; |
| 46 | }; |
| 47 | |
| 48 | struct msm_camera_io_clk { |
| 49 | uint32_t mclk_clk_rate; |
| 50 | uint32_t vfe_clk_rate; |
| 51 | }; |
| 52 | |
Nishant Pandit | 474f225 | 2011-07-23 23:17:56 +0530 | [diff] [blame] | 53 | struct msm_cam_expander_info { |
| 54 | struct i2c_board_info const *board_info; |
| 55 | int bus_id; |
| 56 | }; |
| 57 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 58 | struct msm_camera_device_platform_data { |
| 59 | int (*camera_gpio_on) (void); |
| 60 | void (*camera_gpio_off)(void); |
| 61 | struct msm_camera_io_ext ioext; |
| 62 | struct msm_camera_io_clk ioclk; |
| 63 | uint8_t csid_core; |
Suresh Vankadara | 8df2c75 | 2012-01-18 00:18:03 +0530 | [diff] [blame] | 64 | uint8_t is_csiphy; |
| 65 | uint8_t is_csic; |
| 66 | uint8_t is_csid; |
| 67 | uint8_t is_ispif; |
| 68 | uint8_t is_vpe; |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 69 | struct msm_bus_scale_pdata *cam_bus_scale_table; |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 70 | }; |
| 71 | enum msm_camera_csi_data_format { |
| 72 | CSI_8BIT, |
| 73 | CSI_10BIT, |
| 74 | CSI_12BIT, |
| 75 | }; |
| 76 | struct msm_camera_csi_params { |
| 77 | enum msm_camera_csi_data_format data_format; |
| 78 | uint8_t lane_cnt; |
| 79 | uint8_t lane_assign; |
| 80 | uint8_t settle_cnt; |
| 81 | uint8_t dpcm_scheme; |
| 82 | }; |
| 83 | |
| 84 | #ifdef CONFIG_SENSORS_MT9T013 |
| 85 | struct msm_camera_legacy_device_platform_data { |
| 86 | int sensor_reset; |
| 87 | int sensor_pwd; |
| 88 | int vcm_pwd; |
| 89 | void (*config_gpio_on) (void); |
| 90 | void (*config_gpio_off)(void); |
| 91 | }; |
| 92 | #endif |
| 93 | |
| 94 | #define MSM_CAMERA_FLASH_NONE 0 |
| 95 | #define MSM_CAMERA_FLASH_LED 1 |
| 96 | |
| 97 | #define MSM_CAMERA_FLASH_SRC_PMIC (0x00000001<<0) |
| 98 | #define MSM_CAMERA_FLASH_SRC_PWM (0x00000001<<1) |
| 99 | #define MSM_CAMERA_FLASH_SRC_CURRENT_DRIVER (0x00000001<<2) |
Nishant Pandit | 474f225 | 2011-07-23 23:17:56 +0530 | [diff] [blame] | 100 | #define MSM_CAMERA_FLASH_SRC_EXT (0x00000001<<3) |
Taniya Das | 7a22cdd | 2011-09-08 14:57:00 +0530 | [diff] [blame] | 101 | #define MSM_CAMERA_FLASH_SRC_LED (0x00000001<<3) |
Raju P.L.S.S.S.N | bf3faff | 2012-04-05 14:33:36 +0530 | [diff] [blame] | 102 | #define MSM_CAMERA_FLASH_SRC_LED1 (0x00000001<<4) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 103 | |
| 104 | struct msm_camera_sensor_flash_pmic { |
| 105 | uint8_t num_of_src; |
| 106 | uint32_t low_current; |
| 107 | uint32_t high_current; |
| 108 | enum pmic8058_leds led_src_1; |
| 109 | enum pmic8058_leds led_src_2; |
| 110 | int (*pmic_set_current)(enum pmic8058_leds id, unsigned mA); |
| 111 | }; |
| 112 | |
| 113 | struct msm_camera_sensor_flash_pwm { |
| 114 | uint32_t freq; |
| 115 | uint32_t max_load; |
| 116 | uint32_t low_load; |
| 117 | uint32_t high_load; |
| 118 | uint32_t channel; |
| 119 | }; |
| 120 | |
| 121 | struct pmic8058_leds_platform_data; |
| 122 | struct msm_camera_sensor_flash_current_driver { |
| 123 | uint32_t low_current; |
| 124 | uint32_t high_current; |
| 125 | const struct pmic8058_leds_platform_data *driver_channel; |
Nishant Pandit | 474f225 | 2011-07-23 23:17:56 +0530 | [diff] [blame] | 126 | }; |
| 127 | |
Jeyaprakash Soundrapandian | 85099fe | 2012-05-15 17:09:51 -0700 | [diff] [blame] | 128 | enum msm_camera_ext_led_flash_id { |
| 129 | MAM_CAMERA_EXT_LED_FLASH_SC628A, |
| 130 | MAM_CAMERA_EXT_LED_FLASH_TPS61310, |
| 131 | }; |
| 132 | |
Nishant Pandit | 474f225 | 2011-07-23 23:17:56 +0530 | [diff] [blame] | 133 | struct msm_camera_sensor_flash_external { |
| 134 | uint32_t led_en; |
| 135 | uint32_t led_flash_en; |
Jeyaprakash Soundrapandian | 85099fe | 2012-05-15 17:09:51 -0700 | [diff] [blame] | 136 | enum msm_camera_ext_led_flash_id flash_id; |
Nishant Pandit | 474f225 | 2011-07-23 23:17:56 +0530 | [diff] [blame] | 137 | struct msm_cam_expander_info *expander_info; |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 138 | }; |
| 139 | |
Taniya Das | 7a22cdd | 2011-09-08 14:57:00 +0530 | [diff] [blame] | 140 | struct msm_camera_sensor_flash_led { |
| 141 | const char *led_name; |
| 142 | const int led_name_len; |
| 143 | }; |
| 144 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 145 | struct msm_camera_sensor_flash_src { |
| 146 | int flash_sr_type; |
| 147 | |
| 148 | union { |
| 149 | struct msm_camera_sensor_flash_pmic pmic_src; |
| 150 | struct msm_camera_sensor_flash_pwm pwm_src; |
| 151 | struct msm_camera_sensor_flash_current_driver |
| 152 | current_driver_src; |
Nishant Pandit | 474f225 | 2011-07-23 23:17:56 +0530 | [diff] [blame] | 153 | struct msm_camera_sensor_flash_external |
| 154 | ext_driver_src; |
Taniya Das | 7a22cdd | 2011-09-08 14:57:00 +0530 | [diff] [blame] | 155 | struct msm_camera_sensor_flash_led led_src; |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 156 | } _fsrc; |
| 157 | }; |
| 158 | |
| 159 | struct msm_camera_sensor_flash_data { |
| 160 | int flash_type; |
| 161 | struct msm_camera_sensor_flash_src *flash_src; |
| 162 | }; |
| 163 | |
| 164 | struct msm_camera_sensor_strobe_flash_data { |
| 165 | uint8_t flash_trigger; |
| 166 | uint8_t flash_charge; /* pin for charge */ |
| 167 | uint8_t flash_charge_done; |
| 168 | uint32_t flash_recharge_duration; |
| 169 | uint32_t irq; |
| 170 | spinlock_t spin_lock; |
| 171 | spinlock_t timer_lock; |
| 172 | int state; |
| 173 | }; |
| 174 | |
Nishant Pandit | 24153d8 | 2011-08-27 16:05:13 +0530 | [diff] [blame] | 175 | enum msm_camera_type { |
| 176 | BACK_CAMERA_2D, |
| 177 | FRONT_CAMERA_2D, |
| 178 | BACK_CAMERA_3D, |
| 179 | BACK_CAMERA_INT_3D, |
| 180 | }; |
| 181 | |
Raju P.L.S.S.S.N | 3f4b302 | 2012-03-29 10:09:01 +0530 | [diff] [blame] | 182 | enum msm_sensor_type { |
| 183 | BAYER_SENSOR, |
| 184 | YUV_SENSOR, |
| 185 | }; |
| 186 | |
Kevin Chan | eb6b607 | 2012-01-17 11:54:54 -0800 | [diff] [blame] | 187 | enum camera_vreg_type { |
| 188 | REG_LDO, |
| 189 | REG_VS, |
Kevin Chan | 8b0d232 | 2011-09-10 21:06:31 -0700 | [diff] [blame] | 190 | }; |
| 191 | |
Kevin Chan | eb6b607 | 2012-01-17 11:54:54 -0800 | [diff] [blame] | 192 | struct camera_vreg_t { |
| 193 | char *reg_name; |
| 194 | enum camera_vreg_type type; |
| 195 | int min_voltage; |
| 196 | int max_voltage; |
| 197 | int op_mode; |
| 198 | }; |
| 199 | |
| 200 | struct msm_gpio_set_tbl { |
| 201 | unsigned gpio; |
| 202 | unsigned long flags; |
| 203 | uint32_t delay; |
Nishant Pandit | 24153d8 | 2011-08-27 16:05:13 +0530 | [diff] [blame] | 204 | }; |
| 205 | |
Hody Hung | 9ba65cf | 2012-01-17 17:34:51 -0800 | [diff] [blame] | 206 | struct msm_camera_csi_lane_params { |
| 207 | uint8_t csi_lane_assign; |
| 208 | uint8_t csi_lane_mask; |
| 209 | }; |
| 210 | |
Nishant Pandit | 24153d8 | 2011-08-27 16:05:13 +0530 | [diff] [blame] | 211 | struct msm_camera_gpio_conf { |
| 212 | void *cam_gpiomux_conf_tbl; |
| 213 | uint8_t cam_gpiomux_conf_tbl_size; |
Kevin Chan | eb6b607 | 2012-01-17 11:54:54 -0800 | [diff] [blame] | 214 | struct gpio *cam_gpio_common_tbl; |
| 215 | uint8_t cam_gpio_common_tbl_size; |
| 216 | struct gpio *cam_gpio_req_tbl; |
| 217 | uint8_t cam_gpio_req_tbl_size; |
| 218 | struct msm_gpio_set_tbl *cam_gpio_set_tbl; |
| 219 | uint8_t cam_gpio_set_tbl_size; |
Sandeep Kodimela | c6f7867 | 2012-03-07 10:44:04 +0530 | [diff] [blame] | 220 | uint32_t gpio_no_mux; |
| 221 | uint32_t *camera_off_table; |
| 222 | uint8_t camera_off_table_size; |
| 223 | uint32_t *camera_on_table; |
| 224 | uint8_t camera_on_table_size; |
Kevin Chan | eb6b607 | 2012-01-17 11:54:54 -0800 | [diff] [blame] | 225 | }; |
| 226 | |
Kevin Chan | bb8ef86 | 2012-02-14 13:03:04 -0800 | [diff] [blame] | 227 | enum msm_camera_i2c_mux_mode { |
| 228 | MODE_R, |
| 229 | MODE_L, |
| 230 | MODE_DUAL |
| 231 | }; |
| 232 | |
| 233 | struct msm_camera_i2c_conf { |
| 234 | uint8_t use_i2c_mux; |
| 235 | struct platform_device *mux_dev; |
| 236 | enum msm_camera_i2c_mux_mode i2c_mux_mode; |
| 237 | }; |
| 238 | |
Kevin Chan | eb6b607 | 2012-01-17 11:54:54 -0800 | [diff] [blame] | 239 | struct msm_camera_sensor_platform_info { |
| 240 | int mount_angle; |
| 241 | int sensor_reset; |
| 242 | struct camera_vreg_t *cam_vreg; |
| 243 | int num_vreg; |
| 244 | int32_t (*ext_power_ctrl) (int enable); |
| 245 | struct msm_camera_gpio_conf *gpio_conf; |
Kevin Chan | bb8ef86 | 2012-02-14 13:03:04 -0800 | [diff] [blame] | 246 | struct msm_camera_i2c_conf *i2c_conf; |
Hody Hung | 9ba65cf | 2012-01-17 17:34:51 -0800 | [diff] [blame] | 247 | struct msm_camera_csi_lane_params *csi_lane_params; |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 248 | }; |
| 249 | |
Rajakumar Govindaram | 6627b36 | 2012-01-29 19:00:30 -0800 | [diff] [blame] | 250 | enum msm_camera_actuator_name { |
| 251 | MSM_ACTUATOR_MAIN_CAM_0, |
| 252 | MSM_ACTUATOR_MAIN_CAM_1, |
| 253 | MSM_ACTUATOR_MAIN_CAM_2, |
| 254 | MSM_ACTUATOR_MAIN_CAM_3, |
| 255 | MSM_ACTUATOR_MAIN_CAM_4, |
| 256 | MSM_ACTUATOR_MAIN_CAM_5, |
| 257 | MSM_ACTUATOR_WEB_CAM_0, |
| 258 | MSM_ACTUATOR_WEB_CAM_1, |
| 259 | MSM_ACTUATOR_WEB_CAM_2, |
| 260 | }; |
| 261 | |
Sreesudhan Ramakrish Ramkumar | a4b5f30 | 2011-09-12 16:23:22 -0700 | [diff] [blame] | 262 | struct msm_actuator_info { |
| 263 | struct i2c_board_info const *board_info; |
Rajakumar Govindaram | 6627b36 | 2012-01-29 19:00:30 -0800 | [diff] [blame] | 264 | enum msm_camera_actuator_name cam_name; |
Sreesudhan Ramakrish Ramkumar | a4b5f30 | 2011-09-12 16:23:22 -0700 | [diff] [blame] | 265 | int bus_id; |
| 266 | int vcm_pwd; |
| 267 | int vcm_enable; |
| 268 | }; |
| 269 | |
Jeyaprakash Soundrapandian | 734476b | 2012-05-03 20:08:15 -0700 | [diff] [blame] | 270 | struct msm_eeprom_info { |
| 271 | struct i2c_board_info const *board_info; |
| 272 | int bus_id; |
| 273 | }; |
| 274 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 275 | struct msm_camera_sensor_info { |
| 276 | const char *sensor_name; |
| 277 | int sensor_reset_enable; |
| 278 | int sensor_reset; |
| 279 | int sensor_pwd; |
| 280 | int vcm_pwd; |
| 281 | int vcm_enable; |
| 282 | int mclk; |
| 283 | int flash_type; |
| 284 | struct msm_camera_sensor_platform_info *sensor_platform_info; |
| 285 | struct msm_camera_device_platform_data *pdata; |
| 286 | struct resource *resource; |
| 287 | uint8_t num_resources; |
| 288 | struct msm_camera_sensor_flash_data *flash_data; |
| 289 | int csi_if; |
| 290 | struct msm_camera_csi_params csi_params; |
| 291 | struct msm_camera_sensor_strobe_flash_data *strobe_flash_data; |
| 292 | char *eeprom_data; |
Nishant Pandit | 24153d8 | 2011-08-27 16:05:13 +0530 | [diff] [blame] | 293 | enum msm_camera_type camera_type; |
Raju P.L.S.S.S.N | 3f4b302 | 2012-03-29 10:09:01 +0530 | [diff] [blame] | 294 | enum msm_sensor_type sensor_type; |
Sreesudhan Ramakrish Ramkumar | a4b5f30 | 2011-09-12 16:23:22 -0700 | [diff] [blame] | 295 | struct msm_actuator_info *actuator_info; |
Su Liu | aca0470 | 2012-02-14 02:27:32 +0530 | [diff] [blame] | 296 | int pmic_gpio_enable; |
Raju P.L.S.S.S.N | ce5c5c2 | 2012-05-17 23:10:08 +0530 | [diff] [blame] | 297 | int (*sensor_lcd_gpio_onoff)(int on); |
Jeyaprakash Soundrapandian | 734476b | 2012-05-03 20:08:15 -0700 | [diff] [blame] | 298 | struct msm_eeprom_info *eeprom_info; |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 299 | }; |
| 300 | |
Kevin Chan | 09f4e66 | 2011-12-16 08:17:02 -0800 | [diff] [blame] | 301 | struct msm_camera_board_info { |
| 302 | struct i2c_board_info *board_info; |
| 303 | uint8_t num_i2c_board_info; |
| 304 | }; |
| 305 | |
Stepan Moskovchenko | b3e6386 | 2011-10-20 18:36:55 -0700 | [diff] [blame] | 306 | int msm_get_cam_resources(struct msm_camera_sensor_info *); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 307 | |
Stephen Boyd | bd32344 | 2011-02-23 09:37:42 -0800 | [diff] [blame] | 308 | struct clk_lookup; |
Daniel Walker | 5e96da5 | 2010-05-12 13:43:28 -0700 | [diff] [blame] | 309 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 310 | struct snd_endpoint { |
| 311 | int id; |
| 312 | const char *name; |
| 313 | }; |
Steve Muckle | a55df6e | 2010-01-07 12:43:24 -0800 | [diff] [blame] | 314 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 315 | struct msm_snd_endpoints { |
| 316 | struct snd_endpoint *endpoints; |
| 317 | unsigned num; |
| 318 | }; |
| 319 | |
| 320 | #define MSM_MAX_DEC_CNT 14 |
| 321 | /* 7k target ADSP information */ |
| 322 | /* Bit 23:0, for codec identification like mp3, wav etc * |
| 323 | * Bit 27:24, for mode identification like tunnel, non tunnel* |
| 324 | * bit 31:28, for operation support like DM, DMA */ |
| 325 | enum msm_adspdec_concurrency { |
| 326 | MSM_ADSP_CODEC_WAV = 0, |
| 327 | MSM_ADSP_CODEC_ADPCM = 1, |
| 328 | MSM_ADSP_CODEC_MP3 = 2, |
| 329 | MSM_ADSP_CODEC_REALAUDIO = 3, |
| 330 | MSM_ADSP_CODEC_WMA = 4, |
| 331 | MSM_ADSP_CODEC_AAC = 5, |
| 332 | MSM_ADSP_CODEC_RESERVED = 6, |
| 333 | MSM_ADSP_CODEC_MIDI = 7, |
| 334 | MSM_ADSP_CODEC_YADPCM = 8, |
| 335 | MSM_ADSP_CODEC_QCELP = 9, |
| 336 | MSM_ADSP_CODEC_AMRNB = 10, |
| 337 | MSM_ADSP_CODEC_AMRWB = 11, |
| 338 | MSM_ADSP_CODEC_EVRC = 12, |
| 339 | MSM_ADSP_CODEC_WMAPRO = 13, |
| 340 | MSM_ADSP_MODE_TUNNEL = 24, |
| 341 | MSM_ADSP_MODE_NONTUNNEL = 25, |
| 342 | MSM_ADSP_MODE_LP = 26, |
| 343 | MSM_ADSP_OP_DMA = 28, |
| 344 | MSM_ADSP_OP_DM = 29, |
| 345 | }; |
| 346 | |
| 347 | struct msm_adspdec_info { |
| 348 | const char *module_name; |
| 349 | unsigned module_queueid; |
| 350 | int module_decid; /* objid */ |
| 351 | unsigned nr_codec_support; |
| 352 | }; |
| 353 | |
| 354 | /* Carries information about number codec |
| 355 | * supported if same codec or different codecs |
| 356 | */ |
| 357 | struct dec_instance_table { |
| 358 | uint8_t max_instances_same_dec; |
| 359 | uint8_t max_instances_diff_dec; |
| 360 | }; |
| 361 | |
| 362 | struct msm_adspdec_database { |
| 363 | unsigned num_dec; |
| 364 | unsigned num_concurrency_support; |
| 365 | unsigned int *dec_concurrency_table; /* Bit masked entry to * |
| 366 | * represents codec, mode etc */ |
| 367 | struct msm_adspdec_info *dec_info_list; |
| 368 | struct dec_instance_table *dec_instance_list; |
| 369 | }; |
| 370 | |
| 371 | enum msm_mdp_hw_revision { |
| 372 | MDP_REV_20 = 1, |
| 373 | MDP_REV_22, |
| 374 | MDP_REV_30, |
| 375 | MDP_REV_303, |
| 376 | MDP_REV_31, |
| 377 | MDP_REV_40, |
| 378 | MDP_REV_41, |
| 379 | MDP_REV_42, |
Huaibin Yang | 4a084e3 | 2011-12-15 15:25:52 -0800 | [diff] [blame] | 380 | MDP_REV_43, |
| 381 | MDP_REV_44, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 382 | }; |
| 383 | |
| 384 | struct msm_panel_common_pdata { |
| 385 | uintptr_t hw_revision_addr; |
| 386 | int gpio; |
Padmanabhan Komanduru | bea9c06 | 2012-04-09 10:33:48 +0530 | [diff] [blame] | 387 | bool bl_lock; |
Padmanabhan Komanduru | 0f0000a | 2012-04-12 10:23:02 +0530 | [diff] [blame] | 388 | spinlock_t bl_spinlock; |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 389 | int (*backlight_level)(int level, int max, int min); |
| 390 | int (*pmic_backlight)(int level); |
Jeevan Shriram | 8f7c96d | 2012-05-15 12:42:57 +0530 | [diff] [blame] | 391 | int (*rotate_panel)(void); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 392 | int (*panel_num)(void); |
| 393 | void (*panel_config_gpio)(int); |
| 394 | int (*vga_switch)(int select_vga); |
| 395 | int *gpio_num; |
| 396 | int mdp_core_clk_rate; |
| 397 | unsigned num_mdp_clk; |
| 398 | int *mdp_core_clk_table; |
| 399 | #ifdef CONFIG_MSM_BUS_SCALING |
| 400 | struct msm_bus_scale_pdata *mdp_bus_scale_table; |
| 401 | #endif |
| 402 | int mdp_rev; |
Nagamalleswararao Ganji | 937a119 | 2011-12-07 19:00:52 -0800 | [diff] [blame] | 403 | u32 ov0_wb_size; /* overlay0 writeback size */ |
| 404 | u32 ov1_wb_size; /* overlay1 writeback size */ |
| 405 | u32 mem_hid; |
Chandan Uddaraju | 2679f09 | 2012-03-09 15:48:04 -0800 | [diff] [blame] | 406 | char cont_splash_enabled; |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 407 | }; |
| 408 | |
Huaibin Yang | a541942 | 2011-12-08 23:52:10 -0800 | [diff] [blame] | 409 | |
| 410 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 411 | struct lcdc_platform_data { |
| 412 | int (*lcdc_gpio_config)(int on); |
| 413 | int (*lcdc_power_save)(int); |
| 414 | unsigned int (*lcdc_get_clk)(void); |
| 415 | #ifdef CONFIG_MSM_BUS_SCALING |
| 416 | struct msm_bus_scale_pdata *bus_scale_table; |
| 417 | #endif |
Huaibin Yang | 02f981c | 2012-02-27 16:58:41 -0800 | [diff] [blame] | 418 | int (*lvds_pixel_remap)(void); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 419 | }; |
| 420 | |
| 421 | struct tvenc_platform_data { |
| 422 | int poll; |
| 423 | int (*pm_vid_en)(int on); |
| 424 | #ifdef CONFIG_MSM_BUS_SCALING |
| 425 | struct msm_bus_scale_pdata *bus_scale_table; |
| 426 | #endif |
| 427 | }; |
| 428 | |
| 429 | struct mddi_platform_data { |
| 430 | int (*mddi_power_save)(int on); |
| 431 | int (*mddi_sel_clk)(u32 *clk_rate); |
| 432 | int (*mddi_client_power)(u32 client_id); |
| 433 | }; |
| 434 | |
| 435 | struct mipi_dsi_platform_data { |
| 436 | int vsync_gpio; |
| 437 | int (*dsi_power_save)(int on); |
| 438 | int (*dsi_client_reset)(void); |
| 439 | int (*get_lane_config)(void); |
Ravishangar Kalyanam | 87dd72e | 2012-04-16 19:07:36 -0700 | [diff] [blame] | 440 | char (*splash_is_enabled)(void); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 441 | int target_type; |
| 442 | }; |
| 443 | |
Chandan Uddaraju | 83eac3c | 2011-09-11 18:32:23 -0700 | [diff] [blame] | 444 | enum mipi_dsi_3d_ctrl { |
| 445 | FPGA_EBI2_INTF, |
| 446 | FPGA_SPI_INTF, |
| 447 | }; |
| 448 | |
| 449 | /* DSI PHY configuration */ |
| 450 | struct mipi_dsi_phy_ctrl { |
| 451 | uint32_t regulator[5]; |
| 452 | uint32_t timing[12]; |
| 453 | uint32_t ctrl[4]; |
| 454 | uint32_t strength[4]; |
| 455 | uint32_t pll[21]; |
| 456 | }; |
| 457 | |
Nagamalleswararao Ganji | eac5dfa | 2011-07-23 17:31:16 -0700 | [diff] [blame] | 458 | struct mipi_dsi_panel_platform_data { |
Chandan Uddaraju | 83eac3c | 2011-09-11 18:32:23 -0700 | [diff] [blame] | 459 | int fpga_ctrl_mode; |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 460 | int fpga_3d_config_addr; |
Nagamalleswararao Ganji | eac5dfa | 2011-07-23 17:31:16 -0700 | [diff] [blame] | 461 | int *gpio; |
Chandan Uddaraju | 83eac3c | 2011-09-11 18:32:23 -0700 | [diff] [blame] | 462 | struct mipi_dsi_phy_ctrl *phy_ctrl_settings; |
Ravishangar Kalyanam | 903f65c | 2012-01-28 21:36:22 -0800 | [diff] [blame] | 463 | char dlane_swap; |
Chandan Uddaraju | 2679f09 | 2012-03-09 15:48:04 -0800 | [diff] [blame] | 464 | void (*dsi_pwm_cfg)(void); |
Chandan Uddaraju | 194a4b5 | 2012-03-21 10:11:18 -0700 | [diff] [blame] | 465 | char enable_wled_bl_ctrl; |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 466 | }; |
| 467 | |
Ravishangar Kalyanam | c2fee31 | 2012-02-09 19:11:22 -0800 | [diff] [blame] | 468 | struct lvds_panel_platform_data { |
| 469 | int *gpio; |
| 470 | }; |
| 471 | |
Ravishangar Kalyanam | 8c79ead | 2011-12-02 21:05:01 -0800 | [diff] [blame] | 472 | #define PANEL_NAME_MAX_LEN 50 |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 473 | struct msm_fb_platform_data { |
| 474 | int (*detect_client)(const char *name); |
| 475 | int mddi_prescan; |
| 476 | int (*allow_set_offset)(void); |
Ravishangar Kalyanam | 8c79ead | 2011-12-02 21:05:01 -0800 | [diff] [blame] | 477 | char prim_panel_name[PANEL_NAME_MAX_LEN]; |
| 478 | char ext_panel_name[PANEL_NAME_MAX_LEN]; |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 479 | }; |
| 480 | |
| 481 | struct msm_hdmi_platform_data { |
| 482 | int irq; |
| 483 | int (*cable_detect)(int insert); |
| 484 | int (*comm_power)(int on, int show); |
| 485 | int (*enable_5v)(int on); |
| 486 | int (*core_power)(int on, int show); |
| 487 | int (*cec_power)(int on); |
| 488 | int (*init_irq)(void); |
| 489 | bool (*check_hdcp_hw_support)(void); |
| 490 | }; |
| 491 | |
Manoj Rao | 1464874 | 2012-03-30 19:42:12 -0700 | [diff] [blame] | 492 | struct msm_mhl_platform_data { |
| 493 | int irq; |
| 494 | int (*gpio_setup)(int on); |
| 495 | void (*reset_pin)(int on); |
| 496 | }; |
| 497 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 498 | struct msm_i2c_platform_data { |
| 499 | int clk_freq; |
| 500 | uint32_t rmutex; |
| 501 | const char *rsl_id; |
| 502 | uint32_t pm_lat; |
| 503 | int pri_clk; |
| 504 | int pri_dat; |
| 505 | int aux_clk; |
| 506 | int aux_dat; |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 507 | int src_clk_rate; |
| 508 | int use_gsbi_shared_mode; |
| 509 | void (*msm_i2c_config_gpio)(int iface, int config_type); |
| 510 | }; |
| 511 | |
| 512 | struct msm_i2c_ssbi_platform_data { |
| 513 | const char *rsl_id; |
| 514 | enum msm_ssbi_controller_type controller_type; |
| 515 | }; |
| 516 | |
| 517 | struct msm_vidc_platform_data { |
| 518 | int memtype; |
Deepak Kotur | cb4f672 | 2011-10-31 14:06:57 -0700 | [diff] [blame] | 519 | u32 enable_ion; |
Deepika Pepakayala | bebc762 | 2011-12-01 15:13:43 -0800 | [diff] [blame] | 520 | int disable_dmx; |
Rajeshwar Kurapaty | c155c35 | 2011-12-17 06:35:32 +0530 | [diff] [blame] | 521 | int disable_fullhd; |
Deepak kotur | 5f10b27 | 2012-03-15 22:01:39 -0700 | [diff] [blame] | 522 | u32 cp_enabled; |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 523 | #ifdef CONFIG_MSM_BUS_SCALING |
| 524 | struct msm_bus_scale_pdata *vidc_bus_client_pdata; |
| 525 | #endif |
Mohan Kumar Gubbihalli Lachma Naik | ed9dc91 | 2012-03-01 19:11:14 -0800 | [diff] [blame] | 526 | int cont_mode_dpb_count; |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 527 | }; |
| 528 | |
Terence Hampson | a6914ca | 2012-04-09 14:06:50 -0400 | [diff] [blame] | 529 | struct vcap_platform_data { |
| 530 | unsigned *gpios; |
| 531 | int num_gpios; |
| 532 | struct msm_bus_scale_pdata *bus_client_pdata; |
| 533 | }; |
| 534 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 535 | #if defined(CONFIG_USB_PEHCI_HCD) || defined(CONFIG_USB_PEHCI_HCD_MODULE) |
| 536 | struct isp1763_platform_data { |
| 537 | unsigned reset_gpio; |
| 538 | int (*setup_gpio)(int enable); |
| 539 | }; |
| 540 | #endif |
Russell King | a09e64f | 2008-08-05 16:14:15 +0100 | [diff] [blame] | 541 | /* common init routines for use by arch/arm/mach-msm/board-*.c */ |
| 542 | |
Sathish Ambley | c58afc2 | 2011-10-09 21:55:39 -0700 | [diff] [blame] | 543 | #ifdef CONFIG_OF_DEVICE |
| 544 | void msm_copper_init(struct of_dev_auxdata **); |
| 545 | #endif |
Stepan Moskovchenko | b3e6386 | 2011-10-20 18:36:55 -0700 | [diff] [blame] | 546 | void msm_add_devices(void); |
Sathish Ambley | c58afc2 | 2011-10-09 21:55:39 -0700 | [diff] [blame] | 547 | void msm_copper_add_devices(void); |
Michael Bohan | e7c2b47 | 2012-03-30 14:27:18 -0700 | [diff] [blame] | 548 | void msm_copper_add_drivers(void); |
Stepan Moskovchenko | b3e6386 | 2011-10-20 18:36:55 -0700 | [diff] [blame] | 549 | void msm_map_common_io(void); |
| 550 | void msm_map_qsd8x50_io(void); |
| 551 | void msm_map_msm8x60_io(void); |
| 552 | void msm_map_msm8960_io(void); |
| 553 | void msm_map_msm8930_io(void); |
| 554 | void msm_map_apq8064_io(void); |
| 555 | void msm_map_msm7x30_io(void); |
| 556 | void msm_map_fsm9xxx_io(void); |
Sathish Ambley | c58afc2 | 2011-10-09 21:55:39 -0700 | [diff] [blame] | 557 | void msm_map_copper_io(void); |
Taniya Das | 43bcdd6 | 2011-12-02 17:33:27 +0530 | [diff] [blame] | 558 | void msm_map_msm8625_io(void); |
Rohit Vaswani | 3fc6034 | 2012-04-23 18:55:15 -0700 | [diff] [blame^] | 559 | void msm_map_msm9625_io(void); |
Stepan Moskovchenko | b3e6386 | 2011-10-20 18:36:55 -0700 | [diff] [blame] | 560 | void msm_init_irq(void); |
Sathish Ambley | c58afc2 | 2011-10-09 21:55:39 -0700 | [diff] [blame] | 561 | void msm_copper_init_irq(void); |
Taniya Das | 86e0e13 | 2011-10-19 11:32:00 +0530 | [diff] [blame] | 562 | void vic_handle_irq(struct pt_regs *regs); |
Olav Haugan | b800c8c | 2012-01-30 08:50:45 -0800 | [diff] [blame] | 563 | void msm_copper_reserve(void); |
| 564 | void msm_copper_very_early(void); |
Sathish Ambley | b17ec7e | 2012-04-03 15:20:03 -0700 | [diff] [blame] | 565 | void msm_copper_init_gpiomux(void); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 566 | |
| 567 | struct mmc_platform_data; |
Stepan Moskovchenko | b3e6386 | 2011-10-20 18:36:55 -0700 | [diff] [blame] | 568 | int msm_add_sdcc(unsigned int controller, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 569 | struct mmc_platform_data *plat); |
| 570 | |
Murali Nalajala | 2a0bbda | 2012-03-28 12:12:54 +0530 | [diff] [blame] | 571 | void msm_pm_register_irqs(void); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 572 | struct msm_usb_host_platform_data; |
Stepan Moskovchenko | b3e6386 | 2011-10-20 18:36:55 -0700 | [diff] [blame] | 573 | int msm_add_host(unsigned int host, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 574 | struct msm_usb_host_platform_data *plat); |
| 575 | #if defined(CONFIG_USB_FUNCTION_MSM_HSUSB) \ |
| 576 | || defined(CONFIG_USB_MSM_72K) || defined(CONFIG_USB_MSM_72K_MODULE) |
| 577 | void msm_hsusb_set_vbus_state(int online); |
| 578 | #else |
| 579 | static inline void msm_hsusb_set_vbus_state(int online) {} |
| 580 | #endif |
| 581 | |
Stepan Moskovchenko | b3e6386 | 2011-10-20 18:36:55 -0700 | [diff] [blame] | 582 | void msm_snddev_init(void); |
| 583 | void msm_snddev_init_timpani(void); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 584 | void msm_snddev_poweramp_on(void); |
| 585 | void msm_snddev_poweramp_off(void); |
| 586 | void msm_snddev_hsed_voltage_on(void); |
| 587 | void msm_snddev_hsed_voltage_off(void); |
| 588 | void msm_snddev_tx_route_config(void); |
| 589 | void msm_snddev_tx_route_deconfig(void); |
| 590 | |
| 591 | extern unsigned int msm_shared_ram_phys; /* defined in arch/arm/mach-msm/io.c */ |
| 592 | |
Russell King | a09e64f | 2008-08-05 16:14:15 +0100 | [diff] [blame] | 593 | |
| 594 | #endif |