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