blob: 82a0bb963610bae4bf01bee90bc04c40cad47928 [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"
Rohit Vaswaniced9b3b2011-08-23 17:21:49 -070032
David Collinsfb88c432011-08-25 15:12:47 -070033static struct pm8xxx_irq_platform_data pm8xxx_irq_pdata __devinitdata = {
34 .irq_base = PM8018_IRQ_BASE,
35 .devirq = MSM_GPIO_TO_INT(87),
36 .irq_trigger_flag = IRQF_TRIGGER_LOW,
37};
38
39static struct pm8xxx_gpio_platform_data pm8xxx_gpio_pdata __devinitdata = {
40 .gpio_base = PM8018_GPIO_PM_TO_SYS(1),
41};
42
43static struct pm8xxx_mpp_platform_data pm8xxx_mpp_pdata __devinitdata = {
44 .mpp_base = PM8018_MPP_PM_TO_SYS(1),
45};
46
47static struct pm8xxx_rtc_platform_data pm8xxx_rtc_pdata __devinitdata = {
48 .rtc_write_enable = false,
Ashay Jaiswaldb5e6dc2011-10-12 11:02:47 +053049 .rtc_alarm_powerup = false,
David Collinsfb88c432011-08-25 15:12:47 -070050};
51
52static struct pm8xxx_pwrkey_platform_data pm8xxx_pwrkey_pdata = {
53 .pull_up = 1,
54 .kpd_trigger_delay_us = 970,
55 .wakeup = 1,
56};
57
58static struct pm8xxx_misc_platform_data pm8xxx_misc_pdata = {
59 .priority = 0,
60};
61
62static struct pm8018_platform_data pm8018_platform_data __devinitdata = {
63 .irq_pdata = &pm8xxx_irq_pdata,
64 .gpio_pdata = &pm8xxx_gpio_pdata,
65 .mpp_pdata = &pm8xxx_mpp_pdata,
66 .rtc_pdata = &pm8xxx_rtc_pdata,
67 .pwrkey_pdata = &pm8xxx_pwrkey_pdata,
68 .misc_pdata = &pm8xxx_misc_pdata,
David Collins00b31e62011-08-31 20:00:10 -070069 .regulator_pdatas = msm_pm8018_regulator_pdata,
David Collinsfb88c432011-08-25 15:12:47 -070070};
71
Kenneth Heitkeaf3d3cf2011-09-08 11:45:31 -070072static struct msm_ssbi_platform_data msm9615_ssbi_pm8018_pdata __devinitdata = {
73 .controller_type = MSM_SBI_CTRL_PMIC_ARBITER,
74 .slave = {
David Collinsfb88c432011-08-25 15:12:47 -070075 .name = PM8018_CORE_DEV_NAME,
76 .platform_data = &pm8018_platform_data,
Kenneth Heitkeaf3d3cf2011-09-08 11:45:31 -070077 },
78};
79
David Collinsbea297a2011-09-28 13:11:14 -070080static struct platform_device msm9615_device_rpm_regulator __devinitdata = {
81 .name = "rpm-regulator",
82 .id = -1,
83 .dev = {
84 .platform_data = &msm_rpm_regulator_9615_pdata,
85 },
86};
87
Rohit Vaswanif688fa62011-10-13 18:13:10 -070088static struct gpiomux_setting ps_hold = {
89 .func = GPIOMUX_FUNC_1,
90 .drv = GPIOMUX_DRV_8MA,
91 .pull = GPIOMUX_PULL_NONE,
92};
93
Rohit Vaswani09666872011-08-23 17:41:54 -070094static struct gpiomux_setting gsbi4 = {
95 .func = GPIOMUX_FUNC_1,
96 .drv = GPIOMUX_DRV_8MA,
97 .pull = GPIOMUX_PULL_NONE,
98};
99
Harini Jayaramaneba52672011-09-08 15:13:00 -0600100static struct gpiomux_setting gsbi5 = {
101 .func = GPIOMUX_FUNC_1,
102 .drv = GPIOMUX_DRV_8MA,
103 .pull = GPIOMUX_PULL_NONE,
104};
105
Harini Jayaraman738c9312011-09-08 15:22:38 -0600106static struct gpiomux_setting gsbi3 = {
107 .func = GPIOMUX_FUNC_1,
108 .drv = GPIOMUX_DRV_8MA,
109 .pull = GPIOMUX_PULL_NONE,
110};
111
112static struct gpiomux_setting gsbi3_cs1_config = {
113 .func = GPIOMUX_FUNC_4,
114 .drv = GPIOMUX_DRV_8MA,
115 .pull = GPIOMUX_PULL_NONE,
116};
117
Rohit Vaswanif688fa62011-10-13 18:13:10 -0700118struct msm_gpiomux_config msm9615_ps_hold_config[] __initdata = {
119 {
120 .gpio = 83,
121 .settings = {
122 [GPIOMUX_SUSPENDED] = &ps_hold,
123 },
124 },
125};
126
Rohit Vaswani09666872011-08-23 17:41:54 -0700127struct msm_gpiomux_config msm9615_gsbi_configs[] __initdata = {
128 {
Harini Jayaraman738c9312011-09-08 15:22:38 -0600129 .gpio = 8, /* GSBI3 QUP SPI_CLK */
130 .settings = {
131 [GPIOMUX_SUSPENDED] = &gsbi3,
132 },
133 },
134 {
135 .gpio = 9, /* GSBI3 QUP SPI_CS_N */
136 .settings = {
137 [GPIOMUX_SUSPENDED] = &gsbi3,
138 },
139 },
140 {
141 .gpio = 10, /* GSBI3 QUP SPI_DATA_MISO */
142 .settings = {
143 [GPIOMUX_SUSPENDED] = &gsbi3,
144 },
145 },
146 {
147 .gpio = 11, /* GSBI3 QUP SPI_DATA_MOSI */
148 .settings = {
149 [GPIOMUX_SUSPENDED] = &gsbi3,
150 },
151 },
152 {
Rohit Vaswani09666872011-08-23 17:41:54 -0700153 .gpio = 12, /* GSBI4 UART */
154 .settings = {
155 [GPIOMUX_SUSPENDED] = &gsbi4,
156 },
157 },
158 {
159 .gpio = 13, /* GSBI4 UART */
160 .settings = {
161 [GPIOMUX_SUSPENDED] = &gsbi4,
162 },
163 },
164 {
165 .gpio = 14, /* GSBI4 UART */
166 .settings = {
167 [GPIOMUX_SUSPENDED] = &gsbi4,
168 },
169 },
170 {
171 .gpio = 15, /* GSBI4 UART */
172 .settings = {
173 [GPIOMUX_SUSPENDED] = &gsbi4,
174 },
175 },
Harini Jayaramaneba52672011-09-08 15:13:00 -0600176 {
177 .gpio = 16, /* GSBI5 I2C QUP SCL */
178 .settings = {
179 [GPIOMUX_SUSPENDED] = &gsbi5,
180 },
181 },
182 {
183 .gpio = 17, /* GSBI5 I2C QUP SDA */
184 .settings = {
185 [GPIOMUX_SUSPENDED] = &gsbi5,
186 },
187 },
Harini Jayaraman738c9312011-09-08 15:22:38 -0600188 {
189 /* GPIO 19 can be used for I2C/UART on GSBI5 */
190 .gpio = 19, /* GSBI3 QUP SPI_CS_1 */
191 .settings = {
192 [GPIOMUX_SUSPENDED] = &gsbi3_cs1_config,
193 },
194 },
Rohit Vaswani09666872011-08-23 17:41:54 -0700195};
196
Krishna Kondadd794462011-10-01 00:19:29 -0700197#if (defined(CONFIG_MMC_MSM_SDC1_SUPPORT)\
198 || defined(CONFIG_MMC_MSM_SDC2_SUPPORT))
199
200#define GPIO_SDCARD_PWR_EN 18
201
202/* MDM9x15 have 2 SDCC controllers */
203enum sdcc_controllers {
204 SDCC1,
205 SDCC2,
206 MAX_SDCC_CONTROLLER
207};
208
209#ifdef CONFIG_MMC_MSM_SDC1_SUPPORT
210/* SDC1 pad data */
211static struct msm_mmc_pad_drv sdc1_pad_drv_on_cfg[] = {
212 {TLMM_HDRV_SDC1_CLK, GPIO_CFG_16MA},
213 {TLMM_HDRV_SDC1_CMD, GPIO_CFG_10MA},
214 {TLMM_HDRV_SDC1_DATA, GPIO_CFG_10MA}
215};
216
217static struct msm_mmc_pad_drv sdc1_pad_drv_off_cfg[] = {
218 {TLMM_HDRV_SDC1_CLK, GPIO_CFG_2MA},
219 {TLMM_HDRV_SDC1_CMD, GPIO_CFG_2MA},
220 {TLMM_HDRV_SDC1_DATA, GPIO_CFG_2MA}
221};
222
223static struct msm_mmc_pad_pull sdc1_pad_pull_on_cfg[] = {
224 {TLMM_PULL_SDC1_CLK, GPIO_CFG_NO_PULL},
225 {TLMM_PULL_SDC1_CMD, GPIO_CFG_PULL_UP},
226 {TLMM_PULL_SDC1_DATA, GPIO_CFG_PULL_UP}
227};
228
229static struct msm_mmc_pad_pull sdc1_pad_pull_off_cfg[] = {
230 {TLMM_PULL_SDC1_CLK, GPIO_CFG_NO_PULL},
231 {TLMM_PULL_SDC1_CMD, GPIO_CFG_PULL_DOWN},
232 {TLMM_PULL_SDC1_DATA, GPIO_CFG_PULL_DOWN}
233};
234
235static struct msm_mmc_pad_pull_data mmc_pad_pull_data[MAX_SDCC_CONTROLLER] = {
236 [SDCC1] = {
237 .on = sdc1_pad_pull_on_cfg,
238 .off = sdc1_pad_pull_off_cfg,
239 .size = ARRAY_SIZE(sdc1_pad_pull_on_cfg)
240 },
241};
242
243static struct msm_mmc_pad_drv_data mmc_pad_drv_data[MAX_SDCC_CONTROLLER] = {
244 [SDCC1] = {
245 .on = sdc1_pad_drv_on_cfg,
246 .off = sdc1_pad_drv_off_cfg,
247 .size = ARRAY_SIZE(sdc1_pad_drv_on_cfg)
248 },
249};
250
251static struct msm_mmc_pad_data mmc_pad_data[MAX_SDCC_CONTROLLER] = {
252 [SDCC1] = {
253 .pull = &mmc_pad_pull_data[SDCC1],
254 .drv = &mmc_pad_drv_data[SDCC1]
255 },
256};
257#endif
258
Krishna Konda71aef182011-10-01 02:27:51 -0700259#ifdef CONFIG_MMC_MSM_SDC2_SUPPORT
260static struct gpiomux_setting sdcc2_clk_actv_cfg = {
261 .func = GPIOMUX_FUNC_1,
262 .drv = GPIOMUX_DRV_16MA,
263 .pull = GPIOMUX_PULL_NONE,
264};
265
266static struct gpiomux_setting sdcc2_cmd_data_0_3_actv_cfg = {
267 .func = GPIOMUX_FUNC_1,
268 .drv = GPIOMUX_DRV_8MA,
269 .pull = GPIOMUX_PULL_UP,
270};
271
272static struct gpiomux_setting sdcc2_suspend_cfg = {
273 .func = GPIOMUX_FUNC_1,
274 .drv = GPIOMUX_DRV_2MA,
275 .pull = GPIOMUX_PULL_DOWN,
276};
277
278static struct msm_gpiomux_config msm9615_sdcc2_configs[] __initdata = {
279 {
280 /* SDC2_DATA_0 */
281 .gpio = 25,
282 .settings = {
283 [GPIOMUX_ACTIVE] = &sdcc2_cmd_data_0_3_actv_cfg,
284 [GPIOMUX_SUSPENDED] = &sdcc2_suspend_cfg,
285 },
286 },
287 {
288 /* SDC2_DATA_1 */
289 .gpio = 26,
290 .settings = {
291 [GPIOMUX_ACTIVE] = &sdcc2_cmd_data_0_3_actv_cfg,
292 [GPIOMUX_SUSPENDED] = &sdcc2_suspend_cfg,
293 },
294 },
295 {
296 /* SDC2_DATA_2 */
297 .gpio = 27,
298 .settings = {
299 [GPIOMUX_ACTIVE] = &sdcc2_cmd_data_0_3_actv_cfg,
300 [GPIOMUX_SUSPENDED] = &sdcc2_suspend_cfg,
301 },
302 },
303 {
304 /* SDC2_DATA_3 */
305 .gpio = 28,
306 .settings = {
307 [GPIOMUX_ACTIVE] = &sdcc2_cmd_data_0_3_actv_cfg,
308 [GPIOMUX_SUSPENDED] = &sdcc2_suspend_cfg,
309 },
310 },
311 {
312 /* SDC2_CMD GSBI1 */
313 .gpio = 29,
314 .settings = {
315 [GPIOMUX_ACTIVE] = &sdcc2_cmd_data_0_3_actv_cfg,
316 [GPIOMUX_SUSPENDED] = &sdcc2_suspend_cfg,
317 },
318 },
319 {
320 /* SDC2_CLK GSBI1 */
321 .gpio = 30,
322 .settings = {
323 [GPIOMUX_ACTIVE] = &sdcc2_clk_actv_cfg,
324 [GPIOMUX_SUSPENDED] = &sdcc2_suspend_cfg,
325 },
326 },
327};
328
329static struct msm_mmc_gpio sdc2_gpio_cfg[] = {
330 {25, "sdc2_dat_0"},
331 {26, "sdc2_dat_1"},
332 {27, "sdc2_dat_2"},
333 {28, "sdc2_dat_3"},
334 {29, "sdc2_cmd"},
335 {30, "sdc2_clk"},
336};
337
338static struct msm_mmc_gpio_data mmc_gpio_data[MAX_SDCC_CONTROLLER] = {
339 [SDCC2] = {
340 .gpio = sdc2_gpio_cfg,
341 .size = ARRAY_SIZE(sdc2_gpio_cfg),
342 },
343};
344#else
345static struct msm_gpiomux_config msm9615_sdcc2_configs[0];
346#endif
347
348static struct msm_mmc_pin_data mmc_slot_pin_data[MAX_SDCC_CONTROLLER] = {
Krishna Kondadd794462011-10-01 00:19:29 -0700349#ifdef CONFIG_MMC_MSM_SDC1_SUPPORT
350 [SDCC1] = {
351 .is_gpio = 0,
352 .pad_data = &mmc_pad_data[SDCC1],
353 },
354#endif
Krishna Konda71aef182011-10-01 02:27:51 -0700355#ifdef CONFIG_MMC_MSM_SDC2_SUPPORT
356 [SDCC2] = {
357 .is_gpio = 1,
358 .gpio_data = &mmc_gpio_data[SDCC2],
359 },
360#endif
Krishna Kondadd794462011-10-01 00:19:29 -0700361};
362
363#ifdef CONFIG_MMC_MSM_SDC1_SUPPORT
364static unsigned int sdc1_sup_clk_rates[] = {
365 400000, 24000000, 48000000
366};
367
368static struct mmc_platform_data sdc1_data = {
369 .ocr_mask = MMC_VDD_27_28 | MMC_VDD_28_29,
370 .mmc_bus_width = MMC_CAP_4_BIT_DATA,
371 .sup_clk_table = sdc1_sup_clk_rates,
372 .sup_clk_cnt = ARRAY_SIZE(sdc1_sup_clk_rates),
373 .sdcc_v4_sup = true,
374 .pin_data = &mmc_slot_pin_data[SDCC1],
375};
376static struct mmc_platform_data *msm9615_sdc1_pdata = &sdc1_data;
377#else
378static struct mmc_platform_data *msm9615_sdc1_pdata;
379#endif
380
Krishna Konda71aef182011-10-01 02:27:51 -0700381#ifdef CONFIG_MMC_MSM_SDC2_SUPPORT
382static unsigned int sdc2_sup_clk_rates[] = {
383 400000, 24000000, 48000000
384};
385
386static struct mmc_platform_data sdc2_data = {
387 .ocr_mask = MMC_VDD_27_28 | MMC_VDD_28_29,
388 .mmc_bus_width = MMC_CAP_4_BIT_DATA,
389 .sup_clk_table = sdc2_sup_clk_rates,
390 .sup_clk_cnt = ARRAY_SIZE(sdc2_sup_clk_rates),
391 .sdcc_v4_sup = true,
392 .pin_data = &mmc_slot_pin_data[SDCC2],
393};
394static struct mmc_platform_data *msm9615_sdc2_pdata = &sdc2_data;
395#else
396static struct mmc_platform_data *msm9615_sdc2_pdata;
397#endif
398
Krishna Kondadd794462011-10-01 00:19:29 -0700399static void __init msm9615_init_mmc(void)
400{
401 int ret;
402
403 if (msm9615_sdc1_pdata) {
404 ret = gpio_request(GPIO_SDCARD_PWR_EN, "SDCARD_PWR_EN");
405
406 if (ret) {
407 pr_err("%s: sdcc1: Error requesting GPIO "
408 "SDCARD_PWR_EN:%d\n", __func__, ret);
409 } else {
410 ret = gpio_direction_output(GPIO_SDCARD_PWR_EN, 1);
411 if (ret) {
412 pr_err("%s: sdcc1: Error setting o/p direction"
413 " for GPIO SDCARD_PWR_EN:%d\n",
414 __func__, ret);
415 gpio_free(GPIO_SDCARD_PWR_EN);
416 } else {
417 msm_add_sdcc(1, msm9615_sdc1_pdata);
418 }
419 }
420 }
Krishna Konda71aef182011-10-01 02:27:51 -0700421
422 if (msm9615_sdc2_pdata) {
423 msm_gpiomux_install(msm9615_sdcc2_configs,
424 ARRAY_SIZE(msm9615_sdcc2_configs));
425
426 /* SDC2: External card slot */
427 msm_add_sdcc(2, msm9615_sdc2_pdata);
428 }
Krishna Kondadd794462011-10-01 00:19:29 -0700429}
430#else
431static void __init msm9615_init_mmc(void) { }
432#endif
Maheshkumar Sivasubramanian4923db22011-09-15 09:28:15 -0600433static struct msm_cpuidle_state msm_cstates[] __initdata = {
434 {0, 0, "C0", "WFI",
435 MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT},
436
437 {0, 1, "C1", "STANDALONE_POWER_COLLAPSE",
438 MSM_PM_SLEEP_MODE_POWER_COLLAPSE_STANDALONE},
439
440 {0, 2, "C2", "POWER_COLLAPSE",
441 MSM_PM_SLEEP_MODE_POWER_COLLAPSE},
442};
443static struct msm_pm_platform_data msm_pm_data[MSM_PM_SLEEP_MODE_NR] = {
444 [MSM_PM_MODE(0, MSM_PM_SLEEP_MODE_POWER_COLLAPSE)] = {
445 .idle_supported = 1,
446 .suspend_supported = 1,
447 .idle_enabled = 0,
448 .suspend_enabled = 0,
449 },
450 [MSM_PM_MODE(0, MSM_PM_SLEEP_MODE_POWER_COLLAPSE_STANDALONE)] = {
451 .idle_supported = 1,
452 .suspend_supported = 1,
453 .idle_enabled = 0,
454 .suspend_enabled = 0,
455 },
456 [MSM_PM_MODE(0, MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT)] = {
457 .idle_supported = 1,
458 .suspend_supported = 1,
459 .idle_enabled = 1,
460 .suspend_enabled = 1,
461 },
462};
Krishna Kondadd794462011-10-01 00:19:29 -0700463
Rohit Vaswaniced9b3b2011-08-23 17:21:49 -0700464static int __init gpiomux_init(void)
465{
466 int rc;
467
468 rc = msm_gpiomux_init(NR_GPIO_IRQS);
469 if (rc) {
470 pr_err(KERN_ERR "msm_gpiomux_init failed %d\n", rc);
471 return rc;
472 }
Rohit Vaswani09666872011-08-23 17:41:54 -0700473 msm_gpiomux_install(msm9615_gsbi_configs,
474 ARRAY_SIZE(msm9615_gsbi_configs));
475
Rohit Vaswanif688fa62011-10-13 18:13:10 -0700476 msm_gpiomux_install(msm9615_ps_hold_config,
477 ARRAY_SIZE(msm9615_ps_hold_config));
Rohit Vaswaniced9b3b2011-08-23 17:21:49 -0700478 return 0;
479}
480
Harini Jayaraman738c9312011-09-08 15:22:38 -0600481static struct msm_spi_platform_data msm9615_qup_spi_gsbi3_pdata = {
482 .max_clock_speed = 24000000,
483};
484
Harini Jayaramaneba52672011-09-08 15:13:00 -0600485static struct msm_i2c_platform_data msm9615_i2c_qup_gsbi5_pdata = {
486 .clk_freq = 100000,
487 .src_clk_rate = 24000000,
488};
489
Amit Blay5e4ec192011-10-20 09:16:54 +0200490static struct msm_otg_platform_data msm_otg_pdata = {
491 .mode = USB_PERIPHERAL,
492 .otg_control = OTG_NO_CONTROL,
493 .phy_type = SNPS_28NM_INTEGRATED_PHY,
494 .pclk_src_name = "dfab_usb_hs_clk",
495};
496
497static int usb_diag_update_pid_and_serial_num(uint32_t pid, const char *snum)
498{
499 return 0;
500}
501
502static struct android_usb_platform_data android_usb_pdata = {
503 .update_pid_and_serial_num = usb_diag_update_pid_and_serial_num,
504};
505
506static struct platform_device android_usb_device = {
507 .name = "android_usb",
508 .id = -1,
509 .dev = {
510 .platform_data = &android_usb_pdata,
511 },
512};
513
514static struct platform_device *common_devices[] = {
515 &msm9615_device_dmov,
516 &msm_device_smd,
517 &msm_device_otg,
518 &msm_device_gadget_peripheral,
519 &android_usb_device,
520 &msm9615_device_uart_gsbi4,
521 &msm9615_device_ssbi_pmic1,
522 &msm9615_device_qup_i2c_gsbi5,
523 &msm9615_device_qup_spi_gsbi3,
524 &msm_device_sps,
525 &msm9615_device_tsens,
526 &msm_device_nand,
527 &msm_rpm_device,
528#ifdef CONFIG_HW_RANDOM_MSM
529 &msm_device_rng,
530#endif
531
532#if defined(CONFIG_CRYPTO_DEV_QCRYPTO) || \
533 defined(CONFIG_CRYPTO_DEV_QCRYPTO_MODULE)
Ramesh Masavarapuaa28b5b2011-10-21 10:26:03 -0700534 &msm9615_qcrypto_device,
Amit Blay5e4ec192011-10-20 09:16:54 +0200535#endif
536
537#if defined(CONFIG_CRYPTO_DEV_QCEDEV) || \
538 defined(CONFIG_CRYPTO_DEV_QCEDEV_MODULE)
Ramesh Masavarapuaa28b5b2011-10-21 10:26:03 -0700539 &msm9615_qcedev_device,
Amit Blay5e4ec192011-10-20 09:16:54 +0200540#endif
541};
542
Harini Jayaramaneba52672011-09-08 15:13:00 -0600543static void __init msm9615_i2c_init(void)
544{
545 msm9615_device_qup_i2c_gsbi5.dev.platform_data =
546 &msm9615_i2c_qup_gsbi5_pdata;
547}
548
Rohit Vaswaniced9b3b2011-08-23 17:21:49 -0700549static void __init msm9615_common_init(void)
550{
551 msm9615_device_init();
552 gpiomux_init();
Harini Jayaramaneba52672011-09-08 15:13:00 -0600553 msm9615_i2c_init();
David Collins00b31e62011-08-31 20:00:10 -0700554 regulator_suppress_info_printing();
David Collinsbea297a2011-09-28 13:11:14 -0700555 platform_device_register(&msm9615_device_rpm_regulator);
Harini Jayaraman738c9312011-09-08 15:22:38 -0600556 msm9615_device_qup_spi_gsbi3.dev.platform_data =
557 &msm9615_qup_spi_gsbi3_pdata;
Kenneth Heitkeaf3d3cf2011-09-08 11:45:31 -0700558 msm9615_device_ssbi_pmic1.dev.platform_data =
559 &msm9615_ssbi_pm8018_pdata;
David Collins00b31e62011-08-31 20:00:10 -0700560 pm8018_platform_data.num_regulators = msm_pm8018_regulator_pdata_len;
Amit Blay5e4ec192011-10-20 09:16:54 +0200561
562 msm_device_otg.dev.platform_data = &msm_otg_pdata;
563 msm_device_gadget_peripheral.dev.parent = &msm_device_otg.dev;
Rohit Vaswani09666872011-08-23 17:41:54 -0700564 platform_add_devices(common_devices, ARRAY_SIZE(common_devices));
Krishna Kondadd794462011-10-01 00:19:29 -0700565
566 msm9615_init_mmc();
Maheshkumar Sivasubramanian4923db22011-09-15 09:28:15 -0600567 msm_pm_set_platform_data(msm_pm_data, ARRAY_SIZE(msm_pm_data));
568 msm_pm_set_rpm_wakeup_irq(RPM_APCC_CPU0_WAKE_UP_IRQ);
569 msm_cpuidle_set_states(msm_cstates, ARRAY_SIZE(msm_cstates),
570 msm_pm_data);
Rohit Vaswaniced9b3b2011-08-23 17:21:49 -0700571}
572
573static void __init msm9615_cdp_init(void)
574{
575 msm9615_common_init();
576}
577
578static void __init msm9615_mtp_init(void)
579{
580 msm9615_common_init();
581}
582
583MACHINE_START(MSM9615_CDP, "QCT MSM9615 CDP")
584 .map_io = msm9615_map_io,
585 .init_irq = msm9615_init_irq,
586 .timer = &msm_timer,
587 .init_machine = msm9615_cdp_init,
588MACHINE_END
589
590MACHINE_START(MSM9615_MTP, "QCT MSM9615 MTP")
591 .map_io = msm9615_map_io,
592 .init_irq = msm9615_init_irq,
593 .timer = &msm_timer,
594 .init_machine = msm9615_mtp_init,
595MACHINE_END