blob: ec2a71d90f61b0bffa8f376f7ea807b7904c7389 [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>
Kenneth Heitkeaf3d3cf2011-09-08 11:45:31 -070016#include <linux/msm_ssbi.h>
Maheshkumar Sivasubramanianc6c55032011-10-25 16:01:32 -060017#include <linux/memblock.h>
Rohit Vaswania6815892011-12-15 20:20:39 -080018#include <linux/usb/android.h>
19#include <linux/usb/msm_hsusb.h>
20#include <linux/mfd/pm8xxx/pm8xxx-adc.h>
21#include <linux/leds.h>
22#include <linux/leds-pm8xxx.h>
23#include <linux/power/ltc4088-charger.h>
Rohit Vaswaniced9b3b2011-08-23 17:21:49 -070024#include <asm/mach-types.h>
25#include <asm/mach/arch.h>
Marc Zyngier89bdafd12011-12-22 11:39:20 +053026#include <asm/hardware/gic.h>
Rohit Vaswaniced9b3b2011-08-23 17:21:49 -070027#include <mach/board.h>
28#include <mach/msm_iomap.h>
29#include <mach/gpio.h>
Harini Jayaraman738c9312011-09-08 15:22:38 -060030#include <mach/msm_spi.h>
Gagan Mac7a827642011-09-22 19:42:21 -060031#include <mach/msm_bus_board.h>
Rohit Vaswaniced9b3b2011-08-23 17:21:49 -070032#include "timer.h"
33#include "devices.h"
David Collinsfb88c432011-08-25 15:12:47 -070034#include "board-9615.h"
Maheshkumar Sivasubramanian4923db22011-09-15 09:28:15 -060035#include "cpuidle.h"
36#include "pm.h"
Vikram Mulukutlab5e1cda2011-10-04 16:17:22 -070037#include "acpuclock.h"
Maheshkumar Sivasubramanianc6c55032011-10-25 16:01:32 -060038#include "pm-boot.h"
Rohit Vaswaniced9b3b2011-08-23 17:21:49 -070039
Siddartha Mohanadoss5f60b452011-10-05 11:49:00 -070040static struct pm8xxx_adc_amux pm8018_adc_channels_data[] = {
41 {"vcoin", CHANNEL_VCOIN, CHAN_PATH_SCALING2, AMUX_RSV1,
42 ADC_DECIMATION_TYPE2, ADC_SCALE_DEFAULT},
43 {"vbat", CHANNEL_VBAT, CHAN_PATH_SCALING2, AMUX_RSV1,
44 ADC_DECIMATION_TYPE2, ADC_SCALE_DEFAULT},
45 {"vph_pwr", CHANNEL_VPH_PWR, CHAN_PATH_SCALING2, AMUX_RSV1,
46 ADC_DECIMATION_TYPE2, ADC_SCALE_DEFAULT},
47 {"batt_therm", CHANNEL_BATT_THERM, CHAN_PATH_SCALING1, AMUX_RSV2,
48 ADC_DECIMATION_TYPE2, ADC_SCALE_BATT_THERM},
49 {"batt_id", CHANNEL_BATT_ID, CHAN_PATH_SCALING1, AMUX_RSV2,
50 ADC_DECIMATION_TYPE2, ADC_SCALE_DEFAULT},
51 {"pmic_therm", CHANNEL_DIE_TEMP, CHAN_PATH_SCALING1, AMUX_RSV1,
52 ADC_DECIMATION_TYPE2, ADC_SCALE_PMIC_THERM},
53 {"625mv", CHANNEL_625MV, CHAN_PATH_SCALING1, AMUX_RSV1,
54 ADC_DECIMATION_TYPE2, ADC_SCALE_DEFAULT},
55 {"125v", CHANNEL_125V, CHAN_PATH_SCALING1, AMUX_RSV1,
56 ADC_DECIMATION_TYPE2, ADC_SCALE_DEFAULT},
57 {"pa_therm0", ADC_MPP_1_AMUX3, CHAN_PATH_SCALING1, AMUX_RSV1,
58 ADC_DECIMATION_TYPE2, ADC_SCALE_PA_THERM},
59};
60
61static struct pm8xxx_adc_properties pm8018_adc_data = {
62 .adc_vdd_reference = 1800, /* milli-voltage for this adc */
63 .bitresolution = 15,
64 .bipolar = 0,
65};
66
67static struct pm8xxx_adc_platform_data pm8018_adc_pdata = {
68 .adc_channel = pm8018_adc_channels_data,
69 .adc_num_board_channel = ARRAY_SIZE(pm8018_adc_channels_data),
70 .adc_prop = &pm8018_adc_data,
71};
72
David Collinsfb88c432011-08-25 15:12:47 -070073static struct pm8xxx_irq_platform_data pm8xxx_irq_pdata __devinitdata = {
74 .irq_base = PM8018_IRQ_BASE,
75 .devirq = MSM_GPIO_TO_INT(87),
76 .irq_trigger_flag = IRQF_TRIGGER_LOW,
77};
78
79static struct pm8xxx_gpio_platform_data pm8xxx_gpio_pdata __devinitdata = {
80 .gpio_base = PM8018_GPIO_PM_TO_SYS(1),
81};
82
83static struct pm8xxx_mpp_platform_data pm8xxx_mpp_pdata __devinitdata = {
84 .mpp_base = PM8018_MPP_PM_TO_SYS(1),
85};
86
87static struct pm8xxx_rtc_platform_data pm8xxx_rtc_pdata __devinitdata = {
88 .rtc_write_enable = false,
Ashay Jaiswaldb5e6dc2011-10-12 11:02:47 +053089 .rtc_alarm_powerup = false,
David Collinsfb88c432011-08-25 15:12:47 -070090};
91
92static struct pm8xxx_pwrkey_platform_data pm8xxx_pwrkey_pdata = {
93 .pull_up = 1,
Jing Lineecdc062011-11-17 09:47:09 -080094 .kpd_trigger_delay_us = 15625,
David Collinsfb88c432011-08-25 15:12:47 -070095 .wakeup = 1,
96};
97
98static struct pm8xxx_misc_platform_data pm8xxx_misc_pdata = {
99 .priority = 0,
100};
101
Jay Chokshieb5d0d52011-09-28 17:16:20 -0700102#define PM8018_LED_KB_MAX_CURRENT 20 /* I = 20mA */
103#define PM8XXX_LED_PWM_PERIOD_US 1000
104
105/**
106 * PM8XXX_PWM_CHANNEL_NONE shall be used when LED shall not be
107 * driven using PWM feature.
108 */
109#define PM8XXX_PWM_CHANNEL_NONE -1
110
111static struct led_info pm8018_led_info[] = {
112 [0] = {
113 .name = "led:kb",
114 },
115};
116
117static struct led_platform_data pm8018_led_core_pdata = {
118 .num_leds = ARRAY_SIZE(pm8018_led_info),
119 .leds = pm8018_led_info,
120};
121
122static struct pm8xxx_led_config pm8018_led_configs[] = {
123 [0] = {
124 .id = PM8XXX_ID_LED_KB_LIGHT,
125 .mode = PM8XXX_LED_MODE_PWM3,
126 .max_current = PM8018_LED_KB_MAX_CURRENT,
127 .pwm_channel = 2,
128 .pwm_period_us = PM8XXX_LED_PWM_PERIOD_US,
129 },
130};
131
132static struct pm8xxx_led_platform_data pm8xxx_leds_pdata = {
133 .led_core = &pm8018_led_core_pdata,
134 .configs = pm8018_led_configs,
135 .num_configs = ARRAY_SIZE(pm8018_led_configs),
136};
137
Jay Chokshidc8028b2011-12-01 16:17:34 -0800138#ifdef CONFIG_LTC4088_CHARGER
139static struct ltc4088_charger_platform_data ltc4088_chg_pdata = {
140 .gpio_mode_select_d0 = 7,
141 .gpio_mode_select_d1 = 6,
142 .gpio_mode_select_d2 = 4,
143};
144#endif
145
David Collinsfb88c432011-08-25 15:12:47 -0700146static struct pm8018_platform_data pm8018_platform_data __devinitdata = {
147 .irq_pdata = &pm8xxx_irq_pdata,
148 .gpio_pdata = &pm8xxx_gpio_pdata,
149 .mpp_pdata = &pm8xxx_mpp_pdata,
150 .rtc_pdata = &pm8xxx_rtc_pdata,
151 .pwrkey_pdata = &pm8xxx_pwrkey_pdata,
152 .misc_pdata = &pm8xxx_misc_pdata,
David Collins00b31e62011-08-31 20:00:10 -0700153 .regulator_pdatas = msm_pm8018_regulator_pdata,
Siddartha Mohanadoss5f60b452011-10-05 11:49:00 -0700154 .adc_pdata = &pm8018_adc_pdata,
Jay Chokshieb5d0d52011-09-28 17:16:20 -0700155 .leds_pdata = &pm8xxx_leds_pdata,
David Collinsfb88c432011-08-25 15:12:47 -0700156};
157
Kenneth Heitkeaf3d3cf2011-09-08 11:45:31 -0700158static struct msm_ssbi_platform_data msm9615_ssbi_pm8018_pdata __devinitdata = {
159 .controller_type = MSM_SBI_CTRL_PMIC_ARBITER,
160 .slave = {
David Collinsfb88c432011-08-25 15:12:47 -0700161 .name = PM8018_CORE_DEV_NAME,
162 .platform_data = &pm8018_platform_data,
Kenneth Heitkeaf3d3cf2011-09-08 11:45:31 -0700163 },
164};
165
David Collinsbea297a2011-09-28 13:11:14 -0700166static struct platform_device msm9615_device_rpm_regulator __devinitdata = {
167 .name = "rpm-regulator",
168 .id = -1,
169 .dev = {
170 .platform_data = &msm_rpm_regulator_9615_pdata,
171 },
172};
173
David Collins0f9942a2011-10-31 09:47:34 -0700174static struct platform_device msm9615_device_ext_2p95v_vreg = {
175 .name = GPIO_REGULATOR_DEV_NAME,
176 .id = 18,
177 .dev = {
178 .platform_data =
179 &msm_gpio_regulator_pdata[GPIO_VREG_ID_EXT_2P95V],
180 },
181};
182
Maheshkumar Sivasubramanian4923db22011-09-15 09:28:15 -0600183static struct msm_cpuidle_state msm_cstates[] __initdata = {
184 {0, 0, "C0", "WFI",
185 MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT},
186
187 {0, 1, "C1", "STANDALONE_POWER_COLLAPSE",
188 MSM_PM_SLEEP_MODE_POWER_COLLAPSE_STANDALONE},
189
190 {0, 2, "C2", "POWER_COLLAPSE",
191 MSM_PM_SLEEP_MODE_POWER_COLLAPSE},
192};
193static struct msm_pm_platform_data msm_pm_data[MSM_PM_SLEEP_MODE_NR] = {
194 [MSM_PM_MODE(0, MSM_PM_SLEEP_MODE_POWER_COLLAPSE)] = {
195 .idle_supported = 1,
196 .suspend_supported = 1,
197 .idle_enabled = 0,
198 .suspend_enabled = 0,
199 },
200 [MSM_PM_MODE(0, MSM_PM_SLEEP_MODE_POWER_COLLAPSE_STANDALONE)] = {
201 .idle_supported = 1,
202 .suspend_supported = 1,
203 .idle_enabled = 0,
204 .suspend_enabled = 0,
205 },
206 [MSM_PM_MODE(0, MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT)] = {
207 .idle_supported = 1,
208 .suspend_supported = 1,
209 .idle_enabled = 1,
210 .suspend_enabled = 1,
211 },
212};
Krishna Kondadd794462011-10-01 00:19:29 -0700213
Maheshkumar Sivasubramanianc6c55032011-10-25 16:01:32 -0600214static struct msm_pm_boot_platform_data msm_pm_boot_pdata __initdata = {
215 .mode = MSM_PM_BOOT_CONFIG_REMAP_BOOT_ADDR,
216 .v_addr = MSM_APCS_GLB_BASE + 0x24,
217};
218
Gagan Mac7a827642011-09-22 19:42:21 -0600219static void __init msm9615_init_buses(void)
220{
221#ifdef CONFIG_MSM_BUS_SCALING
222 msm_bus_rpm_set_mt_mask();
223 msm_bus_9615_sys_fabric_pdata.rpm_enabled = 1;
224 msm_bus_9615_sys_fabric.dev.platform_data =
225 &msm_bus_9615_sys_fabric_pdata;
226 msm_bus_def_fab.dev.platform_data = &msm_bus_9615_def_fab_pdata;
227#endif
228}
229
Harini Jayaraman738c9312011-09-08 15:22:38 -0600230static struct msm_spi_platform_data msm9615_qup_spi_gsbi3_pdata = {
231 .max_clock_speed = 24000000,
232};
233
Harini Jayaramaneba52672011-09-08 15:13:00 -0600234static struct msm_i2c_platform_data msm9615_i2c_qup_gsbi5_pdata = {
235 .clk_freq = 100000,
236 .src_clk_rate = 24000000,
237};
238
Amit Blay6a8d4f32011-11-21 10:36:25 +0200239#define USB_5V_EN 3
240#define PM_USB_5V_EN PM8018_GPIO_PM_TO_SYS(USB_5V_EN)
241
242static void msm_hsusb_vbus_power(bool on)
243{
244 int rc;
245 static bool vbus_is_on;
246 struct pm_gpio usb_vbus = {
247 .direction = PM_GPIO_DIR_OUT,
248 .pull = PM_GPIO_PULL_NO,
249 .output_buffer = PM_GPIO_OUT_BUF_CMOS,
250 .output_value = 0,
251 .vin_sel = 2,
252 .out_strength = PM_GPIO_STRENGTH_HIGH,
253 .function = PM_GPIO_FUNC_NORMAL,
254 .inv_int_pol = 0,
255 };
256
257 if (vbus_is_on == on)
258 return;
259
260 if (on) {
261 rc = pm8xxx_gpio_config(PM_USB_5V_EN, &usb_vbus);
262 if (rc) {
263 pr_err("failed to config usb_5v_en gpio\n");
264 return;
265 }
266
267 rc = gpio_request(PM_USB_5V_EN,
268 "usb_5v_en");
269 if (rc < 0) {
270 pr_err("failed to request usb_5v_en gpio\n");
271 return;
272 }
273
274 rc = gpio_direction_output(PM_USB_5V_EN, 1);
275 if (rc) {
276 pr_err("%s: unable to set_direction for gpio [%d]\n",
277 __func__, PM_USB_5V_EN);
278 goto free_usb_5v_en;
279 }
280
281 vbus_is_on = true;
282 return;
283 }
284 gpio_set_value(PM_USB_5V_EN, 0);
285free_usb_5v_en:
286 gpio_free(PM_USB_5V_EN);
287 vbus_is_on = false;
288}
289
Anji jonnalaa8b8d732011-12-06 10:03:24 +0530290static int shelby_phy_init_seq[] = {
291 0x44, 0x80,/* set VBUS valid threshold and
292 disconnect valid threshold */
293 0x38, 0x81, /* update DC voltage level */
294 0x14, 0x82,/* set preemphasis and rise/fall time */
295 0x13, 0x83,/* set source impedance adjustment */
296 -1};
297
Ofir Cohen40a4e862011-12-08 15:17:52 +0200298#define USB_BAM_PHY_BASE 0x12502000
299#define USB_BAM_PHY_SIZE 0x10000
300#define A2_BAM_PHY_BASE 0x124C2000
301static struct usb_bam_pipe_connect msm_usb_bam_connections[4][2] = {
302 [0][USB_TO_PEER_PERIPHERAL] = {
303 .src_phy_addr = USB_BAM_PHY_BASE,
304 .src_pipe_index = 11,
305 .dst_phy_addr = A2_BAM_PHY_BASE,
306 .dst_pipe_index = 0,
Ofir Cohen29cd5752011-12-14 17:20:30 +0200307 .data_fifo_base_offset = 0x1100,
308 .data_fifo_size = 0x600,
309 .desc_fifo_base_offset = 0x1700,
Ofir Cohen40a4e862011-12-08 15:17:52 +0200310 .desc_fifo_size = 0x300,
311 },
312 [0][PEER_PERIPHERAL_TO_USB] = {
313 .src_phy_addr = A2_BAM_PHY_BASE,
314 .src_pipe_index = 1,
315 .dst_phy_addr = USB_BAM_PHY_BASE,
316 .dst_pipe_index = 10,
317 .data_fifo_base_offset = 0xa00,
Ofir Cohen29cd5752011-12-14 17:20:30 +0200318 .data_fifo_size = 0x600,
319 .desc_fifo_base_offset = 0x1000,
Ofir Cohen40a4e862011-12-08 15:17:52 +0200320 .desc_fifo_size = 0x100,
321 },
322};
323
324static struct msm_usb_bam_platform_data msm_usb_bam_pdata = {
325 .connections = &msm_usb_bam_connections[0][0],
326 .usb_bam_phy_base = USB_BAM_PHY_BASE,
327 .usb_bam_phy_size = USB_BAM_PHY_SIZE,
328 .usb_bam_num_pipes = 32,
329};
330
Amit Blay5e4ec192011-10-20 09:16:54 +0200331static struct msm_otg_platform_data msm_otg_pdata = {
Amit Blay6a8d4f32011-11-21 10:36:25 +0200332 .mode = USB_OTG,
333 .otg_control = OTG_PHY_CONTROL,
Amit Blay5e4ec192011-10-20 09:16:54 +0200334 .phy_type = SNPS_28NM_INTEGRATED_PHY,
Amit Blay6a8d4f32011-11-21 10:36:25 +0200335 .pclk_src_name = "dfab_usb_hs_clk",
336 .vbus_power = msm_hsusb_vbus_power,
Amit Blay5e4ec192011-10-20 09:16:54 +0200337};
338
339static int usb_diag_update_pid_and_serial_num(uint32_t pid, const char *snum)
340{
341 return 0;
342}
343
344static struct android_usb_platform_data android_usb_pdata = {
345 .update_pid_and_serial_num = usb_diag_update_pid_and_serial_num,
346};
347
348static struct platform_device android_usb_device = {
349 .name = "android_usb",
350 .id = -1,
351 .dev = {
352 .platform_data = &android_usb_pdata,
353 },
354};
355
Rohit Vaswani149f0a72011-11-09 15:21:28 -0800356static struct platform_device msm_wlan_ar6000_pm_device = {
357 .name = "wlan_ar6000_pm_dev",
358 .id = -1,
359};
360
361static int __init msm9615_init_ar6000pm(void)
362{
363 return platform_device_register(&msm_wlan_ar6000_pm_device);
364}
365
Jay Chokshidc8028b2011-12-01 16:17:34 -0800366#ifdef CONFIG_LTC4088_CHARGER
367static struct platform_device msm_device_charger = {
368 .name = LTC4088_CHARGER_DEV_NAME,
369 .id = -1,
370 .dev = {
371 .platform_data = &ltc4088_chg_pdata,
372 },
373};
374#endif
375
Amit Blay5e4ec192011-10-20 09:16:54 +0200376static struct platform_device *common_devices[] = {
377 &msm9615_device_dmov,
378 &msm_device_smd,
Jay Chokshidc8028b2011-12-01 16:17:34 -0800379#ifdef CONFIG_LTC4088_CHARGER
380 &msm_device_charger,
381#endif
Amit Blay5e4ec192011-10-20 09:16:54 +0200382 &msm_device_otg,
383 &msm_device_gadget_peripheral,
Amit Blay6a8d4f32011-11-21 10:36:25 +0200384 &msm_device_hsusb_host,
Ofir Cohen40a4e862011-12-08 15:17:52 +0200385 &msm_device_usb_bam,
Amit Blay5e4ec192011-10-20 09:16:54 +0200386 &android_usb_device,
387 &msm9615_device_uart_gsbi4,
David Collins0f9942a2011-10-31 09:47:34 -0700388 &msm9615_device_ext_2p95v_vreg,
Amit Blay5e4ec192011-10-20 09:16:54 +0200389 &msm9615_device_ssbi_pmic1,
390 &msm9615_device_qup_i2c_gsbi5,
391 &msm9615_device_qup_spi_gsbi3,
392 &msm_device_sps,
393 &msm9615_device_tsens,
394 &msm_device_nand,
Eric Holmberg0c96e702011-11-08 18:04:31 -0700395 &msm_device_bam_dmux,
Amit Blay5e4ec192011-10-20 09:16:54 +0200396 &msm_rpm_device,
397#ifdef CONFIG_HW_RANDOM_MSM
398 &msm_device_rng,
399#endif
400
401#if defined(CONFIG_CRYPTO_DEV_QCRYPTO) || \
402 defined(CONFIG_CRYPTO_DEV_QCRYPTO_MODULE)
Ramesh Masavarapuaa28b5b2011-10-21 10:26:03 -0700403 &msm9615_qcrypto_device,
Amit Blay5e4ec192011-10-20 09:16:54 +0200404#endif
405
406#if defined(CONFIG_CRYPTO_DEV_QCEDEV) || \
407 defined(CONFIG_CRYPTO_DEV_QCEDEV_MODULE)
Ramesh Masavarapuaa28b5b2011-10-21 10:26:03 -0700408 &msm9615_qcedev_device,
Amit Blay5e4ec192011-10-20 09:16:54 +0200409#endif
Jeff Ohlstein7e668552011-10-06 16:17:25 -0700410 &msm9615_device_watchdog,
Gagan Mac7a827642011-09-22 19:42:21 -0600411 &msm_bus_9615_sys_fabric,
412 &msm_bus_def_fab,
Amit Blay5e4ec192011-10-20 09:16:54 +0200413};
414
Harini Jayaramaneba52672011-09-08 15:13:00 -0600415static void __init msm9615_i2c_init(void)
416{
417 msm9615_device_qup_i2c_gsbi5.dev.platform_data =
418 &msm9615_i2c_qup_gsbi5_pdata;
419}
420
Maheshkumar Sivasubramanianc6c55032011-10-25 16:01:32 -0600421static void __init msm9615_reserve(void)
422{
423 msm_pm_boot_pdata.p_addr = memblock_alloc(SZ_8, SZ_64K);
424}
425
Rohit Vaswaniced9b3b2011-08-23 17:21:49 -0700426static void __init msm9615_common_init(void)
427{
428 msm9615_device_init();
Rohit Vaswania6815892011-12-15 20:20:39 -0800429 msm9615_init_gpiomux();
Harini Jayaramaneba52672011-09-08 15:13:00 -0600430 msm9615_i2c_init();
David Collins00b31e62011-08-31 20:00:10 -0700431 regulator_suppress_info_printing();
David Collinsbea297a2011-09-28 13:11:14 -0700432 platform_device_register(&msm9615_device_rpm_regulator);
Gagan Mac7a827642011-09-22 19:42:21 -0600433 msm_clock_init(&msm9615_clock_init_data);
434 msm9615_init_buses();
Harini Jayaraman738c9312011-09-08 15:22:38 -0600435 msm9615_device_qup_spi_gsbi3.dev.platform_data =
436 &msm9615_qup_spi_gsbi3_pdata;
Kenneth Heitkeaf3d3cf2011-09-08 11:45:31 -0700437 msm9615_device_ssbi_pmic1.dev.platform_data =
438 &msm9615_ssbi_pm8018_pdata;
David Collins00b31e62011-08-31 20:00:10 -0700439 pm8018_platform_data.num_regulators = msm_pm8018_regulator_pdata_len;
Amit Blay5e4ec192011-10-20 09:16:54 +0200440
441 msm_device_otg.dev.platform_data = &msm_otg_pdata;
Anji jonnalaa8b8d732011-12-06 10:03:24 +0530442 msm_otg_pdata.phy_init_seq = shelby_phy_init_seq;
Ofir Cohen40a4e862011-12-08 15:17:52 +0200443 msm_device_usb_bam.dev.platform_data = &msm_usb_bam_pdata;
Rohit Vaswani09666872011-08-23 17:41:54 -0700444 platform_add_devices(common_devices, ARRAY_SIZE(common_devices));
Krishna Kondadd794462011-10-01 00:19:29 -0700445
Vikram Mulukutlab5e1cda2011-10-04 16:17:22 -0700446 acpuclk_init(&acpuclk_9615_soc_data);
447
Rohit Vaswani149f0a72011-11-09 15:21:28 -0800448 /* Ensure ar6000pm device is registered before MMC/SDC */
449 msm9615_init_ar6000pm();
450
Krishna Kondadd794462011-10-01 00:19:29 -0700451 msm9615_init_mmc();
Maheshkumar Sivasubramanian4923db22011-09-15 09:28:15 -0600452 msm_pm_set_platform_data(msm_pm_data, ARRAY_SIZE(msm_pm_data));
453 msm_pm_set_rpm_wakeup_irq(RPM_APCC_CPU0_WAKE_UP_IRQ);
454 msm_cpuidle_set_states(msm_cstates, ARRAY_SIZE(msm_cstates),
455 msm_pm_data);
Maheshkumar Sivasubramanianc6c55032011-10-25 16:01:32 -0600456 BUG_ON(msm_pm_boot_init(&msm_pm_boot_pdata));
Rohit Vaswaniced9b3b2011-08-23 17:21:49 -0700457}
458
459static void __init msm9615_cdp_init(void)
460{
461 msm9615_common_init();
462}
463
464static void __init msm9615_mtp_init(void)
465{
466 msm9615_common_init();
467}
468
469MACHINE_START(MSM9615_CDP, "QCT MSM9615 CDP")
470 .map_io = msm9615_map_io,
471 .init_irq = msm9615_init_irq,
Marc Zyngier89bdafd12011-12-22 11:39:20 +0530472 .handle_irq = gic_handle_irq,
Rohit Vaswaniced9b3b2011-08-23 17:21:49 -0700473 .timer = &msm_timer,
474 .init_machine = msm9615_cdp_init,
Maheshkumar Sivasubramanianc6c55032011-10-25 16:01:32 -0600475 .reserve = msm9615_reserve,
Rohit Vaswaniced9b3b2011-08-23 17:21:49 -0700476MACHINE_END
477
478MACHINE_START(MSM9615_MTP, "QCT MSM9615 MTP")
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_mtp_init,
Maheshkumar Sivasubramanianc6c55032011-10-25 16:01:32 -0600484 .reserve = msm9615_reserve,
Rohit Vaswaniced9b3b2011-08-23 17:21:49 -0700485MACHINE_END