Manu Gautam | 5143b25 | 2012-01-05 19:25:23 -0800 | [diff] [blame] | 1 | /* Copyright (c) 2011-2012, Code Aurora Forum. All rights reserved. |
Rohit Vaswani | ced9b3b | 2011-08-23 17:21:49 -0700 | [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 | #include <linux/kernel.h> |
| 14 | #include <linux/platform_device.h> |
Amit Blay | 5f968cf | 2012-01-22 12:04:01 +0200 | [diff] [blame] | 15 | #include <linux/io.h> |
Harini Jayaraman | eba5267 | 2011-09-08 15:13:00 -0600 | [diff] [blame] | 16 | #include <linux/i2c.h> |
Sagar Dharia | 2a5378d | 2011-12-01 20:00:11 -0700 | [diff] [blame] | 17 | #include <linux/slimbus/slimbus.h> |
Shiv Maliyappanahalli | 9ec55e9 | 2012-01-09 14:44:59 -0800 | [diff] [blame] | 18 | #ifdef CONFIG_WCD9310_CODEC |
| 19 | #include <linux/mfd/wcd9xxx/core.h> |
| 20 | #include <linux/mfd/wcd9xxx/pdata.h> |
| 21 | #endif |
Kenneth Heitke | af3d3cf | 2011-09-08 11:45:31 -0700 | [diff] [blame] | 22 | #include <linux/msm_ssbi.h> |
Maheshkumar Sivasubramanian | c6c5503 | 2011-10-25 16:01:32 -0600 | [diff] [blame] | 23 | #include <linux/memblock.h> |
Rohit Vaswani | a681589 | 2011-12-15 20:20:39 -0800 | [diff] [blame] | 24 | #include <linux/usb/android.h> |
| 25 | #include <linux/usb/msm_hsusb.h> |
| 26 | #include <linux/mfd/pm8xxx/pm8xxx-adc.h> |
| 27 | #include <linux/leds.h> |
| 28 | #include <linux/leds-pm8xxx.h> |
| 29 | #include <linux/power/ltc4088-charger.h> |
Steve Muckle | f132c6c | 2012-06-06 18:30:57 -0700 | [diff] [blame] | 30 | #include <linux/gpio.h> |
Siddartha Mohanadoss | 7e25dc1 | 2012-03-19 11:19:27 -0700 | [diff] [blame] | 31 | #include <linux/msm_tsens.h> |
Olav Haugan | e6a0acd | 2012-04-05 09:29:12 -0700 | [diff] [blame] | 32 | #include <linux/ion.h> |
| 33 | #include <linux/memory.h> |
Rohit Vaswani | ced9b3b | 2011-08-23 17:21:49 -0700 | [diff] [blame] | 34 | #include <asm/mach-types.h> |
| 35 | #include <asm/mach/arch.h> |
Marc Zyngier | 89bdafd1 | 2011-12-22 11:39:20 +0530 | [diff] [blame] | 36 | #include <asm/hardware/gic.h> |
Rohit Vaswani | ced9b3b | 2011-08-23 17:21:49 -0700 | [diff] [blame] | 37 | #include <mach/board.h> |
| 38 | #include <mach/msm_iomap.h> |
Shiv Maliyappanahalli | 9ec55e9 | 2012-01-09 14:44:59 -0800 | [diff] [blame] | 39 | #include <mach/socinfo.h> |
Harini Jayaraman | 738c931 | 2011-09-08 15:22:38 -0600 | [diff] [blame] | 40 | #include <mach/msm_spi.h> |
Gagan Mac | 7a82764 | 2011-09-22 19:42:21 -0600 | [diff] [blame] | 41 | #include <mach/msm_bus_board.h> |
Vikram Mulukutla | 2021c00 | 2011-12-16 12:32:59 -0800 | [diff] [blame] | 42 | #include <mach/msm_xo.h> |
Shiv Maliyappanahalli | 9ec55e9 | 2012-01-09 14:44:59 -0800 | [diff] [blame] | 43 | #include <mach/dma.h> |
Olav Haugan | e6a0acd | 2012-04-05 09:29:12 -0700 | [diff] [blame] | 44 | #include <mach/ion.h> |
| 45 | #include <mach/msm_memtypes.h> |
Amit Blay | e5bb35e | 2012-05-08 20:38:20 +0300 | [diff] [blame] | 46 | #include <mach/cpuidle.h> |
| 47 | #include <mach/usb_bam.h> |
Jeff Ohlstein | dd0dd9b | 2012-05-29 17:47:21 -0700 | [diff] [blame] | 48 | #include <mach/restart.h> |
Rohit Vaswani | ced9b3b | 2011-08-23 17:21:49 -0700 | [diff] [blame] | 49 | #include "timer.h" |
| 50 | #include "devices.h" |
David Collins | fb88c43 | 2011-08-25 15:12:47 -0700 | [diff] [blame] | 51 | #include "board-9615.h" |
Matt Wagantall | 7cca464 | 2012-02-01 16:43:24 -0800 | [diff] [blame] | 52 | #include "pm.h" |
Maheshkumar Sivasubramanian | c6c5503 | 2011-10-25 16:01:32 -0600 | [diff] [blame] | 53 | #include "pm-boot.h" |
Venkat Sudhir | 5efc491 | 2012-05-15 17:10:35 -0700 | [diff] [blame] | 54 | #include <mach/gpiomux.h> |
Rohit Vaswani | ced9b3b | 2011-08-23 17:21:49 -0700 | [diff] [blame] | 55 | |
Olav Haugan | e6a0acd | 2012-04-05 09:29:12 -0700 | [diff] [blame] | 56 | #ifdef CONFIG_ION_MSM |
| 57 | #define MSM_ION_AUDIO_SIZE 0xAF000 |
| 58 | #define MSM_ION_HEAP_NUM 3 |
| 59 | #define MSM_KERNEL_EBI_SIZE 0x51000 |
| 60 | |
| 61 | static struct memtype_reserve msm9615_reserve_table[] __initdata = { |
| 62 | [MEMTYPE_SMI] = { |
| 63 | }, |
| 64 | [MEMTYPE_EBI0] = { |
| 65 | .flags = MEMTYPE_FLAGS_1M_ALIGN, |
| 66 | }, |
| 67 | [MEMTYPE_EBI1] = { |
| 68 | .flags = MEMTYPE_FLAGS_1M_ALIGN, |
| 69 | }, |
| 70 | }; |
| 71 | |
| 72 | static int msm9615_paddr_to_memtype(unsigned int paddr) |
| 73 | { |
| 74 | return MEMTYPE_EBI1; |
| 75 | } |
| 76 | |
| 77 | static struct ion_co_heap_pdata co_ion_pdata = { |
| 78 | .adjacent_mem_id = INVALID_HEAP_ID, |
| 79 | .align = PAGE_SIZE, |
| 80 | }; |
| 81 | |
| 82 | static struct ion_platform_data ion_pdata = { |
| 83 | .nr = MSM_ION_HEAP_NUM, |
| 84 | .heaps = { |
| 85 | { |
| 86 | .id = ION_SYSTEM_HEAP_ID, |
| 87 | .type = ION_HEAP_TYPE_SYSTEM, |
| 88 | .name = ION_VMALLOC_HEAP_NAME, |
| 89 | }, |
| 90 | { |
| 91 | .id = ION_IOMMU_HEAP_ID, |
| 92 | .type = ION_HEAP_TYPE_IOMMU, |
| 93 | .name = ION_IOMMU_HEAP_NAME, |
| 94 | }, |
| 95 | { |
| 96 | .id = ION_AUDIO_HEAP_ID, |
| 97 | .type = ION_HEAP_TYPE_CARVEOUT, |
| 98 | .name = ION_AUDIO_HEAP_NAME, |
| 99 | .size = MSM_ION_AUDIO_SIZE, |
| 100 | .memory_type = ION_EBI_TYPE, |
| 101 | .extra_data = (void *) &co_ion_pdata, |
| 102 | }, |
| 103 | } |
| 104 | }; |
| 105 | |
| 106 | static struct platform_device ion_dev = { |
| 107 | .name = "ion-msm", |
| 108 | .id = 1, |
| 109 | .dev = { .platform_data = &ion_pdata }, |
| 110 | }; |
| 111 | |
Stephen Boyd | 668d765 | 2012-04-25 11:31:01 -0700 | [diff] [blame] | 112 | static void __init reserve_ion_memory(void) |
Olav Haugan | e6a0acd | 2012-04-05 09:29:12 -0700 | [diff] [blame] | 113 | { |
| 114 | msm9615_reserve_table[MEMTYPE_EBI1].size += MSM_ION_AUDIO_SIZE; |
| 115 | } |
| 116 | |
| 117 | static void __init msm9615_calculate_reserve_sizes(void) |
| 118 | { |
| 119 | reserve_ion_memory(); |
| 120 | msm9615_reserve_table[MEMTYPE_EBI1].size += MSM_KERNEL_EBI_SIZE; |
| 121 | } |
| 122 | |
| 123 | static struct reserve_info msm9615_reserve_info __initdata = { |
| 124 | .memtype_reserve_table = msm9615_reserve_table, |
| 125 | .calculate_reserve_sizes = msm9615_calculate_reserve_sizes, |
| 126 | .paddr_to_memtype = msm9615_paddr_to_memtype, |
| 127 | }; |
| 128 | #endif |
| 129 | |
Jay Chokshi | 215f7be | 2012-02-09 18:30:44 -0800 | [diff] [blame] | 130 | struct pm8xxx_gpio_init { |
| 131 | unsigned gpio; |
| 132 | struct pm_gpio config; |
| 133 | }; |
| 134 | |
| 135 | struct pm8xxx_mpp_init { |
| 136 | unsigned mpp; |
| 137 | struct pm8xxx_mpp_config_data config; |
| 138 | }; |
| 139 | |
| 140 | #define PM8018_GPIO_INIT(_gpio, _dir, _buf, _val, _pull, _vin, _out_strength, \ |
| 141 | _func, _inv, _disable) \ |
| 142 | { \ |
| 143 | .gpio = PM8018_GPIO_PM_TO_SYS(_gpio), \ |
| 144 | .config = { \ |
| 145 | .direction = _dir, \ |
| 146 | .output_buffer = _buf, \ |
| 147 | .output_value = _val, \ |
| 148 | .pull = _pull, \ |
| 149 | .vin_sel = _vin, \ |
| 150 | .out_strength = _out_strength, \ |
| 151 | .function = _func, \ |
| 152 | .inv_int_pol = _inv, \ |
| 153 | .disable_pin = _disable, \ |
| 154 | } \ |
| 155 | } |
| 156 | |
| 157 | #define PM8018_MPP_INIT(_mpp, _type, _level, _control) \ |
| 158 | { \ |
| 159 | .mpp = PM8018_MPP_PM_TO_SYS(_mpp), \ |
| 160 | .config = { \ |
| 161 | .type = PM8XXX_MPP_TYPE_##_type, \ |
| 162 | .level = _level, \ |
| 163 | .control = PM8XXX_MPP_##_control, \ |
| 164 | } \ |
| 165 | } |
| 166 | |
| 167 | #define PM8018_GPIO_DISABLE(_gpio) \ |
| 168 | PM8018_GPIO_INIT(_gpio, PM_GPIO_DIR_IN, 0, 0, 0, PM8018_GPIO_VIN_S3, \ |
| 169 | 0, 0, 0, 1) |
| 170 | |
| 171 | #define PM8018_GPIO_OUTPUT(_gpio, _val, _strength) \ |
| 172 | PM8018_GPIO_INIT(_gpio, PM_GPIO_DIR_OUT, PM_GPIO_OUT_BUF_CMOS, _val, \ |
| 173 | PM_GPIO_PULL_NO, PM8018_GPIO_VIN_S3, \ |
| 174 | PM_GPIO_STRENGTH_##_strength, \ |
| 175 | PM_GPIO_FUNC_NORMAL, 0, 0) |
| 176 | |
| 177 | #define PM8018_GPIO_INPUT(_gpio, _pull) \ |
| 178 | PM8018_GPIO_INIT(_gpio, PM_GPIO_DIR_IN, PM_GPIO_OUT_BUF_CMOS, 0, \ |
| 179 | _pull, PM8018_GPIO_VIN_S3, \ |
| 180 | PM_GPIO_STRENGTH_NO, \ |
| 181 | PM_GPIO_FUNC_NORMAL, 0, 0) |
| 182 | |
| 183 | #define PM8018_GPIO_OUTPUT_FUNC(_gpio, _val, _func) \ |
| 184 | PM8018_GPIO_INIT(_gpio, PM_GPIO_DIR_OUT, PM_GPIO_OUT_BUF_CMOS, _val, \ |
| 185 | PM_GPIO_PULL_NO, PM8018_GPIO_VIN_S3, \ |
| 186 | PM_GPIO_STRENGTH_HIGH, \ |
| 187 | _func, 0, 0) |
| 188 | |
| 189 | #define PM8018_GPIO_OUTPUT_VIN(_gpio, _val, _vin) \ |
| 190 | PM8018_GPIO_INIT(_gpio, PM_GPIO_DIR_OUT, PM_GPIO_OUT_BUF_CMOS, _val, \ |
| 191 | PM_GPIO_PULL_NO, _vin, \ |
| 192 | PM_GPIO_STRENGTH_HIGH, \ |
| 193 | PM_GPIO_FUNC_NORMAL, 0, 0) |
| 194 | |
| 195 | /* Initial PM8018 GPIO configurations */ |
| 196 | static struct pm8xxx_gpio_init pm8018_gpios[] __initdata = { |
Pavan Kumar | 2755650 | 2012-05-21 18:38:01 -0700 | [diff] [blame] | 197 | PM8018_GPIO_OUTPUT(2, 0, HIGH) /* EXT_LDO_EN_WLAN */ |
Jay Chokshi | 215f7be | 2012-02-09 18:30:44 -0800 | [diff] [blame] | 198 | }; |
| 199 | |
| 200 | /* Initial PM8018 MPP configurations */ |
| 201 | static struct pm8xxx_mpp_init pm8018_mpps[] __initdata = { |
| 202 | }; |
| 203 | |
| 204 | void __init msm9615_pm8xxx_gpio_mpp_init(void) |
| 205 | { |
| 206 | int i, rc; |
| 207 | |
| 208 | for (i = 0; i < ARRAY_SIZE(pm8018_gpios); i++) { |
| 209 | rc = pm8xxx_gpio_config(pm8018_gpios[i].gpio, |
| 210 | &pm8018_gpios[i].config); |
| 211 | if (rc) { |
| 212 | pr_err("%s: pm8018_gpio_config: rc=%d\n", __func__, rc); |
| 213 | break; |
| 214 | } |
| 215 | } |
| 216 | |
| 217 | for (i = 0; i < ARRAY_SIZE(pm8018_mpps); i++) { |
| 218 | rc = pm8xxx_mpp_config(pm8018_mpps[i].mpp, |
| 219 | &pm8018_mpps[i].config); |
| 220 | if (rc) { |
| 221 | pr_err("%s: pm8018_mpp_config: rc=%d\n", __func__, rc); |
| 222 | break; |
| 223 | } |
| 224 | } |
| 225 | } |
| 226 | |
Siddartha Mohanadoss | 5f60b45 | 2011-10-05 11:49:00 -0700 | [diff] [blame] | 227 | static struct pm8xxx_adc_amux pm8018_adc_channels_data[] = { |
| 228 | {"vcoin", CHANNEL_VCOIN, CHAN_PATH_SCALING2, AMUX_RSV1, |
| 229 | ADC_DECIMATION_TYPE2, ADC_SCALE_DEFAULT}, |
| 230 | {"vbat", CHANNEL_VBAT, CHAN_PATH_SCALING2, AMUX_RSV1, |
| 231 | ADC_DECIMATION_TYPE2, ADC_SCALE_DEFAULT}, |
| 232 | {"vph_pwr", CHANNEL_VPH_PWR, CHAN_PATH_SCALING2, AMUX_RSV1, |
| 233 | ADC_DECIMATION_TYPE2, ADC_SCALE_DEFAULT}, |
Siddartha Mohanadoss | f9383d5 | 2012-04-19 09:42:49 -0700 | [diff] [blame] | 234 | /* AMUX8 is used to read either Batt_id/Batt_therm. |
| 235 | * Current configuration is to support Batt_id. If clients |
| 236 | * want to read the Batt_therm, the scaling function needs to be |
| 237 | * updated to use ADC_SCALE_BATT_THERM instead of ADC_SCALE_DEFAULT. |
| 238 | * E.g. |
| 239 | * {"batt_therm", CHANNEL_BATT_ID_THERM, CHAN_PATH_SCALING1, |
| 240 | * AMUX_RSV2, ADC_DECIMATION_TYPE2, ADC_SCALE_BATT_THERM}, |
| 241 | */ |
| 242 | {"batt_id", CHANNEL_BATT_ID_THERM, CHAN_PATH_SCALING1, |
| 243 | AMUX_RSV2, ADC_DECIMATION_TYPE2, ADC_SCALE_DEFAULT}, |
Siddartha Mohanadoss | 5f60b45 | 2011-10-05 11:49:00 -0700 | [diff] [blame] | 244 | {"pmic_therm", CHANNEL_DIE_TEMP, CHAN_PATH_SCALING1, AMUX_RSV1, |
| 245 | ADC_DECIMATION_TYPE2, ADC_SCALE_PMIC_THERM}, |
| 246 | {"625mv", CHANNEL_625MV, CHAN_PATH_SCALING1, AMUX_RSV1, |
| 247 | ADC_DECIMATION_TYPE2, ADC_SCALE_DEFAULT}, |
| 248 | {"125v", CHANNEL_125V, CHAN_PATH_SCALING1, AMUX_RSV1, |
| 249 | ADC_DECIMATION_TYPE2, ADC_SCALE_DEFAULT}, |
| 250 | {"pa_therm0", ADC_MPP_1_AMUX3, CHAN_PATH_SCALING1, AMUX_RSV1, |
| 251 | ADC_DECIMATION_TYPE2, ADC_SCALE_PA_THERM}, |
| 252 | }; |
| 253 | |
| 254 | static struct pm8xxx_adc_properties pm8018_adc_data = { |
| 255 | .adc_vdd_reference = 1800, /* milli-voltage for this adc */ |
| 256 | .bitresolution = 15, |
| 257 | .bipolar = 0, |
| 258 | }; |
| 259 | |
| 260 | static struct pm8xxx_adc_platform_data pm8018_adc_pdata = { |
| 261 | .adc_channel = pm8018_adc_channels_data, |
| 262 | .adc_num_board_channel = ARRAY_SIZE(pm8018_adc_channels_data), |
| 263 | .adc_prop = &pm8018_adc_data, |
| 264 | }; |
| 265 | |
David Collins | fb88c43 | 2011-08-25 15:12:47 -0700 | [diff] [blame] | 266 | static struct pm8xxx_irq_platform_data pm8xxx_irq_pdata __devinitdata = { |
| 267 | .irq_base = PM8018_IRQ_BASE, |
| 268 | .devirq = MSM_GPIO_TO_INT(87), |
| 269 | .irq_trigger_flag = IRQF_TRIGGER_LOW, |
| 270 | }; |
| 271 | |
| 272 | static struct pm8xxx_gpio_platform_data pm8xxx_gpio_pdata __devinitdata = { |
| 273 | .gpio_base = PM8018_GPIO_PM_TO_SYS(1), |
| 274 | }; |
| 275 | |
| 276 | static struct pm8xxx_mpp_platform_data pm8xxx_mpp_pdata __devinitdata = { |
| 277 | .mpp_base = PM8018_MPP_PM_TO_SYS(1), |
| 278 | }; |
| 279 | |
| 280 | static struct pm8xxx_rtc_platform_data pm8xxx_rtc_pdata __devinitdata = { |
| 281 | .rtc_write_enable = false, |
Ashay Jaiswal | db5e6dc | 2011-10-12 11:02:47 +0530 | [diff] [blame] | 282 | .rtc_alarm_powerup = false, |
David Collins | fb88c43 | 2011-08-25 15:12:47 -0700 | [diff] [blame] | 283 | }; |
| 284 | |
| 285 | static struct pm8xxx_pwrkey_platform_data pm8xxx_pwrkey_pdata = { |
| 286 | .pull_up = 1, |
Jing Lin | eecdc06 | 2011-11-17 09:47:09 -0800 | [diff] [blame] | 287 | .kpd_trigger_delay_us = 15625, |
David Collins | fb88c43 | 2011-08-25 15:12:47 -0700 | [diff] [blame] | 288 | .wakeup = 1, |
| 289 | }; |
| 290 | |
| 291 | static struct pm8xxx_misc_platform_data pm8xxx_misc_pdata = { |
| 292 | .priority = 0, |
| 293 | }; |
| 294 | |
Jay Chokshi | eb5d0d5 | 2011-09-28 17:16:20 -0700 | [diff] [blame] | 295 | #define PM8018_LED_KB_MAX_CURRENT 20 /* I = 20mA */ |
| 296 | #define PM8XXX_LED_PWM_PERIOD_US 1000 |
| 297 | |
| 298 | /** |
| 299 | * PM8XXX_PWM_CHANNEL_NONE shall be used when LED shall not be |
| 300 | * driven using PWM feature. |
| 301 | */ |
| 302 | #define PM8XXX_PWM_CHANNEL_NONE -1 |
| 303 | |
| 304 | static struct led_info pm8018_led_info[] = { |
| 305 | [0] = { |
| 306 | .name = "led:kb", |
| 307 | }, |
| 308 | }; |
| 309 | |
| 310 | static struct led_platform_data pm8018_led_core_pdata = { |
| 311 | .num_leds = ARRAY_SIZE(pm8018_led_info), |
| 312 | .leds = pm8018_led_info, |
| 313 | }; |
| 314 | |
| 315 | static struct pm8xxx_led_config pm8018_led_configs[] = { |
| 316 | [0] = { |
| 317 | .id = PM8XXX_ID_LED_KB_LIGHT, |
| 318 | .mode = PM8XXX_LED_MODE_PWM3, |
| 319 | .max_current = PM8018_LED_KB_MAX_CURRENT, |
| 320 | .pwm_channel = 2, |
| 321 | .pwm_period_us = PM8XXX_LED_PWM_PERIOD_US, |
| 322 | }, |
| 323 | }; |
| 324 | |
| 325 | static struct pm8xxx_led_platform_data pm8xxx_leds_pdata = { |
| 326 | .led_core = &pm8018_led_core_pdata, |
| 327 | .configs = pm8018_led_configs, |
| 328 | .num_configs = ARRAY_SIZE(pm8018_led_configs), |
| 329 | }; |
| 330 | |
Jay Chokshi | dc8028b | 2011-12-01 16:17:34 -0800 | [diff] [blame] | 331 | #ifdef CONFIG_LTC4088_CHARGER |
| 332 | static struct ltc4088_charger_platform_data ltc4088_chg_pdata = { |
| 333 | .gpio_mode_select_d0 = 7, |
| 334 | .gpio_mode_select_d1 = 6, |
| 335 | .gpio_mode_select_d2 = 4, |
| 336 | }; |
| 337 | #endif |
| 338 | |
David Collins | fb88c43 | 2011-08-25 15:12:47 -0700 | [diff] [blame] | 339 | static struct pm8018_platform_data pm8018_platform_data __devinitdata = { |
| 340 | .irq_pdata = &pm8xxx_irq_pdata, |
| 341 | .gpio_pdata = &pm8xxx_gpio_pdata, |
| 342 | .mpp_pdata = &pm8xxx_mpp_pdata, |
| 343 | .rtc_pdata = &pm8xxx_rtc_pdata, |
| 344 | .pwrkey_pdata = &pm8xxx_pwrkey_pdata, |
| 345 | .misc_pdata = &pm8xxx_misc_pdata, |
David Collins | 00b31e6 | 2011-08-31 20:00:10 -0700 | [diff] [blame] | 346 | .regulator_pdatas = msm_pm8018_regulator_pdata, |
Siddartha Mohanadoss | 5f60b45 | 2011-10-05 11:49:00 -0700 | [diff] [blame] | 347 | .adc_pdata = &pm8018_adc_pdata, |
Jay Chokshi | eb5d0d5 | 2011-09-28 17:16:20 -0700 | [diff] [blame] | 348 | .leds_pdata = &pm8xxx_leds_pdata, |
David Collins | fb88c43 | 2011-08-25 15:12:47 -0700 | [diff] [blame] | 349 | }; |
| 350 | |
Kenneth Heitke | af3d3cf | 2011-09-08 11:45:31 -0700 | [diff] [blame] | 351 | static struct msm_ssbi_platform_data msm9615_ssbi_pm8018_pdata __devinitdata = { |
| 352 | .controller_type = MSM_SBI_CTRL_PMIC_ARBITER, |
| 353 | .slave = { |
David Collins | fb88c43 | 2011-08-25 15:12:47 -0700 | [diff] [blame] | 354 | .name = PM8018_CORE_DEV_NAME, |
| 355 | .platform_data = &pm8018_platform_data, |
Kenneth Heitke | af3d3cf | 2011-09-08 11:45:31 -0700 | [diff] [blame] | 356 | }, |
| 357 | }; |
| 358 | |
David Collins | bea297a | 2011-09-28 13:11:14 -0700 | [diff] [blame] | 359 | static struct platform_device msm9615_device_rpm_regulator __devinitdata = { |
| 360 | .name = "rpm-regulator", |
| 361 | .id = -1, |
| 362 | .dev = { |
| 363 | .platform_data = &msm_rpm_regulator_9615_pdata, |
| 364 | }, |
| 365 | }; |
| 366 | |
David Collins | 0f9942a | 2011-10-31 09:47:34 -0700 | [diff] [blame] | 367 | static struct platform_device msm9615_device_ext_2p95v_vreg = { |
| 368 | .name = GPIO_REGULATOR_DEV_NAME, |
| 369 | .id = 18, |
| 370 | .dev = { |
| 371 | .platform_data = |
| 372 | &msm_gpio_regulator_pdata[GPIO_VREG_ID_EXT_2P95V], |
| 373 | }, |
| 374 | }; |
| 375 | |
Maheshkumar Sivasubramanian | c6c5503 | 2011-10-25 16:01:32 -0600 | [diff] [blame] | 376 | static struct msm_pm_boot_platform_data msm_pm_boot_pdata __initdata = { |
| 377 | .mode = MSM_PM_BOOT_CONFIG_REMAP_BOOT_ADDR, |
| 378 | .v_addr = MSM_APCS_GLB_BASE + 0x24, |
| 379 | }; |
| 380 | |
Gagan Mac | 7a82764 | 2011-09-22 19:42:21 -0600 | [diff] [blame] | 381 | static void __init msm9615_init_buses(void) |
| 382 | { |
| 383 | #ifdef CONFIG_MSM_BUS_SCALING |
| 384 | msm_bus_rpm_set_mt_mask(); |
| 385 | msm_bus_9615_sys_fabric_pdata.rpm_enabled = 1; |
| 386 | msm_bus_9615_sys_fabric.dev.platform_data = |
| 387 | &msm_bus_9615_sys_fabric_pdata; |
| 388 | msm_bus_def_fab.dev.platform_data = &msm_bus_9615_def_fab_pdata; |
| 389 | #endif |
| 390 | } |
| 391 | |
Shiv Maliyappanahalli | 9ec55e9 | 2012-01-09 14:44:59 -0800 | [diff] [blame] | 392 | #ifdef CONFIG_WCD9310_CODEC |
| 393 | |
| 394 | #define TABLA_INTERRUPT_BASE (NR_MSM_IRQS + NR_GPIO_IRQS) |
| 395 | |
Venkat Sudhir | 5efc491 | 2012-05-15 17:10:35 -0700 | [diff] [blame] | 396 | /* |
| 397 | * MDM9x15 I2S. |
| 398 | */ |
| 399 | static struct wcd9xxx_pdata wcd9xxx_i2c_platform_data = { |
| 400 | .irq = MSM_GPIO_TO_INT(85), |
| 401 | .irq_base = TABLA_INTERRUPT_BASE, |
| 402 | .num_irqs = NR_TABLA_IRQS, |
| 403 | .reset_gpio = 84, |
| 404 | .micbias = { |
| 405 | .ldoh_v = TABLA_LDOH_2P85_V, |
| 406 | .cfilt1_mv = 1800, |
| 407 | .cfilt2_mv = 1800, |
| 408 | .cfilt3_mv = 1800, |
| 409 | .bias1_cfilt_sel = TABLA_CFILT1_SEL, |
| 410 | .bias2_cfilt_sel = TABLA_CFILT2_SEL, |
| 411 | .bias3_cfilt_sel = TABLA_CFILT3_SEL, |
| 412 | .bias4_cfilt_sel = TABLA_CFILT3_SEL, |
| 413 | }, |
| 414 | .regulator = { |
| 415 | { |
| 416 | .name = "CDC_VDD_CP", |
| 417 | .min_uV = 1800000, |
| 418 | .max_uV = 1800000, |
| 419 | .optimum_uA = WCD9XXX_CDC_VDDA_CP_CUR_MAX, |
| 420 | }, |
| 421 | { |
| 422 | .name = "CDC_VDDA_RX", |
| 423 | .min_uV = 1800000, |
| 424 | .max_uV = 1800000, |
| 425 | .optimum_uA = WCD9XXX_CDC_VDDA_RX_CUR_MAX, |
| 426 | }, |
| 427 | { |
| 428 | .name = "CDC_VDDA_TX", |
| 429 | .min_uV = 1800000, |
| 430 | .max_uV = 1800000, |
| 431 | .optimum_uA = WCD9XXX_CDC_VDDA_TX_CUR_MAX, |
| 432 | }, |
| 433 | { |
| 434 | .name = "VDDIO_CDC", |
| 435 | .min_uV = 1800000, |
| 436 | .max_uV = 1800000, |
| 437 | .optimum_uA = WCD9XXX_VDDIO_CDC_CUR_MAX, |
| 438 | }, |
| 439 | { |
| 440 | .name = "VDDD_CDC_D", |
| 441 | .min_uV = 1225000, |
| 442 | .max_uV = 1225000, |
| 443 | .optimum_uA = WCD9XXX_VDDD_CDC_D_CUR_MAX, |
| 444 | }, |
| 445 | { |
| 446 | .name = "CDC_VDDA_A_1P2V", |
| 447 | .min_uV = 1225000, |
| 448 | .max_uV = 1225000, |
| 449 | .optimum_uA = WCD9XXX_VDDD_CDC_A_CUR_MAX, |
| 450 | } |
| 451 | }, |
| 452 | }; |
| 453 | |
| 454 | static struct i2c_board_info wcd9xxx_device_info[] __initdata = { |
| 455 | { |
| 456 | I2C_BOARD_INFO("tabla top level", TABLA_I2C_SLAVE_ADDR), |
| 457 | .platform_data = &wcd9xxx_i2c_platform_data, |
| 458 | }, |
| 459 | { |
| 460 | I2C_BOARD_INFO("tabla analog", TABLA_ANALOG_I2C_SLAVE_ADDR), |
| 461 | .platform_data = &wcd9xxx_i2c_platform_data, |
| 462 | }, |
| 463 | { |
| 464 | I2C_BOARD_INFO("tabla digital1", TABLA_DIGITAL1_I2C_SLAVE_ADDR), |
| 465 | .platform_data = &wcd9xxx_i2c_platform_data, |
| 466 | }, |
| 467 | { |
| 468 | I2C_BOARD_INFO("tabla digital2", TABLA_DIGITAL2_I2C_SLAVE_ADDR), |
| 469 | .platform_data = &wcd9xxx_i2c_platform_data, |
| 470 | }, |
| 471 | }; |
| 472 | |
Venkat Sudhir | 5efc491 | 2012-05-15 17:10:35 -0700 | [diff] [blame] | 473 | /* |
| 474 | * MDM9x15 I2S. |
| 475 | */ |
| 476 | |
Shiv Maliyappanahalli | 9ec55e9 | 2012-01-09 14:44:59 -0800 | [diff] [blame] | 477 | /* Micbias setting is based on 8660 CDP/MTP/FLUID requirement |
| 478 | * 4 micbiases are used to power various analog and digital |
| 479 | * microphones operating at 1800 mV. Technically, all micbiases |
| 480 | * can source from single cfilter since all microphones operate |
| 481 | * at the same voltage level. The arrangement below is to make |
| 482 | * sure all cfilters are exercised. LDO_H regulator ouput level |
| 483 | * does not need to be as high as 2.85V. It is choosen for |
| 484 | * microphone sensitivity purpose. |
| 485 | */ |
| 486 | |
| 487 | static struct wcd9xxx_pdata tabla20_platform_data = { |
| 488 | .slimbus_slave_device = { |
| 489 | .name = "tabla-slave", |
| 490 | .e_addr = {0, 0, 0x60, 0, 0x17, 2}, |
| 491 | }, |
Shiv Maliyappanahalli | d714781 | 2012-05-17 12:43:03 -0700 | [diff] [blame] | 492 | .irq = MSM_GPIO_TO_INT(85), |
Shiv Maliyappanahalli | 9ec55e9 | 2012-01-09 14:44:59 -0800 | [diff] [blame] | 493 | .irq_base = TABLA_INTERRUPT_BASE, |
| 494 | .num_irqs = NR_WCD9XXX_IRQS, |
| 495 | .reset_gpio = 84, |
| 496 | .micbias = { |
| 497 | .ldoh_v = TABLA_LDOH_2P85_V, |
| 498 | .cfilt1_mv = 1800, |
| 499 | .cfilt2_mv = 1800, |
| 500 | .cfilt3_mv = 1800, |
| 501 | .bias1_cfilt_sel = TABLA_CFILT1_SEL, |
| 502 | .bias2_cfilt_sel = TABLA_CFILT2_SEL, |
| 503 | .bias3_cfilt_sel = TABLA_CFILT3_SEL, |
| 504 | .bias4_cfilt_sel = TABLA_CFILT3_SEL, |
| 505 | }, |
| 506 | .regulator = { |
| 507 | { |
| 508 | .name = "CDC_VDD_CP", |
| 509 | .min_uV = 1800000, |
| 510 | .max_uV = 1800000, |
| 511 | .optimum_uA = WCD9XXX_CDC_VDDA_CP_CUR_MAX, |
| 512 | }, |
| 513 | { |
| 514 | .name = "CDC_VDDA_RX", |
| 515 | .min_uV = 1800000, |
| 516 | .max_uV = 1800000, |
| 517 | .optimum_uA = WCD9XXX_CDC_VDDA_RX_CUR_MAX, |
| 518 | }, |
| 519 | { |
| 520 | .name = "CDC_VDDA_TX", |
| 521 | .min_uV = 1800000, |
| 522 | .max_uV = 1800000, |
| 523 | .optimum_uA = WCD9XXX_CDC_VDDA_TX_CUR_MAX, |
| 524 | }, |
| 525 | { |
| 526 | .name = "VDDIO_CDC", |
| 527 | .min_uV = 1800000, |
| 528 | .max_uV = 1800000, |
| 529 | .optimum_uA = WCD9XXX_VDDIO_CDC_CUR_MAX, |
| 530 | }, |
| 531 | { |
| 532 | .name = "VDDD_CDC_D", |
| 533 | .min_uV = 1225000, |
| 534 | .max_uV = 1225000, |
| 535 | .optimum_uA = WCD9XXX_VDDD_CDC_D_CUR_MAX, |
| 536 | }, |
| 537 | { |
| 538 | .name = "CDC_VDDA_A_1P2V", |
| 539 | .min_uV = 1225000, |
| 540 | .max_uV = 1225000, |
| 541 | .optimum_uA = WCD9XXX_VDDD_CDC_A_CUR_MAX, |
| 542 | }, |
| 543 | }, |
| 544 | }; |
| 545 | |
| 546 | static struct slim_device msm_slim_tabla20 = { |
| 547 | .name = "tabla2x-slim", |
| 548 | .e_addr = {0, 1, 0x60, 0, 0x17, 2}, |
| 549 | .dev = { |
| 550 | .platform_data = &tabla20_platform_data, |
| 551 | }, |
| 552 | }; |
| 553 | #endif |
| 554 | |
Shiv Maliyappanahalli | 3631cfb | 2012-05-31 15:53:24 -0700 | [diff] [blame] | 555 | static struct i2c_registry msm9615_i2c_devices[] __initdata = { |
| 556 | #ifdef CONFIG_WCD9310_CODEC |
| 557 | { |
| 558 | I2C_SURF | I2C_FFA | I2C_FLUID, |
| 559 | MSM_9615_GSBI5_QUP_I2C_BUS_ID, |
| 560 | wcd9xxx_device_info, |
| 561 | ARRAY_SIZE(wcd9xxx_device_info), |
| 562 | }, |
| 563 | #endif |
| 564 | }; |
| 565 | |
Sagar Dharia | 2a5378d | 2011-12-01 20:00:11 -0700 | [diff] [blame] | 566 | static struct slim_boardinfo msm_slim_devices[] = { |
| 567 | /* add slimbus slaves as needed */ |
Shiv Maliyappanahalli | 9ec55e9 | 2012-01-09 14:44:59 -0800 | [diff] [blame] | 568 | #ifdef CONFIG_WCD9310_CODEC |
| 569 | { |
| 570 | .bus_num = 1, |
| 571 | .slim_slave = &msm_slim_tabla20, |
| 572 | }, |
| 573 | #endif |
Sagar Dharia | 2a5378d | 2011-12-01 20:00:11 -0700 | [diff] [blame] | 574 | }; |
| 575 | |
Harini Jayaraman | 738c931 | 2011-09-08 15:22:38 -0600 | [diff] [blame] | 576 | static struct msm_spi_platform_data msm9615_qup_spi_gsbi3_pdata = { |
| 577 | .max_clock_speed = 24000000, |
| 578 | }; |
| 579 | |
Harini Jayaraman | eba5267 | 2011-09-08 15:13:00 -0600 | [diff] [blame] | 580 | static struct msm_i2c_platform_data msm9615_i2c_qup_gsbi5_pdata = { |
| 581 | .clk_freq = 100000, |
| 582 | .src_clk_rate = 24000000, |
| 583 | }; |
| 584 | |
Amit Blay | 6a8d4f3 | 2011-11-21 10:36:25 +0200 | [diff] [blame] | 585 | #define USB_5V_EN 3 |
| 586 | #define PM_USB_5V_EN PM8018_GPIO_PM_TO_SYS(USB_5V_EN) |
| 587 | |
Mayank Rana | 8549e63 | 2012-01-23 12:49:54 +0530 | [diff] [blame] | 588 | static int msm_hsusb_vbus_power(bool on) |
Amit Blay | 6a8d4f3 | 2011-11-21 10:36:25 +0200 | [diff] [blame] | 589 | { |
Amit Blay | a4416f9 | 2012-01-24 21:03:52 +0200 | [diff] [blame] | 590 | int rc; |
Amit Blay | 6a8d4f3 | 2011-11-21 10:36:25 +0200 | [diff] [blame] | 591 | struct pm_gpio usb_vbus = { |
| 592 | .direction = PM_GPIO_DIR_OUT, |
| 593 | .pull = PM_GPIO_PULL_NO, |
| 594 | .output_buffer = PM_GPIO_OUT_BUF_CMOS, |
Amit Blay | 6a8d4f3 | 2011-11-21 10:36:25 +0200 | [diff] [blame] | 595 | .vin_sel = 2, |
| 596 | .out_strength = PM_GPIO_STRENGTH_HIGH, |
| 597 | .function = PM_GPIO_FUNC_NORMAL, |
| 598 | .inv_int_pol = 0, |
| 599 | }; |
| 600 | |
Amit Blay | a4416f9 | 2012-01-24 21:03:52 +0200 | [diff] [blame] | 601 | usb_vbus.output_value = on; |
Amit Blay | 6a8d4f3 | 2011-11-21 10:36:25 +0200 | [diff] [blame] | 602 | |
Amit Blay | a4416f9 | 2012-01-24 21:03:52 +0200 | [diff] [blame] | 603 | rc = pm8xxx_gpio_config(PM_USB_5V_EN, &usb_vbus); |
| 604 | if (rc) |
| 605 | pr_err("failed to config usb_5v_en gpio\n"); |
Amit Blay | 6a8d4f3 | 2011-11-21 10:36:25 +0200 | [diff] [blame] | 606 | |
Mayank Rana | 8549e63 | 2012-01-23 12:49:54 +0530 | [diff] [blame] | 607 | return rc; |
Amit Blay | 6a8d4f3 | 2011-11-21 10:36:25 +0200 | [diff] [blame] | 608 | } |
| 609 | |
Anji jonnala | a8b8d73 | 2011-12-06 10:03:24 +0530 | [diff] [blame] | 610 | static int shelby_phy_init_seq[] = { |
| 611 | 0x44, 0x80,/* set VBUS valid threshold and |
| 612 | disconnect valid threshold */ |
| 613 | 0x38, 0x81, /* update DC voltage level */ |
Amit Blay | dbaeff8 | 2012-04-02 22:13:36 +0300 | [diff] [blame] | 614 | 0x24, 0x82,/* set preemphasis and rise/fall time */ |
Anji jonnala | a8b8d73 | 2011-12-06 10:03:24 +0530 | [diff] [blame] | 615 | 0x13, 0x83,/* set source impedance adjustment */ |
| 616 | -1}; |
| 617 | |
Ofir Cohen | 40a4e86 | 2011-12-08 15:17:52 +0200 | [diff] [blame] | 618 | #define USB_BAM_PHY_BASE 0x12502000 |
Ofir Cohen | 43473c8 | 2012-01-25 16:28:13 +0200 | [diff] [blame] | 619 | #define HSIC_BAM_PHY_BASE 0x12542000 |
Ofir Cohen | 40a4e86 | 2011-12-08 15:17:52 +0200 | [diff] [blame] | 620 | #define A2_BAM_PHY_BASE 0x124C2000 |
Lena Salman | a66eddf | 2012-03-26 13:03:43 +0200 | [diff] [blame] | 621 | static struct usb_bam_pipe_connect msm_usb_bam_connections[2][4][2] = { |
| 622 | [0][0][USB_TO_PEER_PERIPHERAL] = { |
Ofir Cohen | 40a4e86 | 2011-12-08 15:17:52 +0200 | [diff] [blame] | 623 | .src_phy_addr = USB_BAM_PHY_BASE, |
| 624 | .src_pipe_index = 11, |
| 625 | .dst_phy_addr = A2_BAM_PHY_BASE, |
| 626 | .dst_pipe_index = 0, |
Ofir Cohen | 29cd575 | 2011-12-14 17:20:30 +0200 | [diff] [blame] | 627 | .data_fifo_base_offset = 0x1100, |
| 628 | .data_fifo_size = 0x600, |
| 629 | .desc_fifo_base_offset = 0x1700, |
Ofir Cohen | 40a4e86 | 2011-12-08 15:17:52 +0200 | [diff] [blame] | 630 | .desc_fifo_size = 0x300, |
| 631 | }, |
Lena Salman | a66eddf | 2012-03-26 13:03:43 +0200 | [diff] [blame] | 632 | [0][0][PEER_PERIPHERAL_TO_USB] = { |
Ofir Cohen | 40a4e86 | 2011-12-08 15:17:52 +0200 | [diff] [blame] | 633 | .src_phy_addr = A2_BAM_PHY_BASE, |
| 634 | .src_pipe_index = 1, |
| 635 | .dst_phy_addr = USB_BAM_PHY_BASE, |
| 636 | .dst_pipe_index = 10, |
| 637 | .data_fifo_base_offset = 0xa00, |
Ofir Cohen | 29cd575 | 2011-12-14 17:20:30 +0200 | [diff] [blame] | 638 | .data_fifo_size = 0x600, |
| 639 | .desc_fifo_base_offset = 0x1000, |
Ofir Cohen | 40a4e86 | 2011-12-08 15:17:52 +0200 | [diff] [blame] | 640 | .desc_fifo_size = 0x100, |
| 641 | }, |
Lena Salman | a66eddf | 2012-03-26 13:03:43 +0200 | [diff] [blame] | 642 | [0][1][USB_TO_PEER_PERIPHERAL] = { |
Anna Perel | 2151516 | 2012-02-02 20:50:02 +0200 | [diff] [blame] | 643 | .src_phy_addr = USB_BAM_PHY_BASE, |
| 644 | .src_pipe_index = 13, |
| 645 | .dst_phy_addr = A2_BAM_PHY_BASE, |
| 646 | .dst_pipe_index = 2, |
| 647 | .data_fifo_base_offset = 0x2100, |
| 648 | .data_fifo_size = 0x600, |
| 649 | .desc_fifo_base_offset = 0x2700, |
| 650 | .desc_fifo_size = 0x300, |
| 651 | }, |
Lena Salman | a66eddf | 2012-03-26 13:03:43 +0200 | [diff] [blame] | 652 | [0][1][PEER_PERIPHERAL_TO_USB] = { |
Anna Perel | 2151516 | 2012-02-02 20:50:02 +0200 | [diff] [blame] | 653 | .src_phy_addr = A2_BAM_PHY_BASE, |
| 654 | .src_pipe_index = 3, |
| 655 | .dst_phy_addr = USB_BAM_PHY_BASE, |
| 656 | .dst_pipe_index = 12, |
| 657 | .data_fifo_base_offset = 0x1a00, |
| 658 | .data_fifo_size = 0x600, |
| 659 | .desc_fifo_base_offset = 0x2000, |
| 660 | .desc_fifo_size = 0x100, |
| 661 | }, |
Lena Salman | a66eddf | 2012-03-26 13:03:43 +0200 | [diff] [blame] | 662 | [0][2][USB_TO_PEER_PERIPHERAL] = { |
Anna Perel | 2151516 | 2012-02-02 20:50:02 +0200 | [diff] [blame] | 663 | .src_phy_addr = USB_BAM_PHY_BASE, |
| 664 | .src_pipe_index = 15, |
| 665 | .dst_phy_addr = A2_BAM_PHY_BASE, |
| 666 | .dst_pipe_index = 4, |
| 667 | .data_fifo_base_offset = 0x3100, |
| 668 | .data_fifo_size = 0x600, |
| 669 | .desc_fifo_base_offset = 0x3700, |
| 670 | .desc_fifo_size = 0x300, |
| 671 | }, |
Lena Salman | a66eddf | 2012-03-26 13:03:43 +0200 | [diff] [blame] | 672 | [0][2][PEER_PERIPHERAL_TO_USB] = { |
Anna Perel | 2151516 | 2012-02-02 20:50:02 +0200 | [diff] [blame] | 673 | .src_phy_addr = A2_BAM_PHY_BASE, |
| 674 | .src_pipe_index = 5, |
| 675 | .dst_phy_addr = USB_BAM_PHY_BASE, |
| 676 | .dst_pipe_index = 14, |
| 677 | .data_fifo_base_offset = 0x2a00, |
| 678 | .data_fifo_size = 0x600, |
| 679 | .desc_fifo_base_offset = 0x3000, |
| 680 | .desc_fifo_size = 0x100, |
Lena Salman | a66eddf | 2012-03-26 13:03:43 +0200 | [diff] [blame] | 681 | }, |
| 682 | [1][0][USB_TO_PEER_PERIPHERAL] = { |
Ofir Cohen | 057fb3e | 2012-02-05 15:25:47 +0200 | [diff] [blame] | 683 | .src_phy_addr = HSIC_BAM_PHY_BASE, |
| 684 | .src_pipe_index = 1, |
| 685 | .dst_phy_addr = A2_BAM_PHY_BASE, |
| 686 | .dst_pipe_index = 0, |
| 687 | .data_fifo_base_offset = 0x1100, |
| 688 | .data_fifo_size = 0x600, |
| 689 | .desc_fifo_base_offset = 0x1700, |
| 690 | .desc_fifo_size = 0x300, |
| 691 | }, |
Lena Salman | a66eddf | 2012-03-26 13:03:43 +0200 | [diff] [blame] | 692 | [1][0][PEER_PERIPHERAL_TO_USB] = { |
Ofir Cohen | 057fb3e | 2012-02-05 15:25:47 +0200 | [diff] [blame] | 693 | .src_phy_addr = A2_BAM_PHY_BASE, |
| 694 | .src_pipe_index = 1, |
| 695 | .dst_phy_addr = HSIC_BAM_PHY_BASE, |
| 696 | .dst_pipe_index = 0, |
| 697 | .data_fifo_base_offset = 0xa00, |
| 698 | .data_fifo_size = 0x600, |
| 699 | .desc_fifo_base_offset = 0x1000, |
| 700 | .desc_fifo_size = 0x100, |
| 701 | }, |
Lena Salman | a66eddf | 2012-03-26 13:03:43 +0200 | [diff] [blame] | 702 | [1][1][USB_TO_PEER_PERIPHERAL] = { |
Ofir Cohen | 057fb3e | 2012-02-05 15:25:47 +0200 | [diff] [blame] | 703 | .src_phy_addr = HSIC_BAM_PHY_BASE, |
| 704 | .src_pipe_index = 3, |
| 705 | .dst_phy_addr = A2_BAM_PHY_BASE, |
| 706 | .dst_pipe_index = 2, |
| 707 | .data_fifo_base_offset = 0x2100, |
| 708 | .data_fifo_size = 0x600, |
| 709 | .desc_fifo_base_offset = 0x2700, |
| 710 | .desc_fifo_size = 0x300, |
| 711 | }, |
Lena Salman | a66eddf | 2012-03-26 13:03:43 +0200 | [diff] [blame] | 712 | [1][1][PEER_PERIPHERAL_TO_USB] = { |
Ofir Cohen | 057fb3e | 2012-02-05 15:25:47 +0200 | [diff] [blame] | 713 | .src_phy_addr = A2_BAM_PHY_BASE, |
| 714 | .src_pipe_index = 3, |
| 715 | .dst_phy_addr = HSIC_BAM_PHY_BASE, |
| 716 | .dst_pipe_index = 2, |
| 717 | .data_fifo_base_offset = 0x1a00, |
| 718 | .data_fifo_size = 0x600, |
| 719 | .desc_fifo_base_offset = 0x2000, |
| 720 | .desc_fifo_size = 0x100, |
| 721 | }, |
Lena Salman | a66eddf | 2012-03-26 13:03:43 +0200 | [diff] [blame] | 722 | [1][2][USB_TO_PEER_PERIPHERAL] = { |
Ofir Cohen | 057fb3e | 2012-02-05 15:25:47 +0200 | [diff] [blame] | 723 | .src_phy_addr = HSIC_BAM_PHY_BASE, |
| 724 | .src_pipe_index = 5, |
| 725 | .dst_phy_addr = A2_BAM_PHY_BASE, |
| 726 | .dst_pipe_index = 4, |
| 727 | .data_fifo_base_offset = 0x3100, |
| 728 | .data_fifo_size = 0x600, |
| 729 | .desc_fifo_base_offset = 0x3700, |
| 730 | .desc_fifo_size = 0x300, |
| 731 | }, |
Lena Salman | a66eddf | 2012-03-26 13:03:43 +0200 | [diff] [blame] | 732 | [1][2][PEER_PERIPHERAL_TO_USB] = { |
Ofir Cohen | 057fb3e | 2012-02-05 15:25:47 +0200 | [diff] [blame] | 733 | .src_phy_addr = A2_BAM_PHY_BASE, |
| 734 | .src_pipe_index = 5, |
| 735 | .dst_phy_addr = HSIC_BAM_PHY_BASE, |
| 736 | .dst_pipe_index = 4, |
| 737 | .data_fifo_base_offset = 0x2a00, |
| 738 | .data_fifo_size = 0x600, |
| 739 | .desc_fifo_base_offset = 0x3000, |
| 740 | .desc_fifo_size = 0x100, |
| 741 | } |
Ofir Cohen | 40a4e86 | 2011-12-08 15:17:52 +0200 | [diff] [blame] | 742 | }; |
| 743 | |
| 744 | static struct msm_usb_bam_platform_data msm_usb_bam_pdata = { |
Lena Salman | a66eddf | 2012-03-26 13:03:43 +0200 | [diff] [blame] | 745 | .connections = &msm_usb_bam_connections[0][0][0], |
Lena Salman | 57d167e | 2012-03-21 19:46:38 +0200 | [diff] [blame] | 746 | #ifndef CONFIG_USB_CI13XXX_MSM_HSIC |
Ofir Cohen | 43473c8 | 2012-01-25 16:28:13 +0200 | [diff] [blame] | 747 | .usb_active_bam = HSUSB_BAM, |
Ofir Cohen | 43473c8 | 2012-01-25 16:28:13 +0200 | [diff] [blame] | 748 | #else |
| 749 | .usb_active_bam = HSIC_BAM, |
Ofir Cohen | 43473c8 | 2012-01-25 16:28:13 +0200 | [diff] [blame] | 750 | #endif |
Lena Salman | a66eddf | 2012-03-26 13:03:43 +0200 | [diff] [blame] | 751 | .usb_bam_num_pipes = 16, |
Ofir Cohen | 40a4e86 | 2011-12-08 15:17:52 +0200 | [diff] [blame] | 752 | }; |
| 753 | |
Amit Blay | 5e4ec19 | 2011-10-20 09:16:54 +0200 | [diff] [blame] | 754 | static struct msm_otg_platform_data msm_otg_pdata = { |
Amit Blay | 6a8d4f3 | 2011-11-21 10:36:25 +0200 | [diff] [blame] | 755 | .mode = USB_OTG, |
| 756 | .otg_control = OTG_PHY_CONTROL, |
Amit Blay | 5e4ec19 | 2011-10-20 09:16:54 +0200 | [diff] [blame] | 757 | .phy_type = SNPS_28NM_INTEGRATED_PHY, |
Amit Blay | 6a8d4f3 | 2011-11-21 10:36:25 +0200 | [diff] [blame] | 758 | .vbus_power = msm_hsusb_vbus_power, |
Ofir Cohen | 4da266f | 2012-01-03 10:19:29 +0200 | [diff] [blame] | 759 | .disable_reset_on_disconnect = true, |
Amit Blay | 6fa647a | 2012-05-24 14:12:08 +0300 | [diff] [blame] | 760 | .enable_lpm_on_dev_suspend = true, |
Amit Blay | 5e4ec19 | 2011-10-20 09:16:54 +0200 | [diff] [blame] | 761 | }; |
| 762 | |
Amit Blay | 4d57d36 | 2012-04-28 11:00:21 +0300 | [diff] [blame] | 763 | static struct msm_hsic_peripheral_platform_data msm_hsic_peripheral_pdata = { |
| 764 | .keep_core_clk_on_suspend_workaround = true, |
| 765 | }; |
| 766 | |
Amit Blay | 5f968cf | 2012-01-22 12:04:01 +0200 | [diff] [blame] | 767 | #define PID_MAGIC_ID 0x71432909 |
| 768 | #define SERIAL_NUM_MAGIC_ID 0x61945374 |
| 769 | #define SERIAL_NUMBER_LENGTH 127 |
| 770 | #define DLOAD_USB_BASE_ADD 0x2B0000C8 |
| 771 | |
| 772 | struct magic_num_struct { |
| 773 | uint32_t pid; |
| 774 | uint32_t serial_num; |
| 775 | }; |
| 776 | |
| 777 | struct dload_struct { |
| 778 | uint32_t reserved1; |
| 779 | uint32_t reserved2; |
| 780 | uint32_t reserved3; |
| 781 | uint16_t reserved4; |
| 782 | uint16_t pid; |
| 783 | char serial_number[SERIAL_NUMBER_LENGTH]; |
| 784 | uint16_t reserved5; |
| 785 | struct magic_num_struct magic_struct; |
| 786 | }; |
| 787 | |
Amit Blay | 5e4ec19 | 2011-10-20 09:16:54 +0200 | [diff] [blame] | 788 | static int usb_diag_update_pid_and_serial_num(uint32_t pid, const char *snum) |
| 789 | { |
Amit Blay | 5f968cf | 2012-01-22 12:04:01 +0200 | [diff] [blame] | 790 | struct dload_struct __iomem *dload = 0; |
| 791 | |
| 792 | dload = ioremap(DLOAD_USB_BASE_ADD, sizeof(*dload)); |
| 793 | if (!dload) { |
| 794 | pr_err("%s: cannot remap I/O memory region: %08x\n", |
| 795 | __func__, DLOAD_USB_BASE_ADD); |
| 796 | return -ENXIO; |
| 797 | } |
| 798 | |
| 799 | pr_debug("%s: dload:%p pid:%x serial_num:%s\n", |
| 800 | __func__, dload, pid, snum); |
| 801 | /* update pid */ |
| 802 | dload->magic_struct.pid = PID_MAGIC_ID; |
| 803 | dload->pid = pid; |
| 804 | |
| 805 | /* update serial number */ |
| 806 | dload->magic_struct.serial_num = 0; |
| 807 | if (!snum) { |
| 808 | memset(dload->serial_number, 0, SERIAL_NUMBER_LENGTH); |
| 809 | goto out; |
| 810 | } |
| 811 | |
| 812 | dload->magic_struct.serial_num = SERIAL_NUM_MAGIC_ID; |
| 813 | strlcpy(dload->serial_number, snum, SERIAL_NUMBER_LENGTH); |
| 814 | out: |
| 815 | iounmap(dload); |
Amit Blay | 5e4ec19 | 2011-10-20 09:16:54 +0200 | [diff] [blame] | 816 | return 0; |
| 817 | } |
| 818 | |
Rohit Vaswani | 149f0a7 | 2011-11-09 15:21:28 -0800 | [diff] [blame] | 819 | static struct platform_device msm_wlan_ar6000_pm_device = { |
| 820 | .name = "wlan_ar6000_pm_dev", |
| 821 | .id = -1, |
| 822 | }; |
| 823 | |
| 824 | static int __init msm9615_init_ar6000pm(void) |
| 825 | { |
| 826 | return platform_device_register(&msm_wlan_ar6000_pm_device); |
| 827 | } |
| 828 | |
Jay Chokshi | dc8028b | 2011-12-01 16:17:34 -0800 | [diff] [blame] | 829 | #ifdef CONFIG_LTC4088_CHARGER |
| 830 | static struct platform_device msm_device_charger = { |
| 831 | .name = LTC4088_CHARGER_DEV_NAME, |
| 832 | .id = -1, |
| 833 | .dev = { |
| 834 | .platform_data = <c4088_chg_pdata, |
| 835 | }, |
| 836 | }; |
| 837 | #endif |
| 838 | |
Siddartha Mohanadoss | 7e25dc1 | 2012-03-19 11:19:27 -0700 | [diff] [blame] | 839 | static struct tsens_platform_data msm_tsens_pdata = { |
| 840 | .tsens_factor = 1000, |
| 841 | .hw_type = MDM_9615, |
| 842 | .tsens_num_sensor = 5, |
Siddartha Mohanadoss | 892ee47 | 2012-05-03 10:35:20 -0700 | [diff] [blame] | 843 | .slope = {1176, 1162, 1162, 1149, 1176}, |
Siddartha Mohanadoss | 7e25dc1 | 2012-03-19 11:19:27 -0700 | [diff] [blame] | 844 | }; |
| 845 | |
Siddartha Mohanadoss | 48cad91 | 2012-04-05 21:29:54 -0700 | [diff] [blame] | 846 | static struct platform_device msm_tsens_device = { |
| 847 | .name = "tsens8960-tm", |
| 848 | .id = -1, |
| 849 | }; |
| 850 | |
Amit Blay | 5e4ec19 | 2011-10-20 09:16:54 +0200 | [diff] [blame] | 851 | static struct platform_device *common_devices[] = { |
Matt Wagantall | bf430eb | 2012-03-22 11:45:49 -0700 | [diff] [blame^] | 852 | &msm9615_device_acpuclk, |
Amit Blay | 5e4ec19 | 2011-10-20 09:16:54 +0200 | [diff] [blame] | 853 | &msm9615_device_dmov, |
| 854 | &msm_device_smd, |
Jay Chokshi | dc8028b | 2011-12-01 16:17:34 -0800 | [diff] [blame] | 855 | #ifdef CONFIG_LTC4088_CHARGER |
| 856 | &msm_device_charger, |
| 857 | #endif |
Amit Blay | 5e4ec19 | 2011-10-20 09:16:54 +0200 | [diff] [blame] | 858 | &msm_device_otg, |
Ofir Cohen | 73c99e8 | 2012-01-15 13:38:14 +0200 | [diff] [blame] | 859 | &msm_device_hsic_peripheral, |
Amit Blay | 5e4ec19 | 2011-10-20 09:16:54 +0200 | [diff] [blame] | 860 | &msm_device_gadget_peripheral, |
Amit Blay | 6a8d4f3 | 2011-11-21 10:36:25 +0200 | [diff] [blame] | 861 | &msm_device_hsusb_host, |
Lena Salman | 65bcf37 | 2012-02-14 15:33:32 +0200 | [diff] [blame] | 862 | &msm_device_hsic_host, |
Ofir Cohen | 40a4e86 | 2011-12-08 15:17:52 +0200 | [diff] [blame] | 863 | &msm_device_usb_bam, |
Ofir Cohen | 94213a7 | 2012-05-03 14:26:32 +0300 | [diff] [blame] | 864 | &msm_android_usb_device, |
Amit Blay | 5e4ec19 | 2011-10-20 09:16:54 +0200 | [diff] [blame] | 865 | &msm9615_device_uart_gsbi4, |
David Collins | 0f9942a | 2011-10-31 09:47:34 -0700 | [diff] [blame] | 866 | &msm9615_device_ext_2p95v_vreg, |
Amit Blay | 5e4ec19 | 2011-10-20 09:16:54 +0200 | [diff] [blame] | 867 | &msm9615_device_ssbi_pmic1, |
| 868 | &msm9615_device_qup_i2c_gsbi5, |
| 869 | &msm9615_device_qup_spi_gsbi3, |
| 870 | &msm_device_sps, |
Sagar Dharia | 2a5378d | 2011-12-01 20:00:11 -0700 | [diff] [blame] | 871 | &msm9615_slim_ctrl, |
Amit Blay | 5e4ec19 | 2011-10-20 09:16:54 +0200 | [diff] [blame] | 872 | &msm_device_nand, |
Eric Holmberg | 0c96e70 | 2011-11-08 18:04:31 -0700 | [diff] [blame] | 873 | &msm_device_bam_dmux, |
Praveen Chidambaram | 7849901 | 2011-11-01 17:15:17 -0600 | [diff] [blame] | 874 | &msm9615_rpm_device, |
Amit Blay | 5e4ec19 | 2011-10-20 09:16:54 +0200 | [diff] [blame] | 875 | #ifdef CONFIG_HW_RANDOM_MSM |
| 876 | &msm_device_rng, |
| 877 | #endif |
Olav Haugan | e6a0acd | 2012-04-05 09:29:12 -0700 | [diff] [blame] | 878 | #ifdef CONFIG_ION_MSM |
| 879 | &ion_dev, |
| 880 | #endif |
Amit Blay | 5e4ec19 | 2011-10-20 09:16:54 +0200 | [diff] [blame] | 881 | |
Shiv Maliyappanahalli | 9ec55e9 | 2012-01-09 14:44:59 -0800 | [diff] [blame] | 882 | &msm_pcm, |
| 883 | &msm_multi_ch_pcm, |
| 884 | &msm_pcm_routing, |
| 885 | &msm_cpudai0, |
| 886 | &msm_cpudai1, |
| 887 | &msm_cpudai_bt_rx, |
| 888 | &msm_cpudai_bt_tx, |
| 889 | &msm_cpu_fe, |
| 890 | &msm_stub_codec, |
| 891 | &msm_voice, |
| 892 | &msm_voip, |
Venkat Sudhir | 5efc491 | 2012-05-15 17:10:35 -0700 | [diff] [blame] | 893 | &msm_i2s_cpudai0, |
| 894 | &msm_i2s_cpudai1, |
Shiv Maliyappanahalli | 9ec55e9 | 2012-01-09 14:44:59 -0800 | [diff] [blame] | 895 | &msm_pcm_hostless, |
| 896 | &msm_cpudai_afe_01_rx, |
| 897 | &msm_cpudai_afe_01_tx, |
| 898 | &msm_cpudai_afe_02_rx, |
| 899 | &msm_cpudai_afe_02_tx, |
| 900 | &msm_pcm_afe, |
| 901 | &msm_cpudai_auxpcm_rx, |
| 902 | &msm_cpudai_auxpcm_tx, |
Shiv Maliyappanahalli | 7f4dec5 | 2012-06-01 16:06:08 -0700 | [diff] [blame] | 903 | &msm_cpudai_sec_auxpcm_rx, |
| 904 | &msm_cpudai_sec_auxpcm_tx, |
Shiv Maliyappanahalli | 9ec55e9 | 2012-01-09 14:44:59 -0800 | [diff] [blame] | 905 | |
Amit Blay | 5e4ec19 | 2011-10-20 09:16:54 +0200 | [diff] [blame] | 906 | #if defined(CONFIG_CRYPTO_DEV_QCRYPTO) || \ |
| 907 | defined(CONFIG_CRYPTO_DEV_QCRYPTO_MODULE) |
Ramesh Masavarapu | aa28b5b | 2011-10-21 10:26:03 -0700 | [diff] [blame] | 908 | &msm9615_qcrypto_device, |
Amit Blay | 5e4ec19 | 2011-10-20 09:16:54 +0200 | [diff] [blame] | 909 | #endif |
| 910 | |
| 911 | #if defined(CONFIG_CRYPTO_DEV_QCEDEV) || \ |
| 912 | defined(CONFIG_CRYPTO_DEV_QCEDEV_MODULE) |
Ramesh Masavarapu | aa28b5b | 2011-10-21 10:26:03 -0700 | [diff] [blame] | 913 | &msm9615_qcedev_device, |
Amit Blay | 5e4ec19 | 2011-10-20 09:16:54 +0200 | [diff] [blame] | 914 | #endif |
Jeff Ohlstein | 7e66855 | 2011-10-06 16:17:25 -0700 | [diff] [blame] | 915 | &msm9615_device_watchdog, |
Gagan Mac | 7a82764 | 2011-09-22 19:42:21 -0600 | [diff] [blame] | 916 | &msm_bus_9615_sys_fabric, |
| 917 | &msm_bus_def_fab, |
Praveen Chidambaram | 7849901 | 2011-11-01 17:15:17 -0600 | [diff] [blame] | 918 | &msm9615_rpm_log_device, |
| 919 | &msm9615_rpm_stat_device, |
Siddartha Mohanadoss | 48cad91 | 2012-04-05 21:29:54 -0700 | [diff] [blame] | 920 | &msm_tsens_device, |
Amit Blay | 5e4ec19 | 2011-10-20 09:16:54 +0200 | [diff] [blame] | 921 | }; |
| 922 | |
Harini Jayaraman | eba5267 | 2011-09-08 15:13:00 -0600 | [diff] [blame] | 923 | static void __init msm9615_i2c_init(void) |
| 924 | { |
Venkat Sudhir | 5efc491 | 2012-05-15 17:10:35 -0700 | [diff] [blame] | 925 | u8 mach_mask = 0; |
| 926 | int i; |
| 927 | /* Mask is hardcoded to SURF (CDP). |
| 928 | * works on MTP with same configuration. |
| 929 | */ |
| 930 | mach_mask = I2C_SURF; |
| 931 | if (machine_is_msm9615_cdp()) |
| 932 | mach_mask = I2C_SURF; |
| 933 | else if (machine_is_msm9615_mtp()) |
| 934 | mach_mask = I2C_FFA; |
| 935 | else |
| 936 | pr_err("unmatched machine ID in register_i2c_devices\n"); |
Harini Jayaraman | eba5267 | 2011-09-08 15:13:00 -0600 | [diff] [blame] | 937 | msm9615_device_qup_i2c_gsbi5.dev.platform_data = |
| 938 | &msm9615_i2c_qup_gsbi5_pdata; |
Venkat Sudhir | 5efc491 | 2012-05-15 17:10:35 -0700 | [diff] [blame] | 939 | for (i = 0; i < ARRAY_SIZE(msm9615_i2c_devices); ++i) { |
| 940 | if (msm9615_i2c_devices[i].machs & mach_mask) { |
| 941 | i2c_register_board_info(msm9615_i2c_devices[i].bus, |
| 942 | msm9615_i2c_devices[i].info, |
| 943 | msm9615_i2c_devices[i].len); |
| 944 | } |
| 945 | } |
Harini Jayaraman | eba5267 | 2011-09-08 15:13:00 -0600 | [diff] [blame] | 946 | } |
| 947 | |
Maheshkumar Sivasubramanian | c6c5503 | 2011-10-25 16:01:32 -0600 | [diff] [blame] | 948 | static void __init msm9615_reserve(void) |
| 949 | { |
Olav Haugan | e6a0acd | 2012-04-05 09:29:12 -0700 | [diff] [blame] | 950 | #ifdef CONFIG_ION_MSM |
| 951 | reserve_info = &msm9615_reserve_info; |
| 952 | msm_reserve(); |
| 953 | #endif |
Maheshkumar Sivasubramanian | c6c5503 | 2011-10-25 16:01:32 -0600 | [diff] [blame] | 954 | } |
| 955 | |
Rohit Vaswani | ced9b3b | 2011-08-23 17:21:49 -0700 | [diff] [blame] | 956 | static void __init msm9615_common_init(void) |
| 957 | { |
Ofir Cohen | 94213a7 | 2012-05-03 14:26:32 +0300 | [diff] [blame] | 958 | struct android_usb_platform_data *android_pdata = |
| 959 | msm_android_usb_device.dev.platform_data; |
| 960 | |
Rohit Vaswani | ced9b3b | 2011-08-23 17:21:49 -0700 | [diff] [blame] | 961 | msm9615_device_init(); |
Rohit Vaswani | a681589 | 2011-12-15 20:20:39 -0800 | [diff] [blame] | 962 | msm9615_init_gpiomux(); |
Harini Jayaraman | eba5267 | 2011-09-08 15:13:00 -0600 | [diff] [blame] | 963 | msm9615_i2c_init(); |
David Collins | 00b31e6 | 2011-08-31 20:00:10 -0700 | [diff] [blame] | 964 | regulator_suppress_info_printing(); |
David Collins | bea297a | 2011-09-28 13:11:14 -0700 | [diff] [blame] | 965 | platform_device_register(&msm9615_device_rpm_regulator); |
Vikram Mulukutla | 2021c00 | 2011-12-16 12:32:59 -0800 | [diff] [blame] | 966 | msm_xo_init(); |
Gagan Mac | 7a82764 | 2011-09-22 19:42:21 -0600 | [diff] [blame] | 967 | msm_clock_init(&msm9615_clock_init_data); |
| 968 | msm9615_init_buses(); |
Harini Jayaraman | 738c931 | 2011-09-08 15:22:38 -0600 | [diff] [blame] | 969 | msm9615_device_qup_spi_gsbi3.dev.platform_data = |
| 970 | &msm9615_qup_spi_gsbi3_pdata; |
Kenneth Heitke | af3d3cf | 2011-09-08 11:45:31 -0700 | [diff] [blame] | 971 | msm9615_device_ssbi_pmic1.dev.platform_data = |
| 972 | &msm9615_ssbi_pm8018_pdata; |
David Collins | 00b31e6 | 2011-08-31 20:00:10 -0700 | [diff] [blame] | 973 | pm8018_platform_data.num_regulators = msm_pm8018_regulator_pdata_len; |
Amit Blay | 5e4ec19 | 2011-10-20 09:16:54 +0200 | [diff] [blame] | 974 | |
| 975 | msm_device_otg.dev.platform_data = &msm_otg_pdata; |
Anji jonnala | a8b8d73 | 2011-12-06 10:03:24 +0530 | [diff] [blame] | 976 | msm_otg_pdata.phy_init_seq = shelby_phy_init_seq; |
Amit Blay | 4d57d36 | 2012-04-28 11:00:21 +0300 | [diff] [blame] | 977 | msm_device_hsic_peripheral.dev.platform_data = |
| 978 | &msm_hsic_peripheral_pdata; |
Ofir Cohen | 40a4e86 | 2011-12-08 15:17:52 +0200 | [diff] [blame] | 979 | msm_device_usb_bam.dev.platform_data = &msm_usb_bam_pdata; |
Rohit Vaswani | 0966687 | 2011-08-23 17:41:54 -0700 | [diff] [blame] | 980 | platform_add_devices(common_devices, ARRAY_SIZE(common_devices)); |
Jay Chokshi | 215f7be | 2012-02-09 18:30:44 -0800 | [diff] [blame] | 981 | msm9615_pm8xxx_gpio_mpp_init(); |
Vikram Mulukutla | b5e1cda | 2011-10-04 16:17:22 -0700 | [diff] [blame] | 982 | |
Rohit Vaswani | 149f0a7 | 2011-11-09 15:21:28 -0800 | [diff] [blame] | 983 | /* Ensure ar6000pm device is registered before MMC/SDC */ |
| 984 | msm9615_init_ar6000pm(); |
| 985 | |
Krishna Konda | dd79446 | 2011-10-01 00:19:29 -0700 | [diff] [blame] | 986 | msm9615_init_mmc(); |
Sagar Dharia | 2a5378d | 2011-12-01 20:00:11 -0700 | [diff] [blame] | 987 | slim_register_board_info(msm_slim_devices, |
| 988 | ARRAY_SIZE(msm_slim_devices)); |
Ofir Cohen | 94213a7 | 2012-05-03 14:26:32 +0300 | [diff] [blame] | 989 | android_pdata->update_pid_and_serial_num = |
| 990 | usb_diag_update_pid_and_serial_num; |
Olav Haugan | e6a0acd | 2012-04-05 09:29:12 -0700 | [diff] [blame] | 991 | msm_pm_boot_pdata.p_addr = allocate_contiguous_ebi_nomap(SZ_8, SZ_64K); |
Maheshkumar Sivasubramanian | c6c5503 | 2011-10-25 16:01:32 -0600 | [diff] [blame] | 992 | BUG_ON(msm_pm_boot_init(&msm_pm_boot_pdata)); |
Siddartha Mohanadoss | 7e25dc1 | 2012-03-19 11:19:27 -0700 | [diff] [blame] | 993 | msm_tsens_early_init(&msm_tsens_pdata); |
Rohit Vaswani | ced9b3b | 2011-08-23 17:21:49 -0700 | [diff] [blame] | 994 | } |
| 995 | |
| 996 | static void __init msm9615_cdp_init(void) |
| 997 | { |
| 998 | msm9615_common_init(); |
Zhang Chang Ken | a48794b | 2012-03-31 17:45:21 -0400 | [diff] [blame] | 999 | #ifdef CONFIG_FB_MSM |
| 1000 | mdm9615_init_fb(); |
| 1001 | #endif |
Rohit Vaswani | ced9b3b | 2011-08-23 17:21:49 -0700 | [diff] [blame] | 1002 | } |
| 1003 | |
| 1004 | static void __init msm9615_mtp_init(void) |
| 1005 | { |
| 1006 | msm9615_common_init(); |
| 1007 | } |
| 1008 | |
Zhang Chang Ken | a48794b | 2012-03-31 17:45:21 -0400 | [diff] [blame] | 1009 | #ifdef CONFIG_FB_MSM |
| 1010 | static void __init mdm9615_allocate_memory_regions(void) |
| 1011 | { |
| 1012 | mdm9615_allocate_fb_region(); |
| 1013 | } |
| 1014 | #endif |
| 1015 | |
Rohit Vaswani | ced9b3b | 2011-08-23 17:21:49 -0700 | [diff] [blame] | 1016 | MACHINE_START(MSM9615_CDP, "QCT MSM9615 CDP") |
| 1017 | .map_io = msm9615_map_io, |
| 1018 | .init_irq = msm9615_init_irq, |
Marc Zyngier | 89bdafd1 | 2011-12-22 11:39:20 +0530 | [diff] [blame] | 1019 | .handle_irq = gic_handle_irq, |
Rohit Vaswani | ced9b3b | 2011-08-23 17:21:49 -0700 | [diff] [blame] | 1020 | .timer = &msm_timer, |
| 1021 | .init_machine = msm9615_cdp_init, |
Maheshkumar Sivasubramanian | c6c5503 | 2011-10-25 16:01:32 -0600 | [diff] [blame] | 1022 | .reserve = msm9615_reserve, |
Zhang Chang Ken | a48794b | 2012-03-31 17:45:21 -0400 | [diff] [blame] | 1023 | #ifdef CONFIG_FB_MSM |
| 1024 | .init_early = mdm9615_allocate_memory_regions, |
| 1025 | #endif |
Jeff Ohlstein | dd0dd9b | 2012-05-29 17:47:21 -0700 | [diff] [blame] | 1026 | .restart = msm_restart, |
Rohit Vaswani | ced9b3b | 2011-08-23 17:21:49 -0700 | [diff] [blame] | 1027 | MACHINE_END |
| 1028 | |
| 1029 | MACHINE_START(MSM9615_MTP, "QCT MSM9615 MTP") |
| 1030 | .map_io = msm9615_map_io, |
| 1031 | .init_irq = msm9615_init_irq, |
Marc Zyngier | 89bdafd1 | 2011-12-22 11:39:20 +0530 | [diff] [blame] | 1032 | .handle_irq = gic_handle_irq, |
Rohit Vaswani | ced9b3b | 2011-08-23 17:21:49 -0700 | [diff] [blame] | 1033 | .timer = &msm_timer, |
| 1034 | .init_machine = msm9615_mtp_init, |
Maheshkumar Sivasubramanian | c6c5503 | 2011-10-25 16:01:32 -0600 | [diff] [blame] | 1035 | .reserve = msm9615_reserve, |
Jeff Ohlstein | dd0dd9b | 2012-05-29 17:47:21 -0700 | [diff] [blame] | 1036 | .restart = msm_restart, |
Rohit Vaswani | ced9b3b | 2011-08-23 17:21:49 -0700 | [diff] [blame] | 1037 | MACHINE_END |