blob: 26234b9f2dae44be603444abcd54728c64328e9a [file] [log] [blame]
Stepan Moskovchenkof441ca22010-12-01 19:31:16 -08001/* 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 *
Stepan Moskovchenkof441ca22010-12-01 19:31:16 -080012 */
13#include <linux/kernel.h>
14#include <linux/platform_device.h>
15#include <linux/io.h>
16#include <linux/irq.h>
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070017#include <linux/i2c.h>
18#include <linux/gpio.h>
19#include <linux/msm_ssbi.h>
20#include <linux/regulator/gpio-regulator.h>
21#include <linux/mfd/pm8xxx/pm8921.h>
22#include <linux/regulator/consumer.h>
23#include <linux/spi/spi.h>
24#include <linux/slimbus/slimbus.h>
25#include <linux/bootmem.h>
26#ifdef CONFIG_ANDROID_PMEM
27#include <linux/android_pmem.h>
28#endif
29#include <linux/cyttsp.h>
30#include <linux/dma-mapping.h>
31#include <linux/platform_data/qcom_crypto_device.h>
32#include <linux/leds.h>
33#include <linux/leds-pm8xxx.h>
Stepan Moskovchenkof441ca22010-12-01 19:31:16 -080034
35#include <asm/mach-types.h>
36#include <asm/mach/arch.h>
37#include <asm/hardware/gic.h>
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070038#include <asm/mach/mmc.h>
Stepan Moskovchenkof441ca22010-12-01 19:31:16 -080039
40#include <mach/board.h>
41#include <mach/msm_iomap.h>
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070042#include <mach/msm_spi.h>
43#ifdef CONFIG_USB_MSM_OTG_72K
44#include <mach/msm_hsusb.h>
45#else
46#include <linux/usb/msm_hsusb.h>
47#endif
48#include <linux/usb/android.h>
49#include <mach/usbdiag.h>
50#include <mach/socinfo.h>
51#include <mach/rpm.h>
52#include <mach/gpio.h>
53#include <mach/msm_bus_board.h>
54#include <mach/msm_memtypes.h>
55#include <mach/dma.h>
56#include <mach/msm_dsps.h>
57#include <mach/msm_xo.h>
Stepan Moskovchenkof441ca22010-12-01 19:31:16 -080058
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070059#ifdef CONFIG_WCD9310_CODEC
60#include <linux/slimbus/slimbus.h>
61#include <linux/mfd/wcd9310/core.h>
62#include <linux/mfd/wcd9310/pdata.h>
63#endif
64
65#include "timer.h"
66#include "gpiomux.h"
Stepan Moskovchenkod056fca2011-01-27 12:12:07 -080067#include "devices.h"
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070068#include "devices-msm8x60.h"
69#include "gpiomux.h"
70#include "spm.h"
71#include "board-msm8960.h"
72#include "pm.h"
73#include "cpuidle.h"
74#include "rpm_resources.h"
75#include "mpm.h"
76
77static struct platform_device msm_fm_platform_init = {
78 .name = "iris_fm",
79 .id = -1,
80};
81
82struct pm8xxx_gpio_init {
83 unsigned gpio;
84 struct pm_gpio config;
85};
86
87struct pm8xxx_mpp_init {
88 unsigned mpp;
89 struct pm8xxx_mpp_config_data config;
90};
91
92#define PM8XXX_GPIO_INIT(_gpio, _dir, _buf, _val, _pull, _vin, _out_strength, \
93 _func, _inv, _disable) \
94{ \
95 .gpio = PM8921_GPIO_PM_TO_SYS(_gpio), \
96 .config = { \
97 .direction = _dir, \
98 .output_buffer = _buf, \
99 .output_value = _val, \
100 .pull = _pull, \
101 .vin_sel = _vin, \
102 .out_strength = _out_strength, \
103 .function = _func, \
104 .inv_int_pol = _inv, \
105 .disable_pin = _disable, \
106 } \
107}
108
109#define PM8XXX_MPP_INIT(_mpp, _type, _level, _control) \
110{ \
111 .mpp = PM8921_MPP_PM_TO_SYS(_mpp), \
112 .config = { \
113 .type = PM8XXX_MPP_TYPE_##_type, \
114 .level = _level, \
115 .control = PM8XXX_MPP_##_control, \
116 } \
117}
118
119#define PM8XXX_GPIO_DISABLE(_gpio) \
120 PM8XXX_GPIO_INIT(_gpio, PM_GPIO_DIR_IN, 0, 0, 0, PM_GPIO_VIN_S4, \
121 0, 0, 0, 1)
122
123#define PM8XXX_GPIO_OUTPUT(_gpio, _val) \
124 PM8XXX_GPIO_INIT(_gpio, PM_GPIO_DIR_OUT, PM_GPIO_OUT_BUF_CMOS, _val, \
125 PM_GPIO_PULL_NO, PM_GPIO_VIN_S4, \
126 PM_GPIO_STRENGTH_HIGH, \
127 PM_GPIO_FUNC_NORMAL, 0, 0)
128
129#define PM8XXX_GPIO_INPUT(_gpio, _pull) \
130 PM8XXX_GPIO_INIT(_gpio, PM_GPIO_DIR_IN, PM_GPIO_OUT_BUF_CMOS, 0, \
131 _pull, PM_GPIO_VIN_S4, \
132 PM_GPIO_STRENGTH_NO, \
133 PM_GPIO_FUNC_NORMAL, 0, 0)
134
135#define PM8XXX_GPIO_OUTPUT_FUNC(_gpio, _val, _func) \
136 PM8XXX_GPIO_INIT(_gpio, PM_GPIO_DIR_OUT, PM_GPIO_OUT_BUF_CMOS, _val, \
137 PM_GPIO_PULL_NO, PM_GPIO_VIN_S4, \
138 PM_GPIO_STRENGTH_HIGH, \
139 _func, 0, 0)
140
141/* Initial PM8921 GPIO configurations */
142static struct pm8xxx_gpio_init pm8921_gpios[] __initdata = {
143 PM8XXX_GPIO_DISABLE(6), /* Disable unused */
144 PM8XXX_GPIO_DISABLE(7), /* Disable NFC */
145 PM8XXX_GPIO_INPUT(16, PM_GPIO_PULL_UP_30), /* SD_CARD_WP */
146 PM8XXX_GPIO_DISABLE(22), /* Disable NFC */
147 PM8XXX_GPIO_OUTPUT_FUNC(24, 0, PM_GPIO_FUNC_1), /* Bl: Off, PWM mode */
148 PM8XXX_GPIO_INPUT(26, PM_GPIO_PULL_UP_30), /* SD_CARD_DET_N */
149 PM8XXX_GPIO_OUTPUT(43, 0), /* DISP_RESET_N */
150};
151
152/* Initial PM8921 MPP configurations */
153static struct pm8xxx_mpp_init pm8921_mpps[] __initdata = {
154 /* External 5V regulator enable; shared by HDMI and USB_OTG switches. */
155 PM8XXX_MPP_INIT(7, D_INPUT, PM8921_MPP_DIG_LEVEL_VPH, DIN_TO_INT),
156 PM8XXX_MPP_INIT(PM8921_AMUX_MPP_3, A_INPUT, PM8XXX_MPP_AIN_AMUX_CH6,
157 DOUT_CTRL_LOW),
158 PM8XXX_MPP_INIT(PM8921_AMUX_MPP_8, A_INPUT, PM8XXX_MPP_AIN_AMUX_CH8,
159 DOUT_CTRL_LOW),
160};
161
162static void __init pm8921_gpio_mpp_init(void)
163{
164 int i, rc;
165
166 for (i = 0; i < ARRAY_SIZE(pm8921_gpios); i++) {
167 rc = pm8xxx_gpio_config(pm8921_gpios[i].gpio,
168 &pm8921_gpios[i].config);
169 if (rc) {
170 pr_err("%s: pm8xxx_gpio_config: rc=%d\n", __func__, rc);
171 break;
172 }
173 }
174
175 for (i = 0; i < ARRAY_SIZE(pm8921_mpps); i++) {
176 rc = pm8xxx_mpp_config(pm8921_mpps[i].mpp,
177 &pm8921_mpps[i].config);
178 if (rc) {
179 pr_err("%s: pm8xxx_mpp_config: rc=%d\n", __func__, rc);
180 break;
181 }
182 }
183}
184
185#define FPGA_CS_GPIO 14
186#define KS8851_RST_GPIO 89
187#define KS8851_IRQ_GPIO 90
188
189/* Macros assume PMIC GPIOs and MPPs start at 1 */
190#define PM8921_GPIO_BASE NR_GPIO_IRQS
191#define PM8921_GPIO_PM_TO_SYS(pm_gpio) (pm_gpio - 1 + PM8921_GPIO_BASE)
192#define PM8921_MPP_BASE (PM8921_GPIO_BASE + PM8921_NR_GPIOS)
193#define PM8921_MPP_PM_TO_SYS(pm_gpio) (pm_gpio - 1 + PM8921_MPP_BASE)
194#define PM8921_IRQ_BASE (NR_MSM_IRQS + NR_GPIO_IRQS)
195#define PM8921_MPP_IRQ_BASE (PM8921_IRQ_BASE + NR_GPIO_IRQS)
196
197static struct gpiomux_setting gsbi1 = {
198 .func = GPIOMUX_FUNC_1,
199 .drv = GPIOMUX_DRV_8MA,
200 .pull = GPIOMUX_PULL_NONE,
201};
202
203static struct gpiomux_setting gsbi3 = {
204 .func = GPIOMUX_FUNC_1,
205 .drv = GPIOMUX_DRV_8MA,
206 .pull = GPIOMUX_PULL_NONE,
207};
208
209static struct gpiomux_setting gsbi4 = {
210 .func = GPIOMUX_FUNC_1,
211 .drv = GPIOMUX_DRV_8MA,
212 .pull = GPIOMUX_PULL_NONE,
213};
214
215static struct gpiomux_setting gsbi5 = {
216 .func = GPIOMUX_FUNC_1,
217 .drv = GPIOMUX_DRV_8MA,
218 .pull = GPIOMUX_PULL_NONE,
219};
220
221static struct gpiomux_setting gsbi10 = {
222 .func = GPIOMUX_FUNC_2,
223 .drv = GPIOMUX_DRV_8MA,
224 .pull = GPIOMUX_PULL_NONE,
225};
226
227static struct gpiomux_setting gsbi12 = {
228 .func = GPIOMUX_FUNC_1,
229 .drv = GPIOMUX_DRV_8MA,
230 .pull = GPIOMUX_PULL_NONE,
231};
232
233static struct gpiomux_setting cdc_mclk = {
234 .func = GPIOMUX_FUNC_1,
235 .drv = GPIOMUX_DRV_8MA,
236 .pull = GPIOMUX_PULL_NONE,
237};
238
239static struct gpiomux_setting gpio_eth_config = {
240 .pull = GPIOMUX_PULL_NONE,
241 .drv = GPIOMUX_DRV_8MA,
242 .func = GPIOMUX_FUNC_GPIO,
243};
244
245static struct gpiomux_setting slimbus = {
246 .func = GPIOMUX_FUNC_1,
247 .drv = GPIOMUX_DRV_8MA,
248 .pull = GPIOMUX_PULL_KEEPER,
249};
250
251struct msm_gpiomux_config msm8960_gpiomux_configs[NR_GPIO_IRQS] = {
252 {
253 .gpio = KS8851_IRQ_GPIO,
254 .settings = {
255 [GPIOMUX_SUSPENDED] = &gpio_eth_config,
256 }
257 },
258 {
259 .gpio = KS8851_RST_GPIO,
260 .settings = {
261 [GPIOMUX_SUSPENDED] = &gpio_eth_config,
262 }
263 },
264 {
265 .gpio = FPGA_CS_GPIO,
266 .settings = {
267 [GPIOMUX_SUSPENDED] = &gpio_eth_config,
268 }
269 },
270};
271
272static struct msm_gpiomux_config msm8960_gsbi_configs[] __initdata = {
273 {
274 .gpio = 6, /* GSBI1 QUP SPI_DATA_MOSI */
275 .settings = {
276 [GPIOMUX_SUSPENDED] = &gsbi1,
277 },
278 },
279 {
280 .gpio = 7, /* GSBI1 QUP SPI_DATA_MISO */
281 .settings = {
282 [GPIOMUX_SUSPENDED] = &gsbi1,
283 },
284 },
285 {
286 .gpio = 8, /* GSBI1 QUP SPI_CS_N */
287 .settings = {
288 [GPIOMUX_SUSPENDED] = &gsbi1,
289 },
290 },
291 {
292 .gpio = 9, /* GSBI1 QUP SPI_CLK */
293 .settings = {
294 [GPIOMUX_SUSPENDED] = &gsbi1,
295 },
296 },
297 {
298 .gpio = 16, /* GSBI3 I2C QUP SDA */
299 .settings = {
300 [GPIOMUX_SUSPENDED] = &gsbi3,
301 },
302 },
303 {
304 .gpio = 17, /* GSBI3 I2C QUP SCL */
305 .settings = {
306 [GPIOMUX_SUSPENDED] = &gsbi3,
307 },
308 },
309 {
310 .gpio = 20, /* GSBI4 I2C QUP SDA */
311 .settings = {
312 [GPIOMUX_SUSPENDED] = &gsbi4,
313 },
314 },
315 {
316 .gpio = 21, /* GSBI4 I2C QUP SCL */
317 .settings = {
318 [GPIOMUX_SUSPENDED] = &gsbi4,
319 },
320 },
321 {
322 .gpio = 22, /* GSBI5 UART2 */
323 .settings = {
324 [GPIOMUX_SUSPENDED] = &gsbi5,
325 },
326 },
327 {
328 .gpio = 23, /* GSBI5 UART2 */
329 .settings = {
330 [GPIOMUX_SUSPENDED] = &gsbi5,
331 },
332 },
333 {
334 .gpio = 24, /* GSBI5 UART2 */
335 .settings = {
336 [GPIOMUX_SUSPENDED] = &gsbi5,
337 },
338 },
339 {
340 .gpio = 25, /* GSBI5 UART2 */
341 .settings = {
342 [GPIOMUX_SUSPENDED] = &gsbi5,
343 },
344 },
345 {
346 .gpio = 44, /* GSBI12 I2C QUP SDA */
347 .settings = {
348 [GPIOMUX_SUSPENDED] = &gsbi12,
349 },
350 },
351 {
352 .gpio = 45, /* GSBI12 I2C QUP SCL */
353 .settings = {
354 [GPIOMUX_SUSPENDED] = &gsbi12,
355 },
356 },
357 {
358 .gpio = 73, /* GSBI10 I2C QUP SDA */
359 .settings = {
360 [GPIOMUX_SUSPENDED] = &gsbi10,
361 },
362 },
363 {
364 .gpio = 74, /* GSBI10 I2C QUP SCL */
365 .settings = {
366 [GPIOMUX_SUSPENDED] = &gsbi10,
367 },
368 },
369};
370
371static struct msm_gpiomux_config msm8960_slimbus_config[] __initdata = {
372 {
373 .gpio = 60, /* slimbus data */
374 .settings = {
375 [GPIOMUX_SUSPENDED] = &slimbus,
376 },
377 },
378 {
379 .gpio = 61, /* slimbus clk */
380 .settings = {
381 [GPIOMUX_SUSPENDED] = &slimbus,
382 },
383 },
384};
385
386static struct msm_gpiomux_config msm8960_audio_codec_configs[] __initdata = {
387 {
388 .gpio = 59,
389 .settings = {
390 [GPIOMUX_SUSPENDED] = &cdc_mclk,
391 },
392 },
393};
394static struct gpiomux_setting wcnss_5wire_suspend_cfg = {
395 .func = GPIOMUX_FUNC_GPIO,
396 .drv = GPIOMUX_DRV_2MA,
397 .pull = GPIOMUX_PULL_NONE,
398};
399
400static struct gpiomux_setting wcnss_5wire_active_cfg = {
401 .func = GPIOMUX_FUNC_1,
402 .drv = GPIOMUX_DRV_6MA,
403 .pull = GPIOMUX_PULL_DOWN,
404};
405
406static struct msm_gpiomux_config wcnss_5wire_interface[] = {
407 {
408 .gpio = 84,
409 .settings = {
410 [GPIOMUX_ACTIVE] = &wcnss_5wire_active_cfg,
411 [GPIOMUX_SUSPENDED] = &wcnss_5wire_suspend_cfg,
412 },
413 },
414 {
415 .gpio = 85,
416 .settings = {
417 [GPIOMUX_ACTIVE] = &wcnss_5wire_active_cfg,
418 [GPIOMUX_SUSPENDED] = &wcnss_5wire_suspend_cfg,
419 },
420 },
421 {
422 .gpio = 86,
423 .settings = {
424 [GPIOMUX_ACTIVE] = &wcnss_5wire_active_cfg,
425 [GPIOMUX_SUSPENDED] = &wcnss_5wire_suspend_cfg,
426 },
427 },
428 {
429 .gpio = 87,
430 .settings = {
431 [GPIOMUX_ACTIVE] = &wcnss_5wire_active_cfg,
432 [GPIOMUX_SUSPENDED] = &wcnss_5wire_suspend_cfg,
433 },
434 },
435 {
436 .gpio = 88,
437 .settings = {
438 [GPIOMUX_ACTIVE] = &wcnss_5wire_active_cfg,
439 [GPIOMUX_SUSPENDED] = &wcnss_5wire_suspend_cfg,
440 },
441 },
442};
443
444static struct gpiomux_setting cam_suspend_cfg = {
445 .func = GPIOMUX_FUNC_GPIO,
446 .drv = GPIOMUX_DRV_2MA,
447 .pull = GPIOMUX_PULL_DOWN,
448};
449
450static struct gpiomux_setting cam_active_1_cfg = {
451 .func = GPIOMUX_FUNC_1,
452 .drv = GPIOMUX_DRV_2MA,
453 .pull = GPIOMUX_PULL_NONE,
454};
455
456static struct gpiomux_setting cam_active_2_cfg = {
457 .func = GPIOMUX_FUNC_GPIO,
458 .drv = GPIOMUX_DRV_2MA,
459 .pull = GPIOMUX_PULL_NONE,
460};
461
462static struct gpiomux_setting cam_active_3_cfg = {
463 .func = GPIOMUX_FUNC_1,
464 .drv = GPIOMUX_DRV_8MA,
465 .pull = GPIOMUX_PULL_UP,
466};
467
468static struct msm_gpiomux_config msm8960_cam_configs[] __initdata = {
469 {
470 .gpio = 2,
471 .settings = {
472 [GPIOMUX_ACTIVE] = &cam_active_2_cfg,
473 [GPIOMUX_SUSPENDED] = &cam_suspend_cfg,
474 },
475 },
476 {
477 .gpio = 3,
478 .settings = {
479 [GPIOMUX_ACTIVE] = &cam_active_1_cfg,
480 [GPIOMUX_SUSPENDED] = &cam_suspend_cfg,
481 },
482 },
483 {
484 .gpio = 4,
485 .settings = {
486 [GPIOMUX_ACTIVE] = &cam_active_1_cfg,
487 [GPIOMUX_SUSPENDED] = &cam_suspend_cfg,
488 },
489 },
490 {
491 .gpio = 5,
492 .settings = {
493 [GPIOMUX_ACTIVE] = &cam_active_1_cfg,
494 [GPIOMUX_SUSPENDED] = &cam_suspend_cfg,
495 },
496 },
497 {
498 .gpio = 18,
499 .settings = {
500 [GPIOMUX_ACTIVE] = &cam_active_3_cfg,
501 [GPIOMUX_SUSPENDED] = &cam_suspend_cfg,
502 },
503 },
504 {
505 .gpio = 19,
506 .settings = {
507 [GPIOMUX_ACTIVE] = &cam_active_3_cfg,
508 [GPIOMUX_SUSPENDED] = &cam_suspend_cfg,
509 },
510 },
511 {
512 .gpio = 20,
513 .settings = {
514 [GPIOMUX_ACTIVE] = &cam_active_3_cfg,
515 [GPIOMUX_SUSPENDED] = &cam_suspend_cfg,
516 },
517 },
518 {
519 .gpio = 21,
520 .settings = {
521 [GPIOMUX_ACTIVE] = &cam_active_3_cfg,
522 [GPIOMUX_SUSPENDED] = &cam_suspend_cfg,
523 },
524 },
525 {
526 .gpio = 76,
527 .settings = {
528 [GPIOMUX_ACTIVE] = &cam_active_2_cfg,
529 [GPIOMUX_SUSPENDED] = &cam_suspend_cfg,
530 },
531 },
532 {
533 .gpio = 107,
534 .settings = {
535 [GPIOMUX_ACTIVE] = &cam_active_2_cfg,
536 [GPIOMUX_SUSPENDED] = &cam_suspend_cfg,
537 },
538 },
539};
540
541static struct gpiomux_setting cyts_resout_sus_cfg = {
542 .func = GPIOMUX_FUNC_GPIO,
543 .drv = GPIOMUX_DRV_6MA,
544 .pull = GPIOMUX_PULL_UP,
545};
546
547static struct gpiomux_setting cyts_resout_act_cfg = {
548 .func = GPIOMUX_FUNC_GPIO,
549 .drv = GPIOMUX_DRV_6MA,
550 .pull = GPIOMUX_PULL_UP,
551};
552
553static struct gpiomux_setting cyts_sleep_sus_cfg = {
554 .func = GPIOMUX_FUNC_GPIO,
555 .drv = GPIOMUX_DRV_6MA,
556 .pull = GPIOMUX_PULL_DOWN,
557};
558
559static struct gpiomux_setting cyts_sleep_act_cfg = {
560 .func = GPIOMUX_FUNC_GPIO,
561 .drv = GPIOMUX_DRV_6MA,
562 .pull = GPIOMUX_PULL_DOWN,
563};
564
565static struct gpiomux_setting cyts_int_act_cfg = {
566 .func = GPIOMUX_FUNC_GPIO,
567 .drv = GPIOMUX_DRV_8MA,
568 .pull = GPIOMUX_PULL_UP,
569};
570
571static struct gpiomux_setting cyts_int_sus_cfg = {
572 .func = GPIOMUX_FUNC_GPIO,
573 .drv = GPIOMUX_DRV_2MA,
574 .pull = GPIOMUX_PULL_UP,
575};
576
577
578static struct msm_gpiomux_config msm8960_cyts_configs[] __initdata = {
579 { /* TS INTERRUPT */
580 .gpio = 11,
581 .settings = {
582 [GPIOMUX_ACTIVE] = &cyts_int_act_cfg,
583 [GPIOMUX_SUSPENDED] = &cyts_int_sus_cfg,
584 },
585 },
586 { /* TS SLEEP */
587 .gpio = 50,
588 .settings = {
589 [GPIOMUX_ACTIVE] = &cyts_sleep_act_cfg,
590 [GPIOMUX_SUSPENDED] = &cyts_sleep_sus_cfg,
591 },
592 },
593 { /* TS RESOUT */
594 .gpio = 52,
595 .settings = {
596 [GPIOMUX_ACTIVE] = &cyts_resout_act_cfg,
597 [GPIOMUX_SUSPENDED] = &cyts_resout_sus_cfg,
598 },
599 },
600};
601
602#define MSM_PMEM_KERNEL_EBI1_SIZE 0x110C000
603#define MSM_PMEM_ADSP_SIZE 0x3800000
604#define MSM_PMEM_AUDIO_SIZE 0x279000
605#define MSM_PMEM_SIZE 0x1800000 /* 24 Mbytes */
606
607#ifdef CONFIG_KERNEL_PMEM_EBI_REGION
608static unsigned pmem_kernel_ebi1_size = MSM_PMEM_KERNEL_EBI1_SIZE;
609static int __init pmem_kernel_ebi1_size_setup(char *p)
610{
611 pmem_kernel_ebi1_size = memparse(p, NULL);
612 return 0;
613}
614early_param("pmem_kernel_ebi1_size", pmem_kernel_ebi1_size_setup);
615#endif
616
617#ifdef CONFIG_ANDROID_PMEM
618static unsigned pmem_size = MSM_PMEM_SIZE;
619static int __init pmem_size_setup(char *p)
620{
621 pmem_size = memparse(p, NULL);
622 return 0;
623}
624early_param("pmem_size", pmem_size_setup);
625
626static unsigned pmem_adsp_size = MSM_PMEM_ADSP_SIZE;
627
628static int __init pmem_adsp_size_setup(char *p)
629{
630 pmem_adsp_size = memparse(p, NULL);
631 return 0;
632}
633early_param("pmem_adsp_size", pmem_adsp_size_setup);
634
635static unsigned pmem_audio_size = MSM_PMEM_AUDIO_SIZE;
636
637static int __init pmem_audio_size_setup(char *p)
638{
639 pmem_audio_size = memparse(p, NULL);
640 return 0;
641}
642early_param("pmem_audio_size", pmem_audio_size_setup);
643#endif
644
645#ifdef CONFIG_ANDROID_PMEM
646static struct android_pmem_platform_data android_pmem_pdata = {
647 .name = "pmem",
648 .allocator_type = PMEM_ALLOCATORTYPE_ALLORNOTHING,
649 .cached = 1,
650 .memory_type = MEMTYPE_EBI1,
651};
652
653static struct platform_device android_pmem_device = {
654 .name = "android_pmem",
655 .id = 0,
656 .dev = {.platform_data = &android_pmem_pdata},
657};
658
659static struct android_pmem_platform_data android_pmem_adsp_pdata = {
660 .name = "pmem_adsp",
661 .allocator_type = PMEM_ALLOCATORTYPE_BITMAP,
662 .cached = 0,
663 .memory_type = MEMTYPE_EBI1,
664};
665static struct platform_device android_pmem_adsp_device = {
666 .name = "android_pmem",
667 .id = 2,
668 .dev = { .platform_data = &android_pmem_adsp_pdata },
669};
670
671static struct android_pmem_platform_data android_pmem_audio_pdata = {
672 .name = "pmem_audio",
673 .allocator_type = PMEM_ALLOCATORTYPE_BITMAP,
674 .cached = 0,
675 .memory_type = MEMTYPE_EBI1,
676};
677
678static struct platform_device android_pmem_audio_device = {
679 .name = "android_pmem",
680 .id = 4,
681 .dev = { .platform_data = &android_pmem_audio_pdata },
682};
683#endif
684
685static struct memtype_reserve msm8960_reserve_table[] __initdata = {
686 [MEMTYPE_SMI] = {
687 },
688 [MEMTYPE_EBI0] = {
689 .flags = MEMTYPE_FLAGS_1M_ALIGN,
690 },
691 [MEMTYPE_EBI1] = {
692 .flags = MEMTYPE_FLAGS_1M_ALIGN,
693 },
694};
695
696static void __init size_pmem_devices(void)
697{
698#ifdef CONFIG_ANDROID_PMEM
699 android_pmem_adsp_pdata.size = pmem_adsp_size;
700 android_pmem_pdata.size = pmem_size;
701 android_pmem_audio_pdata.size = MSM_PMEM_AUDIO_SIZE;
702#endif
703}
704
705static void __init reserve_memory_for(struct android_pmem_platform_data *p)
706{
707 msm8960_reserve_table[p->memory_type].size += p->size;
708}
709
710static void __init reserve_pmem_memory(void)
711{
712#ifdef CONFIG_ANDROID_PMEM
713 reserve_memory_for(&android_pmem_adsp_pdata);
714 reserve_memory_for(&android_pmem_pdata);
715 reserve_memory_for(&android_pmem_audio_pdata);
716 msm8960_reserve_table[MEMTYPE_EBI1].size += pmem_kernel_ebi1_size;
717#endif
718}
719
720static void __init msm8960_calculate_reserve_sizes(void)
721{
722 size_pmem_devices();
723 reserve_pmem_memory();
724}
725
726static int msm8960_paddr_to_memtype(unsigned int paddr)
727{
728 return MEMTYPE_EBI1;
729}
730
731static struct reserve_info msm8960_reserve_info __initdata = {
732 .memtype_reserve_table = msm8960_reserve_table,
733 .calculate_reserve_sizes = msm8960_calculate_reserve_sizes,
734 .paddr_to_memtype = msm8960_paddr_to_memtype,
735};
736
737static void __init msm8960_reserve(void)
738{
739 reserve_info = &msm8960_reserve_info;
740 msm_reserve();
741}
742
Larry Bassela7eadea2011-07-14 10:46:00 -0700743static int msm8960_change_memory_power(unsigned long start_pfn,
744 unsigned long nr_pages, int change_type)
745{
746 return 1;
747}
748
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700749#ifdef CONFIG_MSM_CAMERA
750
751static int msm_cam_gpio_tbl[] = {
752 5, /*CAMIF_MCLK*/
753 20, /*CAMIF_I2C_DATA*/
754 21, /*CAMIF_I2C_CLK*/
755};
756
757#define VFE_CAMIF_TIMER1_GPIO 2
758#define VFE_CAMIF_TIMER2_GPIO 3
759#define VFE_CAMIF_TIMER3_GPIO_INT 4
760struct msm_camera_sensor_strobe_flash_data strobe_flash_xenon = {
761 .flash_trigger = VFE_CAMIF_TIMER2_GPIO,
762 .flash_charge = VFE_CAMIF_TIMER1_GPIO,
763 .flash_charge_done = VFE_CAMIF_TIMER3_GPIO_INT,
764 .flash_recharge_duration = 50000,
765 .irq = MSM_GPIO_TO_INT(VFE_CAMIF_TIMER3_GPIO_INT),
766};
767
768#ifdef CONFIG_IMX074
769static struct msm_camera_sensor_platform_info sensor_board_info = {
Mansoor Aftab6d6ff5e2011-07-20 17:25:36 -0700770 .mount_angle = 90
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700771};
772#endif
773
774static int config_gpio_table(int gpio_en)
775{
776 int rc = 0, i = 0;
777 if (gpio_en) {
778 for (i = 0; i < ARRAY_SIZE(msm_cam_gpio_tbl); i++) {
779 rc = gpio_request(msm_cam_gpio_tbl[i], "CAM_GPIO");
780 if (rc < 0) {
781 pr_err("%s not able to get gpio\n", __func__);
782 for (i--; i >= 0; i--)
783 gpio_free(msm_cam_gpio_tbl[i]);
784 break;
785 }
786 }
787 } else {
788 for (i = 0; i < ARRAY_SIZE(msm_cam_gpio_tbl); i++)
789 gpio_free(msm_cam_gpio_tbl[i]);
790 }
791 return rc;
792}
793
794static int config_camera_on_gpios(void)
795{
796 int rc = 0;
797
798 rc = config_gpio_table(1);
799 if (rc < 0) {
800 printk(KERN_ERR "%s: CAMSENSOR gpio table request"
801 "failed\n", __func__);
802 return rc;
803 }
804 return rc;
805}
806
807static void config_camera_off_gpios(void)
808{
809 config_gpio_table(0);
810}
811
812struct msm_camera_device_platform_data msm_camera_csi0_device_data = {
813 .camera_gpio_on = config_camera_on_gpios,
814 .camera_gpio_off = config_camera_off_gpios,
815 .ioclk.mclk_clk_rate = 24000000,
816 .ioclk.vfe_clk_rate = 228570000,
817 .csid_core = 0,
818};
819
820struct msm_camera_device_platform_data msm_camera_csi1_device_data = {
821 .camera_gpio_on = config_camera_on_gpios,
822 .camera_gpio_off = config_camera_off_gpios,
823 .ioclk.mclk_clk_rate = 24000000,
824 .ioclk.vfe_clk_rate = 228570000,
825 .csid_core = 1,
826};
827
828#ifdef CONFIG_IMX074
829static struct msm_camera_sensor_flash_data flash_imx074 = {
830 .flash_type = MSM_CAMERA_FLASH_LED,
831};
832
833static struct msm_camera_sensor_info msm_camera_sensor_imx074_data = {
834 .sensor_name = "imx074",
835 .sensor_reset = 107,
836 .sensor_pwd = 85,
837 .vcm_pwd = 0,
838 .vcm_enable = 1,
839 .pdata = &msm_camera_csi0_device_data,
840 .flash_data = &flash_imx074,
841 .strobe_flash_data = &strobe_flash_xenon,
842 .sensor_platform_info = &sensor_board_info,
843 .csi_if = 1
844};
845
846struct platform_device msm8960_camera_sensor_imx074 = {
847 .name = "msm_camera_imx074",
848 .dev = {
849 .platform_data = &msm_camera_sensor_imx074_data,
850 },
851};
852#endif
853#ifdef CONFIG_OV2720
854static struct msm_camera_sensor_flash_data flash_ov2720 = {
855 .flash_type = MSM_CAMERA_FLASH_LED,
856};
857
858static struct msm_camera_sensor_info msm_camera_sensor_ov2720_data = {
859 .sensor_name = "ov2720",
860 .sensor_reset = 76,
861 .sensor_pwd = 85,
862 .vcm_pwd = 0,
863 .vcm_enable = 1,
864 .pdata = &msm_camera_csi1_device_data,
865 .flash_data = &flash_ov2720,
866 .csi_if = 1
867};
868
869struct platform_device msm8960_camera_sensor_ov2720 = {
870 .name = "msm_camera_ov2720",
871 .dev = {
872 .platform_data = &msm_camera_sensor_ov2720_data,
873 },
874};
875#endif
Kevin Chandfecce22011-07-13 10:52:41 -0700876
877static struct msm_camera_sensor_flash_data flash_qs_mt9p017 = {
878 .flash_type = MSM_CAMERA_FLASH_LED,
879};
880
881static struct msm_camera_sensor_info msm_camera_sensor_qs_mt9p017_data = {
882 .sensor_name = "qs_mt9p017",
883 .sensor_reset = 107,
884 .sensor_pwd = 85,
885 .vcm_pwd = 0,
886 .vcm_enable = 1,
887 .pdata = &msm_camera_csi0_device_data,
888 .flash_data = &flash_qs_mt9p017,
889 .sensor_platform_info = &sensor_board_info,
890 .csi_if = 1
891};
892
893struct platform_device msm8960_camera_sensor_qs_mt9p017 = {
894 .name = "msm_camera_qs_mt9p017",
895 .dev = {
896 .platform_data = &msm_camera_sensor_qs_mt9p017_data,
897 },
898};
899
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700900static void __init msm8960_init_cam(void)
901{
902 int i;
903 struct platform_device *cam_dev[] = {
904 &msm8960_camera_sensor_imx074,
905 &msm8960_camera_sensor_ov2720,
Kevin Chandfecce22011-07-13 10:52:41 -0700906 &msm8960_camera_sensor_qs_mt9p017,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700907 };
908
909 for (i = 0; i < ARRAY_SIZE(cam_dev); i++) {
910 struct msm_camera_sensor_info *s_info;
911 s_info = cam_dev[i]->dev.platform_data;
912 msm_get_cam_resources(s_info);
913 platform_device_register(cam_dev[i]);
914 }
915}
916#endif
917
918#ifdef CONFIG_FB_MSM_TRIPLE_BUFFER
919/* prim = 608 x 1024 x 4(bpp) x 3(pages) */
920#define MSM_FB_PRIM_BUF_SIZE 0x720000
921#else
922/* prim = 608 x 1024 x 4(bpp) x 2(pages) */
923#define MSM_FB_PRIM_BUF_SIZE 0x4C0000
924#endif
925
926#ifdef CONFIG_FB_MSM_MIPI_DSI
927/* 960 x 540 x 3 x 2 */
928#define MIPI_DSI_WRITEBACK_SIZE 0x300000
929#else
930#define MIPI_DSI_WRITEBACK_SIZE 0
931#endif
932
933#ifdef CONFIG_FB_MSM_HDMI_MSM_PANEL
934/* hdmi = 1920 x 1088 x 2(bpp) x 1(page) */
935#define MSM_FB_EXT_BUF_SIZE 0x3FC000
936#elif defined(CONFIG_FB_MSM_TVOUT)
937/* tvout = 720 x 576 x 2(bpp) x 2(pages) */
938#define MSM_FB_EXT_BUF_SIZE 0x195000
939#else /* CONFIG_FB_MSM_HDMI_MSM_PANEL */
940#define MSM_FB_EXT_BUF_SIZE 0
941#endif /* CONFIG_FB_MSM_HDMI_MSM_PANEL */
942
943#define MSM_FB_SIZE roundup(MSM_FB_PRIM_BUF_SIZE + MSM_FB_EXT_BUF_SIZE +\
944 MIPI_DSI_WRITEBACK_SIZE, 4096)
945
946#define MDP_VSYNC_GPIO 0
947
948static struct resource msm_fb_resources[] = {
949 {
950 .flags = IORESOURCE_DMA,
951 }
952};
953
954static struct platform_device msm_fb_device = {
955 .name = "msm_fb",
956 .id = 0,
957 .num_resources = ARRAY_SIZE(msm_fb_resources),
958 .resource = msm_fb_resources,
959};
960
961static bool dsi_power_on;
962
963static int mipi_dsi_panel_power(int on)
964{
965 static struct regulator *reg_l8, *reg_l23, *reg_l2;
966 static int gpio24, gpio43;
967 int rc;
968
969 struct pm_gpio gpio43_param = {
970 .direction = PM_GPIO_DIR_OUT,
971 .output_buffer = PM_GPIO_OUT_BUF_CMOS,
972 .output_value = 0,
973 .pull = PM_GPIO_PULL_NO,
974 .vin_sel = 2,
975 .out_strength = PM_GPIO_STRENGTH_HIGH,
976 .function = PM_GPIO_FUNC_PAIRED,
977 .inv_int_pol = 0,
978 .disable_pin = 0,
979 };
980
981 struct pm_gpio gpio24_param = {
982 .direction = PM_GPIO_DIR_OUT,
983 .output_buffer = PM_GPIO_OUT_BUF_CMOS,
984 .output_value = 1,
985 .pull = PM_GPIO_PULL_NO,
986 .vin_sel = 2,
987 .out_strength = PM_GPIO_STRENGTH_HIGH,
988 .function = PM_GPIO_FUNC_NORMAL,
989 .inv_int_pol = 0,
990 .disable_pin = 0,
991 };
992
993 pr_info("%s: state : %d\n", __func__, on);
994
995 if (!dsi_power_on) {
996
997 reg_l8 = regulator_get(&msm_mipi_dsi1_device.dev,
998 "dsi_vdc");
999 if (IS_ERR(reg_l8)) {
1000 pr_err("could not get 8921_l8, rc = %ld\n",
1001 PTR_ERR(reg_l8));
1002 return -ENODEV;
1003 }
1004
1005 reg_l23 = regulator_get(&msm_mipi_dsi1_device.dev,
1006 "dsi_vddio");
1007 if (IS_ERR(reg_l23)) {
1008 pr_err("could not get 8921_l23, rc = %ld\n",
1009 PTR_ERR(reg_l23));
1010 return -ENODEV;
1011 }
1012
1013 reg_l2 = regulator_get(&msm_mipi_dsi1_device.dev,
1014 "dsi_vdda");
1015 if (IS_ERR(reg_l2)) {
1016 pr_err("could not get 8921_l2, rc = %ld\n",
1017 PTR_ERR(reg_l2));
1018 return -ENODEV;
1019 }
1020
1021 rc = regulator_set_voltage(reg_l8, 2800000, 3000000);
1022 if (rc) {
1023 pr_err("set_voltage l8 failed, rc=%d\n", rc);
1024 return -EINVAL;
1025 }
1026 rc = regulator_set_voltage(reg_l23, 1800000, 1800000);
1027 if (rc) {
1028 pr_err("set_voltage l23 failed, rc=%d\n", rc);
1029 return -EINVAL;
1030 }
1031 rc = regulator_set_voltage(reg_l2, 1200000, 1200000);
1032 if (rc) {
1033 pr_err("set_voltage l2 failed, rc=%d\n", rc);
1034 return -EINVAL;
1035 }
1036
1037 gpio43 = PM8921_GPIO_PM_TO_SYS(43);
1038 rc = gpio_request(gpio43, "disp_rst_n");
1039 if (rc) {
1040 pr_err("request gpio 43 failed, rc=%d\n", rc);
1041 return -ENODEV;
1042 }
1043
1044 gpio24 = PM8921_GPIO_PM_TO_SYS(24);
1045 rc = gpio_request(gpio24, "disp_backlight");
1046 if (rc) {
1047 pr_err("request gpio 24 failed, rc=%d\n", rc);
1048 return -EINVAL;
1049 }
1050 dsi_power_on = true;
1051 }
1052
1053 if (on) {
1054 rc = regulator_set_optimum_mode(reg_l8, 100000);
1055 if (rc < 0) {
1056 pr_err("set_optimum_mode l8 failed, rc=%d\n", rc);
1057 return -EINVAL;
1058 }
1059 rc = regulator_set_optimum_mode(reg_l23, 100000);
1060 if (rc < 0) {
1061 pr_err("set_optimum_mode l23 failed, rc=%d\n", rc);
1062 return -EINVAL;
1063 }
1064 rc = regulator_set_optimum_mode(reg_l2, 100000);
1065 if (rc < 0) {
1066 pr_err("set_optimum_mode l2 failed, rc=%d\n", rc);
1067 return -EINVAL;
1068 }
1069 rc = regulator_enable(reg_l8);
1070 if (rc) {
1071 pr_err("enable l8 failed, rc=%d\n", rc);
1072 return -ENODEV;
1073 }
1074 rc = regulator_enable(reg_l23);
1075 if (rc) {
1076 pr_err("enable l8 failed, rc=%d\n", rc);
1077 return -ENODEV;
1078 }
1079 rc = regulator_enable(reg_l2);
1080 if (rc) {
1081 pr_err("enable l2 failed, rc=%d\n", rc);
1082 return -ENODEV;
1083 }
1084
1085 gpio43_param.pull = PM_GPIO_PULL_NO;
1086 rc = pm8xxx_gpio_config(gpio43, &gpio43_param);
1087 if (rc) {
1088 pr_err("gpio_config 43 failed (1), rc=%d\n", rc);
1089 return -EINVAL;
1090 }
1091 gpio43_param.pull = PM_GPIO_PULL_UP_30;
1092 rc = pm8xxx_gpio_config(gpio43, &gpio43_param);
1093 if (rc) {
1094 pr_err("gpio_config 43 failed (2), rc=%d\n", rc);
1095 return -EINVAL;
1096 }
1097 gpio43_param.pull = PM_GPIO_PULL_NO;
1098 rc = pm8xxx_gpio_config(gpio43, &gpio43_param);
1099 if (rc) {
1100 pr_err("gpio_config 43 failed (3), rc=%d\n", rc);
1101 return -EINVAL;
1102 }
1103 gpio43_param.pull = PM_GPIO_PULL_UP_30;
1104 rc = pm8xxx_gpio_config(gpio43, &gpio43_param);
1105 if (rc) {
1106 pr_err("gpio_config 43 failed (4), rc=%d\n", rc);
1107 return -EINVAL;
1108 }
1109
1110 rc = pm8xxx_gpio_config(gpio24, &gpio24_param);
1111 if (rc) {
1112 pr_err("gpio_config 24 failed, rc=%d\n", rc);
1113 return -EINVAL;
1114 }
1115
1116 gpio_set_value_cansleep(gpio43, 1);
1117 } else {
1118 rc = regulator_set_optimum_mode(reg_l8, 100);
1119 if (rc < 0) {
1120 pr_err("set_optimum_mode l8 failed, rc=%d\n", rc);
1121 return -EINVAL;
1122 }
1123 rc = regulator_set_optimum_mode(reg_l23, 100);
1124 if (rc < 0) {
1125 pr_err("set_optimum_mode l23 failed, rc=%d\n", rc);
1126 return -EINVAL;
1127 }
1128 rc = regulator_set_optimum_mode(reg_l2, 100);
1129 if (rc < 0) {
1130 pr_err("set_optimum_mode l2 failed, rc=%d\n", rc);
1131 return -EINVAL;
1132 }
1133 gpio_set_value_cansleep(gpio43, 0);
1134 }
1135 return 0;
1136}
1137
1138static struct mipi_dsi_platform_data mipi_dsi_pdata = {
1139 .vsync_gpio = MDP_VSYNC_GPIO,
1140 .dsi_power_save = mipi_dsi_panel_power,
1141};
1142
1143#ifdef CONFIG_MSM_BUS_SCALING
1144
1145static struct msm_bus_vectors mdp_init_vectors[] = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001146 {
1147 .src = MSM_BUS_MASTER_MDP_PORT0,
1148 .dst = MSM_BUS_SLAVE_EBI_CH0,
1149 .ab = 0,
1150 .ib = 0,
1151 },
Ravishangar Kalyanam882930f2011-07-08 17:51:52 -07001152};
1153
1154static struct msm_bus_vectors mdp_ui_vectors[] = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001155 {
1156 .src = MSM_BUS_MASTER_MDP_PORT0,
1157 .dst = MSM_BUS_SLAVE_EBI_CH0,
Ravishangar Kalyanam882930f2011-07-08 17:51:52 -07001158 .ab = 216000000 * 2,
1159 .ib = 270000000 * 2,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001160 },
1161};
1162
1163static struct msm_bus_vectors mdp_vga_vectors[] = {
1164 /* VGA and less video */
1165 {
1166 .src = MSM_BUS_MASTER_MDP_PORT0,
1167 .dst = MSM_BUS_SLAVE_EBI_CH0,
Ravishangar Kalyanam882930f2011-07-08 17:51:52 -07001168 .ab = 216000000 * 2,
1169 .ib = 270000000 * 2,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001170 },
1171};
1172
1173static struct msm_bus_vectors mdp_720p_vectors[] = {
1174 /* 720p and less video */
1175 {
1176 .src = MSM_BUS_MASTER_MDP_PORT0,
1177 .dst = MSM_BUS_SLAVE_EBI_CH0,
Ravishangar Kalyanam882930f2011-07-08 17:51:52 -07001178 .ab = 230400000 * 2,
1179 .ib = 288000000 * 2,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001180 },
1181};
1182
1183static struct msm_bus_vectors mdp_1080p_vectors[] = {
1184 /* 1080p and less video */
1185 {
1186 .src = MSM_BUS_MASTER_MDP_PORT0,
1187 .dst = MSM_BUS_SLAVE_EBI_CH0,
Ravishangar Kalyanam882930f2011-07-08 17:51:52 -07001188 .ab = 334080000 * 2,
1189 .ib = 417600000 * 2,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001190 },
1191};
1192
1193static struct msm_bus_paths mdp_bus_scale_usecases[] = {
1194 {
1195 ARRAY_SIZE(mdp_init_vectors),
1196 mdp_init_vectors,
1197 },
1198 {
Ravishangar Kalyanam882930f2011-07-08 17:51:52 -07001199 ARRAY_SIZE(mdp_ui_vectors),
1200 mdp_ui_vectors,
1201 },
1202 {
1203 ARRAY_SIZE(mdp_ui_vectors),
1204 mdp_ui_vectors,
1205 },
1206 {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001207 ARRAY_SIZE(mdp_vga_vectors),
1208 mdp_vga_vectors,
1209 },
1210 {
1211 ARRAY_SIZE(mdp_720p_vectors),
1212 mdp_720p_vectors,
1213 },
1214 {
1215 ARRAY_SIZE(mdp_1080p_vectors),
1216 mdp_1080p_vectors,
1217 },
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001218};
1219
1220static struct msm_bus_scale_pdata mdp_bus_scale_pdata = {
1221 mdp_bus_scale_usecases,
1222 ARRAY_SIZE(mdp_bus_scale_usecases),
1223 .name = "mdp",
1224};
1225
1226#endif
1227
1228int mdp_core_clk_rate_table[] = {
1229 85330000,
1230 85330000,
1231 128000000,
1232 200000000,
1233 200000000,
1234};
1235
1236static struct msm_panel_common_pdata mdp_pdata = {
1237 .gpio = MDP_VSYNC_GPIO,
1238 .mdp_core_clk_rate = 85330000,
1239 .mdp_core_clk_table = mdp_core_clk_rate_table,
1240 .num_mdp_clk = ARRAY_SIZE(mdp_core_clk_rate_table),
1241#ifdef CONFIG_MSM_BUS_SCALING
1242 .mdp_bus_scale_table = &mdp_bus_scale_pdata,
1243#endif
1244 .mdp_rev = MDP_REV_42,
1245};
1246
1247static struct platform_device mipi_dsi_renesas_panel_device = {
1248 .name = "mipi_renesas",
1249 .id = 0,
1250};
1251
1252static struct platform_device mipi_dsi_simulator_panel_device = {
1253 .name = "mipi_simulator",
1254 .id = 0,
1255};
1256
1257static struct platform_device mipi_dsi_toshiba_panel_device = {
1258 .name = "mipi_toshiba",
1259 .id = 0,
1260};
1261
1262#ifdef CONFIG_FB_MSM_HDMI_MSM_PANEL
1263static struct resource hdmi_msm_resources[] = {
1264 {
1265 .name = "hdmi_msm_qfprom_addr",
1266 .start = 0x00700000,
1267 .end = 0x007060FF,
1268 .flags = IORESOURCE_MEM,
1269 },
1270 {
1271 .name = "hdmi_msm_hdmi_addr",
1272 .start = 0x04A00000,
1273 .end = 0x04A00FFF,
1274 .flags = IORESOURCE_MEM,
1275 },
1276 {
1277 .name = "hdmi_msm_irq",
1278 .start = HDMI_IRQ,
1279 .end = HDMI_IRQ,
1280 .flags = IORESOURCE_IRQ,
1281 },
1282};
1283
1284static int hdmi_enable_5v(int on);
1285static int hdmi_core_power(int on, int show);
1286static int hdmi_cec_power(int on);
1287
1288static struct msm_hdmi_platform_data hdmi_msm_data = {
1289 .irq = HDMI_IRQ,
1290 .enable_5v = hdmi_enable_5v,
1291 .core_power = hdmi_core_power,
1292 .cec_power = hdmi_cec_power,
1293};
1294
1295static struct platform_device hdmi_msm_device = {
1296 .name = "hdmi_msm",
1297 .id = 0,
1298 .num_resources = ARRAY_SIZE(hdmi_msm_resources),
1299 .resource = hdmi_msm_resources,
1300 .dev.platform_data = &hdmi_msm_data,
1301};
1302#endif /* CONFIG_FB_MSM_HDMI_MSM_PANEL */
1303
Ravishangar Kalyanam882930f2011-07-08 17:51:52 -07001304#ifdef CONFIG_MSM_BUS_SCALING
1305static struct msm_bus_vectors dtv_bus_init_vectors[] = {
1306 {
1307 .src = MSM_BUS_MASTER_MDP_PORT0,
1308 .dst = MSM_BUS_SLAVE_EBI_CH0,
1309 .ab = 0,
1310 .ib = 0,
1311 },
1312};
1313static struct msm_bus_vectors dtv_bus_def_vectors[] = {
1314 {
1315 .src = MSM_BUS_MASTER_MDP_PORT0,
1316 .dst = MSM_BUS_SLAVE_EBI_CH0,
1317 .ab = 566092800 * 2,
1318 .ib = 707616000 * 2,
1319 },
1320};
1321static struct msm_bus_paths dtv_bus_scale_usecases[] = {
1322 {
1323 ARRAY_SIZE(dtv_bus_init_vectors),
1324 dtv_bus_init_vectors,
1325 },
1326 {
1327 ARRAY_SIZE(dtv_bus_def_vectors),
1328 dtv_bus_def_vectors,
1329 },
1330};
1331static struct msm_bus_scale_pdata dtv_bus_scale_pdata = {
1332 dtv_bus_scale_usecases,
1333 ARRAY_SIZE(dtv_bus_scale_usecases),
1334 .name = "dtv",
1335};
1336
1337static struct lcdc_platform_data dtv_pdata = {
1338 .bus_scale_table = &dtv_bus_scale_pdata,
1339};
1340#endif
1341
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001342static void __init msm_fb_add_devices(void)
1343{
1344 if (machine_is_msm8x60_rumi3()) {
1345 msm_fb_register_device("mdp", NULL);
1346 mipi_dsi_pdata.target_type = 1;
1347 } else
1348 msm_fb_register_device("mdp", &mdp_pdata);
1349 msm_fb_register_device("mipi_dsi", &mipi_dsi_pdata);
Ravishangar Kalyanam882930f2011-07-08 17:51:52 -07001350#ifdef CONFIG_MSM_BUS_SCALING
1351 msm_fb_register_device("dtv", &dtv_pdata);
1352#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001353}
1354
1355#ifdef CONFIG_FB_MSM_HDMI_MSM_PANEL
1356static struct gpiomux_setting hdmi_suspend_cfg = {
1357 .func = GPIOMUX_FUNC_GPIO,
1358 .drv = GPIOMUX_DRV_2MA,
1359 .pull = GPIOMUX_PULL_DOWN,
1360};
1361
1362static struct gpiomux_setting hdmi_active_1_cfg = {
1363 .func = GPIOMUX_FUNC_1,
1364 .drv = GPIOMUX_DRV_2MA,
1365 .pull = GPIOMUX_PULL_UP,
1366};
1367
1368static struct gpiomux_setting hdmi_active_2_cfg = {
1369 .func = GPIOMUX_FUNC_1,
1370 .drv = GPIOMUX_DRV_2MA,
1371 .pull = GPIOMUX_PULL_DOWN,
1372};
1373
1374static struct msm_gpiomux_config msm8960_hdmi_configs[] __initdata = {
1375 {
1376 .gpio = 99,
1377 .settings = {
1378 [GPIOMUX_ACTIVE] = &hdmi_active_1_cfg,
1379 [GPIOMUX_SUSPENDED] = &hdmi_suspend_cfg,
1380 },
1381 },
1382 {
1383 .gpio = 100,
1384 .settings = {
1385 [GPIOMUX_ACTIVE] = &hdmi_active_1_cfg,
1386 [GPIOMUX_SUSPENDED] = &hdmi_suspend_cfg,
1387 },
1388 },
1389 {
1390 .gpio = 101,
1391 .settings = {
1392 [GPIOMUX_ACTIVE] = &hdmi_active_1_cfg,
1393 [GPIOMUX_SUSPENDED] = &hdmi_suspend_cfg,
1394 },
1395 },
1396 {
1397 .gpio = 102,
1398 .settings = {
1399 [GPIOMUX_ACTIVE] = &hdmi_active_2_cfg,
1400 [GPIOMUX_SUSPENDED] = &hdmi_suspend_cfg,
1401 },
1402 },
1403};
1404
1405static int hdmi_enable_5v(int on)
1406{
1407 /* TBD: PM8921 regulator instead of 8901 */
1408 static struct regulator *reg_8921_hdmi_mvs; /* HDMI_5V */
1409 static int prev_on;
1410 int rc;
1411
1412 if (on == prev_on)
1413 return 0;
1414
1415 if (!reg_8921_hdmi_mvs)
1416 reg_8921_hdmi_mvs = regulator_get(&hdmi_msm_device.dev,
1417 "hdmi_mvs");
1418
1419 if (on) {
1420 rc = regulator_enable(reg_8921_hdmi_mvs);
1421 if (rc) {
1422 pr_err("'%s' regulator enable failed, rc=%d\n",
1423 "8921_hdmi_mvs", rc);
1424 return rc;
1425 }
1426 pr_debug("%s(on): success\n", __func__);
1427 } else {
1428 rc = regulator_disable(reg_8921_hdmi_mvs);
1429 if (rc)
1430 pr_warning("'%s' regulator disable failed, rc=%d\n",
1431 "8921_hdmi_mvs", rc);
1432 pr_debug("%s(off): success\n", __func__);
1433 }
1434
1435 prev_on = on;
1436
1437 return 0;
1438}
1439
1440static int hdmi_core_power(int on, int show)
1441{
1442 static struct regulator *reg_8921_l23, *reg_8921_s4;
1443 static int prev_on;
1444 int rc;
1445
1446 if (on == prev_on)
1447 return 0;
1448
1449 /* TBD: PM8921 regulator instead of 8901 */
1450 if (!reg_8921_l23)
1451 reg_8921_l23 = regulator_get(&hdmi_msm_device.dev, "hdmi_avdd");
1452
1453 if (!reg_8921_s4)
1454 reg_8921_s4 = regulator_get(&hdmi_msm_device.dev, "hdmi_vcc");
1455
1456 if (on) {
1457 rc = regulator_set_optimum_mode(reg_8921_l23, 100000);
1458 if (rc < 0) {
1459 pr_err("set_optimum_mode l23 failed, rc=%d\n", rc);
1460 return -EINVAL;
1461 }
1462
1463 rc = regulator_set_voltage(reg_8921_l23, 1800000, 1800000);
1464 if (!rc)
1465 rc = regulator_enable(reg_8921_l23);
1466 if (rc) {
1467 pr_err("'%s' regulator enable failed, rc=%d\n",
1468 "hdmi_avdd", rc);
1469 return rc;
1470 }
1471 rc = regulator_set_voltage(reg_8921_s4, 1800000, 1800000);
1472 if (!rc)
1473 rc = regulator_enable(reg_8921_s4);
1474 if (rc) {
1475 pr_err("'%s' regulator enable failed, rc=%d\n",
1476 "hdmi_vcc", rc);
1477 return rc;
1478 }
1479
1480 rc = gpio_request(100, "HDMI_DDC_CLK");
1481 if (rc) {
1482 pr_err("'%s'(%d) gpio_request failed, rc=%d\n",
1483 "HDMI_DDC_CLK", 100, rc);
1484 goto error1;
1485 }
1486 rc = gpio_request(101, "HDMI_DDC_DATA");
1487 if (rc) {
1488 pr_err("'%s'(%d) gpio_request failed, rc=%d\n",
1489 "HDMI_DDC_DATA", 101, rc);
1490 goto error2;
1491 }
1492 rc = gpio_request(102, "HDMI_HPD");
1493 if (rc) {
1494 pr_err("'%s'(%d) gpio_request failed, rc=%d\n",
1495 "HDMI_HPD", 102, rc);
1496 goto error3;
1497 }
1498 pr_debug("%s(on): success\n", __func__);
1499 } else {
1500 gpio_free(100);
1501 gpio_free(101);
1502 gpio_free(102);
1503
1504 rc = regulator_set_optimum_mode(reg_8921_l23, 100);
1505 if (rc < 0) {
1506 pr_err("set_optimum_mode l23 failed, rc=%d\n", rc);
1507 return -EINVAL;
1508 }
1509
1510 pr_debug("%s(off): success\n", __func__);
1511 }
1512
1513 prev_on = on;
1514
1515 return 0;
1516
1517error3:
1518 gpio_free(101);
1519error2:
1520 gpio_free(100);
1521error1:
1522 regulator_disable(reg_8921_l23);
1523 return rc;
1524}
1525
1526static int hdmi_cec_power(int on)
1527{
1528 static int prev_on;
1529 int rc;
1530
1531 if (on == prev_on)
1532 return 0;
1533
1534 if (on) {
1535 rc = gpio_request(99, "HDMI_CEC_VAR");
1536 if (rc) {
1537 pr_err("'%s'(%d) gpio_request failed, rc=%d\n",
1538 "HDMI_CEC_VAR", 99, rc);
1539 goto error;
1540 }
1541 pr_debug("%s(on): success\n", __func__);
1542 } else {
1543 gpio_free(99);
1544 pr_debug("%s(off): success\n", __func__);
1545 }
1546
1547 prev_on = on;
1548
1549 return 0;
1550error:
1551 return rc;
1552}
1553#endif /* CONFIG_FB_MSM_HDMI_MSM_PANEL */
1554
1555static void __init msm8960_allocate_memory_regions(void)
1556{
1557 void *addr;
1558 unsigned long size;
1559
1560 size = MSM_FB_SIZE;
1561 addr = alloc_bootmem_align(size, 0x1000);
1562 msm_fb_resources[0].start = __pa(addr);
1563 msm_fb_resources[0].end = msm_fb_resources[0].start + size - 1;
1564 pr_info("allocating %lu bytes at %p (%lx physical) for fb\n",
1565 size, addr, __pa(addr));
1566
1567}
1568#ifdef CONFIG_WCD9310_CODEC
1569
1570#define TABLA_INTERRUPT_BASE (NR_MSM_IRQS + NR_GPIO_IRQS + NR_PM8921_IRQS)
1571
1572static struct tabla_pdata tabla_platform_data = {
1573 .slimbus_slave_device = {
1574 .name = "tabla-slave",
1575 .e_addr = {0, 0, 0x10, 0, 0x17, 2},
1576 },
1577 .irq = MSM_GPIO_TO_INT(62),
1578 .irq_base = TABLA_INTERRUPT_BASE,
1579 .num_irqs = NR_TABLA_IRQS,
1580 .reset_gpio = PM8921_GPIO_PM_TO_SYS(34),
1581};
1582
1583static struct slim_device msm_slim_tabla = {
1584 .name = "tabla-slim",
1585 .e_addr = {0, 1, 0x10, 0, 0x17, 2},
1586 .dev = {
1587 .platform_data = &tabla_platform_data,
1588 },
1589};
1590#endif
1591
1592static struct slim_boardinfo msm_slim_devices[] = {
1593#ifdef CONFIG_WCD9310_CODEC
1594 {
1595 .bus_num = 1,
1596 .slim_slave = &msm_slim_tabla,
1597 },
1598#endif
1599 /* add more slimbus slaves as needed */
1600};
1601
Yunsen Wang5c1a7392011-07-09 19:10:16 -07001602#define MSM_WCNSS_PHYS 0x03000000
1603#define MSM_WCNSS_SIZE 0x280000
1604
1605static struct resource resources_wcnss_wlan[] = {
1606 {
1607 .start = RIVA_APPS_WLAN_RX_DATA_AVAIL_IRQ,
1608 .end = RIVA_APPS_WLAN_RX_DATA_AVAIL_IRQ,
1609 .name = "wcnss_wlanrx_irq",
1610 .flags = IORESOURCE_IRQ,
1611 },
1612 {
1613 .start = RIVA_APPS_WLAN_DATA_XFER_DONE_IRQ,
1614 .end = RIVA_APPS_WLAN_DATA_XFER_DONE_IRQ,
1615 .name = "wcnss_wlantx_irq",
1616 .flags = IORESOURCE_IRQ,
1617 },
1618 {
1619 .start = MSM_WCNSS_PHYS,
1620 .end = MSM_WCNSS_PHYS + MSM_WCNSS_SIZE - 1,
1621 .name = "wcnss_mmio",
1622 .flags = IORESOURCE_MEM,
1623 },
1624};
1625
1626static struct platform_device msm_device_wcnss_wlan = {
1627 .name = "wcnss_wlan",
1628 .id = 0,
1629 .num_resources = ARRAY_SIZE(resources_wcnss_wlan),
1630 .resource = resources_wcnss_wlan,
1631};
1632
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001633#if defined(CONFIG_CRYPTO_DEV_QCRYPTO) || \
1634 defined(CONFIG_CRYPTO_DEV_QCRYPTO_MODULE) || \
1635 defined(CONFIG_CRYPTO_DEV_QCEDEV) || \
1636 defined(CONFIG_CRYPTO_DEV_QCEDEV_MODULE)
1637
1638#define QCE_SIZE 0x10000
1639#define QCE_0_BASE 0x18500000
1640
1641#define QCE_HW_KEY_SUPPORT 0
1642#define QCE_SHA_HMAC_SUPPORT 1
1643#define QCE_SHARE_CE_RESOURCE 1
1644#define QCE_CE_SHARED 0
1645
1646static struct resource qcrypto_resources[] = {
1647 [0] = {
1648 .start = QCE_0_BASE,
1649 .end = QCE_0_BASE + QCE_SIZE - 1,
1650 .flags = IORESOURCE_MEM,
1651 },
1652 [1] = {
1653 .name = "crypto_channels",
1654 .start = DMOV_CE_IN_CHAN,
1655 .end = DMOV_CE_OUT_CHAN,
1656 .flags = IORESOURCE_DMA,
1657 },
1658 [2] = {
1659 .name = "crypto_crci_in",
1660 .start = DMOV_CE_IN_CRCI,
1661 .end = DMOV_CE_IN_CRCI,
1662 .flags = IORESOURCE_DMA,
1663 },
1664 [3] = {
1665 .name = "crypto_crci_out",
1666 .start = DMOV_CE_OUT_CRCI,
1667 .end = DMOV_CE_OUT_CRCI,
1668 .flags = IORESOURCE_DMA,
1669 },
1670};
1671
1672static struct resource qcedev_resources[] = {
1673 [0] = {
1674 .start = QCE_0_BASE,
1675 .end = QCE_0_BASE + QCE_SIZE - 1,
1676 .flags = IORESOURCE_MEM,
1677 },
1678 [1] = {
1679 .name = "crypto_channels",
1680 .start = DMOV_CE_IN_CHAN,
1681 .end = DMOV_CE_OUT_CHAN,
1682 .flags = IORESOURCE_DMA,
1683 },
1684 [2] = {
1685 .name = "crypto_crci_in",
1686 .start = DMOV_CE_IN_CRCI,
1687 .end = DMOV_CE_IN_CRCI,
1688 .flags = IORESOURCE_DMA,
1689 },
1690 [3] = {
1691 .name = "crypto_crci_out",
1692 .start = DMOV_CE_OUT_CRCI,
1693 .end = DMOV_CE_OUT_CRCI,
1694 .flags = IORESOURCE_DMA,
1695 },
1696};
1697
1698#endif
1699
1700#if defined(CONFIG_CRYPTO_DEV_QCRYPTO) || \
1701 defined(CONFIG_CRYPTO_DEV_QCRYPTO_MODULE)
1702
1703static struct msm_ce_hw_support qcrypto_ce_hw_suppport = {
1704 .ce_shared = QCE_CE_SHARED,
1705 .shared_ce_resource = QCE_SHARE_CE_RESOURCE,
1706 .hw_key_support = QCE_HW_KEY_SUPPORT,
1707 .sha_hmac = QCE_SHA_HMAC_SUPPORT,
1708};
1709
1710static struct platform_device qcrypto_device = {
1711 .name = "qcrypto",
1712 .id = 0,
1713 .num_resources = ARRAY_SIZE(qcrypto_resources),
1714 .resource = qcrypto_resources,
1715 .dev = {
1716 .coherent_dma_mask = DMA_BIT_MASK(32),
1717 .platform_data = &qcrypto_ce_hw_suppport,
1718 },
1719};
1720#endif
1721
1722#if defined(CONFIG_CRYPTO_DEV_QCEDEV) || \
1723 defined(CONFIG_CRYPTO_DEV_QCEDEV_MODULE)
1724
1725static struct msm_ce_hw_support qcedev_ce_hw_suppport = {
1726 .ce_shared = QCE_CE_SHARED,
1727 .shared_ce_resource = QCE_SHARE_CE_RESOURCE,
1728 .hw_key_support = QCE_HW_KEY_SUPPORT,
1729 .sha_hmac = QCE_SHA_HMAC_SUPPORT,
1730};
1731
1732static struct platform_device qcedev_device = {
1733 .name = "qce",
1734 .id = 0,
1735 .num_resources = ARRAY_SIZE(qcedev_resources),
1736 .resource = qcedev_resources,
1737 .dev = {
1738 .coherent_dma_mask = DMA_BIT_MASK(32),
1739 .platform_data = &qcedev_ce_hw_suppport,
1740 },
1741};
1742#endif
1743
1744
1745static int __init gpiomux_init(void)
1746{
1747 int rc;
1748
1749 rc = msm_gpiomux_init(NR_GPIO_IRQS);
1750 if (rc) {
1751 pr_err(KERN_ERR "msm_gpiomux_init failed %d\n", rc);
1752 return rc;
1753 }
1754
1755 msm_gpiomux_install(msm8960_cam_configs,
1756 ARRAY_SIZE(msm8960_cam_configs));
1757
1758 msm_gpiomux_install(msm8960_gpiomux_configs,
1759 ARRAY_SIZE(msm8960_gsbi_configs));
1760
1761 msm_gpiomux_install(msm8960_gsbi_configs,
1762 ARRAY_SIZE(msm8960_gsbi_configs));
1763
1764 msm_gpiomux_install(msm8960_cyts_configs,
1765 ARRAY_SIZE(msm8960_cyts_configs));
1766
1767 msm_gpiomux_install(msm8960_slimbus_config,
1768 ARRAY_SIZE(msm8960_slimbus_config));
1769
1770 msm_gpiomux_install(msm8960_audio_codec_configs,
1771 ARRAY_SIZE(msm8960_audio_codec_configs));
1772
1773#ifdef CONFIG_FB_MSM_HDMI_MSM_PANEL
1774 msm_gpiomux_install(msm8960_hdmi_configs,
1775 ARRAY_SIZE(msm8960_hdmi_configs));
1776#endif
1777
1778 msm_gpiomux_install(wcnss_5wire_interface,
1779 ARRAY_SIZE(wcnss_5wire_interface));
1780
1781 return 0;
1782}
1783
1784static struct msm_acpu_clock_platform_data msm8960_acpu_clock_data = {
1785 .acpu_switch_time_us = 0,
1786 .vdd_switch_time_us = 0,
1787};
1788
1789#define MSM_SHARED_RAM_PHYS 0x80000000
1790
1791static struct pm8921_adc_amux pm8921_adc_channels_data[] = {
1792 {"vcoin", CHANNEL_VCOIN, CHAN_PATH_SCALING2, AMUX_RSV1,
1793 ADC_DECIMATION_TYPE2, ADC_SCALE_DEFAULT},
1794 {"vbat", CHANNEL_VBAT, CHAN_PATH_SCALING2, AMUX_RSV1,
1795 ADC_DECIMATION_TYPE2, ADC_SCALE_DEFAULT},
1796 {"dcin", CHANNEL_DCIN, CHAN_PATH_SCALING4, AMUX_RSV1,
1797 ADC_DECIMATION_TYPE2, ADC_SCALE_DEFAULT},
1798 {"ichg", CHANNEL_ICHG, CHAN_PATH_SCALING1, AMUX_RSV1,
1799 ADC_DECIMATION_TYPE2, ADC_SCALE_DEFAULT},
1800 {"vph_pwr", CHANNEL_VPH_PWR, CHAN_PATH_SCALING2, AMUX_RSV1,
1801 ADC_DECIMATION_TYPE2, ADC_SCALE_DEFAULT},
1802 {"ibat", CHANNEL_IBAT, CHAN_PATH_SCALING1, AMUX_RSV1,
1803 ADC_DECIMATION_TYPE2, ADC_SCALE_DEFAULT},
1804 {"m4", CHANNEL_MPP_1, CHAN_PATH_SCALING1, AMUX_RSV1,
1805 ADC_DECIMATION_TYPE2, ADC_SCALE_DEFAULT},
1806 {"m5", CHANNEL_MPP_2, CHAN_PATH_SCALING2, AMUX_RSV1,
1807 ADC_DECIMATION_TYPE2, ADC_SCALE_DEFAULT},
1808 {"batt_therm", CHANNEL_BATT_THERM, CHAN_PATH_SCALING1, AMUX_RSV2,
1809 ADC_DECIMATION_TYPE2, ADC_SCALE_BATT_THERM},
1810 {"batt_id", CHANNEL_BATT_ID, CHAN_PATH_SCALING1, AMUX_RSV1,
1811 ADC_DECIMATION_TYPE2, ADC_SCALE_DEFAULT},
1812 {"usbin", CHANNEL_USBIN, CHAN_PATH_SCALING3, AMUX_RSV1,
1813 ADC_DECIMATION_TYPE2, ADC_SCALE_DEFAULT},
1814 {"pmic_therm", CHANNEL_DIE_TEMP, CHAN_PATH_SCALING1, AMUX_RSV1,
1815 ADC_DECIMATION_TYPE2, ADC_SCALE_PMIC_THERM},
1816 {"625mv", CHANNEL_625MV, CHAN_PATH_SCALING1, AMUX_RSV1,
1817 ADC_DECIMATION_TYPE2, ADC_SCALE_DEFAULT},
1818 {"125v", CHANNEL_125V, CHAN_PATH_SCALING1, AMUX_RSV1,
1819 ADC_DECIMATION_TYPE2, ADC_SCALE_DEFAULT},
1820 {"chg_temp", CHANNEL_CHG_TEMP, CHAN_PATH_SCALING1, AMUX_RSV1,
1821 ADC_DECIMATION_TYPE2, ADC_SCALE_DEFAULT},
1822};
1823
1824static struct pm8921_adc_properties pm8921_adc_data = {
1825 .adc_vdd_reference = 1800, /* milli-voltage for this adc */
1826 .bitresolution = 15,
1827 .bipolar = 0,
1828};
1829
1830static struct pm8921_adc_platform_data pm8921_adc_pdata = {
1831 .adc_channel = pm8921_adc_channels_data,
1832 .adc_num_channel = ARRAY_SIZE(pm8921_adc_channels_data),
1833 .adc_prop = &pm8921_adc_data,
1834};
Stepan Moskovchenkod056fca2011-01-27 12:12:07 -08001835
Stepan Moskovchenkof441ca22010-12-01 19:31:16 -08001836static void __init msm8960_map_io(void)
1837{
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001838 msm_shared_ram_phys = MSM_SHARED_RAM_PHYS;
Stepan Moskovchenkof441ca22010-12-01 19:31:16 -08001839 msm_map_msm8960_io();
1840}
1841
1842static void __init msm8960_init_irq(void)
1843{
1844 unsigned int i;
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001845
1846 msm_mpm_irq_extn_init();
Stepan Moskovchenkof441ca22010-12-01 19:31:16 -08001847 gic_init(0, GIC_PPI_START, MSM_QGIC_DIST_BASE,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001848 (void *)MSM_QGIC_CPU_BASE);
Stepan Moskovchenkof441ca22010-12-01 19:31:16 -08001849
1850 /* Edge trigger PPIs except AVS_SVICINT and AVS_SVICINTSWDONE */
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001851 writel_relaxed(0xFFFFD7FF, MSM_QGIC_DIST_BASE + GIC_DIST_CONFIG + 4);
Stepan Moskovchenkof441ca22010-12-01 19:31:16 -08001852
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001853 writel_relaxed(0x0000FFFF, MSM_QGIC_DIST_BASE + GIC_DIST_ENABLE_SET);
1854 mb();
Stepan Moskovchenko50ede4e2010-12-13 18:12:19 -08001855
Stepan Moskovchenkof441ca22010-12-01 19:31:16 -08001856 /* FIXME: Not installing AVS_SVICINT and AVS_SVICINTSWDONE yet
1857 * as they are configured as level, which does not play nice with
1858 * handle_percpu_irq.
1859 */
1860 for (i = GIC_PPI_START; i < GIC_SPI_START; i++) {
1861 if (i != AVS_SVICINT && i != AVS_SVICINTSWDONE)
Thomas Gleixner6845664a2011-03-24 13:25:22 +01001862 irq_set_handler(i, handle_percpu_irq);
Stepan Moskovchenkof441ca22010-12-01 19:31:16 -08001863 }
1864}
1865
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001866/* MSM8960 have 5 SDCC controllers */
1867enum sdcc_controllers {
1868 SDCC1,
1869 SDCC2,
1870 SDCC3,
1871 SDCC4,
1872 SDCC5,
1873 MAX_SDCC_CONTROLLER
1874};
1875
1876/* All SDCC controllers requires VDD/VCC voltage */
1877static struct msm_mmc_reg_data mmc_vdd_reg_data[MAX_SDCC_CONTROLLER] = {
1878 /* SDCC1 : eMMC card connected */
1879 [SDCC1] = {
1880 .name = "sdc_vdd",
1881 .set_voltage_sup = 1,
1882 .level = 2950000,
1883 .always_on = 1,
1884 .lpm_sup = 1,
1885 .lpm_uA = 9000,
1886 .hpm_uA = 200000, /* 200mA */
1887 },
1888 /* SDCC3 : External card slot connected */
1889 [SDCC3] = {
1890 .name = "sdc_vdd",
1891 .set_voltage_sup = 1,
1892 .level = 2950000,
1893 .hpm_uA = 600000, /* 600mA */
1894 }
1895};
1896
1897/* Only slots having eMMC card will require VCCQ voltage */
1898static struct msm_mmc_reg_data mmc_vccq_reg_data[1] = {
1899 /* SDCC1 : eMMC card connected */
1900 [SDCC1] = {
1901 .name = "sdc_vccq",
1902 .set_voltage_sup = 1,
1903 .always_on = 1,
1904 .level = 1800000,
1905 .hpm_uA = 200000, /* 200mA */
1906 }
1907};
1908
1909/* All SDCC controllers may require voting for VDD PAD voltage */
1910static struct msm_mmc_reg_data mmc_vddp_reg_data[MAX_SDCC_CONTROLLER] = {
1911 /* SDCC3 : External card slot connected */
1912 [SDCC3] = {
1913 .name = "sdc_vddp",
1914 .set_voltage_sup = 1,
1915 .level = 2950000,
1916 .always_on = 1,
1917 .lpm_sup = 1,
1918 /* Max. Active current required is 16 mA */
1919 .hpm_uA = 16000,
1920 /*
1921 * Sleep current required is ~300 uA. But min. vote can be
1922 * in terms of mA (min. 1 mA). So let's vote for 2 mA
1923 * during sleep.
1924 */
1925 .lpm_uA = 2000,
1926 }
1927};
1928
1929static struct msm_mmc_slot_reg_data mmc_slot_vreg_data[MAX_SDCC_CONTROLLER] = {
1930 /* SDCC1 : eMMC card connected */
1931 [SDCC1] = {
1932 .vdd_data = &mmc_vdd_reg_data[SDCC1],
1933 .vccq_data = &mmc_vccq_reg_data[SDCC1],
1934 },
1935 /* SDCC3 : External card slot connected */
1936 [SDCC3] = {
1937 .vdd_data = &mmc_vdd_reg_data[SDCC3],
1938 .vddp_data = &mmc_vddp_reg_data[SDCC3],
1939 }
1940};
1941
1942/* SDC1 pad data */
1943static struct msm_mmc_pad_drv sdc1_pad_drv_on_cfg[] = {
1944 {TLMM_HDRV_SDC1_CLK, GPIO_CFG_16MA},
1945 {TLMM_HDRV_SDC1_CMD, GPIO_CFG_10MA},
1946 {TLMM_HDRV_SDC1_DATA, GPIO_CFG_10MA}
1947};
1948
1949static struct msm_mmc_pad_drv sdc1_pad_drv_off_cfg[] = {
1950 {TLMM_HDRV_SDC1_CLK, GPIO_CFG_2MA},
1951 {TLMM_HDRV_SDC1_CMD, GPIO_CFG_2MA},
1952 {TLMM_HDRV_SDC1_DATA, GPIO_CFG_2MA}
1953};
1954
1955static struct msm_mmc_pad_pull sdc1_pad_pull_on_cfg[] = {
1956 {TLMM_PULL_SDC1_CMD, GPIO_CFG_PULL_UP},
1957 {TLMM_PULL_SDC1_DATA, GPIO_CFG_PULL_UP}
1958};
1959
1960static struct msm_mmc_pad_pull sdc1_pad_pull_off_cfg[] = {
1961 {TLMM_PULL_SDC1_CMD, GPIO_CFG_PULL_DOWN},
1962 {TLMM_PULL_SDC1_DATA, GPIO_CFG_PULL_DOWN}
1963};
1964
1965/* SDC3 pad data */
1966static struct msm_mmc_pad_drv sdc3_pad_drv_on_cfg[] = {
1967 {TLMM_HDRV_SDC3_CLK, GPIO_CFG_8MA},
1968 {TLMM_HDRV_SDC3_CMD, GPIO_CFG_8MA},
1969 {TLMM_HDRV_SDC3_DATA, GPIO_CFG_8MA}
1970};
1971
1972static struct msm_mmc_pad_drv sdc3_pad_drv_off_cfg[] = {
1973 {TLMM_HDRV_SDC3_CLK, GPIO_CFG_2MA},
1974 {TLMM_HDRV_SDC3_CMD, GPIO_CFG_2MA},
1975 {TLMM_HDRV_SDC3_DATA, GPIO_CFG_2MA}
1976};
1977
1978static struct msm_mmc_pad_pull sdc3_pad_pull_on_cfg[] = {
1979 {TLMM_PULL_SDC3_CMD, GPIO_CFG_PULL_UP},
1980 {TLMM_PULL_SDC3_DATA, GPIO_CFG_PULL_UP}
1981};
1982
1983static struct msm_mmc_pad_pull sdc3_pad_pull_off_cfg[] = {
1984 {TLMM_PULL_SDC3_CMD, GPIO_CFG_PULL_DOWN},
1985 {TLMM_PULL_SDC3_DATA, GPIO_CFG_PULL_DOWN}
1986};
1987
1988struct msm_mmc_pad_pull_data mmc_pad_pull_data[MAX_SDCC_CONTROLLER] = {
1989 [SDCC1] = {
1990 .on = sdc1_pad_pull_on_cfg,
1991 .off = sdc1_pad_pull_off_cfg,
1992 .size = ARRAY_SIZE(sdc1_pad_pull_on_cfg)
1993 },
1994 [SDCC3] = {
1995 .on = sdc3_pad_pull_on_cfg,
1996 .off = sdc3_pad_pull_off_cfg,
1997 .size = ARRAY_SIZE(sdc3_pad_pull_on_cfg)
1998 },
1999};
2000
2001struct msm_mmc_pad_drv_data mmc_pad_drv_data[MAX_SDCC_CONTROLLER] = {
2002 [SDCC1] = {
2003 .on = sdc1_pad_drv_on_cfg,
2004 .off = sdc1_pad_drv_off_cfg,
2005 .size = ARRAY_SIZE(sdc1_pad_drv_on_cfg)
2006 },
2007 [SDCC3] = {
2008 .on = sdc3_pad_drv_on_cfg,
2009 .off = sdc3_pad_drv_off_cfg,
2010 .size = ARRAY_SIZE(sdc3_pad_drv_on_cfg)
2011 },
2012};
2013
2014struct msm_mmc_pad_data mmc_pad_data[MAX_SDCC_CONTROLLER] = {
2015 [SDCC1] = {
2016 .pull = &mmc_pad_pull_data[SDCC1],
2017 .drv = &mmc_pad_drv_data[SDCC1]
2018 },
2019 [SDCC3] = {
2020 .pull = &mmc_pad_pull_data[SDCC3],
2021 .drv = &mmc_pad_drv_data[SDCC3]
2022 },
2023};
2024
2025struct msm_mmc_pin_data mmc_slot_pin_data[MAX_SDCC_CONTROLLER] = {
2026 [SDCC1] = {
2027 .pad_data = &mmc_pad_data[SDCC1],
2028 },
2029 [SDCC3] = {
2030 .pad_data = &mmc_pad_data[SDCC3],
2031 },
2032};
2033
2034static unsigned int sdc1_sup_clk_rates[] = {
2035 400000, 24000000, 48000000
2036};
2037
2038static unsigned int sdc3_sup_clk_rates[] = {
2039 400000, 24000000, 48000000, 96000000
2040};
2041
2042#ifdef CONFIG_MMC_MSM_SDC1_SUPPORT
2043static struct mmc_platform_data msm8960_sdc1_data = {
2044 .ocr_mask = MMC_VDD_27_28 | MMC_VDD_28_29,
2045#ifdef CONFIG_MMC_MSM_SDC1_8_BIT_SUPPORT
2046 .mmc_bus_width = MMC_CAP_8_BIT_DATA,
2047#else
2048 .mmc_bus_width = MMC_CAP_4_BIT_DATA,
2049#endif
2050 .sup_clk_table = sdc1_sup_clk_rates,
2051 .sup_clk_cnt = ARRAY_SIZE(sdc1_sup_clk_rates),
2052 .nonremovable = 1,
2053 .sdcc_v4_sup = true,
2054 .vreg_data = &mmc_slot_vreg_data[SDCC1],
2055 .pin_data = &mmc_slot_pin_data[SDCC1]
2056};
2057#endif
2058
2059#ifdef CONFIG_MMC_MSM_SDC3_SUPPORT
2060static struct mmc_platform_data msm8960_sdc3_data = {
2061 .ocr_mask = MMC_VDD_27_28 | MMC_VDD_28_29,
2062 .mmc_bus_width = MMC_CAP_4_BIT_DATA,
2063 .sup_clk_table = sdc3_sup_clk_rates,
2064 .sup_clk_cnt = ARRAY_SIZE(sdc3_sup_clk_rates),
2065 .wpswitch_gpio = PM8921_GPIO_PM_TO_SYS(16),
2066 .sdcc_v4_sup = true,
2067 .vreg_data = &mmc_slot_vreg_data[SDCC3],
2068 .pin_data = &mmc_slot_pin_data[SDCC3],
2069#ifdef CONFIG_MMC_MSM_CARD_HW_DETECTION
2070 .status_gpio = PM8921_GPIO_PM_TO_SYS(26),
2071 .status_irq = PM8921_GPIO_IRQ(PM8921_IRQ_BASE, 26),
2072 .irq_flags = IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING,
2073#endif
2074 .xpc_cap = 1,
2075 .uhs_caps = (MMC_CAP_UHS_SDR12 | MMC_CAP_UHS_SDR25 |
2076 MMC_CAP_UHS_SDR50 | MMC_CAP_UHS_DDR50 |
2077 MMC_CAP_MAX_CURRENT_600)
2078};
2079#endif
2080
2081static void __init msm8960_init_mmc(void)
2082{
2083#ifdef CONFIG_MMC_MSM_SDC1_SUPPORT
2084 /* SDC1 : eMMC card connected */
2085 msm_add_sdcc(1, &msm8960_sdc1_data);
2086#endif
2087#ifdef CONFIG_MMC_MSM_SDC3_SUPPORT
2088 /* SDC3: External card slot */
2089 msm_add_sdcc(3, &msm8960_sdc3_data);
2090#endif
2091}
2092
2093static void __init msm8960_init_buses(void)
2094{
2095#ifdef CONFIG_MSM_BUS_SCALING
2096 msm_bus_apps_fabric_pdata.rpm_enabled = 1;
2097 msm_bus_sys_fabric_pdata.rpm_enabled = 1;
2098 msm_bus_mm_fabric_pdata.rpm_enabled = 1;
2099 msm_bus_sys_fpb_pdata.rpm_enabled = 1;
2100 msm_bus_cpss_fpb_pdata.rpm_enabled = 1;
2101 msm_bus_apps_fabric.dev.platform_data = &msm_bus_apps_fabric_pdata;
2102 msm_bus_sys_fabric.dev.platform_data = &msm_bus_sys_fabric_pdata;
2103 msm_bus_mm_fabric.dev.platform_data = &msm_bus_mm_fabric_pdata;
2104 msm_bus_sys_fpb.dev.platform_data = &msm_bus_sys_fpb_pdata;
2105 msm_bus_cpss_fpb.dev.platform_data = &msm_bus_cpss_fpb_pdata;
2106#endif
2107}
2108
2109static struct msm_spi_platform_data msm8960_qup_spi_gsbi1_pdata = {
2110 .max_clock_speed = 15060000,
2111};
2112
2113#ifdef CONFIG_USB_MSM_OTG_72K
2114static struct msm_otg_platform_data msm_otg_pdata;
2115#else
2116#define USB_5V_EN 42
2117static void msm_hsusb_vbus_power(bool on)
2118{
2119 int rc;
2120 static bool vbus_is_on;
2121 static struct regulator *mvs_otg_switch;
2122 struct pm_gpio param = {
2123 .direction = PM_GPIO_DIR_OUT,
2124 .output_buffer = PM_GPIO_OUT_BUF_CMOS,
2125 .output_value = 1,
2126 .pull = PM_GPIO_PULL_NO,
2127 .vin_sel = PM_GPIO_VIN_S4,
2128 .out_strength = PM_GPIO_STRENGTH_MED,
2129 .function = PM_GPIO_FUNC_NORMAL,
2130 };
2131
2132 if (vbus_is_on == on)
2133 return;
2134
2135 if (on) {
2136 mvs_otg_switch = regulator_get(&msm_device_otg.dev, "vbus_otg");
2137 if (IS_ERR(mvs_otg_switch)) {
2138 pr_err("Unable to get mvs_otg_switch\n");
2139 return;
2140 }
2141
2142 rc = gpio_request(PM8921_GPIO_PM_TO_SYS(USB_5V_EN),
2143 "usb_5v_en");
2144 if (rc < 0) {
2145 pr_err("failed to request usb_5v_en gpio\n");
2146 goto put_mvs_otg;
2147 }
2148
2149 if (regulator_enable(mvs_otg_switch)) {
2150 pr_err("unable to enable mvs_otg_switch\n");
2151 goto free_usb_5v_en;
2152 }
2153
2154 rc = pm8xxx_gpio_config(PM8921_GPIO_PM_TO_SYS(USB_5V_EN),
2155 &param);
2156 if (rc < 0) {
2157 pr_err("failed to configure usb_5v_en gpio\n");
2158 goto disable_mvs_otg;
2159 }
2160 vbus_is_on = true;
2161 return;
2162 }
2163disable_mvs_otg:
2164 regulator_disable(mvs_otg_switch);
2165free_usb_5v_en:
2166 gpio_free(PM8921_GPIO_PM_TO_SYS(USB_5V_EN));
2167put_mvs_otg:
2168 regulator_put(mvs_otg_switch);
2169 vbus_is_on = false;
2170}
2171
2172static struct msm_otg_platform_data msm_otg_pdata = {
2173 .mode = USB_OTG,
2174 .otg_control = OTG_PMIC_CONTROL,
2175 .phy_type = SNPS_28NM_INTEGRATED_PHY,
2176 .pclk_src_name = "dfab_usb_hs_clk",
2177 .pmic_id_irq = PM8921_USB_ID_IN_IRQ(PM8921_IRQ_BASE),
2178 .vbus_power = msm_hsusb_vbus_power,
2179};
2180#endif
2181
2182#define PID_MAGIC_ID 0x71432909
2183#define SERIAL_NUM_MAGIC_ID 0x61945374
2184#define SERIAL_NUMBER_LENGTH 127
2185#define DLOAD_USB_BASE_ADD 0x2A03F0C8
2186
2187struct magic_num_struct {
2188 uint32_t pid;
2189 uint32_t serial_num;
2190};
2191
2192struct dload_struct {
2193 uint32_t reserved1;
2194 uint32_t reserved2;
2195 uint32_t reserved3;
2196 uint16_t reserved4;
2197 uint16_t pid;
2198 char serial_number[SERIAL_NUMBER_LENGTH];
2199 uint16_t reserved5;
2200 struct magic_num_struct magic_struct;
2201};
2202
2203static int usb_diag_update_pid_and_serial_num(uint32_t pid, const char *snum)
2204{
2205 struct dload_struct __iomem *dload = 0;
2206
2207 dload = ioremap(DLOAD_USB_BASE_ADD, sizeof(*dload));
2208 if (!dload) {
2209 pr_err("%s: cannot remap I/O memory region: %08x\n",
2210 __func__, DLOAD_USB_BASE_ADD);
2211 return -ENXIO;
2212 }
2213
2214 pr_debug("%s: dload:%p pid:%x serial_num:%s\n",
2215 __func__, dload, pid, snum);
2216 /* update pid */
2217 dload->magic_struct.pid = PID_MAGIC_ID;
2218 dload->pid = pid;
2219
2220 /* update serial number */
2221 dload->magic_struct.serial_num = 0;
2222 if (!snum) {
2223 memset(dload->serial_number, 0, SERIAL_NUMBER_LENGTH);
2224 goto out;
2225 }
2226
2227 dload->magic_struct.serial_num = SERIAL_NUM_MAGIC_ID;
2228 strncpy(dload->serial_number, snum, SERIAL_NUMBER_LENGTH);
2229 dload->serial_number[SERIAL_NUMBER_LENGTH - 1] = '\0';
2230out:
2231 iounmap(dload);
2232 return 0;
2233}
2234
2235static struct android_usb_platform_data android_usb_pdata = {
2236 .update_pid_and_serial_num = usb_diag_update_pid_and_serial_num,
2237};
2238
2239struct platform_device android_usb_device = {
2240 .name = "android_usb",
2241 .id = -1,
2242 .dev = {
2243 .platform_data = &android_usb_pdata,
2244 },
2245};
2246
2247static uint8_t spm_wfi_cmd_sequence[] __initdata = {
2248 0x03, 0x0f,
2249};
2250
2251static uint8_t spm_power_collapse_without_rpm[] __initdata = {
2252 0x00, 0x24, 0x54, 0x10,
2253 0x09, 0x03, 0x01,
2254 0x10, 0x54, 0x30, 0x0C,
2255 0x24, 0x30, 0x0f,
2256};
2257
2258static uint8_t spm_power_collapse_with_rpm[] __initdata = {
2259 0x00, 0x24, 0x54, 0x10,
2260 0x09, 0x07, 0x01, 0x0B,
2261 0x10, 0x54, 0x30, 0x0C,
2262 0x24, 0x30, 0x0f,
2263};
2264
2265static struct msm_spm_seq_entry msm_spm_seq_list[] __initdata = {
2266 [0] = {
2267 .mode = MSM_SPM_MODE_CLOCK_GATING,
2268 .notify_rpm = false,
2269 .cmd = spm_wfi_cmd_sequence,
2270 },
2271 [1] = {
2272 .mode = MSM_SPM_MODE_POWER_COLLAPSE,
2273 .notify_rpm = false,
2274 .cmd = spm_power_collapse_without_rpm,
2275 },
2276 [2] = {
2277 .mode = MSM_SPM_MODE_POWER_COLLAPSE,
2278 .notify_rpm = true,
2279 .cmd = spm_power_collapse_with_rpm,
2280 },
2281};
2282
2283static struct msm_spm_platform_data msm_spm_data[] __initdata = {
2284 [0] = {
2285 .reg_base_addr = MSM_SAW0_BASE,
2286 .reg_init_values[MSM_SPM_REG_SAW2_SECURE] = 0x00,
2287 .reg_init_values[MSM_SPM_REG_SAW2_CFG] = 0x1F,
2288 .reg_init_values[MSM_SPM_REG_SAW2_VCTL] = 0x9C,
2289#if defined(CONFIG_MSM_AVS_HW)
2290 .reg_init_values[MSM_SPM_REG_SAW2_AVS_CTL] = 0x00,
2291 .reg_init_values[MSM_SPM_REG_SAW2_AVS_HYSTERESIS] = 0x00,
2292#endif
2293 .reg_init_values[MSM_SPM_REG_SAW2_SPM_CTL] = 0x01,
2294 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DLY] = 0x02020202,
2295 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_0] = 0x0060009C,
2296 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_1] = 0x0000001C,
2297 .vctl_timeout_us = 50,
2298 .num_modes = ARRAY_SIZE(msm_spm_seq_list),
2299 .modes = msm_spm_seq_list,
2300 },
2301 [1] = {
2302 .reg_base_addr = MSM_SAW1_BASE,
2303 .reg_init_values[MSM_SPM_REG_SAW2_SECURE] = 0x00,
2304 .reg_init_values[MSM_SPM_REG_SAW2_CFG] = 0x1F,
2305 .reg_init_values[MSM_SPM_REG_SAW2_VCTL] = 0x9C,
2306#if defined(CONFIG_MSM_AVS_HW)
2307 .reg_init_values[MSM_SPM_REG_SAW2_AVS_CTL] = 0x00,
2308 .reg_init_values[MSM_SPM_REG_SAW2_AVS_HYSTERESIS] = 0x00,
2309#endif
2310 .reg_init_values[MSM_SPM_REG_SAW2_SPM_CTL] = 0x01,
2311 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DLY] = 0x02020202,
2312 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_0] = 0x0060009C,
2313 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_1] = 0x0000001C,
2314 .vctl_timeout_us = 50,
2315 .num_modes = ARRAY_SIZE(msm_spm_seq_list),
2316 .modes = msm_spm_seq_list,
2317 },
2318};
2319
2320static uint8_t l2_spm_wfi_cmd_sequence[] __initdata = {
2321 0x00, 0x20, 0x03, 0x20,
2322 0x00, 0x0f,
2323};
2324
2325static uint8_t l2_spm_gdhs_cmd_sequence[] __initdata = {
2326 0x00, 0x20, 0x34, 0x64,
2327 0x48, 0x07, 0x48, 0x20,
2328 0x50, 0x64, 0x04, 0x34,
2329 0x50, 0x0f,
2330};
2331static uint8_t l2_spm_power_off_cmd_sequence[] __initdata = {
2332 0x00, 0x10, 0x34, 0x64,
2333 0x48, 0x07, 0x48, 0x10,
2334 0x50, 0x64, 0x04, 0x34,
2335 0x50, 0x0F,
2336};
2337
2338static struct msm_spm_seq_entry msm_spm_l2_seq_list[] __initdata = {
2339 [0] = {
2340 .mode = MSM_SPM_L2_MODE_RETENTION,
2341 .notify_rpm = false,
2342 .cmd = l2_spm_wfi_cmd_sequence,
2343 },
2344 [1] = {
2345 .mode = MSM_SPM_L2_MODE_GDHS,
2346 .notify_rpm = true,
2347 .cmd = l2_spm_gdhs_cmd_sequence,
2348 },
2349 [2] = {
2350 .mode = MSM_SPM_L2_MODE_POWER_COLLAPSE,
2351 .notify_rpm = true,
2352 .cmd = l2_spm_power_off_cmd_sequence,
2353 },
2354};
2355
2356
2357static struct msm_spm_platform_data msm_spm_l2_data[] __initdata = {
2358 [0] = {
2359 .reg_base_addr = MSM_SAW_L2_BASE,
2360 .reg_init_values[MSM_SPM_REG_SAW2_SECURE] = 0x00,
2361 .reg_init_values[MSM_SPM_REG_SAW2_SPM_CTL] = 0x00,
2362 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DLY] = 0x02020202,
2363 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_0] = 0x00A000AE,
2364 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_1] = 0x00A00020,
2365 .modes = msm_spm_l2_seq_list,
2366 .num_modes = ARRAY_SIZE(msm_spm_l2_seq_list),
2367 },
2368};
2369
2370#define CYTTSP_TS_GPIO_IRQ 11
2371#define CYTTSP_TS_SLEEP_GPIO 50
2372#define CYTTSP_TS_RESOUT_N_GPIO 52
2373
2374/*virtual key support */
2375static ssize_t tma340_vkeys_show(struct kobject *kobj,
2376 struct kobj_attribute *attr, char *buf)
2377{
2378 return snprintf(buf, 200,
2379 __stringify(EV_KEY) ":" __stringify(KEY_BACK) ":73:1120:97:97"
2380 ":" __stringify(EV_KEY) ":" __stringify(KEY_MENU) ":230:1120:97:97"
2381 ":" __stringify(EV_KEY) ":" __stringify(KEY_HOME) ":389:1120:97:97"
2382 ":" __stringify(EV_KEY) ":" __stringify(KEY_SEARCH) ":544:1120:97:97"
2383 "\n");
2384}
2385
2386static struct kobj_attribute tma340_vkeys_attr = {
2387 .attr = {
2388 .mode = S_IRUGO,
2389 },
2390 .show = &tma340_vkeys_show,
2391};
2392
2393static struct attribute *tma340_properties_attrs[] = {
2394 &tma340_vkeys_attr.attr,
2395 NULL
2396};
2397
2398static struct attribute_group tma340_properties_attr_group = {
2399 .attrs = tma340_properties_attrs,
2400};
2401
2402
2403static int cyttsp_platform_init(struct i2c_client *client)
2404{
2405 int rc = 0;
2406 static struct kobject *tma340_properties_kobj;
2407
2408 tma340_vkeys_attr.attr.name = "virtualkeys.cyttsp-i2c";
2409 tma340_properties_kobj = kobject_create_and_add("board_properties",
2410 NULL);
2411 if (tma340_properties_kobj)
2412 rc = sysfs_create_group(tma340_properties_kobj,
2413 &tma340_properties_attr_group);
2414 if (!tma340_properties_kobj || rc)
2415 pr_err("%s: failed to create board_properties\n",
2416 __func__);
2417
2418 return 0;
2419}
2420
2421static struct cyttsp_regulator regulator_data[] = {
2422 {
2423 .name = "vdd",
2424 .min_uV = CY_TMA300_VTG_MIN_UV,
2425 .max_uV = CY_TMA300_VTG_MAX_UV,
2426 .load_uA = CY_TMA300_CURR_24HZ_UA,
2427 },
2428 /* TODO: Remove after runtime PM is enabled in I2C driver */
2429 {
2430 .name = "vcc_i2c",
2431 .min_uV = CY_I2C_VTG_MIN_UV,
2432 .max_uV = CY_I2C_VTG_MAX_UV,
2433 .load_uA = CY_I2C_CURR_UA,
2434 },
2435};
2436
2437static struct cyttsp_platform_data cyttsp_pdata = {
2438 .panel_maxx = 634,
2439 .panel_maxy = 1166,
2440 .disp_maxx = 616,
2441 .disp_maxy = 1023,
2442 .disp_minx = 0,
2443 .disp_miny = 16,
2444 .flags = 0x01,
2445 .gen = CY_GEN3, /* or */
2446 .use_st = CY_USE_ST,
2447 .use_mt = CY_USE_MT,
2448 .use_hndshk = CY_SEND_HNDSHK,
2449 .use_trk_id = CY_USE_TRACKING_ID,
Anirudh Ghayal15187772011-06-22 17:39:41 +05302450 .use_sleep = 0,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002451 .use_gestures = CY_USE_GESTURES,
2452 .fw_fname = "cyttsp_8960_cdp.hex",
2453 /* activate up to 4 groups
2454 * and set active distance
2455 */
2456 .gest_set = CY_GEST_GRP1 | CY_GEST_GRP2 |
2457 CY_GEST_GRP3 | CY_GEST_GRP4 |
2458 CY_ACT_DIST,
2459 /* change act_intrvl to customize the Active power state
2460 * scanning/processing refresh interval for Operating mode
2461 */
2462 .act_intrvl = CY_ACT_INTRVL_DFLT,
2463 /* change tch_tmout to customize the touch timeout for the
2464 * Active power state for Operating mode
2465 */
2466 .tch_tmout = CY_TCH_TMOUT_DFLT,
2467 /* change lp_intrvl to customize the Low Power power state
2468 * scanning/processing refresh interval for Operating mode
2469 */
2470 .lp_intrvl = CY_LP_INTRVL_DFLT,
2471 .sleep_gpio = CYTTSP_TS_SLEEP_GPIO,
2472 .resout_gpio = CYTTSP_TS_RESOUT_N_GPIO,
2473 .irq_gpio = CYTTSP_TS_GPIO_IRQ,
2474 .regulator_info = regulator_data,
2475 .num_regulators = ARRAY_SIZE(regulator_data),
2476 .init = cyttsp_platform_init,
2477};
2478
2479static struct i2c_board_info cyttsp_info[] __initdata = {
2480 {
2481 I2C_BOARD_INFO(CY_I2C_NAME, 0x24),
2482 .platform_data = &cyttsp_pdata,
2483#ifndef CY_USE_TIMER
2484 .irq = MSM_GPIO_TO_INT(CYTTSP_TS_GPIO_IRQ),
2485#endif /* CY_USE_TIMER */
2486 },
2487};
2488
2489static void gsbi_qup_i2c_gpio_config(int adap_id, int config_type)
2490{
2491}
2492
2493static struct msm_i2c_platform_data msm8960_i2c_qup_gsbi4_pdata = {
2494 .clk_freq = 100000,
2495 .src_clk_rate = 24000000,
2496 .clk = "gsbi_qup_clk",
2497 .pclk = "gsbi_pclk",
2498 .msm_i2c_config_gpio = gsbi_qup_i2c_gpio_config,
2499};
2500
2501static struct msm_i2c_platform_data msm8960_i2c_qup_gsbi3_pdata = {
2502 .clk_freq = 100000,
2503 .src_clk_rate = 24000000,
2504 .clk = "gsbi_qup_clk",
2505 .pclk = "gsbi_pclk",
2506 .msm_i2c_config_gpio = gsbi_qup_i2c_gpio_config,
2507};
2508
2509static struct msm_i2c_platform_data msm8960_i2c_qup_gsbi10_pdata = {
2510 .clk_freq = 100000,
2511 .src_clk_rate = 24000000,
2512 .clk = "gsbi_qup_clk",
2513 .pclk = "gsbi_pclk",
2514 .msm_i2c_config_gpio = gsbi_qup_i2c_gpio_config,
2515};
2516
2517static struct msm_i2c_platform_data msm8960_i2c_qup_gsbi12_pdata = {
2518 .clk_freq = 100000,
2519 .src_clk_rate = 24000000,
2520 .clk = "gsbi_qup_clk",
2521 .pclk = "gsbi_pclk",
2522 .msm_i2c_config_gpio = gsbi_qup_i2c_gpio_config,
2523};
2524
2525static struct msm_rpm_platform_data msm_rpm_data = {
2526 .reg_base_addrs = {
2527 [MSM_RPM_PAGE_STATUS] = MSM_RPM_BASE,
2528 [MSM_RPM_PAGE_CTRL] = MSM_RPM_BASE + 0x400,
2529 [MSM_RPM_PAGE_REQ] = MSM_RPM_BASE + 0x600,
2530 [MSM_RPM_PAGE_ACK] = MSM_RPM_BASE + 0xa00,
2531 },
2532
2533 .irq_ack = RPM_APCC_CPU0_GP_HIGH_IRQ,
2534 .irq_err = RPM_APCC_CPU0_GP_LOW_IRQ,
2535 .irq_vmpm = RPM_APCC_CPU0_GP_MEDIUM_IRQ,
2536 .msm_apps_ipc_rpm_reg = MSM_APCS_GCC_BASE + 0x008,
2537 .msm_apps_ipc_rpm_val = 4,
2538};
2539
2540static struct spi_board_info spi_board_info[] __initdata = {
2541 {
2542 .modalias = "ks8851",
2543 .irq = MSM_GPIO_TO_INT(KS8851_IRQ_GPIO),
2544 .max_speed_hz = 19200000,
2545 .bus_num = 0,
2546 .chip_select = 0,
2547 .mode = SPI_MODE_0,
2548 },
2549};
2550
2551static struct platform_device msm_device_saw_core0 = {
2552 .name = "saw-regulator",
2553 .id = 0,
2554 .dev = {
2555 .platform_data = &msm_saw_regulator_pdata_s5,
2556 },
2557};
2558
2559static struct platform_device msm_device_saw_core1 = {
2560 .name = "saw-regulator",
2561 .id = 1,
2562 .dev = {
2563 .platform_data = &msm_saw_regulator_pdata_s6,
2564 },
2565};
2566
2567#ifdef CONFIG_MSM_FAKE_BATTERY
2568static struct platform_device fish_battery_device = {
2569 .name = "fish_battery",
2570};
2571#endif
2572
2573struct platform_device msm8960_device_ext_5v_vreg __devinitdata = {
2574 .name = GPIO_REGULATOR_DEV_NAME,
2575 .id = PM8921_MPP_PM_TO_SYS(7),
2576 .dev = {
2577 .platform_data = &msm_gpio_regulator_pdata[GPIO_VREG_ID_EXT_5V],
2578 },
2579};
2580
2581struct platform_device msm8960_device_ext_l2_vreg __devinitdata = {
2582 .name = GPIO_REGULATOR_DEV_NAME,
2583 .id = 91,
2584 .dev = {
2585 .platform_data = &msm_gpio_regulator_pdata[GPIO_VREG_ID_EXT_L2],
2586 },
2587};
2588
2589static struct platform_device *common_devices[] __initdata = {
2590 &msm_device_dmov,
2591 &msm_device_smd,
2592 &msm8960_device_uart_gsbi5,
2593 &msm_device_saw_core0,
2594 &msm_device_saw_core1,
2595 &msm8960_device_ext_5v_vreg,
2596 &msm8960_device_ext_l2_vreg,
2597 &msm8960_device_ssbi_pm8921,
2598 &msm8960_device_qup_spi_gsbi1,
2599 &msm8960_device_qup_i2c_gsbi3,
2600 &msm8960_device_qup_i2c_gsbi4,
2601 &msm8960_device_qup_i2c_gsbi10,
2602#ifndef CONFIG_MSM_DSPS
2603 &msm8960_device_qup_i2c_gsbi12,
2604#endif
2605 &msm_slim_ctrl,
2606 &msm_device_wcnss_wlan,
2607#if defined(CONFIG_CRYPTO_DEV_QCRYPTO) || \
2608 defined(CONFIG_CRYPTO_DEV_QCRYPTO_MODULE)
2609 &qcrypto_device,
2610#endif
2611
2612#if defined(CONFIG_CRYPTO_DEV_QCEDEV) || \
2613 defined(CONFIG_CRYPTO_DEV_QCEDEV_MODULE)
2614 &qcedev_device,
2615#endif
2616#ifdef CONFIG_MSM_ROTATOR
2617 &msm_rotator_device,
2618#endif
2619 &msm_device_sps,
2620#ifdef CONFIG_MSM_FAKE_BATTERY
2621 &fish_battery_device,
2622#endif
2623#ifdef CONFIG_ANDROID_PMEM
2624 &android_pmem_device,
2625 &android_pmem_adsp_device,
2626 &android_pmem_audio_device,
2627#endif
2628 &msm_fb_device,
2629 &msm_device_vidc,
2630 &msm_device_bam_dmux,
2631 &msm_fm_platform_init,
2632};
2633
Stepan Moskovchenkod056fca2011-01-27 12:12:07 -08002634static struct platform_device *sim_devices[] __initdata = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002635 &msm_device_otg,
2636 &msm_device_gadget_peripheral,
2637 &msm_device_hsusb_host,
2638 &android_usb_device,
2639 &msm_device_vidc,
2640 &mipi_dsi_simulator_panel_device,
2641 &msm_bus_apps_fabric,
2642 &msm_bus_sys_fabric,
2643 &msm_bus_mm_fabric,
2644 &msm_bus_sys_fpb,
2645 &msm_bus_cpss_fpb,
2646 &msm_pcm,
2647 &msm_pcm_routing,
2648 &msm_cpudai0,
2649 &msm_cpudai1,
2650 &msm_cpudai_hdmi_rx,
2651 &msm_cpudai_bt_rx,
2652 &msm_cpudai_bt_tx,
2653 &msm_cpudai_fm_rx,
2654 &msm_cpudai_fm_tx,
2655 &msm_cpu_fe,
2656 &msm_stub_codec,
2657 &msm_voice,
2658 &msm_voip,
2659 &msm_lpa_pcm,
2660
2661#if defined(CONFIG_CRYPTO_DEV_QCRYPTO) || \
2662 defined(CONFIG_CRYPTO_DEV_QCRYPTO_MODULE)
2663 &qcrypto_device,
2664#endif
2665
2666#if defined(CONFIG_CRYPTO_DEV_QCEDEV) || \
2667 defined(CONFIG_CRYPTO_DEV_QCEDEV_MODULE)
2668 &qcedev_device,
2669#endif
2670
Stepan Moskovchenkod056fca2011-01-27 12:12:07 -08002671};
2672
2673static struct platform_device *rumi3_devices[] __initdata = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002674 &msm_kgsl_3d0,
2675 &msm_kgsl_2d0,
2676 &msm_kgsl_2d1,
2677 &mipi_dsi_renesas_panel_device,
2678#ifdef CONFIG_MSM_GEMINI
2679 &msm8960_gemini_device,
2680#endif
Stepan Moskovchenkod056fca2011-01-27 12:12:07 -08002681};
2682
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002683static struct platform_device *cdp_devices[] __initdata = {
2684 &msm_device_otg,
2685 &msm_device_gadget_peripheral,
2686 &msm_device_hsusb_host,
2687 &android_usb_device,
2688 &msm_pcm,
2689 &msm_pcm_routing,
2690 &msm_cpudai0,
2691 &msm_cpudai1,
2692 &msm_cpudai_hdmi_rx,
2693 &msm_cpudai_bt_rx,
2694 &msm_cpudai_bt_tx,
2695 &msm_cpudai_fm_rx,
2696 &msm_cpudai_fm_tx,
2697 &msm_cpu_fe,
2698 &msm_stub_codec,
2699 &msm_kgsl_3d0,
2700#ifdef CONFIG_MSM_KGSL_2D
2701 &msm_kgsl_2d0,
2702 &msm_kgsl_2d1,
2703#endif
2704 &mipi_dsi_toshiba_panel_device,
2705#ifdef CONFIG_MSM_GEMINI
2706 &msm8960_gemini_device,
2707#endif
2708 &msm_voice,
2709 &msm_voip,
2710 &msm_lpa_pcm,
2711#ifdef CONFIG_FB_MSM_HDMI_MSM_PANEL
2712 &hdmi_msm_device,
2713#endif
2714 &msm_pcm_hostless,
2715 &msm_bus_apps_fabric,
2716 &msm_bus_sys_fabric,
2717 &msm_bus_mm_fabric,
2718 &msm_bus_sys_fpb,
2719 &msm_bus_cpss_fpb,
2720};
2721
2722static void __init msm8960_i2c_init(void)
2723{
2724 msm8960_device_qup_i2c_gsbi4.dev.platform_data =
2725 &msm8960_i2c_qup_gsbi4_pdata;
2726
2727 msm8960_device_qup_i2c_gsbi3.dev.platform_data =
2728 &msm8960_i2c_qup_gsbi3_pdata;
2729
2730 msm8960_device_qup_i2c_gsbi10.dev.platform_data =
2731 &msm8960_i2c_qup_gsbi10_pdata;
2732
2733 msm8960_device_qup_i2c_gsbi12.dev.platform_data =
2734 &msm8960_i2c_qup_gsbi12_pdata;
2735}
2736
2737static struct pm8xxx_irq_platform_data pm8xxx_irq_pdata __devinitdata = {
2738 .irq_base = PM8921_IRQ_BASE,
2739 .devirq = MSM_GPIO_TO_INT(104),
2740 .irq_trigger_flag = IRQF_TRIGGER_LOW,
2741};
2742
2743static struct pm8xxx_gpio_platform_data pm8xxx_gpio_pdata __devinitdata = {
2744 .gpio_base = PM8921_GPIO_PM_TO_SYS(1),
2745};
2746
2747static struct pm8xxx_mpp_platform_data pm8xxx_mpp_pdata __devinitdata = {
2748 .mpp_base = PM8921_MPP_PM_TO_SYS(1),
2749};
2750
2751static struct pm8xxx_rtc_platform_data pm8xxx_rtc_pdata __devinitdata = {
2752 .rtc_write_enable = false,
2753};
2754
2755static struct pm8xxx_pwrkey_platform_data pm8xxx_pwrkey_pdata = {
2756 .pull_up = 1,
2757 .kpd_trigger_delay_us = 970,
2758 .wakeup = 1,
2759};
2760
2761static const unsigned int keymap[] = {
2762 KEY(0, 0, KEY_VOLUMEUP),
2763 KEY(0, 1, KEY_VOLUMEDOWN),
2764 KEY(0, 2, KEY_CAMERA_SNAPSHOT),
2765 KEY(0, 3, KEY_CAMERA_FOCUS),
2766};
2767
2768static struct matrix_keymap_data keymap_data = {
2769 .keymap_size = ARRAY_SIZE(keymap),
2770 .keymap = keymap,
2771};
2772
2773static struct pm8xxx_keypad_platform_data keypad_data = {
2774 .input_name = "keypad_8960",
2775 .input_phys_device = "keypad_8960/input0",
2776 .num_rows = 1,
2777 .num_cols = 5,
2778 .rows_gpio_start = PM8921_GPIO_PM_TO_SYS(9),
2779 .cols_gpio_start = PM8921_GPIO_PM_TO_SYS(1),
2780 .debounce_ms = 15,
2781 .scan_delay_ms = 32,
2782 .row_hold_ns = 91500,
2783 .wakeup = 1,
2784 .keymap_data = &keymap_data,
2785};
2786
2787static const unsigned int keymap_sim[] = {
2788 KEY(0, 0, KEY_7),
2789 KEY(0, 1, KEY_DOWN),
2790 KEY(0, 2, KEY_UP),
2791 KEY(0, 3, KEY_RIGHT),
2792 KEY(0, 4, KEY_ENTER),
2793 KEY(0, 5, KEY_L),
2794 KEY(0, 6, KEY_BACK),
2795 KEY(0, 7, KEY_M),
2796
2797 KEY(1, 0, KEY_LEFT),
2798 KEY(1, 1, KEY_SEND),
2799 KEY(1, 2, KEY_1),
2800 KEY(1, 3, KEY_4),
2801 KEY(1, 4, KEY_CLEAR),
2802 KEY(1, 5, KEY_MSDOS),
2803 KEY(1, 6, KEY_SPACE),
2804 KEY(1, 7, KEY_COMMA),
2805
2806 KEY(2, 0, KEY_6),
2807 KEY(2, 1, KEY_5),
2808 KEY(2, 2, KEY_8),
2809 KEY(2, 3, KEY_3),
2810 KEY(2, 4, KEY_NUMERIC_STAR),
2811 KEY(2, 5, KEY_UP),
2812 KEY(2, 6, KEY_DOWN),
2813 KEY(2, 7, KEY_LEFTSHIFT),
2814
2815 KEY(3, 0, KEY_9),
2816 KEY(3, 1, KEY_NUMERIC_POUND),
2817 KEY(3, 2, KEY_0),
2818 KEY(3, 3, KEY_2),
2819 KEY(3, 4, KEY_SLEEP),
2820 KEY(3, 5, KEY_F1),
2821 KEY(3, 6, KEY_F2),
2822 KEY(3, 7, KEY_F3),
2823
2824 KEY(4, 0, KEY_BACK),
2825 KEY(4, 1, KEY_HOME),
2826 KEY(4, 2, KEY_MENU),
2827 KEY(4, 3, KEY_VOLUMEUP),
2828 KEY(4, 4, KEY_VOLUMEDOWN),
2829 KEY(4, 5, KEY_F4),
2830 KEY(4, 6, KEY_F5),
2831 KEY(4, 7, KEY_F6),
2832
2833 KEY(5, 0, KEY_R),
2834 KEY(5, 1, KEY_T),
2835 KEY(5, 2, KEY_Y),
2836 KEY(5, 3, KEY_LEFTALT),
2837 KEY(5, 4, KEY_KPENTER),
2838 KEY(5, 5, KEY_Q),
2839 KEY(5, 6, KEY_W),
2840 KEY(5, 7, KEY_E),
2841
2842 KEY(6, 0, KEY_F),
2843 KEY(6, 1, KEY_G),
2844 KEY(6, 2, KEY_H),
2845 KEY(6, 3, KEY_CAPSLOCK),
2846 KEY(6, 4, KEY_PAGEUP),
2847 KEY(6, 5, KEY_A),
2848 KEY(6, 6, KEY_S),
2849 KEY(6, 7, KEY_D),
2850
2851 KEY(7, 0, KEY_V),
2852 KEY(7, 1, KEY_B),
2853 KEY(7, 2, KEY_N),
2854 KEY(7, 3, KEY_MENU),
2855 KEY(7, 4, KEY_PAGEDOWN),
2856 KEY(7, 5, KEY_Z),
2857 KEY(7, 6, KEY_X),
2858 KEY(7, 7, KEY_C),
2859
2860 KEY(8, 0, KEY_P),
2861 KEY(8, 1, KEY_J),
2862 KEY(8, 2, KEY_K),
2863 KEY(8, 3, KEY_INSERT),
2864 KEY(8, 4, KEY_LINEFEED),
2865 KEY(8, 5, KEY_U),
2866 KEY(8, 6, KEY_I),
2867 KEY(8, 7, KEY_O),
2868
2869 KEY(9, 0, KEY_4),
2870 KEY(9, 1, KEY_5),
2871 KEY(9, 2, KEY_6),
2872 KEY(9, 3, KEY_7),
2873 KEY(9, 4, KEY_8),
2874 KEY(9, 5, KEY_1),
2875 KEY(9, 6, KEY_2),
2876 KEY(9, 7, KEY_3),
2877
2878 KEY(10, 0, KEY_F7),
2879 KEY(10, 1, KEY_F8),
2880 KEY(10, 2, KEY_F9),
2881 KEY(10, 3, KEY_F10),
2882 KEY(10, 4, KEY_FN),
2883 KEY(10, 5, KEY_9),
2884 KEY(10, 6, KEY_0),
2885 KEY(10, 7, KEY_DOT),
2886
2887 KEY(11, 0, KEY_LEFTCTRL),
2888 KEY(11, 1, KEY_F11),
2889 KEY(11, 2, KEY_ENTER),
2890 KEY(11, 3, KEY_SEARCH),
2891 KEY(11, 4, KEY_DELETE),
2892 KEY(11, 5, KEY_RIGHT),
2893 KEY(11, 6, KEY_LEFT),
2894 KEY(11, 7, KEY_RIGHTSHIFT),
2895 KEY(0, 0, KEY_VOLUMEUP),
2896 KEY(0, 1, KEY_VOLUMEDOWN),
2897 KEY(0, 2, KEY_CAMERA_SNAPSHOT),
2898 KEY(0, 3, KEY_CAMERA_FOCUS),
2899};
2900
2901static struct matrix_keymap_data keymap_data_sim = {
2902 .keymap_size = ARRAY_SIZE(keymap_sim),
2903 .keymap = keymap_sim,
2904};
2905
2906static struct pm8xxx_keypad_platform_data keypad_data_sim = {
2907 .input_name = "keypad_8960",
2908 .input_phys_device = "keypad_8960/input0",
2909 .num_rows = 12,
2910 .num_cols = 8,
2911 .rows_gpio_start = PM8921_GPIO_PM_TO_SYS(9),
2912 .cols_gpio_start = PM8921_GPIO_PM_TO_SYS(1),
2913 .debounce_ms = 15,
2914 .scan_delay_ms = 32,
2915 .row_hold_ns = 91500,
2916 .wakeup = 1,
2917 .keymap_data = &keymap_data_sim,
2918};
2919
2920static struct pm8921_charger_platform_data pm8921_chg_pdata __devinitdata = {
2921 .safety_time = 180,
2922 .update_time = 1,
2923 .max_voltage = 4200,
2924 .min_voltage = 3200,
2925 .resume_voltage = 4100,
2926 .term_current = 100,
2927};
2928
2929static struct pm8xxx_misc_platform_data pm8xxx_misc_pdata = {
2930 .priority = 0,
2931};
2932
2933static struct pm8921_bms_platform_data pm8921_bms_pdata __devinitdata = {
2934 .r_sense = 10,
2935 .i_test = 2500,
2936 .v_failure = 3000,
2937 .calib_delay_ms = 600000,
2938 .batt_data = &palladium_1500_data,
2939};
2940
2941static struct led_info pm8921_led_info[] = {
2942 [0] = {
2943 .name = "led:drv1",
2944 .flags = PM8XXX_ID_LED_1,
2945 },
2946};
2947
2948static struct led_platform_data pm8xxx_leds_pdata = {
2949 .num_leds = ARRAY_SIZE(pm8921_led_info),
2950 .leds = pm8921_led_info,
2951};
2952
2953static struct pm8921_platform_data pm8921_platform_data __devinitdata = {
2954 .irq_pdata = &pm8xxx_irq_pdata,
2955 .gpio_pdata = &pm8xxx_gpio_pdata,
2956 .mpp_pdata = &pm8xxx_mpp_pdata,
2957 .rtc_pdata = &pm8xxx_rtc_pdata,
2958 .pwrkey_pdata = &pm8xxx_pwrkey_pdata,
2959 .keypad_pdata = &keypad_data,
2960 .misc_pdata = &pm8xxx_misc_pdata,
2961 .regulator_pdatas = msm_pm8921_regulator_pdata,
2962 .charger_pdata = &pm8921_chg_pdata,
2963 .bms_pdata = &pm8921_bms_pdata,
2964 .adc_pdata = &pm8921_adc_pdata,
2965 .leds_pdata = &pm8xxx_leds_pdata,
2966};
2967
2968static struct msm_ssbi_platform_data msm8960_ssbi_pm8921_pdata __devinitdata = {
2969 .controller_type = MSM_SBI_CTRL_PMIC_ARBITER,
2970 .slave = {
2971 .name = "pm8921-core",
2972 .platform_data = &pm8921_platform_data,
2973 },
2974};
2975
2976static void msm8960_wcnss_init(void)
2977{
2978 int i, ret, j;
2979
2980 for (i = 0; i < ARRAY_SIZE(wcnss_5wire_interface); i++) {
2981 ret = gpio_request(wcnss_5wire_interface[i].gpio,
2982 "wcnss_5_wire");
2983 if (ret) {
2984 pr_err("wcnss_5_wire gpio %d failed: %d\n",
2985 wcnss_5wire_interface[i].gpio, ret);
2986 goto fail;
2987 }
2988 }
2989
2990 pr_info("%s: Iris 5-wire gpios configured\n", __func__);
2991
2992 return;
2993
2994fail:
2995 for (j = 0; j < i; j++)
2996 gpio_free(wcnss_5wire_interface[j].gpio);
2997}
2998
2999static int ethernet_init(void)
3000{
3001 int ret;
3002 ret = gpio_request(KS8851_IRQ_GPIO, "ks8851_irq");
3003 if (ret) {
3004 pr_err("ks8851 gpio_request failed: %d\n", ret);
3005 goto fail;
3006 }
3007
3008 ret = gpio_request(KS8851_RST_GPIO, "ks8851_rst");
3009 if (ret) {
3010 pr_err("ks8851 gpio_request failed: %d\n", ret);
3011 goto fail_rst;
3012 }
3013
3014 ret = gpio_request(FPGA_CS_GPIO, "fpga_cs");
3015 if (ret) {
3016 pr_err("ks8851 gpio_request failed: %d\n", ret);
3017 goto fail_cs;
3018 }
3019
3020 gpio_direction_output(FPGA_CS_GPIO, 1);
3021 gpio_direction_output(KS8851_RST_GPIO, 1);
3022 return 0;
3023fail_cs:
3024 gpio_free(KS8851_RST_GPIO);
3025fail_rst:
3026 gpio_free(KS8851_IRQ_GPIO);
3027fail:
3028 return ret;
3029}
3030
3031static struct msm_cpuidle_state msm_cstates[] __initdata = {
3032 {0, 0, "C0", "WFI",
3033 MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT},
3034
3035 {0, 1, "C1", "STANDALONE_POWER_COLLAPSE",
3036 MSM_PM_SLEEP_MODE_POWER_COLLAPSE_STANDALONE},
3037
3038 {0, 2, "C2", "POWER_COLLAPSE",
3039 MSM_PM_SLEEP_MODE_POWER_COLLAPSE},
3040
3041 {1, 0, "C0", "WFI",
3042 MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT},
3043
3044 {1, 1, "C1", "STANDALONE_POWER_COLLAPSE",
3045 MSM_PM_SLEEP_MODE_POWER_COLLAPSE_STANDALONE},
3046};
3047
3048static struct msm_pm_platform_data msm_pm_data[MSM_PM_SLEEP_MODE_NR * 2] = {
3049 [MSM_PM_MODE(0, MSM_PM_SLEEP_MODE_POWER_COLLAPSE)] = {
3050 .idle_supported = 1,
3051 .suspend_supported = 1,
3052 .idle_enabled = 0,
3053 .suspend_enabled = 0,
3054 .latency = 4000,
3055 .residency = 13000,
3056 },
3057
3058 [MSM_PM_MODE(0, MSM_PM_SLEEP_MODE_POWER_COLLAPSE_STANDALONE)] = {
3059 .idle_supported = 1,
3060 .suspend_supported = 1,
3061 .idle_enabled = 0,
3062 .suspend_enabled = 0,
3063 .latency = 500,
3064 .residency = 6000,
3065 },
3066
3067 [MSM_PM_MODE(0, MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT)] = {
3068 .idle_supported = 1,
3069 .suspend_supported = 1,
3070 .idle_enabled = 1,
3071 .suspend_enabled = 1,
3072 .latency = 2,
3073 .residency = 0,
3074 },
3075
3076 [MSM_PM_MODE(1, MSM_PM_SLEEP_MODE_POWER_COLLAPSE)] = {
3077 .idle_supported = 0,
3078 .suspend_supported = 1,
3079 .idle_enabled = 0,
3080 .suspend_enabled = 0,
3081 .latency = 600,
3082 .residency = 7200,
3083 },
3084
3085 [MSM_PM_MODE(1, MSM_PM_SLEEP_MODE_POWER_COLLAPSE_STANDALONE)] = {
3086 .idle_supported = 1,
3087 .suspend_supported = 1,
3088 .idle_enabled = 0,
3089 .suspend_enabled = 0,
3090 .latency = 500,
3091 .residency = 6000,
3092 },
3093
3094 [MSM_PM_MODE(1, MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT)] = {
3095 .idle_supported = 1,
3096 .suspend_supported = 0,
3097 .idle_enabled = 1,
3098 .suspend_enabled = 0,
3099 .latency = 2,
3100 .residency = 0,
3101 },
3102};
3103
3104static struct msm_rpmrs_level msm_rpmrs_levels[] __initdata = {
3105 {
3106 MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT,
3107 MSM_RPMRS_LIMITS(ON, ACTIVE, MAX, ACTIVE),
3108 true,
3109 1, 8000, 100000, 1,
3110 },
3111
3112 {
3113 MSM_PM_SLEEP_MODE_POWER_COLLAPSE_STANDALONE,
3114 MSM_RPMRS_LIMITS(ON, ACTIVE, MAX, ACTIVE),
3115 true,
3116 1500, 5000, 60100000, 3000,
3117 },
3118
3119 {
3120 MSM_PM_SLEEP_MODE_POWER_COLLAPSE,
3121 MSM_RPMRS_LIMITS(ON, GDHS, MAX, ACTIVE),
3122 false,
3123 1800, 5000, 60350000, 3500,
3124 },
3125
3126 {
3127 MSM_PM_SLEEP_MODE_POWER_COLLAPSE,
3128 MSM_RPMRS_LIMITS(ON, HSFS_OPEN, MAX, ACTIVE),
3129 false,
3130 2800, 2500, 65350000, 4800,
3131 },
3132
3133 {
3134 MSM_PM_SLEEP_MODE_POWER_COLLAPSE,
3135 MSM_RPMRS_LIMITS(OFF, GDHS, MAX, ACTIVE),
3136 false,
3137 3800, 4500, 67850000, 5500,
3138 },
3139
3140 {
3141 MSM_PM_SLEEP_MODE_POWER_COLLAPSE,
3142 MSM_RPMRS_LIMITS(OFF, HSFS_OPEN, MAX, ACTIVE),
3143 false,
3144 4800, 2000, 71850000, 6800,
3145 },
3146
3147 {
3148 MSM_PM_SLEEP_MODE_POWER_COLLAPSE,
3149 MSM_RPMRS_LIMITS(OFF, HSFS_OPEN, ACTIVE, RET_HIGH),
3150 false,
3151 6800, 500, 75850000, 8800,
3152 },
3153
3154 {
3155 MSM_PM_SLEEP_MODE_POWER_COLLAPSE,
3156 MSM_RPMRS_LIMITS(OFF, HSFS_OPEN, RET_HIGH, RET_LOW),
3157 false,
3158 7800, 0, 76350000, 9800,
3159 },
3160};
3161
3162#ifdef CONFIG_I2C
3163#define I2C_SURF 1
3164#define I2C_FFA (1 << 1)
3165#define I2C_RUMI (1 << 2)
3166#define I2C_SIM (1 << 3)
3167#define I2C_FLUID (1 << 4)
3168#define MSM_8960_GSBI4_QUP_I2C_BUS_ID 4
3169#define MSM_8960_GSBI3_QUP_I2C_BUS_ID 3
3170
3171struct i2c_registry {
3172 u8 machs;
3173 int bus;
3174 struct i2c_board_info *info;
3175 int len;
3176};
3177
3178#ifdef CONFIG_MSM_CAMERA
3179static struct i2c_board_info msm_camera_boardinfo[] __initdata = {
3180#ifdef CONFIG_IMX074
3181 {
3182 I2C_BOARD_INFO("imx074", 0x1A),
3183 },
3184#endif
3185#ifdef CONFIG_OV2720
3186 {
3187 I2C_BOARD_INFO("ov2720", 0x6C),
3188 },
3189#endif
Kevin Chandfecce22011-07-13 10:52:41 -07003190 {
3191 I2C_BOARD_INFO("qs_mt9p017", 0x6C >> 1),
3192 },
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003193};
3194#endif
3195
3196/* Sensors DSPS platform data */
3197#ifdef CONFIG_MSM_DSPS
3198#define DSPS_PIL_GENERIC_NAME "dsps"
3199#endif /* CONFIG_MSM_DSPS */
3200
3201static void __init msm8960_init_dsps(void)
3202{
3203#ifdef CONFIG_MSM_DSPS
3204 struct msm_dsps_platform_data *pdata =
3205 msm_dsps_device.dev.platform_data;
3206 pdata->pil_name = DSPS_PIL_GENERIC_NAME;
3207 pdata->gpios = NULL;
3208 pdata->gpios_num = 0;
3209
3210 platform_device_register(&msm_dsps_device);
3211#endif /* CONFIG_MSM_DSPS */
3212}
3213
3214static struct i2c_registry msm8960_i2c_devices[] __initdata = {
3215#ifdef CONFIG_MSM_CAMERA
3216 {
3217 I2C_SURF | I2C_FFA | I2C_FLUID | I2C_RUMI,
3218 MSM_8960_GSBI4_QUP_I2C_BUS_ID,
3219 msm_camera_boardinfo,
3220 ARRAY_SIZE(msm_camera_boardinfo),
3221 },
3222#endif
3223 {
3224 I2C_SURF | I2C_FFA | I2C_FLUID,
3225 MSM_8960_GSBI3_QUP_I2C_BUS_ID,
3226 cyttsp_info,
3227 ARRAY_SIZE(cyttsp_info),
3228 }
3229};
3230#endif /* CONFIG_I2C */
3231
3232static void __init register_i2c_devices(void)
3233{
3234#ifdef CONFIG_I2C
3235 u8 mach_mask = 0;
3236 int i;
3237
3238 /* Build the matching 'supported_machs' bitmask */
3239 if (machine_is_msm8960_cdp())
3240 mach_mask = I2C_SURF;
3241 else if (machine_is_msm8960_rumi3())
3242 mach_mask = I2C_RUMI;
3243 else if (machine_is_msm8960_sim())
3244 mach_mask = I2C_SIM;
3245 else
3246 pr_err("unmatched machine ID in register_i2c_devices\n");
3247
3248 /* Run the array and install devices as appropriate */
3249 for (i = 0; i < ARRAY_SIZE(msm8960_i2c_devices); ++i) {
3250 if (msm8960_i2c_devices[i].machs & mach_mask)
3251 i2c_register_board_info(msm8960_i2c_devices[i].bus,
3252 msm8960_i2c_devices[i].info,
3253 msm8960_i2c_devices[i].len);
3254 }
3255#endif
3256}
3257
Stepan Moskovchenkod056fca2011-01-27 12:12:07 -08003258static void __init msm8960_sim_init(void)
3259{
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003260 if (socinfo_init() < 0)
3261 pr_err("socinfo_init() failed!\n");
3262
3263 BUG_ON(msm_rpm_init(&msm_rpm_data));
3264 BUG_ON(msm_rpmrs_levels_init(msm_rpmrs_levels,
3265 ARRAY_SIZE(msm_rpmrs_levels)));
3266 regulator_suppress_info_printing();
3267 msm8960_clock_init();
3268 msm8960_device_ssbi_pm8921.dev.platform_data =
3269 &msm8960_ssbi_pm8921_pdata;
3270 pm8921_platform_data.num_regulators = msm_pm8921_regulator_pdata_len;
3271 msm8960_device_qup_spi_gsbi1.dev.platform_data =
3272 &msm8960_qup_spi_gsbi1_pdata;
3273
3274 /* Simulator supports a QWERTY keypad */
3275 pm8921_platform_data.keypad_pdata = &keypad_data_sim;
3276
3277 msm_device_otg.dev.platform_data = &msm_otg_pdata;
3278 msm_device_gadget_peripheral.dev.parent = &msm_device_otg.dev;
3279 msm_device_hsusb_host.dev.parent = &msm_device_otg.dev;
3280 gpiomux_init();
3281 ethernet_init();
3282 msm8960_i2c_init();
3283 msm_spm_init(msm_spm_data, ARRAY_SIZE(msm_spm_data));
3284 msm_spm_l2_init(msm_spm_l2_data);
3285 msm8960_init_buses();
3286 platform_add_devices(common_devices, ARRAY_SIZE(common_devices));
3287 pm8921_gpio_mpp_init();
Stepan Moskovchenkod056fca2011-01-27 12:12:07 -08003288 platform_add_devices(sim_devices, ARRAY_SIZE(sim_devices));
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003289 msm_acpu_clock_init(&msm8960_acpu_clock_data);
3290
3291 msm8960_device_qup_spi_gsbi1.dev.platform_data =
3292 &msm8960_qup_spi_gsbi1_pdata;
3293 spi_register_board_info(spi_board_info, ARRAY_SIZE(spi_board_info));
3294
3295 msm8960_init_mmc();
3296 msm_fb_add_devices();
3297 slim_register_board_info(msm_slim_devices,
3298 ARRAY_SIZE(msm_slim_devices));
3299 msm_pm_set_platform_data(msm_pm_data, ARRAY_SIZE(msm_pm_data));
3300 msm_pm_set_rpm_wakeup_irq(RPM_APCC_CPU0_WAKE_UP_IRQ);
3301 msm_cpuidle_set_states(msm_cstates, ARRAY_SIZE(msm_cstates),
3302 msm_pm_data);
Stepan Moskovchenkod056fca2011-01-27 12:12:07 -08003303}
3304
3305static void __init msm8960_rumi3_init(void)
3306{
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003307 if (socinfo_init() < 0)
3308 pr_err("socinfo_init() failed!\n");
3309
3310 BUG_ON(msm_rpm_init(&msm_rpm_data));
3311 BUG_ON(msm_rpmrs_levels_init(msm_rpmrs_levels,
3312 ARRAY_SIZE(msm_rpmrs_levels)));
3313 regulator_suppress_info_printing();
3314 msm8960_clock_init_dummy();
3315 gpiomux_init();
3316 ethernet_init();
3317 msm8960_device_ssbi_pm8921.dev.platform_data =
3318 &msm8960_ssbi_pm8921_pdata;
3319 pm8921_platform_data.num_regulators = msm_pm8921_regulator_pdata_len;
3320 msm8960_device_qup_spi_gsbi1.dev.platform_data =
3321 &msm8960_qup_spi_gsbi1_pdata;
3322 spi_register_board_info(spi_board_info, ARRAY_SIZE(spi_board_info));
3323 msm8960_i2c_init();
3324 msm_spm_init(msm_spm_data, ARRAY_SIZE(msm_spm_data));
3325 msm_spm_l2_init(msm_spm_l2_data);
3326 platform_add_devices(common_devices, ARRAY_SIZE(common_devices));
3327 pm8921_gpio_mpp_init();
Stepan Moskovchenkod056fca2011-01-27 12:12:07 -08003328 platform_add_devices(rumi3_devices, ARRAY_SIZE(rumi3_devices));
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003329 msm8960_init_mmc();
3330
3331 register_i2c_devices();
3332 msm_fb_add_devices();
3333 slim_register_board_info(msm_slim_devices,
3334 ARRAY_SIZE(msm_slim_devices));
3335 msm_pm_set_platform_data(msm_pm_data, ARRAY_SIZE(msm_pm_data));
3336 msm_pm_set_rpm_wakeup_irq(RPM_APCC_CPU0_WAKE_UP_IRQ);
3337 msm_cpuidle_set_states(msm_cstates, ARRAY_SIZE(msm_cstates),
3338 msm_pm_data);
3339}
3340
3341static void __init msm8960_cdp_init(void)
3342{
3343 if (socinfo_init() < 0)
3344 pr_err("socinfo_init() failed!\n");
3345
3346 BUG_ON(msm_rpm_init(&msm_rpm_data));
3347 BUG_ON(msm_rpmrs_levels_init(msm_rpmrs_levels,
3348 ARRAY_SIZE(msm_rpmrs_levels)));
3349 regulator_suppress_info_printing();
3350 if (msm_xo_init())
3351 pr_err("Failed to initialize XO votes\n");
3352 msm8960_clock_init();
3353 msm_device_otg.dev.platform_data = &msm_otg_pdata;
3354 msm_device_gadget_peripheral.dev.parent = &msm_device_otg.dev;
3355 msm_device_hsusb_host.dev.parent = &msm_device_otg.dev;
3356 gpiomux_init();
3357 ethernet_init();
3358 msm8960_device_qup_spi_gsbi1.dev.platform_data =
3359 &msm8960_qup_spi_gsbi1_pdata;
3360 spi_register_board_info(spi_board_info, ARRAY_SIZE(spi_board_info));
3361 msm8960_device_ssbi_pm8921.dev.platform_data =
3362 &msm8960_ssbi_pm8921_pdata;
3363 pm8921_platform_data.num_regulators = msm_pm8921_regulator_pdata_len;
3364 msm8960_i2c_init();
3365 msm_spm_init(msm_spm_data, ARRAY_SIZE(msm_spm_data));
3366 msm_spm_l2_init(msm_spm_l2_data);
3367 msm8960_init_buses();
3368 platform_add_devices(msm_footswitch_devices,
3369 msm_num_footswitch_devices);
3370 platform_add_devices(common_devices, ARRAY_SIZE(common_devices));
3371 pm8921_gpio_mpp_init();
3372 platform_add_devices(cdp_devices, ARRAY_SIZE(cdp_devices));
3373 msm8960_init_cam();
3374 msm8960_init_mmc();
3375 msm_acpu_clock_init(&msm8960_acpu_clock_data);
3376 register_i2c_devices();
3377 msm8960_wcnss_init();
3378 msm_fb_add_devices();
3379 slim_register_board_info(msm_slim_devices,
3380 ARRAY_SIZE(msm_slim_devices));
3381 msm8960_init_dsps();
3382 msm_pm_set_platform_data(msm_pm_data, ARRAY_SIZE(msm_pm_data));
3383 msm_pm_set_rpm_wakeup_irq(RPM_APCC_CPU0_WAKE_UP_IRQ);
3384 msm_cpuidle_set_states(msm_cstates, ARRAY_SIZE(msm_cstates),
3385 msm_pm_data);
Larry Bassela7eadea2011-07-14 10:46:00 -07003386 change_memory_power = &msm8960_change_memory_power;
Stepan Moskovchenkod056fca2011-01-27 12:12:07 -08003387}
3388
Stepan Moskovchenkof441ca22010-12-01 19:31:16 -08003389MACHINE_START(MSM8960_SIM, "QCT MSM8960 SIMULATOR")
3390 .map_io = msm8960_map_io,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003391 .reserve = msm8960_reserve,
Stepan Moskovchenkof441ca22010-12-01 19:31:16 -08003392 .init_irq = msm8960_init_irq,
3393 .timer = &msm_timer,
Stepan Moskovchenkod056fca2011-01-27 12:12:07 -08003394 .init_machine = msm8960_sim_init,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003395 .init_early = msm8960_allocate_memory_regions,
Stepan Moskovchenkof441ca22010-12-01 19:31:16 -08003396MACHINE_END
Stepan Moskovchenko50ede4e2010-12-13 18:12:19 -08003397
3398MACHINE_START(MSM8960_RUMI3, "QCT MSM8960 RUMI3")
3399 .map_io = msm8960_map_io,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003400 .reserve = msm8960_reserve,
Stepan Moskovchenko50ede4e2010-12-13 18:12:19 -08003401 .init_irq = msm8960_init_irq,
3402 .timer = &msm_timer,
Stepan Moskovchenkod056fca2011-01-27 12:12:07 -08003403 .init_machine = msm8960_rumi3_init,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003404 .init_early = msm8960_allocate_memory_regions,
Stepan Moskovchenko50ede4e2010-12-13 18:12:19 -08003405MACHINE_END
3406
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003407MACHINE_START(MSM8960_CDP, "QCT MSM8960 CDP")
3408 .map_io = msm8960_map_io,
3409 .reserve = msm8960_reserve,
3410 .init_irq = msm8960_init_irq,
3411 .timer = &msm_timer,
3412 .init_machine = msm8960_cdp_init,
3413 .init_early = msm8960_allocate_memory_regions,
3414MACHINE_END
3415
3416MACHINE_START(MSM8960_MTP, "QCT MSM8960 MTP")
3417 .map_io = msm8960_map_io,
3418 .reserve = msm8960_reserve,
3419 .init_irq = msm8960_init_irq,
3420 .timer = &msm_timer,
3421 .init_machine = msm8960_cdp_init,
3422 .init_early = msm8960_allocate_memory_regions,
3423MACHINE_END
3424
3425MACHINE_START(MSM8960_FLUID, "QCT MSM8960 FLUID")
3426 .map_io = msm8960_map_io,
3427 .reserve = msm8960_reserve,
3428 .init_irq = msm8960_init_irq,
3429 .timer = &msm_timer,
3430 .init_machine = msm8960_cdp_init,
3431 .init_early = msm8960_allocate_memory_regions,
3432MACHINE_END