Sravan Kumar Ambapuram | b22cf4d | 2012-01-02 21:45:04 +0530 | [diff] [blame] | 1 | /* Copyright (c) 2011-2012, Code Aurora Forum. All rights reserved. |
Taniya Das | c98bfbc | 2011-08-23 09:58:55 +0530 | [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/init.h> |
| 15 | #include <linux/gpio_event.h> |
Pankaj Kumar | 6f84174 | 2011-10-10 15:52:14 +0530 | [diff] [blame] | 16 | #include <linux/usb/android.h> |
Taniya Das | c98bfbc | 2011-08-23 09:58:55 +0530 | [diff] [blame] | 17 | #include <linux/platform_device.h> |
| 18 | #include <linux/io.h> |
| 19 | #include <linux/gpio.h> |
| 20 | #include <linux/mtd/nand.h> |
| 21 | #include <linux/mtd/partitions.h> |
| 22 | #include <linux/i2c.h> |
| 23 | #include <linux/android_pmem.h> |
| 24 | #include <linux/bootmem.h> |
| 25 | #include <linux/mfd/marimba.h> |
| 26 | #include <linux/power_supply.h> |
Trilok Soni | b941079 | 2012-04-07 15:37:13 +0530 | [diff] [blame] | 27 | #include <linux/input/rmi_platformdata.h> |
| 28 | #include <linux/input/rmi_i2c.h> |
| 29 | #include <linux/i2c/atmel_mxt_ts.h> |
Pankaj Kumar | 3cec058 | 2011-11-18 11:13:29 +0530 | [diff] [blame] | 30 | #include <linux/regulator/consumer.h> |
Chintan Pandya | f4ad400 | 2012-02-28 19:49:03 +0530 | [diff] [blame] | 31 | #include <linux/memblock.h> |
Mohan Pallaka | 5afe985 | 2012-01-12 23:12:06 +0530 | [diff] [blame] | 32 | #include <linux/input/ft5x06_ts.h> |
Siddartha Mohanadoss | bc2103f | 2012-03-20 11:41:48 -0700 | [diff] [blame] | 33 | #include <linux/msm_adc.h> |
Steve Muckle | 75c34ca | 2012-06-12 14:27:40 -0700 | [diff] [blame] | 34 | #include <linux/regulator/msm-gpio-regulator.h> |
Chintan Pandya | 43d0a34 | 2012-06-08 19:45:56 +0530 | [diff] [blame] | 35 | #include <linux/ion.h> |
Taniya Das | c98bfbc | 2011-08-23 09:58:55 +0530 | [diff] [blame] | 36 | #include <asm/mach/mmc.h> |
| 37 | #include <asm/mach-types.h> |
| 38 | #include <asm/mach/arch.h> |
Chintan Pandya | f4ad400 | 2012-02-28 19:49:03 +0530 | [diff] [blame] | 39 | #include <asm/hardware/gic.h> |
Taniya Das | c98bfbc | 2011-08-23 09:58:55 +0530 | [diff] [blame] | 40 | #include <mach/board.h> |
| 41 | #include <mach/msm_iomap.h> |
| 42 | #include <mach/msm_hsusb.h> |
| 43 | #include <mach/rpc_hsusb.h> |
| 44 | #include <mach/rpc_pmapp.h> |
| 45 | #include <mach/usbdiag.h> |
Taniya Das | c98bfbc | 2011-08-23 09:58:55 +0530 | [diff] [blame] | 46 | #include <mach/msm_memtypes.h> |
| 47 | #include <mach/msm_serial_hs.h> |
Taniya Das | c98bfbc | 2011-08-23 09:58:55 +0530 | [diff] [blame] | 48 | #include <mach/pmic.h> |
| 49 | #include <mach/socinfo.h> |
| 50 | #include <mach/vreg.h> |
| 51 | #include <mach/rpc_pmapp.h> |
| 52 | #include <mach/msm_battery.h> |
| 53 | #include <mach/rpc_server_handset.h> |
| 54 | #include <mach/socinfo.h> |
Pankaj Kumar | 27c0264 | 2011-09-22 15:55:55 +0530 | [diff] [blame] | 55 | #include "board-msm7x27a-regulator.h" |
Taniya Das | c98bfbc | 2011-08-23 09:58:55 +0530 | [diff] [blame] | 56 | #include "devices.h" |
| 57 | #include "devices-msm7x2xa.h" |
Matt Wagantall | 7cca464 | 2012-02-01 16:43:24 -0800 | [diff] [blame] | 58 | #include "pm.h" |
Taniya Das | c98bfbc | 2011-08-23 09:58:55 +0530 | [diff] [blame] | 59 | #include "timer.h" |
Murali Nalajala | a182784 | 2011-11-13 14:12:39 +0530 | [diff] [blame] | 60 | #include "pm-boot.h" |
Pankaj Kumar | 3cec058 | 2011-11-18 11:13:29 +0530 | [diff] [blame] | 61 | #include "board-msm7x27a-regulator.h" |
Chintan Pandya | cf467fc | 2011-12-01 17:11:11 +0530 | [diff] [blame] | 62 | #include "board-msm7627a.h" |
Taniya Das | c98bfbc | 2011-08-23 09:58:55 +0530 | [diff] [blame] | 63 | |
Trilok Soni | b941079 | 2012-04-07 15:37:13 +0530 | [diff] [blame] | 64 | #define PMEM_KERNEL_EBI1_SIZE 0x3A000 |
Sidipotu Ashok | 4f1ddc9 | 2012-04-11 13:51:34 +0530 | [diff] [blame] | 65 | #define MSM_PMEM_AUDIO_SIZE 0x1F4000 |
Trilok Soni | b941079 | 2012-04-07 15:37:13 +0530 | [diff] [blame] | 66 | #define BAHAMA_SLAVE_ID_FM_REG 0x02 |
| 67 | #define FM_GPIO 83 |
| 68 | #define BT_PCM_BCLK_MODE 0x88 |
| 69 | #define BT_PCM_DIN_MODE 0x89 |
| 70 | #define BT_PCM_DOUT_MODE 0x8A |
| 71 | #define BT_PCM_SYNC_MODE 0x8B |
| 72 | #define FM_I2S_SD_MODE 0x8E |
| 73 | #define FM_I2S_WS_MODE 0x8F |
| 74 | #define FM_I2S_SCK_MODE 0x90 |
| 75 | #define I2C_PIN_CTL 0x15 |
| 76 | #define I2C_NORMAL 0x40 |
| 77 | |
Taniya Das | c98bfbc | 2011-08-23 09:58:55 +0530 | [diff] [blame] | 78 | static struct platform_device msm_wlan_ar6000_pm_device = { |
| 79 | .name = "wlan_ar6000_pm_dev", |
| 80 | .id = -1, |
| 81 | }; |
| 82 | |
Taniya Das | c98bfbc | 2011-08-23 09:58:55 +0530 | [diff] [blame] | 83 | static struct msm_gpio qup_i2c_gpios_io[] = { |
| 84 | { GPIO_CFG(60, 0, GPIO_CFG_OUTPUT, GPIO_CFG_NO_PULL, GPIO_CFG_8MA), |
| 85 | "qup_scl" }, |
| 86 | { GPIO_CFG(61, 0, GPIO_CFG_OUTPUT, GPIO_CFG_NO_PULL, GPIO_CFG_8MA), |
| 87 | "qup_sda" }, |
| 88 | { GPIO_CFG(131, 0, GPIO_CFG_OUTPUT, GPIO_CFG_NO_PULL, GPIO_CFG_8MA), |
| 89 | "qup_scl" }, |
| 90 | { GPIO_CFG(132, 0, GPIO_CFG_OUTPUT, GPIO_CFG_NO_PULL, GPIO_CFG_8MA), |
| 91 | "qup_sda" }, |
| 92 | }; |
| 93 | |
| 94 | static struct msm_gpio qup_i2c_gpios_hw[] = { |
| 95 | { GPIO_CFG(60, 1, GPIO_CFG_INPUT, GPIO_CFG_NO_PULL, GPIO_CFG_8MA), |
| 96 | "qup_scl" }, |
| 97 | { GPIO_CFG(61, 1, GPIO_CFG_INPUT, GPIO_CFG_NO_PULL, GPIO_CFG_8MA), |
| 98 | "qup_sda" }, |
| 99 | { GPIO_CFG(131, 2, GPIO_CFG_INPUT, GPIO_CFG_NO_PULL, GPIO_CFG_8MA), |
| 100 | "qup_scl" }, |
| 101 | { GPIO_CFG(132, 2, GPIO_CFG_INPUT, GPIO_CFG_NO_PULL, GPIO_CFG_8MA), |
| 102 | "qup_sda" }, |
| 103 | }; |
| 104 | |
| 105 | static void gsbi_qup_i2c_gpio_config(int adap_id, int config_type) |
| 106 | { |
| 107 | int rc; |
| 108 | |
| 109 | if (adap_id < 0 || adap_id > 1) |
| 110 | return; |
| 111 | |
| 112 | /* Each adapter gets 2 lines from the table */ |
| 113 | if (config_type) |
| 114 | rc = msm_gpios_request_enable(&qup_i2c_gpios_hw[adap_id*2], 2); |
| 115 | else |
| 116 | rc = msm_gpios_request_enable(&qup_i2c_gpios_io[adap_id*2], 2); |
| 117 | if (rc < 0) |
| 118 | pr_err("QUP GPIO request/enable failed: %d\n", rc); |
| 119 | } |
| 120 | |
| 121 | static struct msm_i2c_platform_data msm_gsbi0_qup_i2c_pdata = { |
| 122 | .clk_freq = 100000, |
| 123 | .msm_i2c_config_gpio = gsbi_qup_i2c_gpio_config, |
| 124 | }; |
| 125 | |
| 126 | static struct msm_i2c_platform_data msm_gsbi1_qup_i2c_pdata = { |
| 127 | .clk_freq = 100000, |
| 128 | .msm_i2c_config_gpio = gsbi_qup_i2c_gpio_config, |
| 129 | }; |
| 130 | |
Trilok Soni | b941079 | 2012-04-07 15:37:13 +0530 | [diff] [blame] | 131 | #ifdef CONFIG_ARCH_MSM7X27A |
Sravan Kumar D.V.N | 2655b11 | 2012-08-02 19:08:30 +0530 | [diff] [blame] | 132 | #define MSM_PMEM_MDP_SIZE 0x1B00000 |
Rajeshwar Kurapaty | 20d7ad1 | 2012-06-22 16:11:06 +0530 | [diff] [blame] | 133 | #define MSM_PMEM_ADSP_SIZE 0x1200000 |
Chintan Pandya | 43d0a34 | 2012-06-08 19:45:56 +0530 | [diff] [blame] | 134 | |
| 135 | #define MSM_ION_AUDIO_SIZE (MSM_PMEM_AUDIO_SIZE + PMEM_KERNEL_EBI1_SIZE) |
| 136 | #define MSM_ION_CAMERA_SIZE MSM_PMEM_ADSP_SIZE |
| 137 | #define MSM_ION_SF_SIZE MSM_PMEM_MDP_SIZE |
| 138 | #define MSM_ION_HEAP_NUM 4 |
| 139 | #ifdef CONFIG_ION_MSM |
| 140 | static struct platform_device ion_dev; |
| 141 | #endif |
Trilok Soni | b941079 | 2012-04-07 15:37:13 +0530 | [diff] [blame] | 142 | #endif |
| 143 | |
Taniya Das | c98bfbc | 2011-08-23 09:58:55 +0530 | [diff] [blame] | 144 | static struct android_usb_platform_data android_usb_pdata = { |
Pankaj Kumar | 6f84174 | 2011-10-10 15:52:14 +0530 | [diff] [blame] | 145 | .update_pid_and_serial_num = usb_diag_update_pid_and_serial_num, |
Rajkumar Raghupathy | c9cb205 | 2012-04-26 13:14:10 +0530 | [diff] [blame] | 146 | .cdrom = 1, |
Taniya Das | c98bfbc | 2011-08-23 09:58:55 +0530 | [diff] [blame] | 147 | }; |
| 148 | |
| 149 | static struct platform_device android_usb_device = { |
| 150 | .name = "android_usb", |
| 151 | .id = -1, |
| 152 | .dev = { |
| 153 | .platform_data = &android_usb_pdata, |
| 154 | }, |
| 155 | }; |
| 156 | |
Taniya Das | c98bfbc | 2011-08-23 09:58:55 +0530 | [diff] [blame] | 157 | #ifdef CONFIG_USB_EHCI_MSM_72K |
| 158 | static void msm_hsusb_vbus_power(unsigned phy_info, int on) |
| 159 | { |
| 160 | int rc = 0; |
| 161 | unsigned gpio; |
| 162 | |
Chintan Pandya | 4076270 | 2011-12-06 13:47:06 +0530 | [diff] [blame] | 163 | gpio = QRD_GPIO_HOST_VBUS_EN; |
Taniya Das | c98bfbc | 2011-08-23 09:58:55 +0530 | [diff] [blame] | 164 | |
| 165 | rc = gpio_request(gpio, "i2c_host_vbus_en"); |
| 166 | if (rc < 0) { |
| 167 | pr_err("failed to request %d GPIO\n", gpio); |
| 168 | return; |
| 169 | } |
| 170 | gpio_direction_output(gpio, !!on); |
| 171 | gpio_set_value_cansleep(gpio, !!on); |
| 172 | gpio_free(gpio); |
| 173 | } |
| 174 | |
| 175 | static struct msm_usb_host_platform_data msm_usb_host_pdata = { |
| 176 | .phy_info = (USB_PHY_INTEGRATED | USB_PHY_MODEL_45NM), |
| 177 | }; |
| 178 | |
| 179 | static void __init msm7627a_init_host(void) |
| 180 | { |
| 181 | msm_add_host(0, &msm_usb_host_pdata); |
| 182 | } |
| 183 | #endif |
| 184 | |
| 185 | #ifdef CONFIG_USB_MSM_OTG_72K |
| 186 | static int hsusb_rpc_connect(int connect) |
| 187 | { |
| 188 | if (connect) |
| 189 | return msm_hsusb_rpc_connect(); |
| 190 | else |
| 191 | return msm_hsusb_rpc_close(); |
| 192 | } |
| 193 | |
Pankaj Kumar | 27c0264 | 2011-09-22 15:55:55 +0530 | [diff] [blame] | 194 | static struct regulator *reg_hsusb; |
Taniya Das | c98bfbc | 2011-08-23 09:58:55 +0530 | [diff] [blame] | 195 | static int msm_hsusb_ldo_init(int init) |
| 196 | { |
Pankaj Kumar | 27c0264 | 2011-09-22 15:55:55 +0530 | [diff] [blame] | 197 | int rc = 0; |
Taniya Das | c98bfbc | 2011-08-23 09:58:55 +0530 | [diff] [blame] | 198 | |
Pankaj Kumar | 27c0264 | 2011-09-22 15:55:55 +0530 | [diff] [blame] | 199 | if (init) { |
| 200 | reg_hsusb = regulator_get(NULL, "usb"); |
| 201 | if (IS_ERR(reg_hsusb)) { |
| 202 | rc = PTR_ERR(reg_hsusb); |
| 203 | pr_err("%s: could not get regulator: %d\n", |
| 204 | __func__, rc); |
| 205 | goto out; |
| 206 | } |
| 207 | |
| 208 | rc = regulator_set_voltage(reg_hsusb, 3300000, 3300000); |
| 209 | if (rc) { |
| 210 | pr_err("%s: could not set voltage: %d\n", |
| 211 | __func__, rc); |
| 212 | goto reg_free; |
| 213 | } |
| 214 | |
| 215 | return 0; |
| 216 | } |
| 217 | /* else fall through */ |
| 218 | reg_free: |
| 219 | regulator_put(reg_hsusb); |
| 220 | out: |
| 221 | reg_hsusb = NULL; |
| 222 | return rc; |
Taniya Das | c98bfbc | 2011-08-23 09:58:55 +0530 | [diff] [blame] | 223 | } |
| 224 | |
| 225 | static int msm_hsusb_ldo_enable(int enable) |
| 226 | { |
| 227 | static int ldo_status; |
| 228 | |
Pankaj Kumar | 27c0264 | 2011-09-22 15:55:55 +0530 | [diff] [blame] | 229 | if (IS_ERR_OR_NULL(reg_hsusb)) |
| 230 | return reg_hsusb ? PTR_ERR(reg_hsusb) : -ENODEV; |
Taniya Das | c98bfbc | 2011-08-23 09:58:55 +0530 | [diff] [blame] | 231 | |
| 232 | if (ldo_status == enable) |
| 233 | return 0; |
| 234 | |
| 235 | ldo_status = enable; |
| 236 | |
Pankaj Kumar | 27c0264 | 2011-09-22 15:55:55 +0530 | [diff] [blame] | 237 | return enable ? |
| 238 | regulator_enable(reg_hsusb) : |
| 239 | regulator_disable(reg_hsusb); |
Taniya Das | c98bfbc | 2011-08-23 09:58:55 +0530 | [diff] [blame] | 240 | } |
| 241 | |
| 242 | #ifndef CONFIG_USB_EHCI_MSM_72K |
| 243 | static int msm_hsusb_pmic_notif_init(void (*callback)(int online), int init) |
| 244 | { |
| 245 | int ret = 0; |
| 246 | |
| 247 | if (init) |
| 248 | ret = msm_pm_app_rpc_init(callback); |
| 249 | else |
| 250 | msm_pm_app_rpc_deinit(callback); |
| 251 | |
| 252 | return ret; |
| 253 | } |
| 254 | #endif |
| 255 | |
| 256 | static struct msm_otg_platform_data msm_otg_pdata = { |
| 257 | #ifndef CONFIG_USB_EHCI_MSM_72K |
| 258 | .pmic_vbus_notif_init = msm_hsusb_pmic_notif_init, |
| 259 | #else |
| 260 | .vbus_power = msm_hsusb_vbus_power, |
| 261 | #endif |
| 262 | .rpc_connect = hsusb_rpc_connect, |
Taniya Das | c98bfbc | 2011-08-23 09:58:55 +0530 | [diff] [blame] | 263 | .pemp_level = PRE_EMPHASIS_WITH_20_PERCENT, |
| 264 | .cdr_autoreset = CDR_AUTO_RESET_DISABLE, |
| 265 | .drv_ampl = HS_DRV_AMPLITUDE_DEFAULT, |
| 266 | .se1_gating = SE1_GATING_DISABLE, |
| 267 | .ldo_init = msm_hsusb_ldo_init, |
| 268 | .ldo_enable = msm_hsusb_ldo_enable, |
| 269 | .chg_init = hsusb_chg_init, |
| 270 | .chg_connected = hsusb_chg_connected, |
| 271 | .chg_vbus_draw = hsusb_chg_vbus_draw, |
| 272 | }; |
| 273 | #endif |
| 274 | |
| 275 | static struct msm_hsusb_gadget_platform_data msm_gadget_pdata = { |
| 276 | .is_phy_status_timer_on = 1, |
| 277 | }; |
| 278 | |
Taniya Das | c98bfbc | 2011-08-23 09:58:55 +0530 | [diff] [blame] | 279 | #ifdef CONFIG_SERIAL_MSM_HS |
| 280 | static struct msm_serial_hs_platform_data msm_uart_dm1_pdata = { |
| 281 | .inject_rx_on_wakeup = 1, |
| 282 | .rx_to_inject = 0xFD, |
| 283 | }; |
| 284 | #endif |
| 285 | static struct msm_pm_platform_data msm7627a_pm_data[MSM_PM_SLEEP_MODE_NR] = { |
| 286 | [MSM_PM_SLEEP_MODE_POWER_COLLAPSE] = { |
| 287 | .idle_supported = 1, |
| 288 | .suspend_supported = 1, |
| 289 | .idle_enabled = 1, |
| 290 | .suspend_enabled = 1, |
| 291 | .latency = 16000, |
| 292 | .residency = 20000, |
| 293 | }, |
| 294 | [MSM_PM_SLEEP_MODE_POWER_COLLAPSE_NO_XO_SHUTDOWN] = { |
| 295 | .idle_supported = 1, |
| 296 | .suspend_supported = 1, |
| 297 | .idle_enabled = 1, |
| 298 | .suspend_enabled = 1, |
| 299 | .latency = 12000, |
| 300 | .residency = 20000, |
| 301 | }, |
| 302 | [MSM_PM_SLEEP_MODE_RAMP_DOWN_AND_WAIT_FOR_INTERRUPT] = { |
| 303 | .idle_supported = 1, |
| 304 | .suspend_supported = 1, |
| 305 | .idle_enabled = 0, |
| 306 | .suspend_enabled = 1, |
| 307 | .latency = 2000, |
| 308 | .residency = 0, |
| 309 | }, |
| 310 | [MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT] = { |
| 311 | .idle_supported = 1, |
| 312 | .suspend_supported = 1, |
| 313 | .idle_enabled = 1, |
| 314 | .suspend_enabled = 1, |
| 315 | .latency = 2, |
| 316 | .residency = 0, |
| 317 | }, |
| 318 | }; |
| 319 | |
Maheshkumar Sivasubramanian | c6c5503 | 2011-10-25 16:01:32 -0600 | [diff] [blame] | 320 | static struct msm_pm_boot_platform_data msm_pm_boot_pdata __initdata = { |
Sravan Kumar Ambapuram | b22cf4d | 2012-01-02 21:45:04 +0530 | [diff] [blame] | 321 | .mode = MSM_PM_BOOT_CONFIG_RESET_VECTOR_PHYS, |
| 322 | .p_addr = 0, |
Maheshkumar Sivasubramanian | c6c5503 | 2011-10-25 16:01:32 -0600 | [diff] [blame] | 323 | }; |
| 324 | |
Murali Nalajala | 4c996be | 2012-03-12 17:05:41 +0530 | [diff] [blame] | 325 | /* 8625 PM platform data */ |
| 326 | static struct msm_pm_platform_data msm8625_pm_data[MSM_PM_SLEEP_MODE_NR * 2] = { |
| 327 | /* CORE0 entries */ |
| 328 | [MSM_PM_MODE(0, MSM_PM_SLEEP_MODE_POWER_COLLAPSE)] = { |
| 329 | .idle_supported = 1, |
| 330 | .suspend_supported = 1, |
| 331 | .idle_enabled = 0, |
| 332 | .suspend_enabled = 0, |
| 333 | .latency = 16000, |
| 334 | .residency = 20000, |
| 335 | }, |
| 336 | |
| 337 | [MSM_PM_MODE(0, MSM_PM_SLEEP_MODE_POWER_COLLAPSE_NO_XO_SHUTDOWN)] = { |
| 338 | .idle_supported = 1, |
| 339 | .suspend_supported = 1, |
| 340 | .idle_enabled = 0, |
| 341 | .suspend_enabled = 0, |
| 342 | .latency = 12000, |
| 343 | .residency = 20000, |
| 344 | }, |
| 345 | |
| 346 | /* picked latency & redisdency values from 7x30 */ |
| 347 | [MSM_PM_MODE(0, MSM_PM_SLEEP_MODE_POWER_COLLAPSE_STANDALONE)] = { |
| 348 | .idle_supported = 1, |
| 349 | .suspend_supported = 1, |
| 350 | .idle_enabled = 0, |
| 351 | .suspend_enabled = 0, |
| 352 | .latency = 500, |
| 353 | .residency = 6000, |
| 354 | }, |
| 355 | |
| 356 | [MSM_PM_MODE(0, MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT)] = { |
| 357 | .idle_supported = 1, |
| 358 | .suspend_supported = 1, |
| 359 | .idle_enabled = 1, |
| 360 | .suspend_enabled = 1, |
| 361 | .latency = 2, |
| 362 | .residency = 10, |
| 363 | }, |
| 364 | |
| 365 | /* picked latency & redisdency values from 7x30 */ |
| 366 | [MSM_PM_MODE(1, MSM_PM_SLEEP_MODE_POWER_COLLAPSE_STANDALONE)] = { |
| 367 | .idle_supported = 1, |
| 368 | .suspend_supported = 1, |
| 369 | .idle_enabled = 0, |
| 370 | .suspend_enabled = 0, |
| 371 | .latency = 500, |
| 372 | .residency = 6000, |
| 373 | }, |
| 374 | |
| 375 | [MSM_PM_MODE(1, MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT)] = { |
| 376 | .idle_supported = 1, |
| 377 | .suspend_supported = 1, |
| 378 | .idle_enabled = 1, |
| 379 | .suspend_enabled = 1, |
| 380 | .latency = 2, |
| 381 | .residency = 10, |
| 382 | }, |
| 383 | |
| 384 | }; |
| 385 | |
| 386 | static struct msm_pm_boot_platform_data msm_pm_8625_boot_pdata __initdata = { |
| 387 | .mode = MSM_PM_BOOT_CONFIG_REMAP_BOOT_ADDR, |
| 388 | .v_addr = MSM_CFG_CTL_BASE, |
| 389 | }; |
| 390 | |
Trilok Soni | b941079 | 2012-04-07 15:37:13 +0530 | [diff] [blame] | 391 | static struct android_pmem_platform_data android_pmem_adsp_pdata = { |
| 392 | .name = "pmem_adsp", |
| 393 | .allocator_type = PMEM_ALLOCATORTYPE_BITMAP, |
| 394 | .cached = 1, |
| 395 | .memory_type = MEMTYPE_EBI1, |
| 396 | }; |
| 397 | |
| 398 | static struct platform_device android_pmem_adsp_device = { |
| 399 | .name = "android_pmem", |
| 400 | .id = 1, |
| 401 | .dev = { .platform_data = &android_pmem_adsp_pdata }, |
| 402 | }; |
| 403 | |
| 404 | static unsigned pmem_mdp_size = MSM_PMEM_MDP_SIZE; |
| 405 | static int __init pmem_mdp_size_setup(char *p) |
| 406 | { |
| 407 | pmem_mdp_size = memparse(p, NULL); |
| 408 | return 0; |
| 409 | } |
| 410 | |
| 411 | early_param("pmem_mdp_size", pmem_mdp_size_setup); |
| 412 | |
| 413 | static unsigned pmem_adsp_size = MSM_PMEM_ADSP_SIZE; |
| 414 | static int __init pmem_adsp_size_setup(char *p) |
| 415 | { |
| 416 | pmem_adsp_size = memparse(p, NULL); |
| 417 | return 0; |
| 418 | } |
| 419 | |
| 420 | early_param("pmem_adsp_size", pmem_adsp_size_setup); |
| 421 | |
| 422 | #define SND(desc, num) { .name = #desc, .id = num } |
| 423 | static struct snd_endpoint snd_endpoints_list[] = { |
| 424 | SND(HANDSET, 0), |
| 425 | SND(MONO_HEADSET, 2), |
| 426 | SND(HEADSET, 3), |
| 427 | SND(SPEAKER, 6), |
| 428 | SND(TTY_HEADSET, 8), |
| 429 | SND(TTY_VCO, 9), |
| 430 | SND(TTY_HCO, 10), |
| 431 | SND(BT, 12), |
| 432 | SND(IN_S_SADC_OUT_HANDSET, 16), |
| 433 | SND(IN_S_SADC_OUT_SPEAKER_PHONE, 25), |
| 434 | SND(FM_DIGITAL_STEREO_HEADSET, 26), |
| 435 | SND(FM_DIGITAL_SPEAKER_PHONE, 27), |
| 436 | SND(FM_DIGITAL_BT_A2DP_HEADSET, 28), |
| 437 | SND(STEREO_HEADSET_AND_SPEAKER, 31), |
| 438 | SND(CURRENT, 0x7FFFFFFE), |
| 439 | SND(FM_ANALOG_STEREO_HEADSET, 35), |
| 440 | SND(FM_ANALOG_STEREO_HEADSET_CODEC, 36), |
| 441 | }; |
| 442 | #undef SND |
| 443 | |
| 444 | static struct msm_snd_endpoints msm_device_snd_endpoints = { |
| 445 | .endpoints = snd_endpoints_list, |
| 446 | .num = sizeof(snd_endpoints_list) / sizeof(struct snd_endpoint) |
| 447 | }; |
| 448 | |
| 449 | static struct platform_device msm_device_snd = { |
| 450 | .name = "msm_snd", |
| 451 | .id = -1, |
| 452 | .dev = { |
| 453 | .platform_data = &msm_device_snd_endpoints |
| 454 | }, |
| 455 | }; |
| 456 | |
| 457 | #define DEC0_FORMAT ((1<<MSM_ADSP_CODEC_MP3)| \ |
| 458 | (1<<MSM_ADSP_CODEC_AAC)|(1<<MSM_ADSP_CODEC_WMA)| \ |
| 459 | (1<<MSM_ADSP_CODEC_WMAPRO)|(1<<MSM_ADSP_CODEC_AMRWB)| \ |
| 460 | (1<<MSM_ADSP_CODEC_AMRNB)|(1<<MSM_ADSP_CODEC_WAV)| \ |
| 461 | (1<<MSM_ADSP_CODEC_ADPCM)|(1<<MSM_ADSP_CODEC_YADPCM)| \ |
| 462 | (1<<MSM_ADSP_CODEC_EVRC)|(1<<MSM_ADSP_CODEC_QCELP)) |
| 463 | #define DEC1_FORMAT ((1<<MSM_ADSP_CODEC_MP3)| \ |
| 464 | (1<<MSM_ADSP_CODEC_AAC)|(1<<MSM_ADSP_CODEC_WMA)| \ |
| 465 | (1<<MSM_ADSP_CODEC_WMAPRO)|(1<<MSM_ADSP_CODEC_AMRWB)| \ |
| 466 | (1<<MSM_ADSP_CODEC_AMRNB)|(1<<MSM_ADSP_CODEC_WAV)| \ |
| 467 | (1<<MSM_ADSP_CODEC_ADPCM)|(1<<MSM_ADSP_CODEC_YADPCM)| \ |
| 468 | (1<<MSM_ADSP_CODEC_EVRC)|(1<<MSM_ADSP_CODEC_QCELP)) |
| 469 | #define DEC2_FORMAT ((1<<MSM_ADSP_CODEC_MP3)| \ |
| 470 | (1<<MSM_ADSP_CODEC_AAC)|(1<<MSM_ADSP_CODEC_WMA)| \ |
| 471 | (1<<MSM_ADSP_CODEC_WMAPRO)|(1<<MSM_ADSP_CODEC_AMRWB)| \ |
| 472 | (1<<MSM_ADSP_CODEC_AMRNB)|(1<<MSM_ADSP_CODEC_WAV)| \ |
| 473 | (1<<MSM_ADSP_CODEC_ADPCM)|(1<<MSM_ADSP_CODEC_YADPCM)| \ |
| 474 | (1<<MSM_ADSP_CODEC_EVRC)|(1<<MSM_ADSP_CODEC_QCELP)) |
| 475 | #define DEC3_FORMAT ((1<<MSM_ADSP_CODEC_MP3)| \ |
| 476 | (1<<MSM_ADSP_CODEC_AAC)|(1<<MSM_ADSP_CODEC_WMA)| \ |
| 477 | (1<<MSM_ADSP_CODEC_WMAPRO)|(1<<MSM_ADSP_CODEC_AMRWB)| \ |
| 478 | (1<<MSM_ADSP_CODEC_AMRNB)|(1<<MSM_ADSP_CODEC_WAV)| \ |
| 479 | (1<<MSM_ADSP_CODEC_ADPCM)|(1<<MSM_ADSP_CODEC_YADPCM)| \ |
| 480 | (1<<MSM_ADSP_CODEC_EVRC)|(1<<MSM_ADSP_CODEC_QCELP)) |
| 481 | #define DEC4_FORMAT (1<<MSM_ADSP_CODEC_MIDI) |
| 482 | |
| 483 | static unsigned int dec_concurrency_table[] = { |
| 484 | /* Audio LP */ |
| 485 | (DEC0_FORMAT|(1<<MSM_ADSP_MODE_TUNNEL)|(1<<MSM_ADSP_OP_DMA)), 0, |
| 486 | 0, 0, 0, |
| 487 | |
| 488 | /* Concurrency 1 */ |
| 489 | (DEC0_FORMAT|(1<<MSM_ADSP_MODE_TUNNEL)|(1<<MSM_ADSP_OP_DM)), |
| 490 | (DEC1_FORMAT|(1<<MSM_ADSP_MODE_TUNNEL)|(1<<MSM_ADSP_OP_DM)), |
| 491 | (DEC2_FORMAT|(1<<MSM_ADSP_MODE_TUNNEL)|(1<<MSM_ADSP_OP_DM)), |
| 492 | (DEC3_FORMAT|(1<<MSM_ADSP_MODE_TUNNEL)|(1<<MSM_ADSP_OP_DM)), |
| 493 | (DEC4_FORMAT), |
| 494 | |
| 495 | /* Concurrency 2 */ |
| 496 | (DEC0_FORMAT|(1<<MSM_ADSP_MODE_TUNNEL)|(1<<MSM_ADSP_OP_DM)), |
| 497 | (DEC1_FORMAT|(1<<MSM_ADSP_MODE_TUNNEL)|(1<<MSM_ADSP_OP_DM)), |
| 498 | (DEC2_FORMAT|(1<<MSM_ADSP_MODE_TUNNEL)|(1<<MSM_ADSP_OP_DM)), |
| 499 | (DEC3_FORMAT|(1<<MSM_ADSP_MODE_TUNNEL)|(1<<MSM_ADSP_OP_DM)), |
| 500 | (DEC4_FORMAT), |
| 501 | |
| 502 | /* Concurrency 3 */ |
| 503 | (DEC0_FORMAT|(1<<MSM_ADSP_MODE_TUNNEL)|(1<<MSM_ADSP_OP_DM)), |
| 504 | (DEC1_FORMAT|(1<<MSM_ADSP_MODE_TUNNEL)|(1<<MSM_ADSP_OP_DM)), |
| 505 | (DEC2_FORMAT|(1<<MSM_ADSP_MODE_TUNNEL)|(1<<MSM_ADSP_OP_DM)), |
| 506 | (DEC3_FORMAT|(1<<MSM_ADSP_MODE_NONTUNNEL)|(1<<MSM_ADSP_OP_DM)), |
| 507 | (DEC4_FORMAT), |
| 508 | |
| 509 | /* Concurrency 4 */ |
| 510 | (DEC0_FORMAT|(1<<MSM_ADSP_MODE_TUNNEL)|(1<<MSM_ADSP_OP_DM)), |
| 511 | (DEC1_FORMAT|(1<<MSM_ADSP_MODE_TUNNEL)|(1<<MSM_ADSP_OP_DM)), |
| 512 | (DEC2_FORMAT|(1<<MSM_ADSP_MODE_NONTUNNEL)|(1<<MSM_ADSP_OP_DM)), |
| 513 | (DEC3_FORMAT|(1<<MSM_ADSP_MODE_NONTUNNEL)|(1<<MSM_ADSP_OP_DM)), |
| 514 | (DEC4_FORMAT), |
| 515 | |
| 516 | /* Concurrency 5 */ |
| 517 | (DEC0_FORMAT|(1<<MSM_ADSP_MODE_TUNNEL)|(1<<MSM_ADSP_OP_DM)), |
| 518 | (DEC1_FORMAT|(1<<MSM_ADSP_MODE_NONTUNNEL)|(1<<MSM_ADSP_OP_DM)), |
| 519 | (DEC2_FORMAT|(1<<MSM_ADSP_MODE_NONTUNNEL)|(1<<MSM_ADSP_OP_DM)), |
| 520 | (DEC3_FORMAT|(1<<MSM_ADSP_MODE_NONTUNNEL)|(1<<MSM_ADSP_OP_DM)), |
| 521 | (DEC4_FORMAT), |
| 522 | |
| 523 | /* Concurrency 6 */ |
Chaithanya Krishna Bacharaju | 72ab89b | 2012-05-11 14:24:04 +0530 | [diff] [blame] | 524 | (DEC0_FORMAT|(1<<MSM_ADSP_MODE_TUNNEL)| |
| 525 | (1<<MSM_ADSP_MODE_NONTUNNEL)|(1<<MSM_ADSP_OP_DM)), |
| 526 | 0, 0, 0, 0, |
Trilok Soni | b941079 | 2012-04-07 15:37:13 +0530 | [diff] [blame] | 527 | |
| 528 | /* Concurrency 7 */ |
| 529 | (DEC0_FORMAT|(1<<MSM_ADSP_MODE_NONTUNNEL)|(1<<MSM_ADSP_OP_DM)), |
| 530 | (DEC1_FORMAT|(1<<MSM_ADSP_MODE_NONTUNNEL)|(1<<MSM_ADSP_OP_DM)), |
| 531 | (DEC2_FORMAT|(1<<MSM_ADSP_MODE_NONTUNNEL)|(1<<MSM_ADSP_OP_DM)), |
| 532 | (DEC3_FORMAT|(1<<MSM_ADSP_MODE_NONTUNNEL)|(1<<MSM_ADSP_OP_DM)), |
| 533 | (DEC4_FORMAT), |
| 534 | }; |
| 535 | |
| 536 | #define DEC_INFO(name, queueid, decid, nr_codec) { .module_name = name, \ |
| 537 | .module_queueid = queueid, .module_decid = decid, \ |
| 538 | .nr_codec_support = nr_codec} |
| 539 | |
| 540 | static struct msm_adspdec_info dec_info_list[] = { |
| 541 | DEC_INFO("AUDPLAY0TASK", 13, 0, 11), /* AudPlay0BitStreamCtrlQueue */ |
| 542 | DEC_INFO("AUDPLAY1TASK", 14, 1, 11), /* AudPlay1BitStreamCtrlQueue */ |
| 543 | DEC_INFO("AUDPLAY2TASK", 15, 2, 11), /* AudPlay2BitStreamCtrlQueue */ |
| 544 | DEC_INFO("AUDPLAY3TASK", 16, 3, 11), /* AudPlay3BitStreamCtrlQueue */ |
| 545 | DEC_INFO("AUDPLAY4TASK", 17, 4, 1), /* AudPlay4BitStreamCtrlQueue */ |
| 546 | }; |
| 547 | |
| 548 | static struct msm_adspdec_database msm_device_adspdec_database = { |
| 549 | .num_dec = ARRAY_SIZE(dec_info_list), |
| 550 | .num_concurrency_support = (ARRAY_SIZE(dec_concurrency_table) / \ |
| 551 | ARRAY_SIZE(dec_info_list)), |
| 552 | .dec_concurrency_table = dec_concurrency_table, |
| 553 | .dec_info_list = dec_info_list, |
| 554 | }; |
| 555 | |
| 556 | static struct platform_device msm_device_adspdec = { |
| 557 | .name = "msm_adspdec", |
| 558 | .id = -1, |
| 559 | .dev = { |
| 560 | .platform_data = &msm_device_adspdec_database |
| 561 | }, |
| 562 | }; |
| 563 | |
| 564 | static struct android_pmem_platform_data android_pmem_audio_pdata = { |
| 565 | .name = "pmem_audio", |
| 566 | .allocator_type = PMEM_ALLOCATORTYPE_BITMAP, |
| 567 | .cached = 0, |
| 568 | .memory_type = MEMTYPE_EBI1, |
| 569 | }; |
| 570 | |
| 571 | static struct platform_device android_pmem_audio_device = { |
| 572 | .name = "android_pmem", |
| 573 | .id = 2, |
| 574 | .dev = { .platform_data = &android_pmem_audio_pdata }, |
| 575 | }; |
| 576 | |
| 577 | static struct android_pmem_platform_data android_pmem_pdata = { |
| 578 | .name = "pmem", |
| 579 | .allocator_type = PMEM_ALLOCATORTYPE_BITMAP, |
| 580 | .cached = 1, |
| 581 | .memory_type = MEMTYPE_EBI1, |
| 582 | }; |
| 583 | static struct platform_device android_pmem_device = { |
| 584 | .name = "android_pmem", |
| 585 | .id = 0, |
| 586 | .dev = { .platform_data = &android_pmem_pdata }, |
| 587 | }; |
| 588 | |
Taniya Das | c98bfbc | 2011-08-23 09:58:55 +0530 | [diff] [blame] | 589 | static u32 msm_calculate_batt_capacity(u32 current_voltage); |
| 590 | |
| 591 | static struct msm_psy_batt_pdata msm_psy_batt_data = { |
Krishna Vanka | b377811 | 2012-07-16 11:36:12 +0530 | [diff] [blame] | 592 | .voltage_min_design = 3500, |
Krishna Vanka | 9a265e1 | 2012-06-04 23:24:26 +0530 | [diff] [blame] | 593 | .voltage_max_design = 4200, |
Krishna Vanka | b377811 | 2012-07-16 11:36:12 +0530 | [diff] [blame] | 594 | .voltage_fail_safe = 3598, |
Taniya Das | c98bfbc | 2011-08-23 09:58:55 +0530 | [diff] [blame] | 595 | .avail_chg_sources = AC_CHG | USB_CHG , |
| 596 | .batt_technology = POWER_SUPPLY_TECHNOLOGY_LION, |
| 597 | .calculate_capacity = &msm_calculate_batt_capacity, |
| 598 | }; |
| 599 | |
| 600 | static u32 msm_calculate_batt_capacity(u32 current_voltage) |
| 601 | { |
| 602 | u32 low_voltage = msm_psy_batt_data.voltage_min_design; |
| 603 | u32 high_voltage = msm_psy_batt_data.voltage_max_design; |
| 604 | |
Krishna Vanka | b349469 | 2012-06-12 15:06:43 +0530 | [diff] [blame] | 605 | if (current_voltage <= low_voltage) |
| 606 | return 0; |
| 607 | else if (current_voltage >= high_voltage) |
| 608 | return 100; |
| 609 | else |
| 610 | return (current_voltage - low_voltage) * 100 |
Taniya Das | c98bfbc | 2011-08-23 09:58:55 +0530 | [diff] [blame] | 611 | / (high_voltage - low_voltage); |
| 612 | } |
| 613 | |
| 614 | static struct platform_device msm_batt_device = { |
| 615 | .name = "msm-battery", |
| 616 | .id = -1, |
| 617 | .dev.platform_data = &msm_psy_batt_data, |
| 618 | }; |
| 619 | |
Siddartha Mohanadoss | bc2103f | 2012-03-20 11:41:48 -0700 | [diff] [blame] | 620 | static char *msm_adc_surf_device_names[] = { |
| 621 | "XO_ADC", |
| 622 | }; |
| 623 | |
| 624 | static struct msm_adc_platform_data msm_adc_pdata = { |
| 625 | .dev_names = msm_adc_surf_device_names, |
| 626 | .num_adc = ARRAY_SIZE(msm_adc_surf_device_names), |
| 627 | .target_hw = MSM_8x25, |
| 628 | }; |
| 629 | |
| 630 | static struct platform_device msm_adc_device = { |
| 631 | .name = "msm_adc", |
| 632 | .id = -1, |
| 633 | .dev = { |
| 634 | .platform_data = &msm_adc_pdata, |
| 635 | }, |
| 636 | }; |
| 637 | |
Trilok Soni | 0ed9c4a | 2012-05-22 17:54:32 +0530 | [diff] [blame] | 638 | #define GPIO_VREG_INIT(_id, _reg_name, _gpio_label, _gpio, _active_low) \ |
| 639 | [GPIO_VREG_ID_##_id] = { \ |
| 640 | .init_data = { \ |
| 641 | .constraints = { \ |
| 642 | .valid_ops_mask = REGULATOR_CHANGE_STATUS, \ |
| 643 | }, \ |
| 644 | .num_consumer_supplies = \ |
| 645 | ARRAY_SIZE(vreg_consumers_##_id), \ |
| 646 | .consumer_supplies = vreg_consumers_##_id, \ |
| 647 | }, \ |
| 648 | .regulator_name = _reg_name, \ |
| 649 | .active_low = _active_low, \ |
| 650 | .gpio_label = _gpio_label, \ |
| 651 | .gpio = _gpio, \ |
| 652 | } |
| 653 | |
| 654 | #define GPIO_VREG_ID_EXT_2P85V 0 |
| 655 | #define GPIO_VREG_ID_EXT_1P8V 1 |
| 656 | |
| 657 | static struct regulator_consumer_supply vreg_consumers_EXT_2P85V[] = { |
Raju P.L.S.S.S.N | 4d01b2c | 2012-06-13 20:13:27 +0530 | [diff] [blame] | 658 | REGULATOR_SUPPLY("cam_ov5647_avdd", "0-006c"), |
| 659 | REGULATOR_SUPPLY("cam_ov7692_avdd", "0-0078"), |
| 660 | REGULATOR_SUPPLY("cam_ov8825_avdd", "0-000d"), |
Trilok Soni | 0ed9c4a | 2012-05-22 17:54:32 +0530 | [diff] [blame] | 661 | REGULATOR_SUPPLY("lcd_vdd", "mipi_dsi.1"), |
| 662 | }; |
| 663 | |
| 664 | static struct regulator_consumer_supply vreg_consumers_EXT_1P8V[] = { |
Raju P.L.S.S.S.N | 4d01b2c | 2012-06-13 20:13:27 +0530 | [diff] [blame] | 665 | REGULATOR_SUPPLY("cam_ov5647_vdd", "0-006c"), |
| 666 | REGULATOR_SUPPLY("cam_ov7692_vdd", "0-0078"), |
| 667 | REGULATOR_SUPPLY("cam_ov8825_vdd", "0-000d"), |
Trilok Soni | 0ed9c4a | 2012-05-22 17:54:32 +0530 | [diff] [blame] | 668 | REGULATOR_SUPPLY("lcd_vddi", "mipi_dsi.1"), |
| 669 | }; |
| 670 | |
| 671 | /* GPIO regulator constraints */ |
| 672 | static struct gpio_regulator_platform_data msm_gpio_regulator_pdata[] = { |
| 673 | GPIO_VREG_INIT(EXT_2P85V, "ext_2p85v", "ext_2p85v_en", 35, 0), |
| 674 | GPIO_VREG_INIT(EXT_1P8V, "ext_1p8v", "ext_1p8v_en", 40, 0), |
| 675 | }; |
| 676 | |
| 677 | /* GPIO regulator */ |
Aparna Mallavarapu | 336c78d | 2012-07-02 19:43:18 +0530 | [diff] [blame] | 678 | static struct platform_device qrd_vreg_gpio_ext_2p85v __devinitdata = { |
Trilok Soni | 0ed9c4a | 2012-05-22 17:54:32 +0530 | [diff] [blame] | 679 | .name = GPIO_REGULATOR_DEV_NAME, |
| 680 | .id = 35, |
| 681 | .dev = { |
| 682 | .platform_data = |
| 683 | &msm_gpio_regulator_pdata[GPIO_VREG_ID_EXT_2P85V], |
| 684 | }, |
| 685 | }; |
| 686 | |
Aparna Mallavarapu | 336c78d | 2012-07-02 19:43:18 +0530 | [diff] [blame] | 687 | static struct platform_device qrd_vreg_gpio_ext_1p8v __devinitdata = { |
Trilok Soni | 0ed9c4a | 2012-05-22 17:54:32 +0530 | [diff] [blame] | 688 | .name = GPIO_REGULATOR_DEV_NAME, |
| 689 | .id = 40, |
| 690 | .dev = { |
| 691 | .platform_data = |
| 692 | &msm_gpio_regulator_pdata[GPIO_VREG_ID_EXT_1P8V], |
| 693 | }, |
| 694 | }; |
| 695 | |
Chintan Pandya | f4ad400 | 2012-02-28 19:49:03 +0530 | [diff] [blame] | 696 | static struct platform_device *common_devices[] __initdata = { |
| 697 | &android_usb_device, |
Trilok Soni | b941079 | 2012-04-07 15:37:13 +0530 | [diff] [blame] | 698 | &android_pmem_device, |
| 699 | &android_pmem_adsp_device, |
| 700 | &android_pmem_audio_device, |
Chintan Pandya | f4ad400 | 2012-02-28 19:49:03 +0530 | [diff] [blame] | 701 | &msm_batt_device, |
Trilok Soni | b941079 | 2012-04-07 15:37:13 +0530 | [diff] [blame] | 702 | &msm_device_adspdec, |
| 703 | &msm_device_snd, |
Chintan Pandya | f4ad400 | 2012-02-28 19:49:03 +0530 | [diff] [blame] | 704 | &asoc_msm_pcm, |
| 705 | &asoc_msm_dai0, |
| 706 | &asoc_msm_dai1, |
Siddartha Mohanadoss | bc2103f | 2012-03-20 11:41:48 -0700 | [diff] [blame] | 707 | &msm_adc_device, |
Chintan Pandya | 43d0a34 | 2012-06-08 19:45:56 +0530 | [diff] [blame] | 708 | #ifdef CONFIG_ION_MSM |
| 709 | &ion_dev, |
| 710 | #endif |
Chintan Pandya | f4ad400 | 2012-02-28 19:49:03 +0530 | [diff] [blame] | 711 | }; |
| 712 | |
| 713 | static struct platform_device *qrd7627a_devices[] __initdata = { |
Taniya Das | c98bfbc | 2011-08-23 09:58:55 +0530 | [diff] [blame] | 714 | &msm_device_dmov, |
| 715 | &msm_device_smd, |
| 716 | &msm_device_uart1, |
| 717 | &msm_device_uart_dm1, |
| 718 | &msm_gsbi0_qup_i2c_device, |
| 719 | &msm_gsbi1_qup_i2c_device, |
| 720 | &msm_device_otg, |
| 721 | &msm_device_gadget_peripheral, |
Taniya Das | c98bfbc | 2011-08-23 09:58:55 +0530 | [diff] [blame] | 722 | &msm_kgsl_3d0, |
Aparna Mallavarapu | 336c78d | 2012-07-02 19:43:18 +0530 | [diff] [blame] | 723 | &qrd_vreg_gpio_ext_2p85v, |
| 724 | &qrd_vreg_gpio_ext_1p8v, |
Taniya Das | c98bfbc | 2011-08-23 09:58:55 +0530 | [diff] [blame] | 725 | }; |
| 726 | |
Chintan Pandya | b1bad0e | 2012-02-06 19:04:51 +0530 | [diff] [blame] | 727 | static struct platform_device *qrd3_devices[] __initdata = { |
| 728 | &msm_device_nand, |
| 729 | }; |
| 730 | |
Chintan Pandya | f4ad400 | 2012-02-28 19:49:03 +0530 | [diff] [blame] | 731 | static struct platform_device *msm8625_evb_devices[] __initdata = { |
| 732 | &msm8625_device_dmov, |
| 733 | &msm8625_device_smd, |
| 734 | &msm8625_gsbi0_qup_i2c_device, |
| 735 | &msm8625_gsbi1_qup_i2c_device, |
| 736 | &msm8625_device_uart1, |
Ram Mohan Korukonda | 5ee9fb8 | 2012-03-09 12:10:01 +0530 | [diff] [blame] | 737 | &msm8625_device_uart_dm1, |
Chintan Pandya | f4ad400 | 2012-02-28 19:49:03 +0530 | [diff] [blame] | 738 | &msm8625_device_otg, |
| 739 | &msm8625_device_gadget_peripheral, |
Aparna Mallavarapu | d95d8fc | 2012-03-08 12:07:37 +0530 | [diff] [blame] | 740 | &msm8625_kgsl_3d0, |
Aparna Mallavarapu | 336c78d | 2012-07-02 19:43:18 +0530 | [diff] [blame] | 741 | &qrd_vreg_gpio_ext_2p85v, |
| 742 | &qrd_vreg_gpio_ext_1p8v, |
Chintan Pandya | f4ad400 | 2012-02-28 19:49:03 +0530 | [diff] [blame] | 743 | }; |
| 744 | |
Trilok Soni | b941079 | 2012-04-07 15:37:13 +0530 | [diff] [blame] | 745 | static unsigned pmem_kernel_ebi1_size = PMEM_KERNEL_EBI1_SIZE; |
| 746 | static int __init pmem_kernel_ebi1_size_setup(char *p) |
| 747 | { |
| 748 | pmem_kernel_ebi1_size = memparse(p, NULL); |
| 749 | return 0; |
| 750 | } |
| 751 | early_param("pmem_kernel_ebi1_size", pmem_kernel_ebi1_size_setup); |
| 752 | |
| 753 | static unsigned pmem_audio_size = MSM_PMEM_AUDIO_SIZE; |
| 754 | static int __init pmem_audio_size_setup(char *p) |
| 755 | { |
| 756 | pmem_audio_size = memparse(p, NULL); |
| 757 | return 0; |
| 758 | } |
| 759 | early_param("pmem_audio_size", pmem_audio_size_setup); |
| 760 | |
Chintan Pandya | 43d0a34 | 2012-06-08 19:45:56 +0530 | [diff] [blame] | 761 | #ifdef CONFIG_ION_MSM |
| 762 | #ifdef CONFIG_MSM_MULTIMEDIA_USE_ION |
| 763 | static struct ion_co_heap_pdata co_ion_pdata = { |
| 764 | .adjacent_mem_id = INVALID_HEAP_ID, |
| 765 | .align = PAGE_SIZE, |
| 766 | }; |
| 767 | #endif |
| 768 | |
| 769 | /** |
| 770 | * These heaps are listed in the order they will be allocated. |
| 771 | * Don't swap the order unless you know what you are doing! |
| 772 | */ |
| 773 | static struct ion_platform_data ion_pdata = { |
| 774 | .nr = MSM_ION_HEAP_NUM, |
Chintan Pandya | 8ce738d | 2012-07-27 13:21:06 +0530 | [diff] [blame] | 775 | .has_outer_cache = 1, |
Chintan Pandya | 43d0a34 | 2012-06-08 19:45:56 +0530 | [diff] [blame] | 776 | .heaps = { |
| 777 | { |
| 778 | .id = ION_SYSTEM_HEAP_ID, |
| 779 | .type = ION_HEAP_TYPE_SYSTEM, |
| 780 | .name = ION_VMALLOC_HEAP_NAME, |
| 781 | }, |
| 782 | #ifdef CONFIG_MSM_MULTIMEDIA_USE_ION |
| 783 | /* PMEM_ADSP = CAMERA */ |
| 784 | { |
| 785 | .id = ION_CAMERA_HEAP_ID, |
| 786 | .type = ION_HEAP_TYPE_CARVEOUT, |
| 787 | .name = ION_CAMERA_HEAP_NAME, |
| 788 | .size = MSM_ION_CAMERA_SIZE, |
| 789 | .memory_type = ION_EBI_TYPE, |
Chintan Pandya | 43d0a34 | 2012-06-08 19:45:56 +0530 | [diff] [blame] | 790 | .extra_data = (void *)&co_ion_pdata, |
| 791 | }, |
| 792 | /* PMEM_AUDIO */ |
| 793 | { |
| 794 | .id = ION_AUDIO_HEAP_ID, |
| 795 | .type = ION_HEAP_TYPE_CARVEOUT, |
| 796 | .name = ION_AUDIO_HEAP_NAME, |
| 797 | .size = MSM_ION_AUDIO_SIZE, |
| 798 | .memory_type = ION_EBI_TYPE, |
Chintan Pandya | 43d0a34 | 2012-06-08 19:45:56 +0530 | [diff] [blame] | 799 | .extra_data = (void *)&co_ion_pdata, |
| 800 | }, |
| 801 | /* PMEM_MDP = SF */ |
| 802 | { |
| 803 | .id = ION_SF_HEAP_ID, |
| 804 | .type = ION_HEAP_TYPE_CARVEOUT, |
| 805 | .name = ION_SF_HEAP_NAME, |
| 806 | .size = MSM_ION_SF_SIZE, |
| 807 | .memory_type = ION_EBI_TYPE, |
Chintan Pandya | 43d0a34 | 2012-06-08 19:45:56 +0530 | [diff] [blame] | 808 | .extra_data = (void *)&co_ion_pdata, |
| 809 | }, |
| 810 | #endif |
| 811 | } |
| 812 | }; |
| 813 | |
| 814 | static struct platform_device ion_dev = { |
| 815 | .name = "ion-msm", |
| 816 | .id = 1, |
| 817 | .dev = { .platform_data = &ion_pdata }, |
| 818 | }; |
| 819 | #endif |
| 820 | |
Trilok Soni | b941079 | 2012-04-07 15:37:13 +0530 | [diff] [blame] | 821 | static struct memtype_reserve msm7627a_reserve_table[] __initdata = { |
| 822 | [MEMTYPE_SMI] = { |
| 823 | }, |
| 824 | [MEMTYPE_EBI0] = { |
| 825 | .flags = MEMTYPE_FLAGS_1M_ALIGN, |
| 826 | }, |
| 827 | [MEMTYPE_EBI1] = { |
| 828 | .flags = MEMTYPE_FLAGS_1M_ALIGN, |
| 829 | }, |
| 830 | }; |
| 831 | |
Taniya Das | 720c5c3 | 2012-05-18 14:08:14 +0530 | [diff] [blame] | 832 | #ifdef CONFIG_ANDROID_PMEM |
Chintan Pandya | 43d0a34 | 2012-06-08 19:45:56 +0530 | [diff] [blame] | 833 | #ifndef CONFIG_MSM_MULTIMEDIA_USE_ION |
Taniya Das | 720c5c3 | 2012-05-18 14:08:14 +0530 | [diff] [blame] | 834 | static struct android_pmem_platform_data *pmem_pdata_array[] __initdata = { |
| 835 | &android_pmem_adsp_pdata, |
| 836 | &android_pmem_audio_pdata, |
| 837 | &android_pmem_pdata, |
| 838 | }; |
| 839 | #endif |
Chintan Pandya | 43d0a34 | 2012-06-08 19:45:56 +0530 | [diff] [blame] | 840 | #endif |
Taniya Das | 720c5c3 | 2012-05-18 14:08:14 +0530 | [diff] [blame] | 841 | |
Trilok Soni | b941079 | 2012-04-07 15:37:13 +0530 | [diff] [blame] | 842 | static void __init size_pmem_devices(void) |
| 843 | { |
| 844 | #ifdef CONFIG_ANDROID_PMEM |
Chintan Pandya | 43d0a34 | 2012-06-08 19:45:56 +0530 | [diff] [blame] | 845 | #ifndef CONFIG_MSM_MULTIMEDIA_USE_ION |
Trilok Soni | b941079 | 2012-04-07 15:37:13 +0530 | [diff] [blame] | 846 | android_pmem_adsp_pdata.size = pmem_adsp_size; |
| 847 | android_pmem_pdata.size = pmem_mdp_size; |
| 848 | android_pmem_audio_pdata.size = pmem_audio_size; |
Chintan Pandya | 43d0a34 | 2012-06-08 19:45:56 +0530 | [diff] [blame] | 849 | #endif |
Trilok Soni | b941079 | 2012-04-07 15:37:13 +0530 | [diff] [blame] | 850 | #endif |
| 851 | } |
| 852 | |
Chintan Pandya | 43d0a34 | 2012-06-08 19:45:56 +0530 | [diff] [blame] | 853 | #ifdef CONFIG_ANDROID_PMEM |
| 854 | #ifndef CONFIG_MSM_MULTIMEDIA_USE_ION |
Trilok Soni | b941079 | 2012-04-07 15:37:13 +0530 | [diff] [blame] | 855 | static void __init reserve_memory_for(struct android_pmem_platform_data *p) |
| 856 | { |
| 857 | msm7627a_reserve_table[p->memory_type].size += p->size; |
| 858 | } |
Chintan Pandya | 43d0a34 | 2012-06-08 19:45:56 +0530 | [diff] [blame] | 859 | #endif |
| 860 | #endif |
Trilok Soni | b941079 | 2012-04-07 15:37:13 +0530 | [diff] [blame] | 861 | |
| 862 | static void __init reserve_pmem_memory(void) |
| 863 | { |
| 864 | #ifdef CONFIG_ANDROID_PMEM |
Chintan Pandya | 43d0a34 | 2012-06-08 19:45:56 +0530 | [diff] [blame] | 865 | #ifndef CONFIG_MSM_MULTIMEDIA_USE_ION |
Taniya Das | 720c5c3 | 2012-05-18 14:08:14 +0530 | [diff] [blame] | 866 | unsigned int i; |
| 867 | for (i = 0; i < ARRAY_SIZE(pmem_pdata_array); ++i) |
| 868 | reserve_memory_for(pmem_pdata_array[i]); |
| 869 | |
Trilok Soni | b941079 | 2012-04-07 15:37:13 +0530 | [diff] [blame] | 870 | msm7627a_reserve_table[MEMTYPE_EBI1].size += pmem_kernel_ebi1_size; |
| 871 | #endif |
Chintan Pandya | 43d0a34 | 2012-06-08 19:45:56 +0530 | [diff] [blame] | 872 | #endif |
| 873 | } |
| 874 | |
| 875 | static void __init reserve_ion_memory(void) |
| 876 | { |
| 877 | #if defined(CONFIG_ION_MSM) && defined(CONFIG_MSM_MULTIMEDIA_USE_ION) |
| 878 | msm7627a_reserve_table[MEMTYPE_EBI1].size += MSM_ION_CAMERA_SIZE; |
| 879 | msm7627a_reserve_table[MEMTYPE_EBI1].size += MSM_ION_AUDIO_SIZE; |
| 880 | msm7627a_reserve_table[MEMTYPE_EBI1].size += MSM_ION_SF_SIZE; |
| 881 | #endif |
Trilok Soni | b941079 | 2012-04-07 15:37:13 +0530 | [diff] [blame] | 882 | } |
| 883 | |
| 884 | static void __init msm7627a_calculate_reserve_sizes(void) |
| 885 | { |
| 886 | size_pmem_devices(); |
| 887 | reserve_pmem_memory(); |
Chintan Pandya | 43d0a34 | 2012-06-08 19:45:56 +0530 | [diff] [blame] | 888 | reserve_ion_memory(); |
Trilok Soni | b941079 | 2012-04-07 15:37:13 +0530 | [diff] [blame] | 889 | } |
| 890 | |
| 891 | static int msm7627a_paddr_to_memtype(unsigned int paddr) |
| 892 | { |
| 893 | return MEMTYPE_EBI1; |
| 894 | } |
| 895 | |
| 896 | static struct reserve_info msm7627a_reserve_info __initdata = { |
| 897 | .memtype_reserve_table = msm7627a_reserve_table, |
| 898 | .calculate_reserve_sizes = msm7627a_calculate_reserve_sizes, |
| 899 | .paddr_to_memtype = msm7627a_paddr_to_memtype, |
| 900 | }; |
| 901 | |
| 902 | static void __init msm7627a_reserve(void) |
| 903 | { |
| 904 | reserve_info = &msm7627a_reserve_info; |
| 905 | msm_reserve(); |
| 906 | memblock_remove(MSM8625_WARM_BOOT_PHYS, SZ_32); |
| 907 | } |
| 908 | |
| 909 | static void __init msm8625_reserve(void) |
| 910 | { |
| 911 | memblock_remove(MSM8625_SECONDARY_PHYS, SZ_8); |
| 912 | msm7627a_reserve(); |
| 913 | } |
| 914 | |
| 915 | static void msmqrd_adsp_add_pdev(void) |
| 916 | { |
| 917 | int rc = 0; |
| 918 | struct rpc_board_dev *rpc_adsp_pdev; |
| 919 | |
| 920 | rpc_adsp_pdev = kzalloc(sizeof(struct rpc_board_dev), GFP_KERNEL); |
| 921 | if (rpc_adsp_pdev == NULL) { |
| 922 | pr_err("%s: Memory Allocation failure\n", __func__); |
| 923 | return; |
| 924 | } |
| 925 | rpc_adsp_pdev->prog = ADSP_RPC_PROG; |
| 926 | |
| 927 | if (cpu_is_msm8625()) |
| 928 | rpc_adsp_pdev->pdev = msm8625_device_adsp; |
| 929 | else |
| 930 | rpc_adsp_pdev->pdev = msm_adsp_device; |
| 931 | rc = msm_rpc_add_board_dev(rpc_adsp_pdev, 1); |
| 932 | if (rc < 0) { |
| 933 | pr_err("%s: return val: %d\n", __func__, rc); |
| 934 | kfree(rpc_adsp_pdev); |
| 935 | } |
| 936 | } |
| 937 | |
Chintan Pandya | f4ad400 | 2012-02-28 19:49:03 +0530 | [diff] [blame] | 938 | static void __init msm7627a_device_i2c_init(void) |
Taniya Das | c98bfbc | 2011-08-23 09:58:55 +0530 | [diff] [blame] | 939 | { |
| 940 | msm_gsbi0_qup_i2c_device.dev.platform_data = &msm_gsbi0_qup_i2c_pdata; |
| 941 | msm_gsbi1_qup_i2c_device.dev.platform_data = &msm_gsbi1_qup_i2c_pdata; |
| 942 | } |
| 943 | |
Chintan Pandya | f4ad400 | 2012-02-28 19:49:03 +0530 | [diff] [blame] | 944 | static void __init msm8625_device_i2c_init(void) |
| 945 | { |
| 946 | msm8625_gsbi0_qup_i2c_device.dev.platform_data |
| 947 | = &msm_gsbi0_qup_i2c_pdata; |
| 948 | msm8625_gsbi1_qup_i2c_device.dev.platform_data |
| 949 | = &msm_gsbi1_qup_i2c_pdata; |
| 950 | } |
| 951 | |
Pankaj Kumar | 3cec058 | 2011-11-18 11:13:29 +0530 | [diff] [blame] | 952 | static struct platform_device msm_proccomm_regulator_dev = { |
| 953 | .name = PROCCOMM_REGULATOR_DEV_NAME, |
| 954 | .id = -1, |
| 955 | .dev = { |
| 956 | .platform_data = &msm7x27a_proccomm_regulator_data |
| 957 | } |
| 958 | }; |
| 959 | |
| 960 | static void __init msm7627a_init_regulators(void) |
| 961 | { |
| 962 | int rc = platform_device_register(&msm_proccomm_regulator_dev); |
| 963 | if (rc) |
| 964 | pr_err("%s: could not register regulator device: %d\n", |
| 965 | __func__, rc); |
| 966 | } |
| 967 | |
Santosh Sajjan | 374d659 | 2012-01-19 23:16:46 +0530 | [diff] [blame] | 968 | static int __init msm_qrd_init_ar6000pm(void) |
| 969 | { |
| 970 | msm_wlan_ar6000_pm_device.dev.platform_data = &ar600x_wlan_power; |
| 971 | return platform_device_register(&msm_wlan_ar6000_pm_device); |
| 972 | } |
| 973 | |
Taniya Das | e380a2d | 2012-03-09 13:02:41 +0530 | [diff] [blame] | 974 | static void __init msm_add_footswitch_devices(void) |
| 975 | { |
| 976 | platform_add_devices(msm_footswitch_devices, |
| 977 | msm_num_footswitch_devices); |
| 978 | } |
| 979 | |
Stephen Boyd | 668d765 | 2012-04-25 11:31:01 -0700 | [diff] [blame] | 980 | static void __init add_platform_devices(void) |
Chintan Pandya | b1bad0e | 2012-02-06 19:04:51 +0530 | [diff] [blame] | 981 | { |
Aparna Mallavarapu | 5a32624 | 2012-05-09 19:49:02 +0530 | [diff] [blame] | 982 | if (machine_is_msm8625_evb() || machine_is_msm8625_qrd7() |
| 983 | || machine_is_msm8625_evt()) { |
Chintan Pandya | f4ad400 | 2012-02-28 19:49:03 +0530 | [diff] [blame] | 984 | platform_add_devices(msm8625_evb_devices, |
| 985 | ARRAY_SIZE(msm8625_evb_devices)); |
Aparna Mallavarapu | beafcbc | 2012-03-13 16:57:39 +0530 | [diff] [blame] | 986 | platform_add_devices(qrd3_devices, |
Taniya Das | bd09654 | 2012-03-15 17:43:45 +0530 | [diff] [blame] | 987 | ARRAY_SIZE(qrd3_devices)); |
Aparna Mallavarapu | beafcbc | 2012-03-13 16:57:39 +0530 | [diff] [blame] | 988 | } else { |
Chintan Pandya | f4ad400 | 2012-02-28 19:49:03 +0530 | [diff] [blame] | 989 | platform_add_devices(qrd7627a_devices, |
| 990 | ARRAY_SIZE(qrd7627a_devices)); |
Chintan Pandya | f4ad400 | 2012-02-28 19:49:03 +0530 | [diff] [blame] | 991 | } |
Taniya Das | bd09654 | 2012-03-15 17:43:45 +0530 | [diff] [blame] | 992 | |
Aparna Mallavarapu | 0b69ca2 | 2012-03-26 15:58:35 +0530 | [diff] [blame] | 993 | if (machine_is_msm7627a_qrd3() || machine_is_msm7627a_evb()) |
Taniya Das | bd09654 | 2012-03-15 17:43:45 +0530 | [diff] [blame] | 994 | platform_add_devices(qrd3_devices, |
Aparna Mallavarapu | 0b69ca2 | 2012-03-26 15:58:35 +0530 | [diff] [blame] | 995 | ARRAY_SIZE(qrd3_devices)); |
Taniya Das | bd09654 | 2012-03-15 17:43:45 +0530 | [diff] [blame] | 996 | |
Chintan Pandya | f4ad400 | 2012-02-28 19:49:03 +0530 | [diff] [blame] | 997 | platform_add_devices(common_devices, |
| 998 | ARRAY_SIZE(common_devices)); |
Chintan Pandya | b1bad0e | 2012-02-06 19:04:51 +0530 | [diff] [blame] | 999 | } |
| 1000 | |
Taniya Das | c98bfbc | 2011-08-23 09:58:55 +0530 | [diff] [blame] | 1001 | #define UART1DM_RX_GPIO 45 |
Chintan Pandya | f4ad400 | 2012-02-28 19:49:03 +0530 | [diff] [blame] | 1002 | static void __init qrd7627a_uart1dm_config(void) |
| 1003 | { |
| 1004 | msm_uart_dm1_pdata.wakeup_irq = gpio_to_irq(UART1DM_RX_GPIO); |
| 1005 | if (cpu_is_msm8625()) |
| 1006 | msm8625_device_uart_dm1.dev.platform_data = |
| 1007 | &msm_uart_dm1_pdata; |
| 1008 | else |
| 1009 | msm_device_uart_dm1.dev.platform_data = &msm_uart_dm1_pdata; |
| 1010 | } |
| 1011 | |
| 1012 | static void __init qrd7627a_otg_gadget(void) |
| 1013 | { |
Chintan Pandya | f4ad400 | 2012-02-28 19:49:03 +0530 | [diff] [blame] | 1014 | if (cpu_is_msm8625()) { |
Murali Nalajala | 6ff8fb1 | 2012-05-02 18:50:50 +0530 | [diff] [blame] | 1015 | msm_otg_pdata.swfi_latency = msm8625_pm_data |
| 1016 | [MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT].latency; |
Chintan Pandya | f4ad400 | 2012-02-28 19:49:03 +0530 | [diff] [blame] | 1017 | msm8625_device_otg.dev.platform_data = &msm_otg_pdata; |
| 1018 | msm8625_device_gadget_peripheral.dev.platform_data = |
| 1019 | &msm_gadget_pdata; |
| 1020 | |
| 1021 | } else { |
Murali Nalajala | 6ff8fb1 | 2012-05-02 18:50:50 +0530 | [diff] [blame] | 1022 | msm_otg_pdata.swfi_latency = msm7627a_pm_data |
| 1023 | [MSM_PM_SLEEP_MODE_RAMP_DOWN_AND_WAIT_FOR_INTERRUPT].latency; |
Chintan Pandya | f4ad400 | 2012-02-28 19:49:03 +0530 | [diff] [blame] | 1024 | msm_device_otg.dev.platform_data = &msm_otg_pdata; |
| 1025 | msm_device_gadget_peripheral.dev.platform_data = |
| 1026 | &msm_gadget_pdata; |
| 1027 | } |
| 1028 | } |
| 1029 | |
Taniya Das | bd09654 | 2012-03-15 17:43:45 +0530 | [diff] [blame] | 1030 | static void __init msm_pm_init(void) |
| 1031 | { |
Taniya Das | bd09654 | 2012-03-15 17:43:45 +0530 | [diff] [blame] | 1032 | |
Aparna Mallavarapu | 6d969eb | 2012-04-03 15:10:25 +0530 | [diff] [blame] | 1033 | if (!cpu_is_msm8625()) { |
Taniya Das | bd09654 | 2012-03-15 17:43:45 +0530 | [diff] [blame] | 1034 | msm_pm_set_platform_data(msm7627a_pm_data, |
| 1035 | ARRAY_SIZE(msm7627a_pm_data)); |
| 1036 | BUG_ON(msm_pm_boot_init(&msm_pm_boot_pdata)); |
| 1037 | } else { |
| 1038 | msm_pm_set_platform_data(msm8625_pm_data, |
| 1039 | ARRAY_SIZE(msm8625_pm_data)); |
| 1040 | BUG_ON(msm_pm_boot_init(&msm_pm_8625_boot_pdata)); |
| 1041 | msm8x25_spm_device_init(); |
| 1042 | } |
| 1043 | } |
| 1044 | |
Taniya Das | c868a2e | 2012-01-03 10:18:47 +0530 | [diff] [blame] | 1045 | static void __init msm_qrd_init(void) |
Taniya Das | c98bfbc | 2011-08-23 09:58:55 +0530 | [diff] [blame] | 1046 | { |
| 1047 | msm7x2x_misc_init(); |
Pankaj Kumar | 3cec058 | 2011-11-18 11:13:29 +0530 | [diff] [blame] | 1048 | msm7627a_init_regulators(); |
Trilok Soni | b941079 | 2012-04-07 15:37:13 +0530 | [diff] [blame] | 1049 | msmqrd_adsp_add_pdev(); |
Taniya Das | c98bfbc | 2011-08-23 09:58:55 +0530 | [diff] [blame] | 1050 | |
Chintan Pandya | f4ad400 | 2012-02-28 19:49:03 +0530 | [diff] [blame] | 1051 | if (cpu_is_msm8625()) |
| 1052 | msm8625_device_i2c_init(); |
| 1053 | else |
| 1054 | msm7627a_device_i2c_init(); |
| 1055 | |
| 1056 | /* uart1dm*/ |
| 1057 | qrd7627a_uart1dm_config(); |
| 1058 | /*OTG gadget*/ |
| 1059 | qrd7627a_otg_gadget(); |
Taniya Das | c868a2e | 2012-01-03 10:18:47 +0530 | [diff] [blame] | 1060 | |
Taniya Das | e380a2d | 2012-03-09 13:02:41 +0530 | [diff] [blame] | 1061 | msm_add_footswitch_devices(); |
Chintan Pandya | b1bad0e | 2012-02-06 19:04:51 +0530 | [diff] [blame] | 1062 | add_platform_devices(); |
Taniya Das | c868a2e | 2012-01-03 10:18:47 +0530 | [diff] [blame] | 1063 | |
Santosh Sajjan | 374d659 | 2012-01-19 23:16:46 +0530 | [diff] [blame] | 1064 | /* Ensure ar6000pm device is registered before MMC/SDC */ |
| 1065 | msm_qrd_init_ar6000pm(); |
Chintan Pandya | cf467fc | 2011-12-01 17:11:11 +0530 | [diff] [blame] | 1066 | msm7627a_init_mmc(); |
| 1067 | |
Taniya Das | c98bfbc | 2011-08-23 09:58:55 +0530 | [diff] [blame] | 1068 | #ifdef CONFIG_USB_EHCI_MSM_72K |
| 1069 | msm7627a_init_host(); |
| 1070 | #endif |
Taniya Das | bd09654 | 2012-03-15 17:43:45 +0530 | [diff] [blame] | 1071 | msm_pm_init(); |
Murali Nalajala | a182784 | 2011-11-13 14:12:39 +0530 | [diff] [blame] | 1072 | |
Murali Nalajala | 2a0bbda | 2012-03-28 12:12:54 +0530 | [diff] [blame] | 1073 | msm_pm_register_irqs(); |
Taniya Das | 0a5303a | 2011-08-23 18:47:48 +0530 | [diff] [blame] | 1074 | msm_fb_add_devices(); |
Taniya Das | c98bfbc | 2011-08-23 09:58:55 +0530 | [diff] [blame] | 1075 | |
| 1076 | #if defined(CONFIG_BT) && defined(CONFIG_MARIMBA_CORE) |
Chintan Pandya | 13490c0 | 2011-12-20 13:03:36 +0530 | [diff] [blame] | 1077 | msm7627a_bt_power_init(); |
Taniya Das | c98bfbc | 2011-08-23 09:58:55 +0530 | [diff] [blame] | 1078 | #endif |
Taniya Das | da40882 | 2011-09-06 12:54:06 +0530 | [diff] [blame] | 1079 | |
Chintan Pandya | 4076270 | 2011-12-06 13:47:06 +0530 | [diff] [blame] | 1080 | msm7627a_camera_init(); |
Chintan Pandya | 0d45319 | 2012-03-09 13:20:33 +0530 | [diff] [blame] | 1081 | qrd7627a_add_io_devices(); |
Aparna Mallavarapu | d95d8fc | 2012-03-08 12:07:37 +0530 | [diff] [blame] | 1082 | msm7x25a_kgsl_3d0_init(); |
Sudhakara Rao Tentu | 38ad6e1 | 2012-03-30 15:25:18 -0700 | [diff] [blame] | 1083 | msm8x25_kgsl_3d0_init(); |
Taniya Das | c98bfbc | 2011-08-23 09:58:55 +0530 | [diff] [blame] | 1084 | } |
| 1085 | |
| 1086 | static void __init qrd7627a_init_early(void) |
| 1087 | { |
| 1088 | msm_msm7627a_allocate_memory_regions(); |
| 1089 | } |
| 1090 | |
| 1091 | MACHINE_START(MSM7627A_QRD1, "QRD MSM7627a QRD1") |
Steve Muckle | f132c6c | 2012-06-06 18:30:57 -0700 | [diff] [blame] | 1092 | .atag_offset = 0x100, |
Taniya Das | c98bfbc | 2011-08-23 09:58:55 +0530 | [diff] [blame] | 1093 | .map_io = msm_common_io_init, |
Trilok Soni | b941079 | 2012-04-07 15:37:13 +0530 | [diff] [blame] | 1094 | .reserve = msm7627a_reserve, |
Taniya Das | c98bfbc | 2011-08-23 09:58:55 +0530 | [diff] [blame] | 1095 | .init_irq = msm_init_irq, |
Taniya Das | c868a2e | 2012-01-03 10:18:47 +0530 | [diff] [blame] | 1096 | .init_machine = msm_qrd_init, |
| 1097 | .timer = &msm_timer, |
| 1098 | .init_early = qrd7627a_init_early, |
| 1099 | .handle_irq = vic_handle_irq, |
| 1100 | MACHINE_END |
Chintan Pandya | b1bad0e | 2012-02-06 19:04:51 +0530 | [diff] [blame] | 1101 | MACHINE_START(MSM7627A_QRD3, "QRD MSM7627a QRD3") |
Steve Muckle | f132c6c | 2012-06-06 18:30:57 -0700 | [diff] [blame] | 1102 | .atag_offset = 0x100, |
Chintan Pandya | b1bad0e | 2012-02-06 19:04:51 +0530 | [diff] [blame] | 1103 | .map_io = msm_common_io_init, |
Trilok Soni | b941079 | 2012-04-07 15:37:13 +0530 | [diff] [blame] | 1104 | .reserve = msm7627a_reserve, |
Chintan Pandya | b1bad0e | 2012-02-06 19:04:51 +0530 | [diff] [blame] | 1105 | .init_irq = msm_init_irq, |
| 1106 | .init_machine = msm_qrd_init, |
| 1107 | .timer = &msm_timer, |
| 1108 | .init_early = qrd7627a_init_early, |
| 1109 | .handle_irq = vic_handle_irq, |
| 1110 | MACHINE_END |
Taniya Das | c868a2e | 2012-01-03 10:18:47 +0530 | [diff] [blame] | 1111 | MACHINE_START(MSM7627A_EVB, "QRD MSM7627a EVB") |
Steve Muckle | f132c6c | 2012-06-06 18:30:57 -0700 | [diff] [blame] | 1112 | .atag_offset = 0x100, |
Taniya Das | c868a2e | 2012-01-03 10:18:47 +0530 | [diff] [blame] | 1113 | .map_io = msm_common_io_init, |
Trilok Soni | b941079 | 2012-04-07 15:37:13 +0530 | [diff] [blame] | 1114 | .reserve = msm7627a_reserve, |
Taniya Das | c868a2e | 2012-01-03 10:18:47 +0530 | [diff] [blame] | 1115 | .init_irq = msm_init_irq, |
| 1116 | .init_machine = msm_qrd_init, |
Taniya Das | c98bfbc | 2011-08-23 09:58:55 +0530 | [diff] [blame] | 1117 | .timer = &msm_timer, |
| 1118 | .init_early = qrd7627a_init_early, |
Pankaj Kumar | bf8a2a3 | 2011-10-21 11:47:21 +0530 | [diff] [blame] | 1119 | .handle_irq = vic_handle_irq, |
Taniya Das | c98bfbc | 2011-08-23 09:58:55 +0530 | [diff] [blame] | 1120 | MACHINE_END |
Chintan Pandya | f4ad400 | 2012-02-28 19:49:03 +0530 | [diff] [blame] | 1121 | MACHINE_START(MSM8625_EVB, "QRD MSM8625 EVB") |
Steve Muckle | f132c6c | 2012-06-06 18:30:57 -0700 | [diff] [blame] | 1122 | .atag_offset = 0x100, |
Chintan Pandya | f4ad400 | 2012-02-28 19:49:03 +0530 | [diff] [blame] | 1123 | .map_io = msm8625_map_io, |
Trilok Soni | b941079 | 2012-04-07 15:37:13 +0530 | [diff] [blame] | 1124 | .reserve = msm8625_reserve, |
Chintan Pandya | f4ad400 | 2012-02-28 19:49:03 +0530 | [diff] [blame] | 1125 | .init_irq = msm8625_init_irq, |
| 1126 | .init_machine = msm_qrd_init, |
| 1127 | .timer = &msm_timer, |
| 1128 | .init_early = qrd7627a_init_early, |
| 1129 | .handle_irq = gic_handle_irq, |
| 1130 | MACHINE_END |
Taniya Das | bd09654 | 2012-03-15 17:43:45 +0530 | [diff] [blame] | 1131 | MACHINE_START(MSM8625_QRD7, "QRD MSM8625 QRD7") |
Steve Muckle | f132c6c | 2012-06-06 18:30:57 -0700 | [diff] [blame] | 1132 | .atag_offset = 0x100, |
Taniya Das | bd09654 | 2012-03-15 17:43:45 +0530 | [diff] [blame] | 1133 | .map_io = msm8625_map_io, |
Trilok Soni | b941079 | 2012-04-07 15:37:13 +0530 | [diff] [blame] | 1134 | .reserve = msm8625_reserve, |
Taniya Das | bd09654 | 2012-03-15 17:43:45 +0530 | [diff] [blame] | 1135 | .init_irq = msm8625_init_irq, |
| 1136 | .init_machine = msm_qrd_init, |
| 1137 | .timer = &msm_timer, |
| 1138 | .init_early = qrd7627a_init_early, |
| 1139 | .handle_irq = gic_handle_irq, |
| 1140 | MACHINE_END |
Aparna Mallavarapu | 5a32624 | 2012-05-09 19:49:02 +0530 | [diff] [blame] | 1141 | MACHINE_START(MSM8625_EVT, "QRD MSM8625 EVT") |
Steve Muckle | f132c6c | 2012-06-06 18:30:57 -0700 | [diff] [blame] | 1142 | .atag_offset = 0x100, |
Aparna Mallavarapu | 5a32624 | 2012-05-09 19:49:02 +0530 | [diff] [blame] | 1143 | .map_io = msm8625_map_io, |
| 1144 | .reserve = msm8625_reserve, |
| 1145 | .init_irq = msm8625_init_irq, |
| 1146 | .init_machine = msm_qrd_init, |
| 1147 | .timer = &msm_timer, |
| 1148 | .init_early = qrd7627a_init_early, |
| 1149 | .handle_irq = gic_handle_irq, |
| 1150 | MACHINE_END |