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