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