blob: c4040455b0ff6ccfa330231db739cc551f7f9594 [file] [log] [blame]
Rohit Vaswaniced9b3b2011-08-23 17:21:49 -07001/* Copyright (c) 2011, Code Aurora Forum. All rights reserved.
2 *
3 * This program is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License version 2 and
5 * only version 2 as published by the Free Software Foundation.
6 *
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
11 *
12 */
13#include <linux/kernel.h>
14#include <linux/platform_device.h>
Harini Jayaramaneba52672011-09-08 15:13:00 -060015#include <linux/i2c.h>
Sagar Dharia2a5378d2011-12-01 20:00:11 -070016#include <linux/slimbus/slimbus.h>
Kenneth Heitkeaf3d3cf2011-09-08 11:45:31 -070017#include <linux/msm_ssbi.h>
Maheshkumar Sivasubramanianc6c55032011-10-25 16:01:32 -060018#include <linux/memblock.h>
Rohit Vaswania6815892011-12-15 20:20:39 -080019#include <linux/usb/android.h>
20#include <linux/usb/msm_hsusb.h>
21#include <linux/mfd/pm8xxx/pm8xxx-adc.h>
22#include <linux/leds.h>
23#include <linux/leds-pm8xxx.h>
24#include <linux/power/ltc4088-charger.h>
Rohit Vaswaniced9b3b2011-08-23 17:21:49 -070025#include <asm/mach-types.h>
26#include <asm/mach/arch.h>
Marc Zyngier89bdafd12011-12-22 11:39:20 +053027#include <asm/hardware/gic.h>
Rohit Vaswaniced9b3b2011-08-23 17:21:49 -070028#include <mach/board.h>
29#include <mach/msm_iomap.h>
30#include <mach/gpio.h>
Harini Jayaraman738c9312011-09-08 15:22:38 -060031#include <mach/msm_spi.h>
Gagan Mac7a827642011-09-22 19:42:21 -060032#include <mach/msm_bus_board.h>
Rohit Vaswaniced9b3b2011-08-23 17:21:49 -070033#include "timer.h"
34#include "devices.h"
David Collinsfb88c432011-08-25 15:12:47 -070035#include "board-9615.h"
Maheshkumar Sivasubramanian4923db22011-09-15 09:28:15 -060036#include "cpuidle.h"
37#include "pm.h"
Vikram Mulukutlab5e1cda2011-10-04 16:17:22 -070038#include "acpuclock.h"
Maheshkumar Sivasubramanianc6c55032011-10-25 16:01:32 -060039#include "pm-boot.h"
Rohit Vaswaniced9b3b2011-08-23 17:21:49 -070040
Siddartha Mohanadoss5f60b452011-10-05 11:49:00 -070041static struct pm8xxx_adc_amux pm8018_adc_channels_data[] = {
42 {"vcoin", CHANNEL_VCOIN, CHAN_PATH_SCALING2, AMUX_RSV1,
43 ADC_DECIMATION_TYPE2, ADC_SCALE_DEFAULT},
44 {"vbat", CHANNEL_VBAT, CHAN_PATH_SCALING2, AMUX_RSV1,
45 ADC_DECIMATION_TYPE2, ADC_SCALE_DEFAULT},
46 {"vph_pwr", CHANNEL_VPH_PWR, CHAN_PATH_SCALING2, AMUX_RSV1,
47 ADC_DECIMATION_TYPE2, ADC_SCALE_DEFAULT},
48 {"batt_therm", CHANNEL_BATT_THERM, CHAN_PATH_SCALING1, AMUX_RSV2,
49 ADC_DECIMATION_TYPE2, ADC_SCALE_BATT_THERM},
50 {"batt_id", CHANNEL_BATT_ID, CHAN_PATH_SCALING1, AMUX_RSV2,
51 ADC_DECIMATION_TYPE2, ADC_SCALE_DEFAULT},
52 {"pmic_therm", CHANNEL_DIE_TEMP, CHAN_PATH_SCALING1, AMUX_RSV1,
53 ADC_DECIMATION_TYPE2, ADC_SCALE_PMIC_THERM},
54 {"625mv", CHANNEL_625MV, CHAN_PATH_SCALING1, AMUX_RSV1,
55 ADC_DECIMATION_TYPE2, ADC_SCALE_DEFAULT},
56 {"125v", CHANNEL_125V, CHAN_PATH_SCALING1, AMUX_RSV1,
57 ADC_DECIMATION_TYPE2, ADC_SCALE_DEFAULT},
58 {"pa_therm0", ADC_MPP_1_AMUX3, CHAN_PATH_SCALING1, AMUX_RSV1,
59 ADC_DECIMATION_TYPE2, ADC_SCALE_PA_THERM},
60};
61
62static struct pm8xxx_adc_properties pm8018_adc_data = {
63 .adc_vdd_reference = 1800, /* milli-voltage for this adc */
64 .bitresolution = 15,
65 .bipolar = 0,
66};
67
68static struct pm8xxx_adc_platform_data pm8018_adc_pdata = {
69 .adc_channel = pm8018_adc_channels_data,
70 .adc_num_board_channel = ARRAY_SIZE(pm8018_adc_channels_data),
71 .adc_prop = &pm8018_adc_data,
72};
73
David Collinsfb88c432011-08-25 15:12:47 -070074static struct pm8xxx_irq_platform_data pm8xxx_irq_pdata __devinitdata = {
75 .irq_base = PM8018_IRQ_BASE,
76 .devirq = MSM_GPIO_TO_INT(87),
77 .irq_trigger_flag = IRQF_TRIGGER_LOW,
78};
79
80static struct pm8xxx_gpio_platform_data pm8xxx_gpio_pdata __devinitdata = {
81 .gpio_base = PM8018_GPIO_PM_TO_SYS(1),
82};
83
84static struct pm8xxx_mpp_platform_data pm8xxx_mpp_pdata __devinitdata = {
85 .mpp_base = PM8018_MPP_PM_TO_SYS(1),
86};
87
88static struct pm8xxx_rtc_platform_data pm8xxx_rtc_pdata __devinitdata = {
89 .rtc_write_enable = false,
Ashay Jaiswaldb5e6dc2011-10-12 11:02:47 +053090 .rtc_alarm_powerup = false,
David Collinsfb88c432011-08-25 15:12:47 -070091};
92
93static struct pm8xxx_pwrkey_platform_data pm8xxx_pwrkey_pdata = {
94 .pull_up = 1,
Jing Lineecdc062011-11-17 09:47:09 -080095 .kpd_trigger_delay_us = 15625,
David Collinsfb88c432011-08-25 15:12:47 -070096 .wakeup = 1,
97};
98
99static struct pm8xxx_misc_platform_data pm8xxx_misc_pdata = {
100 .priority = 0,
101};
102
Jay Chokshieb5d0d52011-09-28 17:16:20 -0700103#define PM8018_LED_KB_MAX_CURRENT 20 /* I = 20mA */
104#define PM8XXX_LED_PWM_PERIOD_US 1000
105
106/**
107 * PM8XXX_PWM_CHANNEL_NONE shall be used when LED shall not be
108 * driven using PWM feature.
109 */
110#define PM8XXX_PWM_CHANNEL_NONE -1
111
112static struct led_info pm8018_led_info[] = {
113 [0] = {
114 .name = "led:kb",
115 },
116};
117
118static struct led_platform_data pm8018_led_core_pdata = {
119 .num_leds = ARRAY_SIZE(pm8018_led_info),
120 .leds = pm8018_led_info,
121};
122
123static struct pm8xxx_led_config pm8018_led_configs[] = {
124 [0] = {
125 .id = PM8XXX_ID_LED_KB_LIGHT,
126 .mode = PM8XXX_LED_MODE_PWM3,
127 .max_current = PM8018_LED_KB_MAX_CURRENT,
128 .pwm_channel = 2,
129 .pwm_period_us = PM8XXX_LED_PWM_PERIOD_US,
130 },
131};
132
133static struct pm8xxx_led_platform_data pm8xxx_leds_pdata = {
134 .led_core = &pm8018_led_core_pdata,
135 .configs = pm8018_led_configs,
136 .num_configs = ARRAY_SIZE(pm8018_led_configs),
137};
138
Jay Chokshidc8028b2011-12-01 16:17:34 -0800139#ifdef CONFIG_LTC4088_CHARGER
140static struct ltc4088_charger_platform_data ltc4088_chg_pdata = {
141 .gpio_mode_select_d0 = 7,
142 .gpio_mode_select_d1 = 6,
143 .gpio_mode_select_d2 = 4,
144};
145#endif
146
David Collinsfb88c432011-08-25 15:12:47 -0700147static struct pm8018_platform_data pm8018_platform_data __devinitdata = {
148 .irq_pdata = &pm8xxx_irq_pdata,
149 .gpio_pdata = &pm8xxx_gpio_pdata,
150 .mpp_pdata = &pm8xxx_mpp_pdata,
151 .rtc_pdata = &pm8xxx_rtc_pdata,
152 .pwrkey_pdata = &pm8xxx_pwrkey_pdata,
153 .misc_pdata = &pm8xxx_misc_pdata,
David Collins00b31e62011-08-31 20:00:10 -0700154 .regulator_pdatas = msm_pm8018_regulator_pdata,
Siddartha Mohanadoss5f60b452011-10-05 11:49:00 -0700155 .adc_pdata = &pm8018_adc_pdata,
Jay Chokshieb5d0d52011-09-28 17:16:20 -0700156 .leds_pdata = &pm8xxx_leds_pdata,
David Collinsfb88c432011-08-25 15:12:47 -0700157};
158
Kenneth Heitkeaf3d3cf2011-09-08 11:45:31 -0700159static struct msm_ssbi_platform_data msm9615_ssbi_pm8018_pdata __devinitdata = {
160 .controller_type = MSM_SBI_CTRL_PMIC_ARBITER,
161 .slave = {
David Collinsfb88c432011-08-25 15:12:47 -0700162 .name = PM8018_CORE_DEV_NAME,
163 .platform_data = &pm8018_platform_data,
Kenneth Heitkeaf3d3cf2011-09-08 11:45:31 -0700164 },
165};
166
David Collinsbea297a2011-09-28 13:11:14 -0700167static struct platform_device msm9615_device_rpm_regulator __devinitdata = {
168 .name = "rpm-regulator",
169 .id = -1,
170 .dev = {
171 .platform_data = &msm_rpm_regulator_9615_pdata,
172 },
173};
174
David Collins0f9942a2011-10-31 09:47:34 -0700175static struct platform_device msm9615_device_ext_2p95v_vreg = {
176 .name = GPIO_REGULATOR_DEV_NAME,
177 .id = 18,
178 .dev = {
179 .platform_data =
180 &msm_gpio_regulator_pdata[GPIO_VREG_ID_EXT_2P95V],
181 },
182};
183
Maheshkumar Sivasubramanian4923db22011-09-15 09:28:15 -0600184static struct msm_cpuidle_state msm_cstates[] __initdata = {
185 {0, 0, "C0", "WFI",
186 MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT},
187
188 {0, 1, "C1", "STANDALONE_POWER_COLLAPSE",
189 MSM_PM_SLEEP_MODE_POWER_COLLAPSE_STANDALONE},
190
191 {0, 2, "C2", "POWER_COLLAPSE",
192 MSM_PM_SLEEP_MODE_POWER_COLLAPSE},
193};
194static struct msm_pm_platform_data msm_pm_data[MSM_PM_SLEEP_MODE_NR] = {
195 [MSM_PM_MODE(0, MSM_PM_SLEEP_MODE_POWER_COLLAPSE)] = {
196 .idle_supported = 1,
197 .suspend_supported = 1,
198 .idle_enabled = 0,
199 .suspend_enabled = 0,
200 },
201 [MSM_PM_MODE(0, MSM_PM_SLEEP_MODE_POWER_COLLAPSE_STANDALONE)] = {
202 .idle_supported = 1,
203 .suspend_supported = 1,
204 .idle_enabled = 0,
205 .suspend_enabled = 0,
206 },
207 [MSM_PM_MODE(0, MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT)] = {
208 .idle_supported = 1,
209 .suspend_supported = 1,
210 .idle_enabled = 1,
211 .suspend_enabled = 1,
212 },
213};
Krishna Kondadd794462011-10-01 00:19:29 -0700214
Maheshkumar Sivasubramanianc6c55032011-10-25 16:01:32 -0600215static struct msm_pm_boot_platform_data msm_pm_boot_pdata __initdata = {
216 .mode = MSM_PM_BOOT_CONFIG_REMAP_BOOT_ADDR,
217 .v_addr = MSM_APCS_GLB_BASE + 0x24,
218};
219
Gagan Mac7a827642011-09-22 19:42:21 -0600220static void __init msm9615_init_buses(void)
221{
222#ifdef CONFIG_MSM_BUS_SCALING
223 msm_bus_rpm_set_mt_mask();
224 msm_bus_9615_sys_fabric_pdata.rpm_enabled = 1;
225 msm_bus_9615_sys_fabric.dev.platform_data =
226 &msm_bus_9615_sys_fabric_pdata;
227 msm_bus_def_fab.dev.platform_data = &msm_bus_9615_def_fab_pdata;
228#endif
229}
230
Sagar Dharia2a5378d2011-12-01 20:00:11 -0700231static struct slim_boardinfo msm_slim_devices[] = {
232 /* add slimbus slaves as needed */
233};
234
Harini Jayaraman738c9312011-09-08 15:22:38 -0600235static struct msm_spi_platform_data msm9615_qup_spi_gsbi3_pdata = {
236 .max_clock_speed = 24000000,
237};
238
Harini Jayaramaneba52672011-09-08 15:13:00 -0600239static struct msm_i2c_platform_data msm9615_i2c_qup_gsbi5_pdata = {
240 .clk_freq = 100000,
241 .src_clk_rate = 24000000,
242};
243
Amit Blay6a8d4f32011-11-21 10:36:25 +0200244#define USB_5V_EN 3
245#define PM_USB_5V_EN PM8018_GPIO_PM_TO_SYS(USB_5V_EN)
246
247static void msm_hsusb_vbus_power(bool on)
248{
249 int rc;
250 static bool vbus_is_on;
251 struct pm_gpio usb_vbus = {
252 .direction = PM_GPIO_DIR_OUT,
253 .pull = PM_GPIO_PULL_NO,
254 .output_buffer = PM_GPIO_OUT_BUF_CMOS,
255 .output_value = 0,
256 .vin_sel = 2,
257 .out_strength = PM_GPIO_STRENGTH_HIGH,
258 .function = PM_GPIO_FUNC_NORMAL,
259 .inv_int_pol = 0,
260 };
261
262 if (vbus_is_on == on)
263 return;
264
265 if (on) {
266 rc = pm8xxx_gpio_config(PM_USB_5V_EN, &usb_vbus);
267 if (rc) {
268 pr_err("failed to config usb_5v_en gpio\n");
269 return;
270 }
271
272 rc = gpio_request(PM_USB_5V_EN,
273 "usb_5v_en");
274 if (rc < 0) {
275 pr_err("failed to request usb_5v_en gpio\n");
276 return;
277 }
278
279 rc = gpio_direction_output(PM_USB_5V_EN, 1);
280 if (rc) {
281 pr_err("%s: unable to set_direction for gpio [%d]\n",
282 __func__, PM_USB_5V_EN);
283 goto free_usb_5v_en;
284 }
285
286 vbus_is_on = true;
287 return;
288 }
289 gpio_set_value(PM_USB_5V_EN, 0);
290free_usb_5v_en:
291 gpio_free(PM_USB_5V_EN);
292 vbus_is_on = false;
293}
294
Anji jonnalaa8b8d732011-12-06 10:03:24 +0530295static int shelby_phy_init_seq[] = {
296 0x44, 0x80,/* set VBUS valid threshold and
297 disconnect valid threshold */
298 0x38, 0x81, /* update DC voltage level */
299 0x14, 0x82,/* set preemphasis and rise/fall time */
300 0x13, 0x83,/* set source impedance adjustment */
301 -1};
302
Ofir Cohen40a4e862011-12-08 15:17:52 +0200303#define USB_BAM_PHY_BASE 0x12502000
304#define USB_BAM_PHY_SIZE 0x10000
305#define A2_BAM_PHY_BASE 0x124C2000
306static struct usb_bam_pipe_connect msm_usb_bam_connections[4][2] = {
307 [0][USB_TO_PEER_PERIPHERAL] = {
308 .src_phy_addr = USB_BAM_PHY_BASE,
309 .src_pipe_index = 11,
310 .dst_phy_addr = A2_BAM_PHY_BASE,
311 .dst_pipe_index = 0,
Ofir Cohen29cd5752011-12-14 17:20:30 +0200312 .data_fifo_base_offset = 0x1100,
313 .data_fifo_size = 0x600,
314 .desc_fifo_base_offset = 0x1700,
Ofir Cohen40a4e862011-12-08 15:17:52 +0200315 .desc_fifo_size = 0x300,
316 },
317 [0][PEER_PERIPHERAL_TO_USB] = {
318 .src_phy_addr = A2_BAM_PHY_BASE,
319 .src_pipe_index = 1,
320 .dst_phy_addr = USB_BAM_PHY_BASE,
321 .dst_pipe_index = 10,
322 .data_fifo_base_offset = 0xa00,
Ofir Cohen29cd5752011-12-14 17:20:30 +0200323 .data_fifo_size = 0x600,
324 .desc_fifo_base_offset = 0x1000,
Ofir Cohen40a4e862011-12-08 15:17:52 +0200325 .desc_fifo_size = 0x100,
326 },
327};
328
329static struct msm_usb_bam_platform_data msm_usb_bam_pdata = {
330 .connections = &msm_usb_bam_connections[0][0],
331 .usb_bam_phy_base = USB_BAM_PHY_BASE,
332 .usb_bam_phy_size = USB_BAM_PHY_SIZE,
333 .usb_bam_num_pipes = 32,
334};
335
Amit Blay5e4ec192011-10-20 09:16:54 +0200336static struct msm_otg_platform_data msm_otg_pdata = {
Amit Blay6a8d4f32011-11-21 10:36:25 +0200337 .mode = USB_OTG,
338 .otg_control = OTG_PHY_CONTROL,
Amit Blay5e4ec192011-10-20 09:16:54 +0200339 .phy_type = SNPS_28NM_INTEGRATED_PHY,
Amit Blay6a8d4f32011-11-21 10:36:25 +0200340 .pclk_src_name = "dfab_usb_hs_clk",
341 .vbus_power = msm_hsusb_vbus_power,
Ofir Cohen4da266f2012-01-03 10:19:29 +0200342 .disable_reset_on_disconnect = true,
Amit Blay5e4ec192011-10-20 09:16:54 +0200343};
344
345static int usb_diag_update_pid_and_serial_num(uint32_t pid, const char *snum)
346{
347 return 0;
348}
349
350static struct android_usb_platform_data android_usb_pdata = {
351 .update_pid_and_serial_num = usb_diag_update_pid_and_serial_num,
352};
353
354static struct platform_device android_usb_device = {
355 .name = "android_usb",
356 .id = -1,
357 .dev = {
358 .platform_data = &android_usb_pdata,
359 },
360};
361
Rohit Vaswani149f0a72011-11-09 15:21:28 -0800362static struct platform_device msm_wlan_ar6000_pm_device = {
363 .name = "wlan_ar6000_pm_dev",
364 .id = -1,
365};
366
367static int __init msm9615_init_ar6000pm(void)
368{
369 return platform_device_register(&msm_wlan_ar6000_pm_device);
370}
371
Jay Chokshidc8028b2011-12-01 16:17:34 -0800372#ifdef CONFIG_LTC4088_CHARGER
373static struct platform_device msm_device_charger = {
374 .name = LTC4088_CHARGER_DEV_NAME,
375 .id = -1,
376 .dev = {
377 .platform_data = &ltc4088_chg_pdata,
378 },
379};
380#endif
381
Amit Blay5e4ec192011-10-20 09:16:54 +0200382static struct platform_device *common_devices[] = {
383 &msm9615_device_dmov,
384 &msm_device_smd,
Jay Chokshidc8028b2011-12-01 16:17:34 -0800385#ifdef CONFIG_LTC4088_CHARGER
386 &msm_device_charger,
387#endif
Amit Blay5e4ec192011-10-20 09:16:54 +0200388 &msm_device_otg,
389 &msm_device_gadget_peripheral,
Amit Blay6a8d4f32011-11-21 10:36:25 +0200390 &msm_device_hsusb_host,
Ofir Cohen40a4e862011-12-08 15:17:52 +0200391 &msm_device_usb_bam,
Amit Blay5e4ec192011-10-20 09:16:54 +0200392 &android_usb_device,
393 &msm9615_device_uart_gsbi4,
David Collins0f9942a2011-10-31 09:47:34 -0700394 &msm9615_device_ext_2p95v_vreg,
Amit Blay5e4ec192011-10-20 09:16:54 +0200395 &msm9615_device_ssbi_pmic1,
396 &msm9615_device_qup_i2c_gsbi5,
397 &msm9615_device_qup_spi_gsbi3,
398 &msm_device_sps,
Sagar Dharia2a5378d2011-12-01 20:00:11 -0700399 &msm9615_slim_ctrl,
Amit Blay5e4ec192011-10-20 09:16:54 +0200400 &msm9615_device_tsens,
401 &msm_device_nand,
Eric Holmberg0c96e702011-11-08 18:04:31 -0700402 &msm_device_bam_dmux,
Amit Blay5e4ec192011-10-20 09:16:54 +0200403 &msm_rpm_device,
404#ifdef CONFIG_HW_RANDOM_MSM
405 &msm_device_rng,
406#endif
407
408#if defined(CONFIG_CRYPTO_DEV_QCRYPTO) || \
409 defined(CONFIG_CRYPTO_DEV_QCRYPTO_MODULE)
Ramesh Masavarapuaa28b5b2011-10-21 10:26:03 -0700410 &msm9615_qcrypto_device,
Amit Blay5e4ec192011-10-20 09:16:54 +0200411#endif
412
413#if defined(CONFIG_CRYPTO_DEV_QCEDEV) || \
414 defined(CONFIG_CRYPTO_DEV_QCEDEV_MODULE)
Ramesh Masavarapuaa28b5b2011-10-21 10:26:03 -0700415 &msm9615_qcedev_device,
Amit Blay5e4ec192011-10-20 09:16:54 +0200416#endif
Jeff Ohlstein7e668552011-10-06 16:17:25 -0700417 &msm9615_device_watchdog,
Gagan Mac7a827642011-09-22 19:42:21 -0600418 &msm_bus_9615_sys_fabric,
419 &msm_bus_def_fab,
Amit Blay5e4ec192011-10-20 09:16:54 +0200420};
421
Harini Jayaramaneba52672011-09-08 15:13:00 -0600422static void __init msm9615_i2c_init(void)
423{
424 msm9615_device_qup_i2c_gsbi5.dev.platform_data =
425 &msm9615_i2c_qup_gsbi5_pdata;
426}
427
Maheshkumar Sivasubramanianc6c55032011-10-25 16:01:32 -0600428static void __init msm9615_reserve(void)
429{
430 msm_pm_boot_pdata.p_addr = memblock_alloc(SZ_8, SZ_64K);
431}
432
Rohit Vaswaniced9b3b2011-08-23 17:21:49 -0700433static void __init msm9615_common_init(void)
434{
435 msm9615_device_init();
Rohit Vaswania6815892011-12-15 20:20:39 -0800436 msm9615_init_gpiomux();
Harini Jayaramaneba52672011-09-08 15:13:00 -0600437 msm9615_i2c_init();
David Collins00b31e62011-08-31 20:00:10 -0700438 regulator_suppress_info_printing();
David Collinsbea297a2011-09-28 13:11:14 -0700439 platform_device_register(&msm9615_device_rpm_regulator);
Gagan Mac7a827642011-09-22 19:42:21 -0600440 msm_clock_init(&msm9615_clock_init_data);
441 msm9615_init_buses();
Harini Jayaraman738c9312011-09-08 15:22:38 -0600442 msm9615_device_qup_spi_gsbi3.dev.platform_data =
443 &msm9615_qup_spi_gsbi3_pdata;
Kenneth Heitkeaf3d3cf2011-09-08 11:45:31 -0700444 msm9615_device_ssbi_pmic1.dev.platform_data =
445 &msm9615_ssbi_pm8018_pdata;
David Collins00b31e62011-08-31 20:00:10 -0700446 pm8018_platform_data.num_regulators = msm_pm8018_regulator_pdata_len;
Amit Blay5e4ec192011-10-20 09:16:54 +0200447
448 msm_device_otg.dev.platform_data = &msm_otg_pdata;
Anji jonnalaa8b8d732011-12-06 10:03:24 +0530449 msm_otg_pdata.phy_init_seq = shelby_phy_init_seq;
Ofir Cohen40a4e862011-12-08 15:17:52 +0200450 msm_device_usb_bam.dev.platform_data = &msm_usb_bam_pdata;
Rohit Vaswani09666872011-08-23 17:41:54 -0700451 platform_add_devices(common_devices, ARRAY_SIZE(common_devices));
Krishna Kondadd794462011-10-01 00:19:29 -0700452
Vikram Mulukutlab5e1cda2011-10-04 16:17:22 -0700453 acpuclk_init(&acpuclk_9615_soc_data);
454
Rohit Vaswani149f0a72011-11-09 15:21:28 -0800455 /* Ensure ar6000pm device is registered before MMC/SDC */
456 msm9615_init_ar6000pm();
457
Krishna Kondadd794462011-10-01 00:19:29 -0700458 msm9615_init_mmc();
Sagar Dharia2a5378d2011-12-01 20:00:11 -0700459 slim_register_board_info(msm_slim_devices,
460 ARRAY_SIZE(msm_slim_devices));
Maheshkumar Sivasubramanian4923db22011-09-15 09:28:15 -0600461 msm_pm_set_platform_data(msm_pm_data, ARRAY_SIZE(msm_pm_data));
462 msm_pm_set_rpm_wakeup_irq(RPM_APCC_CPU0_WAKE_UP_IRQ);
463 msm_cpuidle_set_states(msm_cstates, ARRAY_SIZE(msm_cstates),
464 msm_pm_data);
Maheshkumar Sivasubramanianc6c55032011-10-25 16:01:32 -0600465 BUG_ON(msm_pm_boot_init(&msm_pm_boot_pdata));
Rohit Vaswaniced9b3b2011-08-23 17:21:49 -0700466}
467
468static void __init msm9615_cdp_init(void)
469{
470 msm9615_common_init();
471}
472
473static void __init msm9615_mtp_init(void)
474{
475 msm9615_common_init();
476}
477
478MACHINE_START(MSM9615_CDP, "QCT MSM9615 CDP")
479 .map_io = msm9615_map_io,
480 .init_irq = msm9615_init_irq,
Marc Zyngier89bdafd12011-12-22 11:39:20 +0530481 .handle_irq = gic_handle_irq,
Rohit Vaswaniced9b3b2011-08-23 17:21:49 -0700482 .timer = &msm_timer,
483 .init_machine = msm9615_cdp_init,
Maheshkumar Sivasubramanianc6c55032011-10-25 16:01:32 -0600484 .reserve = msm9615_reserve,
Rohit Vaswaniced9b3b2011-08-23 17:21:49 -0700485MACHINE_END
486
487MACHINE_START(MSM9615_MTP, "QCT MSM9615 MTP")
488 .map_io = msm9615_map_io,
489 .init_irq = msm9615_init_irq,
Marc Zyngier89bdafd12011-12-22 11:39:20 +0530490 .handle_irq = gic_handle_irq,
Rohit Vaswaniced9b3b2011-08-23 17:21:49 -0700491 .timer = &msm_timer,
492 .init_machine = msm9615_mtp_init,
Maheshkumar Sivasubramanianc6c55032011-10-25 16:01:32 -0600493 .reserve = msm9615_reserve,
Rohit Vaswaniced9b3b2011-08-23 17:21:49 -0700494MACHINE_END