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