blob: 40cbee0ae88b6fffc9a7a5fbe83dea2f2db33b70 [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>
Rohit Vaswaniced9b3b2011-08-23 17:21:49 -070017#include <asm/mach-types.h>
18#include <asm/mach/arch.h>
Krishna Kondadd794462011-10-01 00:19:29 -070019#include <asm/mach/mmc.h>
Rohit Vaswaniced9b3b2011-08-23 17:21:49 -070020#include <mach/board.h>
21#include <mach/msm_iomap.h>
22#include <mach/gpio.h>
23#include <mach/gpiomux.h>
Harini Jayaraman738c9312011-09-08 15:22:38 -060024#include <mach/msm_spi.h>
Amit Blay5e4ec192011-10-20 09:16:54 +020025#include <linux/usb/android.h>
26#include <linux/usb/msm_hsusb.h>
Rohit Vaswaniced9b3b2011-08-23 17:21:49 -070027#include "timer.h"
28#include "devices.h"
David Collinsfb88c432011-08-25 15:12:47 -070029#include "board-9615.h"
Maheshkumar Sivasubramanian4923db22011-09-15 09:28:15 -060030#include "cpuidle.h"
31#include "pm.h"
Vikram Mulukutlab5e1cda2011-10-04 16:17:22 -070032#include "acpuclock.h"
Rohit Vaswaniced9b3b2011-08-23 17:21:49 -070033
David Collinsfb88c432011-08-25 15:12:47 -070034static struct pm8xxx_irq_platform_data pm8xxx_irq_pdata __devinitdata = {
35 .irq_base = PM8018_IRQ_BASE,
36 .devirq = MSM_GPIO_TO_INT(87),
37 .irq_trigger_flag = IRQF_TRIGGER_LOW,
38};
39
40static struct pm8xxx_gpio_platform_data pm8xxx_gpio_pdata __devinitdata = {
41 .gpio_base = PM8018_GPIO_PM_TO_SYS(1),
42};
43
44static struct pm8xxx_mpp_platform_data pm8xxx_mpp_pdata __devinitdata = {
45 .mpp_base = PM8018_MPP_PM_TO_SYS(1),
46};
47
48static struct pm8xxx_rtc_platform_data pm8xxx_rtc_pdata __devinitdata = {
49 .rtc_write_enable = false,
Ashay Jaiswaldb5e6dc2011-10-12 11:02:47 +053050 .rtc_alarm_powerup = false,
David Collinsfb88c432011-08-25 15:12:47 -070051};
52
53static struct pm8xxx_pwrkey_platform_data pm8xxx_pwrkey_pdata = {
54 .pull_up = 1,
55 .kpd_trigger_delay_us = 970,
56 .wakeup = 1,
57};
58
59static struct pm8xxx_misc_platform_data pm8xxx_misc_pdata = {
60 .priority = 0,
61};
62
63static struct pm8018_platform_data pm8018_platform_data __devinitdata = {
64 .irq_pdata = &pm8xxx_irq_pdata,
65 .gpio_pdata = &pm8xxx_gpio_pdata,
66 .mpp_pdata = &pm8xxx_mpp_pdata,
67 .rtc_pdata = &pm8xxx_rtc_pdata,
68 .pwrkey_pdata = &pm8xxx_pwrkey_pdata,
69 .misc_pdata = &pm8xxx_misc_pdata,
David Collins00b31e62011-08-31 20:00:10 -070070 .regulator_pdatas = msm_pm8018_regulator_pdata,
David Collinsfb88c432011-08-25 15:12:47 -070071};
72
Kenneth Heitkeaf3d3cf2011-09-08 11:45:31 -070073static struct msm_ssbi_platform_data msm9615_ssbi_pm8018_pdata __devinitdata = {
74 .controller_type = MSM_SBI_CTRL_PMIC_ARBITER,
75 .slave = {
David Collinsfb88c432011-08-25 15:12:47 -070076 .name = PM8018_CORE_DEV_NAME,
77 .platform_data = &pm8018_platform_data,
Kenneth Heitkeaf3d3cf2011-09-08 11:45:31 -070078 },
79};
80
David Collinsbea297a2011-09-28 13:11:14 -070081static struct platform_device msm9615_device_rpm_regulator __devinitdata = {
82 .name = "rpm-regulator",
83 .id = -1,
84 .dev = {
85 .platform_data = &msm_rpm_regulator_9615_pdata,
86 },
87};
88
Rohit Vaswanif688fa62011-10-13 18:13:10 -070089static struct gpiomux_setting ps_hold = {
90 .func = GPIOMUX_FUNC_1,
91 .drv = GPIOMUX_DRV_8MA,
92 .pull = GPIOMUX_PULL_NONE,
93};
94
Rohit Vaswani09666872011-08-23 17:41:54 -070095static struct gpiomux_setting gsbi4 = {
96 .func = GPIOMUX_FUNC_1,
97 .drv = GPIOMUX_DRV_8MA,
98 .pull = GPIOMUX_PULL_NONE,
99};
100
Harini Jayaramaneba52672011-09-08 15:13:00 -0600101static struct gpiomux_setting gsbi5 = {
102 .func = GPIOMUX_FUNC_1,
103 .drv = GPIOMUX_DRV_8MA,
104 .pull = GPIOMUX_PULL_NONE,
105};
106
Harini Jayaraman738c9312011-09-08 15:22:38 -0600107static struct gpiomux_setting gsbi3 = {
108 .func = GPIOMUX_FUNC_1,
109 .drv = GPIOMUX_DRV_8MA,
110 .pull = GPIOMUX_PULL_NONE,
111};
112
113static struct gpiomux_setting gsbi3_cs1_config = {
114 .func = GPIOMUX_FUNC_4,
115 .drv = GPIOMUX_DRV_8MA,
116 .pull = GPIOMUX_PULL_NONE,
117};
118
Rohit Vaswanif688fa62011-10-13 18:13:10 -0700119struct msm_gpiomux_config msm9615_ps_hold_config[] __initdata = {
120 {
121 .gpio = 83,
122 .settings = {
123 [GPIOMUX_SUSPENDED] = &ps_hold,
124 },
125 },
126};
127
Rohit Vaswani09666872011-08-23 17:41:54 -0700128struct msm_gpiomux_config msm9615_gsbi_configs[] __initdata = {
129 {
Harini Jayaraman738c9312011-09-08 15:22:38 -0600130 .gpio = 8, /* GSBI3 QUP SPI_CLK */
131 .settings = {
132 [GPIOMUX_SUSPENDED] = &gsbi3,
133 },
134 },
135 {
136 .gpio = 9, /* GSBI3 QUP SPI_CS_N */
137 .settings = {
138 [GPIOMUX_SUSPENDED] = &gsbi3,
139 },
140 },
141 {
142 .gpio = 10, /* GSBI3 QUP SPI_DATA_MISO */
143 .settings = {
144 [GPIOMUX_SUSPENDED] = &gsbi3,
145 },
146 },
147 {
148 .gpio = 11, /* GSBI3 QUP SPI_DATA_MOSI */
149 .settings = {
150 [GPIOMUX_SUSPENDED] = &gsbi3,
151 },
152 },
153 {
Rohit Vaswani09666872011-08-23 17:41:54 -0700154 .gpio = 12, /* GSBI4 UART */
155 .settings = {
156 [GPIOMUX_SUSPENDED] = &gsbi4,
157 },
158 },
159 {
160 .gpio = 13, /* GSBI4 UART */
161 .settings = {
162 [GPIOMUX_SUSPENDED] = &gsbi4,
163 },
164 },
165 {
166 .gpio = 14, /* GSBI4 UART */
167 .settings = {
168 [GPIOMUX_SUSPENDED] = &gsbi4,
169 },
170 },
171 {
172 .gpio = 15, /* GSBI4 UART */
173 .settings = {
174 [GPIOMUX_SUSPENDED] = &gsbi4,
175 },
176 },
Harini Jayaramaneba52672011-09-08 15:13:00 -0600177 {
178 .gpio = 16, /* GSBI5 I2C QUP SCL */
179 .settings = {
180 [GPIOMUX_SUSPENDED] = &gsbi5,
181 },
182 },
183 {
184 .gpio = 17, /* GSBI5 I2C QUP SDA */
185 .settings = {
186 [GPIOMUX_SUSPENDED] = &gsbi5,
187 },
188 },
Harini Jayaraman738c9312011-09-08 15:22:38 -0600189 {
190 /* GPIO 19 can be used for I2C/UART on GSBI5 */
191 .gpio = 19, /* GSBI3 QUP SPI_CS_1 */
192 .settings = {
193 [GPIOMUX_SUSPENDED] = &gsbi3_cs1_config,
194 },
195 },
Rohit Vaswani09666872011-08-23 17:41:54 -0700196};
197
Krishna Kondadd794462011-10-01 00:19:29 -0700198#if (defined(CONFIG_MMC_MSM_SDC1_SUPPORT)\
199 || defined(CONFIG_MMC_MSM_SDC2_SUPPORT))
200
201#define GPIO_SDCARD_PWR_EN 18
202
203/* MDM9x15 have 2 SDCC controllers */
204enum sdcc_controllers {
205 SDCC1,
206 SDCC2,
207 MAX_SDCC_CONTROLLER
208};
209
210#ifdef CONFIG_MMC_MSM_SDC1_SUPPORT
211/* SDC1 pad data */
212static struct msm_mmc_pad_drv sdc1_pad_drv_on_cfg[] = {
213 {TLMM_HDRV_SDC1_CLK, GPIO_CFG_16MA},
214 {TLMM_HDRV_SDC1_CMD, GPIO_CFG_10MA},
215 {TLMM_HDRV_SDC1_DATA, GPIO_CFG_10MA}
216};
217
218static struct msm_mmc_pad_drv sdc1_pad_drv_off_cfg[] = {
219 {TLMM_HDRV_SDC1_CLK, GPIO_CFG_2MA},
220 {TLMM_HDRV_SDC1_CMD, GPIO_CFG_2MA},
221 {TLMM_HDRV_SDC1_DATA, GPIO_CFG_2MA}
222};
223
224static struct msm_mmc_pad_pull sdc1_pad_pull_on_cfg[] = {
225 {TLMM_PULL_SDC1_CLK, GPIO_CFG_NO_PULL},
226 {TLMM_PULL_SDC1_CMD, GPIO_CFG_PULL_UP},
227 {TLMM_PULL_SDC1_DATA, GPIO_CFG_PULL_UP}
228};
229
230static struct msm_mmc_pad_pull sdc1_pad_pull_off_cfg[] = {
231 {TLMM_PULL_SDC1_CLK, GPIO_CFG_NO_PULL},
232 {TLMM_PULL_SDC1_CMD, GPIO_CFG_PULL_DOWN},
233 {TLMM_PULL_SDC1_DATA, GPIO_CFG_PULL_DOWN}
234};
235
236static struct msm_mmc_pad_pull_data mmc_pad_pull_data[MAX_SDCC_CONTROLLER] = {
237 [SDCC1] = {
238 .on = sdc1_pad_pull_on_cfg,
239 .off = sdc1_pad_pull_off_cfg,
240 .size = ARRAY_SIZE(sdc1_pad_pull_on_cfg)
241 },
242};
243
244static struct msm_mmc_pad_drv_data mmc_pad_drv_data[MAX_SDCC_CONTROLLER] = {
245 [SDCC1] = {
246 .on = sdc1_pad_drv_on_cfg,
247 .off = sdc1_pad_drv_off_cfg,
248 .size = ARRAY_SIZE(sdc1_pad_drv_on_cfg)
249 },
250};
251
252static struct msm_mmc_pad_data mmc_pad_data[MAX_SDCC_CONTROLLER] = {
253 [SDCC1] = {
254 .pull = &mmc_pad_pull_data[SDCC1],
255 .drv = &mmc_pad_drv_data[SDCC1]
256 },
257};
258#endif
259
Krishna Konda71aef182011-10-01 02:27:51 -0700260#ifdef CONFIG_MMC_MSM_SDC2_SUPPORT
261static struct gpiomux_setting sdcc2_clk_actv_cfg = {
262 .func = GPIOMUX_FUNC_1,
263 .drv = GPIOMUX_DRV_16MA,
264 .pull = GPIOMUX_PULL_NONE,
265};
266
267static struct gpiomux_setting sdcc2_cmd_data_0_3_actv_cfg = {
268 .func = GPIOMUX_FUNC_1,
269 .drv = GPIOMUX_DRV_8MA,
270 .pull = GPIOMUX_PULL_UP,
271};
272
273static struct gpiomux_setting sdcc2_suspend_cfg = {
274 .func = GPIOMUX_FUNC_1,
275 .drv = GPIOMUX_DRV_2MA,
276 .pull = GPIOMUX_PULL_DOWN,
277};
278
279static struct msm_gpiomux_config msm9615_sdcc2_configs[] __initdata = {
280 {
281 /* SDC2_DATA_0 */
282 .gpio = 25,
283 .settings = {
284 [GPIOMUX_ACTIVE] = &sdcc2_cmd_data_0_3_actv_cfg,
285 [GPIOMUX_SUSPENDED] = &sdcc2_suspend_cfg,
286 },
287 },
288 {
289 /* SDC2_DATA_1 */
290 .gpio = 26,
291 .settings = {
292 [GPIOMUX_ACTIVE] = &sdcc2_cmd_data_0_3_actv_cfg,
293 [GPIOMUX_SUSPENDED] = &sdcc2_suspend_cfg,
294 },
295 },
296 {
297 /* SDC2_DATA_2 */
298 .gpio = 27,
299 .settings = {
300 [GPIOMUX_ACTIVE] = &sdcc2_cmd_data_0_3_actv_cfg,
301 [GPIOMUX_SUSPENDED] = &sdcc2_suspend_cfg,
302 },
303 },
304 {
305 /* SDC2_DATA_3 */
306 .gpio = 28,
307 .settings = {
308 [GPIOMUX_ACTIVE] = &sdcc2_cmd_data_0_3_actv_cfg,
309 [GPIOMUX_SUSPENDED] = &sdcc2_suspend_cfg,
310 },
311 },
312 {
313 /* SDC2_CMD GSBI1 */
314 .gpio = 29,
315 .settings = {
316 [GPIOMUX_ACTIVE] = &sdcc2_cmd_data_0_3_actv_cfg,
317 [GPIOMUX_SUSPENDED] = &sdcc2_suspend_cfg,
318 },
319 },
320 {
321 /* SDC2_CLK GSBI1 */
322 .gpio = 30,
323 .settings = {
324 [GPIOMUX_ACTIVE] = &sdcc2_clk_actv_cfg,
325 [GPIOMUX_SUSPENDED] = &sdcc2_suspend_cfg,
326 },
327 },
328};
329
330static struct msm_mmc_gpio sdc2_gpio_cfg[] = {
331 {25, "sdc2_dat_0"},
332 {26, "sdc2_dat_1"},
333 {27, "sdc2_dat_2"},
334 {28, "sdc2_dat_3"},
335 {29, "sdc2_cmd"},
336 {30, "sdc2_clk"},
337};
338
339static struct msm_mmc_gpio_data mmc_gpio_data[MAX_SDCC_CONTROLLER] = {
340 [SDCC2] = {
341 .gpio = sdc2_gpio_cfg,
342 .size = ARRAY_SIZE(sdc2_gpio_cfg),
343 },
344};
345#else
346static struct msm_gpiomux_config msm9615_sdcc2_configs[0];
347#endif
348
349static struct msm_mmc_pin_data mmc_slot_pin_data[MAX_SDCC_CONTROLLER] = {
Krishna Kondadd794462011-10-01 00:19:29 -0700350#ifdef CONFIG_MMC_MSM_SDC1_SUPPORT
351 [SDCC1] = {
352 .is_gpio = 0,
353 .pad_data = &mmc_pad_data[SDCC1],
354 },
355#endif
Krishna Konda71aef182011-10-01 02:27:51 -0700356#ifdef CONFIG_MMC_MSM_SDC2_SUPPORT
357 [SDCC2] = {
358 .is_gpio = 1,
359 .gpio_data = &mmc_gpio_data[SDCC2],
360 },
361#endif
Krishna Kondadd794462011-10-01 00:19:29 -0700362};
363
364#ifdef CONFIG_MMC_MSM_SDC1_SUPPORT
365static unsigned int sdc1_sup_clk_rates[] = {
366 400000, 24000000, 48000000
367};
368
369static struct mmc_platform_data sdc1_data = {
370 .ocr_mask = MMC_VDD_27_28 | MMC_VDD_28_29,
371 .mmc_bus_width = MMC_CAP_4_BIT_DATA,
372 .sup_clk_table = sdc1_sup_clk_rates,
373 .sup_clk_cnt = ARRAY_SIZE(sdc1_sup_clk_rates),
374 .sdcc_v4_sup = true,
375 .pin_data = &mmc_slot_pin_data[SDCC1],
376};
377static struct mmc_platform_data *msm9615_sdc1_pdata = &sdc1_data;
378#else
379static struct mmc_platform_data *msm9615_sdc1_pdata;
380#endif
381
Krishna Konda71aef182011-10-01 02:27:51 -0700382#ifdef CONFIG_MMC_MSM_SDC2_SUPPORT
383static unsigned int sdc2_sup_clk_rates[] = {
384 400000, 24000000, 48000000
385};
386
387static struct mmc_platform_data sdc2_data = {
388 .ocr_mask = MMC_VDD_27_28 | MMC_VDD_28_29,
389 .mmc_bus_width = MMC_CAP_4_BIT_DATA,
390 .sup_clk_table = sdc2_sup_clk_rates,
391 .sup_clk_cnt = ARRAY_SIZE(sdc2_sup_clk_rates),
392 .sdcc_v4_sup = true,
393 .pin_data = &mmc_slot_pin_data[SDCC2],
394};
395static struct mmc_platform_data *msm9615_sdc2_pdata = &sdc2_data;
396#else
397static struct mmc_platform_data *msm9615_sdc2_pdata;
398#endif
399
Krishna Kondadd794462011-10-01 00:19:29 -0700400static void __init msm9615_init_mmc(void)
401{
402 int ret;
403
404 if (msm9615_sdc1_pdata) {
405 ret = gpio_request(GPIO_SDCARD_PWR_EN, "SDCARD_PWR_EN");
406
407 if (ret) {
408 pr_err("%s: sdcc1: Error requesting GPIO "
409 "SDCARD_PWR_EN:%d\n", __func__, ret);
410 } else {
411 ret = gpio_direction_output(GPIO_SDCARD_PWR_EN, 1);
412 if (ret) {
413 pr_err("%s: sdcc1: Error setting o/p direction"
414 " for GPIO SDCARD_PWR_EN:%d\n",
415 __func__, ret);
416 gpio_free(GPIO_SDCARD_PWR_EN);
417 } else {
418 msm_add_sdcc(1, msm9615_sdc1_pdata);
419 }
420 }
421 }
Krishna Konda71aef182011-10-01 02:27:51 -0700422
423 if (msm9615_sdc2_pdata) {
424 msm_gpiomux_install(msm9615_sdcc2_configs,
425 ARRAY_SIZE(msm9615_sdcc2_configs));
426
427 /* SDC2: External card slot */
428 msm_add_sdcc(2, msm9615_sdc2_pdata);
429 }
Krishna Kondadd794462011-10-01 00:19:29 -0700430}
431#else
432static void __init msm9615_init_mmc(void) { }
433#endif
Maheshkumar Sivasubramanian4923db22011-09-15 09:28:15 -0600434static struct msm_cpuidle_state msm_cstates[] __initdata = {
435 {0, 0, "C0", "WFI",
436 MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT},
437
438 {0, 1, "C1", "STANDALONE_POWER_COLLAPSE",
439 MSM_PM_SLEEP_MODE_POWER_COLLAPSE_STANDALONE},
440
441 {0, 2, "C2", "POWER_COLLAPSE",
442 MSM_PM_SLEEP_MODE_POWER_COLLAPSE},
443};
444static struct msm_pm_platform_data msm_pm_data[MSM_PM_SLEEP_MODE_NR] = {
445 [MSM_PM_MODE(0, MSM_PM_SLEEP_MODE_POWER_COLLAPSE)] = {
446 .idle_supported = 1,
447 .suspend_supported = 1,
448 .idle_enabled = 0,
449 .suspend_enabled = 0,
450 },
451 [MSM_PM_MODE(0, MSM_PM_SLEEP_MODE_POWER_COLLAPSE_STANDALONE)] = {
452 .idle_supported = 1,
453 .suspend_supported = 1,
454 .idle_enabled = 0,
455 .suspend_enabled = 0,
456 },
457 [MSM_PM_MODE(0, MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT)] = {
458 .idle_supported = 1,
459 .suspend_supported = 1,
460 .idle_enabled = 1,
461 .suspend_enabled = 1,
462 },
463};
Krishna Kondadd794462011-10-01 00:19:29 -0700464
Rohit Vaswaniced9b3b2011-08-23 17:21:49 -0700465static int __init gpiomux_init(void)
466{
467 int rc;
468
469 rc = msm_gpiomux_init(NR_GPIO_IRQS);
470 if (rc) {
471 pr_err(KERN_ERR "msm_gpiomux_init failed %d\n", rc);
472 return rc;
473 }
Rohit Vaswani09666872011-08-23 17:41:54 -0700474 msm_gpiomux_install(msm9615_gsbi_configs,
475 ARRAY_SIZE(msm9615_gsbi_configs));
476
Rohit Vaswanif688fa62011-10-13 18:13:10 -0700477 msm_gpiomux_install(msm9615_ps_hold_config,
478 ARRAY_SIZE(msm9615_ps_hold_config));
Rohit Vaswaniced9b3b2011-08-23 17:21:49 -0700479 return 0;
480}
481
Harini Jayaraman738c9312011-09-08 15:22:38 -0600482static struct msm_spi_platform_data msm9615_qup_spi_gsbi3_pdata = {
483 .max_clock_speed = 24000000,
484};
485
Harini Jayaramaneba52672011-09-08 15:13:00 -0600486static struct msm_i2c_platform_data msm9615_i2c_qup_gsbi5_pdata = {
487 .clk_freq = 100000,
488 .src_clk_rate = 24000000,
489};
490
Amit Blay5e4ec192011-10-20 09:16:54 +0200491static struct msm_otg_platform_data msm_otg_pdata = {
492 .mode = USB_PERIPHERAL,
493 .otg_control = OTG_NO_CONTROL,
494 .phy_type = SNPS_28NM_INTEGRATED_PHY,
495 .pclk_src_name = "dfab_usb_hs_clk",
496};
497
498static int usb_diag_update_pid_and_serial_num(uint32_t pid, const char *snum)
499{
500 return 0;
501}
502
503static struct android_usb_platform_data android_usb_pdata = {
504 .update_pid_and_serial_num = usb_diag_update_pid_and_serial_num,
505};
506
507static struct platform_device android_usb_device = {
508 .name = "android_usb",
509 .id = -1,
510 .dev = {
511 .platform_data = &android_usb_pdata,
512 },
513};
514
515static struct platform_device *common_devices[] = {
516 &msm9615_device_dmov,
517 &msm_device_smd,
518 &msm_device_otg,
519 &msm_device_gadget_peripheral,
520 &android_usb_device,
521 &msm9615_device_uart_gsbi4,
522 &msm9615_device_ssbi_pmic1,
523 &msm9615_device_qup_i2c_gsbi5,
524 &msm9615_device_qup_spi_gsbi3,
525 &msm_device_sps,
526 &msm9615_device_tsens,
527 &msm_device_nand,
528 &msm_rpm_device,
529#ifdef CONFIG_HW_RANDOM_MSM
530 &msm_device_rng,
531#endif
532
533#if defined(CONFIG_CRYPTO_DEV_QCRYPTO) || \
534 defined(CONFIG_CRYPTO_DEV_QCRYPTO_MODULE)
Ramesh Masavarapuaa28b5b2011-10-21 10:26:03 -0700535 &msm9615_qcrypto_device,
Amit Blay5e4ec192011-10-20 09:16:54 +0200536#endif
537
538#if defined(CONFIG_CRYPTO_DEV_QCEDEV) || \
539 defined(CONFIG_CRYPTO_DEV_QCEDEV_MODULE)
Ramesh Masavarapuaa28b5b2011-10-21 10:26:03 -0700540 &msm9615_qcedev_device,
Amit Blay5e4ec192011-10-20 09:16:54 +0200541#endif
542};
543
Harini Jayaramaneba52672011-09-08 15:13:00 -0600544static void __init msm9615_i2c_init(void)
545{
546 msm9615_device_qup_i2c_gsbi5.dev.platform_data =
547 &msm9615_i2c_qup_gsbi5_pdata;
548}
549
Rohit Vaswaniced9b3b2011-08-23 17:21:49 -0700550static void __init msm9615_common_init(void)
551{
552 msm9615_device_init();
553 gpiomux_init();
Harini Jayaramaneba52672011-09-08 15:13:00 -0600554 msm9615_i2c_init();
David Collins00b31e62011-08-31 20:00:10 -0700555 regulator_suppress_info_printing();
David Collinsbea297a2011-09-28 13:11:14 -0700556 platform_device_register(&msm9615_device_rpm_regulator);
Harini Jayaraman738c9312011-09-08 15:22:38 -0600557 msm9615_device_qup_spi_gsbi3.dev.platform_data =
558 &msm9615_qup_spi_gsbi3_pdata;
Kenneth Heitkeaf3d3cf2011-09-08 11:45:31 -0700559 msm9615_device_ssbi_pmic1.dev.platform_data =
560 &msm9615_ssbi_pm8018_pdata;
David Collins00b31e62011-08-31 20:00:10 -0700561 pm8018_platform_data.num_regulators = msm_pm8018_regulator_pdata_len;
Amit Blay5e4ec192011-10-20 09:16:54 +0200562
563 msm_device_otg.dev.platform_data = &msm_otg_pdata;
564 msm_device_gadget_peripheral.dev.parent = &msm_device_otg.dev;
Rohit Vaswani09666872011-08-23 17:41:54 -0700565 platform_add_devices(common_devices, ARRAY_SIZE(common_devices));
Krishna Kondadd794462011-10-01 00:19:29 -0700566
Vikram Mulukutlab5e1cda2011-10-04 16:17:22 -0700567 msm_clock_init(&msm9615_clock_init_data);
568 acpuclk_init(&acpuclk_9615_soc_data);
569
Krishna Kondadd794462011-10-01 00:19:29 -0700570 msm9615_init_mmc();
Maheshkumar Sivasubramanian4923db22011-09-15 09:28:15 -0600571 msm_pm_set_platform_data(msm_pm_data, ARRAY_SIZE(msm_pm_data));
572 msm_pm_set_rpm_wakeup_irq(RPM_APCC_CPU0_WAKE_UP_IRQ);
573 msm_cpuidle_set_states(msm_cstates, ARRAY_SIZE(msm_cstates),
574 msm_pm_data);
Rohit Vaswaniced9b3b2011-08-23 17:21:49 -0700575}
576
577static void __init msm9615_cdp_init(void)
578{
579 msm9615_common_init();
580}
581
582static void __init msm9615_mtp_init(void)
583{
584 msm9615_common_init();
585}
586
587MACHINE_START(MSM9615_CDP, "QCT MSM9615 CDP")
588 .map_io = msm9615_map_io,
589 .init_irq = msm9615_init_irq,
590 .timer = &msm_timer,
591 .init_machine = msm9615_cdp_init,
592MACHINE_END
593
594MACHINE_START(MSM9615_MTP, "QCT MSM9615 MTP")
595 .map_io = msm9615_map_io,
596 .init_irq = msm9615_init_irq,
597 .timer = &msm_timer,
598 .init_machine = msm9615_mtp_init,
599MACHINE_END