blob: d01dd9f3ef01d7edae5fe7c7e068cadc1124e62a [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>
Rohit Vaswanicd2a59b2011-07-19 12:00:48 -070018#include <linux/i2c/sx150x.h>
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070019#include <linux/gpio.h>
20#include <linux/msm_ssbi.h>
21#include <linux/regulator/gpio-regulator.h>
22#include <linux/mfd/pm8xxx/pm8921.h>
23#include <linux/regulator/consumer.h>
24#include <linux/spi/spi.h>
25#include <linux/slimbus/slimbus.h>
26#include <linux/bootmem.h>
Lucille Sylvester34ec3692011-08-16 16:28:04 -060027#include <linux/msm_kgsl.h>
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070028#ifdef CONFIG_ANDROID_PMEM
29#include <linux/android_pmem.h>
30#endif
31#include <linux/cyttsp.h>
32#include <linux/dma-mapping.h>
33#include <linux/platform_data/qcom_crypto_device.h>
Ankur Nandwanib0039b02011-08-09 14:00:45 -070034#include <linux/platform_data/qcom_wcnss_device.h>
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070035#include <linux/leds.h>
36#include <linux/leds-pm8xxx.h>
Stepan Moskovchenkof441ca22010-12-01 19:31:16 -080037
38#include <asm/mach-types.h>
39#include <asm/mach/arch.h>
Larry Basselb4126da2011-07-18 14:31:33 -070040#include <asm/setup.h>
Stepan Moskovchenkof441ca22010-12-01 19:31:16 -080041#include <asm/hardware/gic.h>
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070042#include <asm/mach/mmc.h>
Stepan Moskovchenkof441ca22010-12-01 19:31:16 -080043
44#include <mach/board.h>
45#include <mach/msm_iomap.h>
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070046#include <mach/msm_spi.h>
47#ifdef CONFIG_USB_MSM_OTG_72K
48#include <mach/msm_hsusb.h>
49#else
50#include <linux/usb/msm_hsusb.h>
51#endif
52#include <linux/usb/android.h>
53#include <mach/usbdiag.h>
54#include <mach/socinfo.h>
55#include <mach/rpm.h>
56#include <mach/gpio.h>
Rohit Vaswania513aa8d2011-07-18 15:14:28 -070057#include <mach/gpiomux.h>
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070058#include <mach/msm_bus_board.h>
59#include <mach/msm_memtypes.h>
60#include <mach/dma.h>
61#include <mach/msm_dsps.h>
62#include <mach/msm_xo.h>
Stepan Moskovchenkof441ca22010-12-01 19:31:16 -080063
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070064#ifdef CONFIG_WCD9310_CODEC
65#include <linux/slimbus/slimbus.h>
66#include <linux/mfd/wcd9310/core.h>
67#include <linux/mfd/wcd9310/pdata.h>
68#endif
69
Laura Abbottd6183792011-08-19 13:42:24 -070070#include <linux/ion.h>
71#include <mach/ion.h>
72
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070073#include "timer.h"
Stepan Moskovchenkod056fca2011-01-27 12:12:07 -080074#include "devices.h"
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070075#include "devices-msm8x60.h"
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070076#include "spm.h"
77#include "board-msm8960.h"
78#include "pm.h"
79#include "cpuidle.h"
80#include "rpm_resources.h"
81#include "mpm.h"
82
83static struct platform_device msm_fm_platform_init = {
84 .name = "iris_fm",
85 .id = -1,
86};
87
88struct pm8xxx_gpio_init {
89 unsigned gpio;
90 struct pm_gpio config;
91};
92
93struct pm8xxx_mpp_init {
94 unsigned mpp;
95 struct pm8xxx_mpp_config_data config;
96};
97
98#define PM8XXX_GPIO_INIT(_gpio, _dir, _buf, _val, _pull, _vin, _out_strength, \
99 _func, _inv, _disable) \
100{ \
101 .gpio = PM8921_GPIO_PM_TO_SYS(_gpio), \
102 .config = { \
103 .direction = _dir, \
104 .output_buffer = _buf, \
105 .output_value = _val, \
106 .pull = _pull, \
107 .vin_sel = _vin, \
108 .out_strength = _out_strength, \
109 .function = _func, \
110 .inv_int_pol = _inv, \
111 .disable_pin = _disable, \
112 } \
113}
114
115#define PM8XXX_MPP_INIT(_mpp, _type, _level, _control) \
116{ \
117 .mpp = PM8921_MPP_PM_TO_SYS(_mpp), \
118 .config = { \
119 .type = PM8XXX_MPP_TYPE_##_type, \
120 .level = _level, \
121 .control = PM8XXX_MPP_##_control, \
122 } \
123}
124
125#define PM8XXX_GPIO_DISABLE(_gpio) \
126 PM8XXX_GPIO_INIT(_gpio, PM_GPIO_DIR_IN, 0, 0, 0, PM_GPIO_VIN_S4, \
127 0, 0, 0, 1)
128
129#define PM8XXX_GPIO_OUTPUT(_gpio, _val) \
130 PM8XXX_GPIO_INIT(_gpio, PM_GPIO_DIR_OUT, PM_GPIO_OUT_BUF_CMOS, _val, \
131 PM_GPIO_PULL_NO, PM_GPIO_VIN_S4, \
132 PM_GPIO_STRENGTH_HIGH, \
133 PM_GPIO_FUNC_NORMAL, 0, 0)
134
135#define PM8XXX_GPIO_INPUT(_gpio, _pull) \
136 PM8XXX_GPIO_INIT(_gpio, PM_GPIO_DIR_IN, PM_GPIO_OUT_BUF_CMOS, 0, \
137 _pull, PM_GPIO_VIN_S4, \
138 PM_GPIO_STRENGTH_NO, \
139 PM_GPIO_FUNC_NORMAL, 0, 0)
140
141#define PM8XXX_GPIO_OUTPUT_FUNC(_gpio, _val, _func) \
142 PM8XXX_GPIO_INIT(_gpio, PM_GPIO_DIR_OUT, PM_GPIO_OUT_BUF_CMOS, _val, \
143 PM_GPIO_PULL_NO, PM_GPIO_VIN_S4, \
144 PM_GPIO_STRENGTH_HIGH, \
145 _func, 0, 0)
146
147/* Initial PM8921 GPIO configurations */
148static struct pm8xxx_gpio_init pm8921_gpios[] __initdata = {
149 PM8XXX_GPIO_DISABLE(6), /* Disable unused */
150 PM8XXX_GPIO_DISABLE(7), /* Disable NFC */
151 PM8XXX_GPIO_INPUT(16, PM_GPIO_PULL_UP_30), /* SD_CARD_WP */
152 PM8XXX_GPIO_DISABLE(22), /* Disable NFC */
Nagamalleswararao Ganjieac5dfa2011-07-23 17:31:16 -0700153 PM8XXX_GPIO_OUTPUT_FUNC(24, 0, PM_GPIO_FUNC_2), /* Bl: Off, PWM mode */
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700154 PM8XXX_GPIO_INPUT(26, PM_GPIO_PULL_UP_30), /* SD_CARD_DET_N */
155 PM8XXX_GPIO_OUTPUT(43, 0), /* DISP_RESET_N */
156};
157
158/* Initial PM8921 MPP configurations */
159static struct pm8xxx_mpp_init pm8921_mpps[] __initdata = {
160 /* External 5V regulator enable; shared by HDMI and USB_OTG switches. */
161 PM8XXX_MPP_INIT(7, D_INPUT, PM8921_MPP_DIG_LEVEL_VPH, DIN_TO_INT),
162 PM8XXX_MPP_INIT(PM8921_AMUX_MPP_3, A_INPUT, PM8XXX_MPP_AIN_AMUX_CH6,
163 DOUT_CTRL_LOW),
164 PM8XXX_MPP_INIT(PM8921_AMUX_MPP_8, A_INPUT, PM8XXX_MPP_AIN_AMUX_CH8,
165 DOUT_CTRL_LOW),
166};
167
168static void __init pm8921_gpio_mpp_init(void)
169{
170 int i, rc;
171
172 for (i = 0; i < ARRAY_SIZE(pm8921_gpios); i++) {
173 rc = pm8xxx_gpio_config(pm8921_gpios[i].gpio,
174 &pm8921_gpios[i].config);
175 if (rc) {
176 pr_err("%s: pm8xxx_gpio_config: rc=%d\n", __func__, rc);
177 break;
178 }
179 }
180
181 for (i = 0; i < ARRAY_SIZE(pm8921_mpps); i++) {
182 rc = pm8xxx_mpp_config(pm8921_mpps[i].mpp,
183 &pm8921_mpps[i].config);
184 if (rc) {
185 pr_err("%s: pm8xxx_mpp_config: rc=%d\n", __func__, rc);
186 break;
187 }
188 }
189}
190
191#define FPGA_CS_GPIO 14
192#define KS8851_RST_GPIO 89
193#define KS8851_IRQ_GPIO 90
194
Rohit Vaswanicd2a59b2011-07-19 12:00:48 -0700195#if defined(CONFIG_GPIO_SX150X) || defined(CONFIG_GPIO_SX150X_MODULE)
196enum {
Abhijeet Dharmapurikar0fda5602011-08-17 18:00:55 -0700197 GPIO_EXPANDER_IRQ_BASE = (PM8921_IRQ_BASE + PM8921_NR_IRQS),
Rohit Vaswanicd2a59b2011-07-19 12:00:48 -0700198 GPIO_EXPANDER_GPIO_BASE = (PM8921_MPP_BASE + PM8921_NR_MPPS),
199 /* CAM Expander */
200 GPIO_CAM_EXPANDER_BASE = GPIO_EXPANDER_GPIO_BASE,
201 GPIO_CAM_GP_STROBE_READY = GPIO_CAM_EXPANDER_BASE,
202 GPIO_CAM_GP_AFBUSY,
203 GPIO_CAM_GP_STROBE_CE,
204 GPIO_CAM_GP_CAM1MP_XCLR,
205 GPIO_CAM_GP_CAMIF_RESET_N,
206 GPIO_CAM_GP_XMT_FLASH_INT,
207 GPIO_CAM_GP_LED_EN1,
208 GPIO_CAM_GP_LED_EN2,
209
210};
211#endif
212
Harini Jayaraman608d0462011-08-09 19:10:03 -0600213/* The SPI configurations apply to GSBI 1*/
214static struct gpiomux_setting spi_active = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700215 .func = GPIOMUX_FUNC_1,
216 .drv = GPIOMUX_DRV_8MA,
217 .pull = GPIOMUX_PULL_NONE,
218};
219
Harini Jayaraman608d0462011-08-09 19:10:03 -0600220static struct gpiomux_setting spi_suspended_config = {
221 .func = GPIOMUX_FUNC_GPIO,
222 .drv = GPIOMUX_DRV_2MA,
223 .pull = GPIOMUX_PULL_DOWN,
224};
225
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700226static struct gpiomux_setting gsbi3 = {
227 .func = GPIOMUX_FUNC_1,
228 .drv = GPIOMUX_DRV_8MA,
229 .pull = GPIOMUX_PULL_NONE,
230};
231
232static struct gpiomux_setting gsbi4 = {
233 .func = GPIOMUX_FUNC_1,
234 .drv = GPIOMUX_DRV_8MA,
235 .pull = GPIOMUX_PULL_NONE,
236};
237
238static struct gpiomux_setting gsbi5 = {
239 .func = GPIOMUX_FUNC_1,
240 .drv = GPIOMUX_DRV_8MA,
241 .pull = GPIOMUX_PULL_NONE,
242};
243
244static struct gpiomux_setting gsbi10 = {
245 .func = GPIOMUX_FUNC_2,
246 .drv = GPIOMUX_DRV_8MA,
247 .pull = GPIOMUX_PULL_NONE,
248};
249
250static struct gpiomux_setting gsbi12 = {
251 .func = GPIOMUX_FUNC_1,
252 .drv = GPIOMUX_DRV_8MA,
253 .pull = GPIOMUX_PULL_NONE,
254};
255
256static struct gpiomux_setting cdc_mclk = {
257 .func = GPIOMUX_FUNC_1,
258 .drv = GPIOMUX_DRV_8MA,
259 .pull = GPIOMUX_PULL_NONE,
260};
261
Stepan Moskovchenko41d168272011-08-09 17:09:42 -0700262#ifdef CONFIG_KS8851
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700263static struct gpiomux_setting gpio_eth_config = {
264 .pull = GPIOMUX_PULL_NONE,
265 .drv = GPIOMUX_DRV_8MA,
266 .func = GPIOMUX_FUNC_GPIO,
267};
Stepan Moskovchenko41d168272011-08-09 17:09:42 -0700268#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700269
270static struct gpiomux_setting slimbus = {
271 .func = GPIOMUX_FUNC_1,
272 .drv = GPIOMUX_DRV_8MA,
273 .pull = GPIOMUX_PULL_KEEPER,
274};
275
276struct msm_gpiomux_config msm8960_gpiomux_configs[NR_GPIO_IRQS] = {
Stepan Moskovchenko41d168272011-08-09 17:09:42 -0700277#ifdef CONFIG_KS8851
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700278 {
279 .gpio = KS8851_IRQ_GPIO,
280 .settings = {
281 [GPIOMUX_SUSPENDED] = &gpio_eth_config,
282 }
283 },
284 {
285 .gpio = KS8851_RST_GPIO,
286 .settings = {
287 [GPIOMUX_SUSPENDED] = &gpio_eth_config,
288 }
289 },
290 {
291 .gpio = FPGA_CS_GPIO,
292 .settings = {
293 [GPIOMUX_SUSPENDED] = &gpio_eth_config,
294 }
295 },
Stepan Moskovchenko41d168272011-08-09 17:09:42 -0700296#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700297};
298
299static struct msm_gpiomux_config msm8960_gsbi_configs[] __initdata = {
300 {
301 .gpio = 6, /* GSBI1 QUP SPI_DATA_MOSI */
302 .settings = {
Harini Jayaraman608d0462011-08-09 19:10:03 -0600303 [GPIOMUX_SUSPENDED] = &spi_suspended_config,
304 [GPIOMUX_ACTIVE] = &spi_active,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700305 },
306 },
307 {
308 .gpio = 7, /* GSBI1 QUP SPI_DATA_MISO */
309 .settings = {
Harini Jayaraman608d0462011-08-09 19:10:03 -0600310 [GPIOMUX_SUSPENDED] = &spi_suspended_config,
311 [GPIOMUX_ACTIVE] = &spi_active,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700312 },
313 },
314 {
315 .gpio = 8, /* GSBI1 QUP SPI_CS_N */
316 .settings = {
Harini Jayaraman608d0462011-08-09 19:10:03 -0600317 [GPIOMUX_SUSPENDED] = &spi_suspended_config,
318 [GPIOMUX_ACTIVE] = &spi_active,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700319 },
320 },
321 {
322 .gpio = 9, /* GSBI1 QUP SPI_CLK */
323 .settings = {
Harini Jayaraman608d0462011-08-09 19:10:03 -0600324 [GPIOMUX_SUSPENDED] = &spi_suspended_config,
325 [GPIOMUX_ACTIVE] = &spi_active,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700326 },
327 },
328 {
329 .gpio = 16, /* GSBI3 I2C QUP SDA */
330 .settings = {
331 [GPIOMUX_SUSPENDED] = &gsbi3,
332 },
333 },
334 {
335 .gpio = 17, /* GSBI3 I2C QUP SCL */
336 .settings = {
337 [GPIOMUX_SUSPENDED] = &gsbi3,
338 },
339 },
340 {
341 .gpio = 20, /* GSBI4 I2C QUP SDA */
342 .settings = {
343 [GPIOMUX_SUSPENDED] = &gsbi4,
344 },
345 },
346 {
347 .gpio = 21, /* GSBI4 I2C QUP SCL */
348 .settings = {
349 [GPIOMUX_SUSPENDED] = &gsbi4,
350 },
351 },
352 {
353 .gpio = 22, /* GSBI5 UART2 */
354 .settings = {
355 [GPIOMUX_SUSPENDED] = &gsbi5,
356 },
357 },
358 {
359 .gpio = 23, /* GSBI5 UART2 */
360 .settings = {
361 [GPIOMUX_SUSPENDED] = &gsbi5,
362 },
363 },
364 {
365 .gpio = 24, /* GSBI5 UART2 */
366 .settings = {
367 [GPIOMUX_SUSPENDED] = &gsbi5,
368 },
369 },
370 {
371 .gpio = 25, /* GSBI5 UART2 */
372 .settings = {
373 [GPIOMUX_SUSPENDED] = &gsbi5,
374 },
375 },
376 {
377 .gpio = 44, /* GSBI12 I2C QUP SDA */
378 .settings = {
379 [GPIOMUX_SUSPENDED] = &gsbi12,
380 },
381 },
382 {
383 .gpio = 45, /* GSBI12 I2C QUP SCL */
384 .settings = {
385 [GPIOMUX_SUSPENDED] = &gsbi12,
386 },
387 },
388 {
389 .gpio = 73, /* GSBI10 I2C QUP SDA */
390 .settings = {
391 [GPIOMUX_SUSPENDED] = &gsbi10,
392 },
393 },
394 {
395 .gpio = 74, /* GSBI10 I2C QUP SCL */
396 .settings = {
397 [GPIOMUX_SUSPENDED] = &gsbi10,
398 },
399 },
400};
401
402static struct msm_gpiomux_config msm8960_slimbus_config[] __initdata = {
403 {
404 .gpio = 60, /* slimbus data */
405 .settings = {
406 [GPIOMUX_SUSPENDED] = &slimbus,
407 },
408 },
409 {
410 .gpio = 61, /* slimbus clk */
411 .settings = {
412 [GPIOMUX_SUSPENDED] = &slimbus,
413 },
414 },
415};
416
417static struct msm_gpiomux_config msm8960_audio_codec_configs[] __initdata = {
418 {
419 .gpio = 59,
420 .settings = {
421 [GPIOMUX_SUSPENDED] = &cdc_mclk,
422 },
423 },
424};
425static struct gpiomux_setting wcnss_5wire_suspend_cfg = {
426 .func = GPIOMUX_FUNC_GPIO,
427 .drv = GPIOMUX_DRV_2MA,
428 .pull = GPIOMUX_PULL_NONE,
429};
430
431static struct gpiomux_setting wcnss_5wire_active_cfg = {
432 .func = GPIOMUX_FUNC_1,
433 .drv = GPIOMUX_DRV_6MA,
434 .pull = GPIOMUX_PULL_DOWN,
435};
436
437static struct msm_gpiomux_config wcnss_5wire_interface[] = {
438 {
439 .gpio = 84,
440 .settings = {
441 [GPIOMUX_ACTIVE] = &wcnss_5wire_active_cfg,
442 [GPIOMUX_SUSPENDED] = &wcnss_5wire_suspend_cfg,
443 },
444 },
445 {
446 .gpio = 85,
447 .settings = {
448 [GPIOMUX_ACTIVE] = &wcnss_5wire_active_cfg,
449 [GPIOMUX_SUSPENDED] = &wcnss_5wire_suspend_cfg,
450 },
451 },
452 {
453 .gpio = 86,
454 .settings = {
455 [GPIOMUX_ACTIVE] = &wcnss_5wire_active_cfg,
456 [GPIOMUX_SUSPENDED] = &wcnss_5wire_suspend_cfg,
457 },
458 },
459 {
460 .gpio = 87,
461 .settings = {
462 [GPIOMUX_ACTIVE] = &wcnss_5wire_active_cfg,
463 [GPIOMUX_SUSPENDED] = &wcnss_5wire_suspend_cfg,
464 },
465 },
466 {
467 .gpio = 88,
468 .settings = {
469 [GPIOMUX_ACTIVE] = &wcnss_5wire_active_cfg,
470 [GPIOMUX_SUSPENDED] = &wcnss_5wire_suspend_cfg,
471 },
472 },
473};
Nishant Pandit474f2252011-07-23 23:17:56 +0530474static struct gpiomux_setting cam_settings[4] = {
475 {
476 .func = GPIOMUX_FUNC_GPIO, /*suspend*/
477 .drv = GPIOMUX_DRV_2MA,
478 .pull = GPIOMUX_PULL_DOWN,
479 },
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700480
Nishant Pandit474f2252011-07-23 23:17:56 +0530481 {
482 .func = GPIOMUX_FUNC_1, /*active 1*/
483 .drv = GPIOMUX_DRV_2MA,
484 .pull = GPIOMUX_PULL_NONE,
485 },
486
487 {
488 .func = GPIOMUX_FUNC_GPIO, /*active 2*/
489 .drv = GPIOMUX_DRV_2MA,
490 .pull = GPIOMUX_PULL_NONE,
491 },
492
493 {
494 .func = GPIOMUX_FUNC_1, /*active 3*/
495 .drv = GPIOMUX_DRV_8MA,
496 .pull = GPIOMUX_PULL_UP,
497 },
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700498};
499
Nishant Pandit474f2252011-07-23 23:17:56 +0530500static struct msm_gpiomux_config msm8960_cam_configs[] = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700501 {
502 .gpio = 2,
503 .settings = {
Nishant Pandit474f2252011-07-23 23:17:56 +0530504 [GPIOMUX_ACTIVE] = &cam_settings[2],
505 [GPIOMUX_SUSPENDED] = &cam_settings[0],
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700506 },
507 },
508 {
509 .gpio = 3,
510 .settings = {
Nishant Pandit474f2252011-07-23 23:17:56 +0530511 [GPIOMUX_ACTIVE] = &cam_settings[1],
512 [GPIOMUX_SUSPENDED] = &cam_settings[0],
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700513 },
514 },
515 {
516 .gpio = 4,
517 .settings = {
Nishant Pandit474f2252011-07-23 23:17:56 +0530518 [GPIOMUX_ACTIVE] = &cam_settings[1],
519 [GPIOMUX_SUSPENDED] = &cam_settings[0],
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700520 },
521 },
522 {
523 .gpio = 5,
524 .settings = {
Nishant Pandit474f2252011-07-23 23:17:56 +0530525 [GPIOMUX_ACTIVE] = &cam_settings[1],
526 [GPIOMUX_SUSPENDED] = &cam_settings[0],
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700527 },
528 },
529 {
530 .gpio = 18,
531 .settings = {
Nishant Pandit474f2252011-07-23 23:17:56 +0530532 [GPIOMUX_ACTIVE] = &cam_settings[3],
533 [GPIOMUX_SUSPENDED] = &cam_settings[0],
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700534 },
535 },
536 {
537 .gpio = 19,
538 .settings = {
Nishant Pandit474f2252011-07-23 23:17:56 +0530539 [GPIOMUX_ACTIVE] = &cam_settings[3],
540 [GPIOMUX_SUSPENDED] = &cam_settings[0],
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700541 },
542 },
543 {
544 .gpio = 20,
545 .settings = {
Nishant Pandit474f2252011-07-23 23:17:56 +0530546 [GPIOMUX_ACTIVE] = &cam_settings[3],
547 [GPIOMUX_SUSPENDED] = &cam_settings[0],
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700548 },
549 },
550 {
551 .gpio = 21,
552 .settings = {
Nishant Pandit474f2252011-07-23 23:17:56 +0530553 [GPIOMUX_ACTIVE] = &cam_settings[3],
554 [GPIOMUX_SUSPENDED] = &cam_settings[0],
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700555 },
556 },
557 {
558 .gpio = 76,
559 .settings = {
Nishant Pandit474f2252011-07-23 23:17:56 +0530560 [GPIOMUX_ACTIVE] = &cam_settings[2],
561 [GPIOMUX_SUSPENDED] = &cam_settings[0],
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700562 },
563 },
564 {
565 .gpio = 107,
566 .settings = {
Nishant Pandit474f2252011-07-23 23:17:56 +0530567 [GPIOMUX_ACTIVE] = &cam_settings[2],
568 [GPIOMUX_SUSPENDED] = &cam_settings[0],
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700569 },
570 },
571};
572
573static struct gpiomux_setting cyts_resout_sus_cfg = {
574 .func = GPIOMUX_FUNC_GPIO,
575 .drv = GPIOMUX_DRV_6MA,
576 .pull = GPIOMUX_PULL_UP,
577};
578
579static struct gpiomux_setting cyts_resout_act_cfg = {
580 .func = GPIOMUX_FUNC_GPIO,
581 .drv = GPIOMUX_DRV_6MA,
582 .pull = GPIOMUX_PULL_UP,
583};
584
585static struct gpiomux_setting cyts_sleep_sus_cfg = {
586 .func = GPIOMUX_FUNC_GPIO,
587 .drv = GPIOMUX_DRV_6MA,
588 .pull = GPIOMUX_PULL_DOWN,
589};
590
591static struct gpiomux_setting cyts_sleep_act_cfg = {
592 .func = GPIOMUX_FUNC_GPIO,
593 .drv = GPIOMUX_DRV_6MA,
594 .pull = GPIOMUX_PULL_DOWN,
595};
596
597static struct gpiomux_setting cyts_int_act_cfg = {
598 .func = GPIOMUX_FUNC_GPIO,
599 .drv = GPIOMUX_DRV_8MA,
600 .pull = GPIOMUX_PULL_UP,
601};
602
603static struct gpiomux_setting cyts_int_sus_cfg = {
604 .func = GPIOMUX_FUNC_GPIO,
605 .drv = GPIOMUX_DRV_2MA,
606 .pull = GPIOMUX_PULL_UP,
607};
608
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700609static struct msm_gpiomux_config msm8960_cyts_configs[] __initdata = {
610 { /* TS INTERRUPT */
611 .gpio = 11,
612 .settings = {
613 [GPIOMUX_ACTIVE] = &cyts_int_act_cfg,
614 [GPIOMUX_SUSPENDED] = &cyts_int_sus_cfg,
615 },
616 },
617 { /* TS SLEEP */
618 .gpio = 50,
619 .settings = {
620 [GPIOMUX_ACTIVE] = &cyts_sleep_act_cfg,
621 [GPIOMUX_SUSPENDED] = &cyts_sleep_sus_cfg,
622 },
623 },
624 { /* TS RESOUT */
625 .gpio = 52,
626 .settings = {
627 [GPIOMUX_ACTIVE] = &cyts_resout_act_cfg,
628 [GPIOMUX_SUSPENDED] = &cyts_resout_sus_cfg,
629 },
630 },
631};
632
Rohit Vaswanicd2a59b2011-07-19 12:00:48 -0700633#if defined(CONFIG_GPIO_SX150X) || defined(CONFIG_GPIO_SX150X_MODULE)
634enum {
635 SX150X_CAM,
636};
637
Nishant Pandit474f2252011-07-23 23:17:56 +0530638static struct sx150x_platform_data sx150x_data[] = {
Rohit Vaswanicd2a59b2011-07-19 12:00:48 -0700639 [SX150X_CAM] = {
640 .gpio_base = GPIO_CAM_EXPANDER_BASE,
641 .oscio_is_gpo = false,
642 .io_pullup_ena = 0x0,
Nishant Pandit474f2252011-07-23 23:17:56 +0530643 .io_pulldn_ena = 0xc0,
Rohit Vaswanicd2a59b2011-07-19 12:00:48 -0700644 .io_open_drain_ena = 0x0,
645 .irq_summary = -1,
646 },
647};
Nishant Pandit474f2252011-07-23 23:17:56 +0530648
649#endif
650
651#ifdef CONFIG_I2C
652
653#define MSM_8960_GSBI4_QUP_I2C_BUS_ID 4
654#define MSM_8960_GSBI3_QUP_I2C_BUS_ID 3
655
656#if defined(CONFIG_GPIO_SX150X) || defined(CONFIG_GPIO_SX150X_MODULE)
657
658static struct i2c_board_info cam_expander_i2c_info[] = {
659 {
660 I2C_BOARD_INFO("sx1508q", 0x22),
661 .platform_data = &sx150x_data[SX150X_CAM]
662 },
663};
664
665static struct msm_cam_expander_info cam_expander_info[] = {
666 {
667 cam_expander_i2c_info,
668 MSM_8960_GSBI4_QUP_I2C_BUS_ID,
669 },
670};
671#endif
Rohit Vaswanicd2a59b2011-07-19 12:00:48 -0700672#endif
673
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700674#define MSM_PMEM_KERNEL_EBI1_SIZE 0x110C000
675#define MSM_PMEM_ADSP_SIZE 0x3800000
Ben Romberger09e462d2011-08-09 15:24:37 -0700676#define MSM_PMEM_AUDIO_SIZE 0x28B000
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700677#define MSM_PMEM_SIZE 0x1800000 /* 24 Mbytes */
678
Laura Abbottd6183792011-08-19 13:42:24 -0700679#define MSM_ION_EBI_SIZE SZ_8M
680
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700681#ifdef CONFIG_KERNEL_PMEM_EBI_REGION
682static unsigned pmem_kernel_ebi1_size = MSM_PMEM_KERNEL_EBI1_SIZE;
683static int __init pmem_kernel_ebi1_size_setup(char *p)
684{
685 pmem_kernel_ebi1_size = memparse(p, NULL);
686 return 0;
687}
688early_param("pmem_kernel_ebi1_size", pmem_kernel_ebi1_size_setup);
689#endif
690
691#ifdef CONFIG_ANDROID_PMEM
692static unsigned pmem_size = MSM_PMEM_SIZE;
693static int __init pmem_size_setup(char *p)
694{
695 pmem_size = memparse(p, NULL);
696 return 0;
697}
698early_param("pmem_size", pmem_size_setup);
699
700static unsigned pmem_adsp_size = MSM_PMEM_ADSP_SIZE;
701
702static int __init pmem_adsp_size_setup(char *p)
703{
704 pmem_adsp_size = memparse(p, NULL);
705 return 0;
706}
707early_param("pmem_adsp_size", pmem_adsp_size_setup);
708
709static unsigned pmem_audio_size = MSM_PMEM_AUDIO_SIZE;
710
711static int __init pmem_audio_size_setup(char *p)
712{
713 pmem_audio_size = memparse(p, NULL);
714 return 0;
715}
716early_param("pmem_audio_size", pmem_audio_size_setup);
717#endif
718
719#ifdef CONFIG_ANDROID_PMEM
720static struct android_pmem_platform_data android_pmem_pdata = {
721 .name = "pmem",
722 .allocator_type = PMEM_ALLOCATORTYPE_ALLORNOTHING,
723 .cached = 1,
724 .memory_type = MEMTYPE_EBI1,
725};
726
727static struct platform_device android_pmem_device = {
728 .name = "android_pmem",
729 .id = 0,
730 .dev = {.platform_data = &android_pmem_pdata},
731};
732
733static struct android_pmem_platform_data android_pmem_adsp_pdata = {
734 .name = "pmem_adsp",
735 .allocator_type = PMEM_ALLOCATORTYPE_BITMAP,
736 .cached = 0,
737 .memory_type = MEMTYPE_EBI1,
738};
739static struct platform_device android_pmem_adsp_device = {
740 .name = "android_pmem",
741 .id = 2,
742 .dev = { .platform_data = &android_pmem_adsp_pdata },
743};
744
745static struct android_pmem_platform_data android_pmem_audio_pdata = {
746 .name = "pmem_audio",
747 .allocator_type = PMEM_ALLOCATORTYPE_BITMAP,
748 .cached = 0,
749 .memory_type = MEMTYPE_EBI1,
750};
751
752static struct platform_device android_pmem_audio_device = {
753 .name = "android_pmem",
754 .id = 4,
755 .dev = { .platform_data = &android_pmem_audio_pdata },
756};
757#endif
758
759static struct memtype_reserve msm8960_reserve_table[] __initdata = {
760 [MEMTYPE_SMI] = {
761 },
762 [MEMTYPE_EBI0] = {
763 .flags = MEMTYPE_FLAGS_1M_ALIGN,
764 },
765 [MEMTYPE_EBI1] = {
766 .flags = MEMTYPE_FLAGS_1M_ALIGN,
767 },
768};
769
770static void __init size_pmem_devices(void)
771{
772#ifdef CONFIG_ANDROID_PMEM
773 android_pmem_adsp_pdata.size = pmem_adsp_size;
774 android_pmem_pdata.size = pmem_size;
775 android_pmem_audio_pdata.size = MSM_PMEM_AUDIO_SIZE;
776#endif
777}
778
779static void __init reserve_memory_for(struct android_pmem_platform_data *p)
780{
781 msm8960_reserve_table[p->memory_type].size += p->size;
782}
783
784static void __init reserve_pmem_memory(void)
785{
786#ifdef CONFIG_ANDROID_PMEM
787 reserve_memory_for(&android_pmem_adsp_pdata);
788 reserve_memory_for(&android_pmem_pdata);
789 reserve_memory_for(&android_pmem_audio_pdata);
790 msm8960_reserve_table[MEMTYPE_EBI1].size += pmem_kernel_ebi1_size;
791#endif
792}
793
Larry Basselb4126da2011-07-18 14:31:33 -0700794static int msm8960_paddr_to_memtype(unsigned int paddr)
795{
796 return MEMTYPE_EBI1;
797}
798
Laura Abbottd6183792011-08-19 13:42:24 -0700799#ifdef CONFIG_ION_MSM
800struct ion_platform_data ion_pdata = {
801 .nr = 3,
802 .heaps = {
803 {
804 .id = ION_HEAP_SYSTEM_ID,
805 .type = ION_HEAP_TYPE_SYSTEM,
806 .name = ION_KMALLOC_HEAP_NAME,
807 },
808 {
809 .id = ION_HEAP_SYSTEM_CONTIG_ID,
810 .type = ION_HEAP_TYPE_SYSTEM_CONTIG,
811 .name = ION_VMALLOC_HEAP_NAME,
812 },
813 {
814 .id = ION_HEAP_EBI_ID,
815 .type = ION_HEAP_TYPE_CARVEOUT,
816 .name = ION_EBI1_HEAP_NAME,
817 .size = MSM_ION_EBI_SIZE,
818 .memory_type = ION_EBI_TYPE,
819 },
820 }
821};
822
823struct platform_device ion_dev = {
824 .name = "ion-msm",
825 .id = 1,
826 .dev = { .platform_data = &ion_pdata },
827};
828#endif
829
830static void reserve_ion_memory(void)
831{
832#ifdef CONFIG_ION_MSM
833 msm8960_reserve_table[MEMTYPE_EBI1].size += MSM_ION_EBI_SIZE;
834#endif
835}
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700836static void __init msm8960_calculate_reserve_sizes(void)
837{
838 size_pmem_devices();
839 reserve_pmem_memory();
Laura Abbottd6183792011-08-19 13:42:24 -0700840 reserve_ion_memory();
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700841}
842
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700843static struct reserve_info msm8960_reserve_info __initdata = {
844 .memtype_reserve_table = msm8960_reserve_table,
845 .calculate_reserve_sizes = msm8960_calculate_reserve_sizes,
846 .paddr_to_memtype = msm8960_paddr_to_memtype,
847};
848
Larry Basselb4126da2011-07-18 14:31:33 -0700849static int msm8960_memory_bank_size(void)
850{
851 return 1<<29;
852}
853
854static void __init locate_unstable_memory(void)
855{
856 struct membank *mb = &meminfo.bank[meminfo.nr_banks - 1];
857 unsigned long bank_size;
858 unsigned long low, high;
859
860 bank_size = msm8960_memory_bank_size();
861 low = meminfo.bank[0].start;
862 high = mb->start + mb->size;
863 low &= ~(bank_size - 1);
864
865 if (high - low <= bank_size)
866 return;
867 msm8960_reserve_info.low_unstable_address = low + bank_size;
868 msm8960_reserve_info.max_unstable_size = high - low - bank_size;
869 msm8960_reserve_info.bank_size = bank_size;
870 pr_info("low unstable address %lx max size %lx bank size %lx\n",
871 msm8960_reserve_info.low_unstable_address,
872 msm8960_reserve_info.max_unstable_size,
873 msm8960_reserve_info.bank_size);
874}
875
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700876static void __init msm8960_reserve(void)
877{
878 reserve_info = &msm8960_reserve_info;
Larry Basselb4126da2011-07-18 14:31:33 -0700879 locate_unstable_memory();
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700880 msm_reserve();
881}
882
Larry Bassela4414b12011-08-04 11:11:02 -0700883static int msm8960_change_memory_power(u64 start, u64 size,
884 int change_type)
Larry Bassela7eadea2011-07-14 10:46:00 -0700885{
Larry Bassela4414b12011-08-04 11:11:02 -0700886 return size;
Larry Bassela7eadea2011-07-14 10:46:00 -0700887}
888
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700889#ifdef CONFIG_MSM_CAMERA
890
Kevin Chan28446522011-07-26 16:39:53 -0700891static uint16_t msm_cam_gpio_tbl[] = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700892 5, /*CAMIF_MCLK*/
893 20, /*CAMIF_I2C_DATA*/
894 21, /*CAMIF_I2C_CLK*/
895};
896
897#define VFE_CAMIF_TIMER1_GPIO 2
898#define VFE_CAMIF_TIMER2_GPIO 3
899#define VFE_CAMIF_TIMER3_GPIO_INT 4
900struct msm_camera_sensor_strobe_flash_data strobe_flash_xenon = {
901 .flash_trigger = VFE_CAMIF_TIMER2_GPIO,
902 .flash_charge = VFE_CAMIF_TIMER1_GPIO,
903 .flash_charge_done = VFE_CAMIF_TIMER3_GPIO_INT,
904 .flash_recharge_duration = 50000,
905 .irq = MSM_GPIO_TO_INT(VFE_CAMIF_TIMER3_GPIO_INT),
906};
907
Nishant Pandit474f2252011-07-23 23:17:56 +0530908#ifdef CONFIG_MSM_CAMERA_FLASH
909static struct msm_camera_sensor_flash_src msm_flash_src = {
910 .flash_sr_type = MSM_CAMERA_FLASH_SRC_EXT,
911 ._fsrc.ext_driver_src.led_en = GPIO_CAM_GP_LED_EN1,
912 ._fsrc.ext_driver_src.led_flash_en = GPIO_CAM_GP_LED_EN2,
913#if defined(CONFIG_I2C) && (defined(CONFIG_GPIO_SX150X) || \
914 defined(CONFIG_GPIO_SX150X_MODULE))
915 ._fsrc.ext_driver_src.expander_info = cam_expander_info,
916#endif
917};
918#endif
919
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700920#ifdef CONFIG_IMX074
921static struct msm_camera_sensor_platform_info sensor_board_info = {
Mansoor Aftab6d6ff5e2011-07-20 17:25:36 -0700922 .mount_angle = 90
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700923};
924#endif
925
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700926struct msm_camera_device_platform_data msm_camera_csi0_device_data = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700927 .ioclk.mclk_clk_rate = 24000000,
928 .ioclk.vfe_clk_rate = 228570000,
929 .csid_core = 0,
Kevin Chan28446522011-07-26 16:39:53 -0700930 .cam_gpio_tbl = msm_cam_gpio_tbl,
931 .cam_gpio_tbl_size = ARRAY_SIZE(msm_cam_gpio_tbl),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700932};
933
934struct msm_camera_device_platform_data msm_camera_csi1_device_data = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700935 .ioclk.mclk_clk_rate = 24000000,
936 .ioclk.vfe_clk_rate = 228570000,
937 .csid_core = 1,
Kevin Chan28446522011-07-26 16:39:53 -0700938 .cam_gpio_tbl = msm_cam_gpio_tbl,
939 .cam_gpio_tbl_size = ARRAY_SIZE(msm_cam_gpio_tbl),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700940};
941
942#ifdef CONFIG_IMX074
943static struct msm_camera_sensor_flash_data flash_imx074 = {
944 .flash_type = MSM_CAMERA_FLASH_LED,
Nishant Pandit474f2252011-07-23 23:17:56 +0530945#ifdef CONFIG_MSM_CAMERA_FLASH
946 .flash_src = &msm_flash_src
947#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700948};
949
950static struct msm_camera_sensor_info msm_camera_sensor_imx074_data = {
951 .sensor_name = "imx074",
952 .sensor_reset = 107,
953 .sensor_pwd = 85,
954 .vcm_pwd = 0,
955 .vcm_enable = 1,
956 .pdata = &msm_camera_csi0_device_data,
957 .flash_data = &flash_imx074,
958 .strobe_flash_data = &strobe_flash_xenon,
959 .sensor_platform_info = &sensor_board_info,
960 .csi_if = 1
961};
962
963struct platform_device msm8960_camera_sensor_imx074 = {
964 .name = "msm_camera_imx074",
965 .dev = {
966 .platform_data = &msm_camera_sensor_imx074_data,
967 },
968};
969#endif
970#ifdef CONFIG_OV2720
971static struct msm_camera_sensor_flash_data flash_ov2720 = {
Kevin Chan1a990332011-07-26 20:31:23 -0700972 .flash_type = MSM_CAMERA_FLASH_NONE,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700973};
974
975static struct msm_camera_sensor_info msm_camera_sensor_ov2720_data = {
976 .sensor_name = "ov2720",
977 .sensor_reset = 76,
978 .sensor_pwd = 85,
979 .vcm_pwd = 0,
980 .vcm_enable = 1,
981 .pdata = &msm_camera_csi1_device_data,
982 .flash_data = &flash_ov2720,
983 .csi_if = 1
984};
985
986struct platform_device msm8960_camera_sensor_ov2720 = {
987 .name = "msm_camera_ov2720",
988 .dev = {
989 .platform_data = &msm_camera_sensor_ov2720_data,
990 },
991};
992#endif
Kevin Chandfecce22011-07-13 10:52:41 -0700993
994static struct msm_camera_sensor_flash_data flash_qs_mt9p017 = {
995 .flash_type = MSM_CAMERA_FLASH_LED,
996};
997
998static struct msm_camera_sensor_info msm_camera_sensor_qs_mt9p017_data = {
999 .sensor_name = "qs_mt9p017",
1000 .sensor_reset = 107,
1001 .sensor_pwd = 85,
1002 .vcm_pwd = 0,
1003 .vcm_enable = 1,
1004 .pdata = &msm_camera_csi0_device_data,
1005 .flash_data = &flash_qs_mt9p017,
1006 .sensor_platform_info = &sensor_board_info,
1007 .csi_if = 1
1008};
1009
1010struct platform_device msm8960_camera_sensor_qs_mt9p017 = {
1011 .name = "msm_camera_qs_mt9p017",
1012 .dev = {
1013 .platform_data = &msm_camera_sensor_qs_mt9p017_data,
1014 },
1015};
1016
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001017static void __init msm8960_init_cam(void)
1018{
1019 int i;
1020 struct platform_device *cam_dev[] = {
1021 &msm8960_camera_sensor_imx074,
1022 &msm8960_camera_sensor_ov2720,
Kevin Chandfecce22011-07-13 10:52:41 -07001023 &msm8960_camera_sensor_qs_mt9p017,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001024 };
1025
1026 for (i = 0; i < ARRAY_SIZE(cam_dev); i++) {
1027 struct msm_camera_sensor_info *s_info;
1028 s_info = cam_dev[i]->dev.platform_data;
1029 msm_get_cam_resources(s_info);
1030 platform_device_register(cam_dev[i]);
1031 }
1032}
1033#endif
1034
1035#ifdef CONFIG_FB_MSM_TRIPLE_BUFFER
1036/* prim = 608 x 1024 x 4(bpp) x 3(pages) */
1037#define MSM_FB_PRIM_BUF_SIZE 0x720000
1038#else
1039/* prim = 608 x 1024 x 4(bpp) x 2(pages) */
1040#define MSM_FB_PRIM_BUF_SIZE 0x4C0000
1041#endif
1042
1043#ifdef CONFIG_FB_MSM_MIPI_DSI
Nagamalleswararao Ganji0b8dbd02011-08-18 20:46:59 -07001044#define MIPI_DSI_WRITEBACK_SIZE (1024 * 600 * 3 * 2)
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001045#else
1046#define MIPI_DSI_WRITEBACK_SIZE 0
1047#endif
1048
1049#ifdef CONFIG_FB_MSM_HDMI_MSM_PANEL
1050/* hdmi = 1920 x 1088 x 2(bpp) x 1(page) */
1051#define MSM_FB_EXT_BUF_SIZE 0x3FC000
1052#elif defined(CONFIG_FB_MSM_TVOUT)
1053/* tvout = 720 x 576 x 2(bpp) x 2(pages) */
1054#define MSM_FB_EXT_BUF_SIZE 0x195000
1055#else /* CONFIG_FB_MSM_HDMI_MSM_PANEL */
1056#define MSM_FB_EXT_BUF_SIZE 0
1057#endif /* CONFIG_FB_MSM_HDMI_MSM_PANEL */
1058
1059#define MSM_FB_SIZE roundup(MSM_FB_PRIM_BUF_SIZE + MSM_FB_EXT_BUF_SIZE +\
1060 MIPI_DSI_WRITEBACK_SIZE, 4096)
1061
1062#define MDP_VSYNC_GPIO 0
1063
1064static struct resource msm_fb_resources[] = {
1065 {
1066 .flags = IORESOURCE_DMA,
1067 }
1068};
1069
1070static struct platform_device msm_fb_device = {
1071 .name = "msm_fb",
1072 .id = 0,
1073 .num_resources = ARRAY_SIZE(msm_fb_resources),
1074 .resource = msm_fb_resources,
1075};
1076
1077static bool dsi_power_on;
1078
1079static int mipi_dsi_panel_power(int on)
1080{
1081 static struct regulator *reg_l8, *reg_l23, *reg_l2;
Nagamalleswararao Ganjieac5dfa2011-07-23 17:31:16 -07001082 static int gpio43;
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001083 int rc;
1084
1085 struct pm_gpio gpio43_param = {
1086 .direction = PM_GPIO_DIR_OUT,
1087 .output_buffer = PM_GPIO_OUT_BUF_CMOS,
1088 .output_value = 0,
1089 .pull = PM_GPIO_PULL_NO,
1090 .vin_sel = 2,
1091 .out_strength = PM_GPIO_STRENGTH_HIGH,
1092 .function = PM_GPIO_FUNC_PAIRED,
1093 .inv_int_pol = 0,
1094 .disable_pin = 0,
1095 };
1096
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001097 pr_info("%s: state : %d\n", __func__, on);
1098
1099 if (!dsi_power_on) {
1100
1101 reg_l8 = regulator_get(&msm_mipi_dsi1_device.dev,
1102 "dsi_vdc");
1103 if (IS_ERR(reg_l8)) {
1104 pr_err("could not get 8921_l8, rc = %ld\n",
1105 PTR_ERR(reg_l8));
1106 return -ENODEV;
1107 }
1108
1109 reg_l23 = regulator_get(&msm_mipi_dsi1_device.dev,
1110 "dsi_vddio");
1111 if (IS_ERR(reg_l23)) {
1112 pr_err("could not get 8921_l23, rc = %ld\n",
1113 PTR_ERR(reg_l23));
1114 return -ENODEV;
1115 }
1116
1117 reg_l2 = regulator_get(&msm_mipi_dsi1_device.dev,
1118 "dsi_vdda");
1119 if (IS_ERR(reg_l2)) {
1120 pr_err("could not get 8921_l2, rc = %ld\n",
1121 PTR_ERR(reg_l2));
1122 return -ENODEV;
1123 }
1124
1125 rc = regulator_set_voltage(reg_l8, 2800000, 3000000);
1126 if (rc) {
1127 pr_err("set_voltage l8 failed, rc=%d\n", rc);
1128 return -EINVAL;
1129 }
1130 rc = regulator_set_voltage(reg_l23, 1800000, 1800000);
1131 if (rc) {
1132 pr_err("set_voltage l23 failed, rc=%d\n", rc);
1133 return -EINVAL;
1134 }
1135 rc = regulator_set_voltage(reg_l2, 1200000, 1200000);
1136 if (rc) {
1137 pr_err("set_voltage l2 failed, rc=%d\n", rc);
1138 return -EINVAL;
1139 }
1140
1141 gpio43 = PM8921_GPIO_PM_TO_SYS(43);
1142 rc = gpio_request(gpio43, "disp_rst_n");
1143 if (rc) {
1144 pr_err("request gpio 43 failed, rc=%d\n", rc);
1145 return -ENODEV;
1146 }
1147
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001148 dsi_power_on = true;
1149 }
1150
1151 if (on) {
1152 rc = regulator_set_optimum_mode(reg_l8, 100000);
1153 if (rc < 0) {
1154 pr_err("set_optimum_mode l8 failed, rc=%d\n", rc);
1155 return -EINVAL;
1156 }
1157 rc = regulator_set_optimum_mode(reg_l23, 100000);
1158 if (rc < 0) {
1159 pr_err("set_optimum_mode l23 failed, rc=%d\n", rc);
1160 return -EINVAL;
1161 }
1162 rc = regulator_set_optimum_mode(reg_l2, 100000);
1163 if (rc < 0) {
1164 pr_err("set_optimum_mode l2 failed, rc=%d\n", rc);
1165 return -EINVAL;
1166 }
1167 rc = regulator_enable(reg_l8);
1168 if (rc) {
1169 pr_err("enable l8 failed, rc=%d\n", rc);
1170 return -ENODEV;
1171 }
1172 rc = regulator_enable(reg_l23);
1173 if (rc) {
1174 pr_err("enable l8 failed, rc=%d\n", rc);
1175 return -ENODEV;
1176 }
1177 rc = regulator_enable(reg_l2);
1178 if (rc) {
1179 pr_err("enable l2 failed, rc=%d\n", rc);
1180 return -ENODEV;
1181 }
1182
1183 gpio43_param.pull = PM_GPIO_PULL_NO;
1184 rc = pm8xxx_gpio_config(gpio43, &gpio43_param);
1185 if (rc) {
1186 pr_err("gpio_config 43 failed (1), rc=%d\n", rc);
1187 return -EINVAL;
1188 }
1189 gpio43_param.pull = PM_GPIO_PULL_UP_30;
1190 rc = pm8xxx_gpio_config(gpio43, &gpio43_param);
1191 if (rc) {
1192 pr_err("gpio_config 43 failed (2), rc=%d\n", rc);
1193 return -EINVAL;
1194 }
1195 gpio43_param.pull = PM_GPIO_PULL_NO;
1196 rc = pm8xxx_gpio_config(gpio43, &gpio43_param);
1197 if (rc) {
1198 pr_err("gpio_config 43 failed (3), rc=%d\n", rc);
1199 return -EINVAL;
1200 }
1201 gpio43_param.pull = PM_GPIO_PULL_UP_30;
1202 rc = pm8xxx_gpio_config(gpio43, &gpio43_param);
1203 if (rc) {
1204 pr_err("gpio_config 43 failed (4), rc=%d\n", rc);
1205 return -EINVAL;
1206 }
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001207 gpio_set_value_cansleep(gpio43, 1);
1208 } else {
1209 rc = regulator_set_optimum_mode(reg_l8, 100);
1210 if (rc < 0) {
1211 pr_err("set_optimum_mode l8 failed, rc=%d\n", rc);
1212 return -EINVAL;
1213 }
1214 rc = regulator_set_optimum_mode(reg_l23, 100);
1215 if (rc < 0) {
1216 pr_err("set_optimum_mode l23 failed, rc=%d\n", rc);
1217 return -EINVAL;
1218 }
1219 rc = regulator_set_optimum_mode(reg_l2, 100);
1220 if (rc < 0) {
1221 pr_err("set_optimum_mode l2 failed, rc=%d\n", rc);
1222 return -EINVAL;
1223 }
1224 gpio_set_value_cansleep(gpio43, 0);
1225 }
1226 return 0;
1227}
1228
1229static struct mipi_dsi_platform_data mipi_dsi_pdata = {
1230 .vsync_gpio = MDP_VSYNC_GPIO,
1231 .dsi_power_save = mipi_dsi_panel_power,
1232};
1233
1234#ifdef CONFIG_MSM_BUS_SCALING
1235
1236static struct msm_bus_vectors mdp_init_vectors[] = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001237 {
1238 .src = MSM_BUS_MASTER_MDP_PORT0,
1239 .dst = MSM_BUS_SLAVE_EBI_CH0,
1240 .ab = 0,
1241 .ib = 0,
1242 },
Ravishangar Kalyanam882930f2011-07-08 17:51:52 -07001243};
1244
1245static struct msm_bus_vectors mdp_ui_vectors[] = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001246 {
1247 .src = MSM_BUS_MASTER_MDP_PORT0,
1248 .dst = MSM_BUS_SLAVE_EBI_CH0,
Ravishangar Kalyanam882930f2011-07-08 17:51:52 -07001249 .ab = 216000000 * 2,
1250 .ib = 270000000 * 2,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001251 },
1252};
1253
1254static struct msm_bus_vectors mdp_vga_vectors[] = {
1255 /* VGA and less video */
1256 {
1257 .src = MSM_BUS_MASTER_MDP_PORT0,
1258 .dst = MSM_BUS_SLAVE_EBI_CH0,
Ravishangar Kalyanam882930f2011-07-08 17:51:52 -07001259 .ab = 216000000 * 2,
1260 .ib = 270000000 * 2,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001261 },
1262};
1263
1264static struct msm_bus_vectors mdp_720p_vectors[] = {
1265 /* 720p and less video */
1266 {
1267 .src = MSM_BUS_MASTER_MDP_PORT0,
1268 .dst = MSM_BUS_SLAVE_EBI_CH0,
Ravishangar Kalyanam882930f2011-07-08 17:51:52 -07001269 .ab = 230400000 * 2,
1270 .ib = 288000000 * 2,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001271 },
1272};
1273
1274static struct msm_bus_vectors mdp_1080p_vectors[] = {
1275 /* 1080p and less video */
1276 {
1277 .src = MSM_BUS_MASTER_MDP_PORT0,
1278 .dst = MSM_BUS_SLAVE_EBI_CH0,
Ravishangar Kalyanam882930f2011-07-08 17:51:52 -07001279 .ab = 334080000 * 2,
1280 .ib = 417600000 * 2,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001281 },
1282};
1283
1284static struct msm_bus_paths mdp_bus_scale_usecases[] = {
1285 {
1286 ARRAY_SIZE(mdp_init_vectors),
1287 mdp_init_vectors,
1288 },
1289 {
Ravishangar Kalyanam882930f2011-07-08 17:51:52 -07001290 ARRAY_SIZE(mdp_ui_vectors),
1291 mdp_ui_vectors,
1292 },
1293 {
1294 ARRAY_SIZE(mdp_ui_vectors),
1295 mdp_ui_vectors,
1296 },
1297 {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001298 ARRAY_SIZE(mdp_vga_vectors),
1299 mdp_vga_vectors,
1300 },
1301 {
1302 ARRAY_SIZE(mdp_720p_vectors),
1303 mdp_720p_vectors,
1304 },
1305 {
1306 ARRAY_SIZE(mdp_1080p_vectors),
1307 mdp_1080p_vectors,
1308 },
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001309};
1310
1311static struct msm_bus_scale_pdata mdp_bus_scale_pdata = {
1312 mdp_bus_scale_usecases,
1313 ARRAY_SIZE(mdp_bus_scale_usecases),
1314 .name = "mdp",
1315};
1316
1317#endif
1318
1319int mdp_core_clk_rate_table[] = {
1320 85330000,
1321 85330000,
1322 128000000,
1323 200000000,
1324 200000000,
1325};
1326
1327static struct msm_panel_common_pdata mdp_pdata = {
1328 .gpio = MDP_VSYNC_GPIO,
1329 .mdp_core_clk_rate = 85330000,
1330 .mdp_core_clk_table = mdp_core_clk_rate_table,
1331 .num_mdp_clk = ARRAY_SIZE(mdp_core_clk_rate_table),
1332#ifdef CONFIG_MSM_BUS_SCALING
1333 .mdp_bus_scale_table = &mdp_bus_scale_pdata,
1334#endif
1335 .mdp_rev = MDP_REV_42,
1336};
1337
1338static struct platform_device mipi_dsi_renesas_panel_device = {
1339 .name = "mipi_renesas",
1340 .id = 0,
1341};
1342
1343static struct platform_device mipi_dsi_simulator_panel_device = {
1344 .name = "mipi_simulator",
1345 .id = 0,
1346};
1347
Nagamalleswararao Ganjieac5dfa2011-07-23 17:31:16 -07001348#define LPM_CHANNEL0 0
1349static int toshiba_gpio[] = {LPM_CHANNEL0};
1350
1351static struct mipi_dsi_panel_platform_data toshiba_pdata = {
1352 .gpio = toshiba_gpio,
1353};
1354
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001355static struct platform_device mipi_dsi_toshiba_panel_device = {
1356 .name = "mipi_toshiba",
1357 .id = 0,
Nagamalleswararao Ganjieac5dfa2011-07-23 17:31:16 -07001358 .dev = {
1359 .platform_data = &toshiba_pdata,
1360 }
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001361};
1362
1363#ifdef CONFIG_FB_MSM_HDMI_MSM_PANEL
1364static struct resource hdmi_msm_resources[] = {
1365 {
1366 .name = "hdmi_msm_qfprom_addr",
1367 .start = 0x00700000,
1368 .end = 0x007060FF,
1369 .flags = IORESOURCE_MEM,
1370 },
1371 {
1372 .name = "hdmi_msm_hdmi_addr",
1373 .start = 0x04A00000,
1374 .end = 0x04A00FFF,
1375 .flags = IORESOURCE_MEM,
1376 },
1377 {
1378 .name = "hdmi_msm_irq",
1379 .start = HDMI_IRQ,
1380 .end = HDMI_IRQ,
1381 .flags = IORESOURCE_IRQ,
1382 },
1383};
1384
1385static int hdmi_enable_5v(int on);
1386static int hdmi_core_power(int on, int show);
1387static int hdmi_cec_power(int on);
1388
1389static struct msm_hdmi_platform_data hdmi_msm_data = {
1390 .irq = HDMI_IRQ,
1391 .enable_5v = hdmi_enable_5v,
1392 .core_power = hdmi_core_power,
1393 .cec_power = hdmi_cec_power,
1394};
1395
1396static struct platform_device hdmi_msm_device = {
1397 .name = "hdmi_msm",
1398 .id = 0,
1399 .num_resources = ARRAY_SIZE(hdmi_msm_resources),
1400 .resource = hdmi_msm_resources,
1401 .dev.platform_data = &hdmi_msm_data,
1402};
1403#endif /* CONFIG_FB_MSM_HDMI_MSM_PANEL */
1404
Ravishangar Kalyanam882930f2011-07-08 17:51:52 -07001405#ifdef CONFIG_MSM_BUS_SCALING
1406static struct msm_bus_vectors dtv_bus_init_vectors[] = {
1407 {
1408 .src = MSM_BUS_MASTER_MDP_PORT0,
1409 .dst = MSM_BUS_SLAVE_EBI_CH0,
1410 .ab = 0,
1411 .ib = 0,
1412 },
1413};
1414static struct msm_bus_vectors dtv_bus_def_vectors[] = {
1415 {
1416 .src = MSM_BUS_MASTER_MDP_PORT0,
1417 .dst = MSM_BUS_SLAVE_EBI_CH0,
1418 .ab = 566092800 * 2,
1419 .ib = 707616000 * 2,
1420 },
1421};
1422static struct msm_bus_paths dtv_bus_scale_usecases[] = {
1423 {
1424 ARRAY_SIZE(dtv_bus_init_vectors),
1425 dtv_bus_init_vectors,
1426 },
1427 {
1428 ARRAY_SIZE(dtv_bus_def_vectors),
1429 dtv_bus_def_vectors,
1430 },
1431};
1432static struct msm_bus_scale_pdata dtv_bus_scale_pdata = {
1433 dtv_bus_scale_usecases,
1434 ARRAY_SIZE(dtv_bus_scale_usecases),
1435 .name = "dtv",
1436};
1437
1438static struct lcdc_platform_data dtv_pdata = {
1439 .bus_scale_table = &dtv_bus_scale_pdata,
1440};
1441#endif
1442
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001443static void __init msm_fb_add_devices(void)
1444{
1445 if (machine_is_msm8x60_rumi3()) {
1446 msm_fb_register_device("mdp", NULL);
1447 mipi_dsi_pdata.target_type = 1;
1448 } else
1449 msm_fb_register_device("mdp", &mdp_pdata);
1450 msm_fb_register_device("mipi_dsi", &mipi_dsi_pdata);
Ravishangar Kalyanam882930f2011-07-08 17:51:52 -07001451#ifdef CONFIG_MSM_BUS_SCALING
1452 msm_fb_register_device("dtv", &dtv_pdata);
1453#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001454}
1455
Ravishangar Kalyanamba99e512011-07-20 12:57:19 -07001456static struct gpiomux_setting mdp_vsync_suspend_cfg = {
1457 .func = GPIOMUX_FUNC_GPIO,
1458 .drv = GPIOMUX_DRV_2MA,
1459 .pull = GPIOMUX_PULL_DOWN,
1460};
1461
1462static struct gpiomux_setting mdp_vsync_active_cfg = {
1463 .func = GPIOMUX_FUNC_1,
1464 .drv = GPIOMUX_DRV_2MA,
1465 .pull = GPIOMUX_PULL_DOWN,
1466};
1467
1468static struct msm_gpiomux_config msm8960_mdp_vsync_configs[] __initdata = {
1469 {
1470 .gpio = MDP_VSYNC_GPIO,
1471 .settings = {
1472 [GPIOMUX_ACTIVE] = &mdp_vsync_active_cfg,
1473 [GPIOMUX_SUSPENDED] = &mdp_vsync_suspend_cfg,
1474 },
1475 }
1476};
1477
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001478#ifdef CONFIG_FB_MSM_HDMI_MSM_PANEL
1479static struct gpiomux_setting hdmi_suspend_cfg = {
1480 .func = GPIOMUX_FUNC_GPIO,
1481 .drv = GPIOMUX_DRV_2MA,
1482 .pull = GPIOMUX_PULL_DOWN,
1483};
1484
1485static struct gpiomux_setting hdmi_active_1_cfg = {
1486 .func = GPIOMUX_FUNC_1,
1487 .drv = GPIOMUX_DRV_2MA,
1488 .pull = GPIOMUX_PULL_UP,
1489};
1490
1491static struct gpiomux_setting hdmi_active_2_cfg = {
1492 .func = GPIOMUX_FUNC_1,
1493 .drv = GPIOMUX_DRV_2MA,
1494 .pull = GPIOMUX_PULL_DOWN,
1495};
1496
1497static struct msm_gpiomux_config msm8960_hdmi_configs[] __initdata = {
1498 {
1499 .gpio = 99,
1500 .settings = {
1501 [GPIOMUX_ACTIVE] = &hdmi_active_1_cfg,
1502 [GPIOMUX_SUSPENDED] = &hdmi_suspend_cfg,
1503 },
1504 },
1505 {
1506 .gpio = 100,
1507 .settings = {
1508 [GPIOMUX_ACTIVE] = &hdmi_active_1_cfg,
1509 [GPIOMUX_SUSPENDED] = &hdmi_suspend_cfg,
1510 },
1511 },
1512 {
1513 .gpio = 101,
1514 .settings = {
1515 [GPIOMUX_ACTIVE] = &hdmi_active_1_cfg,
1516 [GPIOMUX_SUSPENDED] = &hdmi_suspend_cfg,
1517 },
1518 },
1519 {
1520 .gpio = 102,
1521 .settings = {
1522 [GPIOMUX_ACTIVE] = &hdmi_active_2_cfg,
1523 [GPIOMUX_SUSPENDED] = &hdmi_suspend_cfg,
1524 },
1525 },
1526};
1527
1528static int hdmi_enable_5v(int on)
1529{
1530 /* TBD: PM8921 regulator instead of 8901 */
1531 static struct regulator *reg_8921_hdmi_mvs; /* HDMI_5V */
1532 static int prev_on;
1533 int rc;
1534
1535 if (on == prev_on)
1536 return 0;
1537
1538 if (!reg_8921_hdmi_mvs)
1539 reg_8921_hdmi_mvs = regulator_get(&hdmi_msm_device.dev,
1540 "hdmi_mvs");
1541
1542 if (on) {
1543 rc = regulator_enable(reg_8921_hdmi_mvs);
1544 if (rc) {
1545 pr_err("'%s' regulator enable failed, rc=%d\n",
1546 "8921_hdmi_mvs", rc);
1547 return rc;
1548 }
1549 pr_debug("%s(on): success\n", __func__);
1550 } else {
1551 rc = regulator_disable(reg_8921_hdmi_mvs);
1552 if (rc)
1553 pr_warning("'%s' regulator disable failed, rc=%d\n",
1554 "8921_hdmi_mvs", rc);
1555 pr_debug("%s(off): success\n", __func__);
1556 }
1557
1558 prev_on = on;
1559
1560 return 0;
1561}
1562
1563static int hdmi_core_power(int on, int show)
1564{
1565 static struct regulator *reg_8921_l23, *reg_8921_s4;
1566 static int prev_on;
1567 int rc;
1568
1569 if (on == prev_on)
1570 return 0;
1571
1572 /* TBD: PM8921 regulator instead of 8901 */
1573 if (!reg_8921_l23)
1574 reg_8921_l23 = regulator_get(&hdmi_msm_device.dev, "hdmi_avdd");
1575
1576 if (!reg_8921_s4)
1577 reg_8921_s4 = regulator_get(&hdmi_msm_device.dev, "hdmi_vcc");
1578
1579 if (on) {
1580 rc = regulator_set_optimum_mode(reg_8921_l23, 100000);
1581 if (rc < 0) {
1582 pr_err("set_optimum_mode l23 failed, rc=%d\n", rc);
1583 return -EINVAL;
1584 }
1585
1586 rc = regulator_set_voltage(reg_8921_l23, 1800000, 1800000);
1587 if (!rc)
1588 rc = regulator_enable(reg_8921_l23);
1589 if (rc) {
1590 pr_err("'%s' regulator enable failed, rc=%d\n",
1591 "hdmi_avdd", rc);
1592 return rc;
1593 }
1594 rc = regulator_set_voltage(reg_8921_s4, 1800000, 1800000);
1595 if (!rc)
1596 rc = regulator_enable(reg_8921_s4);
1597 if (rc) {
1598 pr_err("'%s' regulator enable failed, rc=%d\n",
1599 "hdmi_vcc", rc);
1600 return rc;
1601 }
1602
1603 rc = gpio_request(100, "HDMI_DDC_CLK");
1604 if (rc) {
1605 pr_err("'%s'(%d) gpio_request failed, rc=%d\n",
1606 "HDMI_DDC_CLK", 100, rc);
1607 goto error1;
1608 }
1609 rc = gpio_request(101, "HDMI_DDC_DATA");
1610 if (rc) {
1611 pr_err("'%s'(%d) gpio_request failed, rc=%d\n",
1612 "HDMI_DDC_DATA", 101, rc);
1613 goto error2;
1614 }
1615 rc = gpio_request(102, "HDMI_HPD");
1616 if (rc) {
1617 pr_err("'%s'(%d) gpio_request failed, rc=%d\n",
1618 "HDMI_HPD", 102, rc);
1619 goto error3;
1620 }
1621 pr_debug("%s(on): success\n", __func__);
1622 } else {
1623 gpio_free(100);
1624 gpio_free(101);
1625 gpio_free(102);
1626
1627 rc = regulator_set_optimum_mode(reg_8921_l23, 100);
1628 if (rc < 0) {
1629 pr_err("set_optimum_mode l23 failed, rc=%d\n", rc);
1630 return -EINVAL;
1631 }
1632
1633 pr_debug("%s(off): success\n", __func__);
1634 }
1635
1636 prev_on = on;
1637
1638 return 0;
1639
1640error3:
1641 gpio_free(101);
1642error2:
1643 gpio_free(100);
1644error1:
1645 regulator_disable(reg_8921_l23);
1646 return rc;
1647}
1648
1649static int hdmi_cec_power(int on)
1650{
1651 static int prev_on;
1652 int rc;
1653
1654 if (on == prev_on)
1655 return 0;
1656
1657 if (on) {
1658 rc = gpio_request(99, "HDMI_CEC_VAR");
1659 if (rc) {
1660 pr_err("'%s'(%d) gpio_request failed, rc=%d\n",
1661 "HDMI_CEC_VAR", 99, rc);
1662 goto error;
1663 }
1664 pr_debug("%s(on): success\n", __func__);
1665 } else {
1666 gpio_free(99);
1667 pr_debug("%s(off): success\n", __func__);
1668 }
1669
1670 prev_on = on;
1671
1672 return 0;
1673error:
1674 return rc;
1675}
1676#endif /* CONFIG_FB_MSM_HDMI_MSM_PANEL */
1677
1678static void __init msm8960_allocate_memory_regions(void)
1679{
1680 void *addr;
1681 unsigned long size;
1682
1683 size = MSM_FB_SIZE;
1684 addr = alloc_bootmem_align(size, 0x1000);
1685 msm_fb_resources[0].start = __pa(addr);
1686 msm_fb_resources[0].end = msm_fb_resources[0].start + size - 1;
1687 pr_info("allocating %lu bytes at %p (%lx physical) for fb\n",
1688 size, addr, __pa(addr));
1689
1690}
1691#ifdef CONFIG_WCD9310_CODEC
1692
1693#define TABLA_INTERRUPT_BASE (NR_MSM_IRQS + NR_GPIO_IRQS + NR_PM8921_IRQS)
1694
Patrick Lai3043fba2011-08-01 14:15:57 -07001695/* Micbias setting is based on 8660 CDP/MTP/FLUID requirement
1696 * 4 micbiases are used to power various analog and digital
1697 * microphones operating at 1800 mV. Technically, all micbiases
1698 * can source from single cfilter since all microphones operate
1699 * at the same voltage level. The arrangement below is to make
1700 * sure all cfilters are exercised. LDO_H regulator ouput level
1701 * does not need to be as high as 2.85V. It is choosen for
1702 * microphone sensitivity purpose.
1703 */
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001704static struct tabla_pdata tabla_platform_data = {
1705 .slimbus_slave_device = {
1706 .name = "tabla-slave",
1707 .e_addr = {0, 0, 0x10, 0, 0x17, 2},
1708 },
1709 .irq = MSM_GPIO_TO_INT(62),
1710 .irq_base = TABLA_INTERRUPT_BASE,
1711 .num_irqs = NR_TABLA_IRQS,
1712 .reset_gpio = PM8921_GPIO_PM_TO_SYS(34),
Patrick Lai3043fba2011-08-01 14:15:57 -07001713 .micbias = {
1714 .ldoh_v = TABLA_LDOH_2P85_V,
1715 .cfilt1_mv = 1800,
1716 .cfilt2_mv = 1800,
1717 .cfilt3_mv = 1800,
1718 .bias1_cfilt_sel = TABLA_CFILT1_SEL,
1719 .bias2_cfilt_sel = TABLA_CFILT2_SEL,
1720 .bias3_cfilt_sel = TABLA_CFILT3_SEL,
1721 .bias4_cfilt_sel = TABLA_CFILT3_SEL,
1722 }
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001723};
1724
1725static struct slim_device msm_slim_tabla = {
1726 .name = "tabla-slim",
1727 .e_addr = {0, 1, 0x10, 0, 0x17, 2},
1728 .dev = {
1729 .platform_data = &tabla_platform_data,
1730 },
1731};
1732#endif
1733
1734static struct slim_boardinfo msm_slim_devices[] = {
1735#ifdef CONFIG_WCD9310_CODEC
1736 {
1737 .bus_num = 1,
1738 .slim_slave = &msm_slim_tabla,
1739 },
1740#endif
1741 /* add more slimbus slaves as needed */
1742};
1743
Yunsen Wang5c1a7392011-07-09 19:10:16 -07001744#define MSM_WCNSS_PHYS 0x03000000
1745#define MSM_WCNSS_SIZE 0x280000
1746
1747static struct resource resources_wcnss_wlan[] = {
1748 {
1749 .start = RIVA_APPS_WLAN_RX_DATA_AVAIL_IRQ,
1750 .end = RIVA_APPS_WLAN_RX_DATA_AVAIL_IRQ,
1751 .name = "wcnss_wlanrx_irq",
1752 .flags = IORESOURCE_IRQ,
1753 },
1754 {
1755 .start = RIVA_APPS_WLAN_DATA_XFER_DONE_IRQ,
1756 .end = RIVA_APPS_WLAN_DATA_XFER_DONE_IRQ,
1757 .name = "wcnss_wlantx_irq",
1758 .flags = IORESOURCE_IRQ,
1759 },
1760 {
1761 .start = MSM_WCNSS_PHYS,
1762 .end = MSM_WCNSS_PHYS + MSM_WCNSS_SIZE - 1,
1763 .name = "wcnss_mmio",
1764 .flags = IORESOURCE_MEM,
1765 },
1766};
1767
Ankur Nandwanib0039b02011-08-09 14:00:45 -07001768static struct qcom_wcnss_opts qcom_wcnss_pdata = {
1769 .has_48mhz_xo = 1,
1770};
1771
Yunsen Wang5c1a7392011-07-09 19:10:16 -07001772static struct platform_device msm_device_wcnss_wlan = {
1773 .name = "wcnss_wlan",
1774 .id = 0,
1775 .num_resources = ARRAY_SIZE(resources_wcnss_wlan),
1776 .resource = resources_wcnss_wlan,
Ankur Nandwanib0039b02011-08-09 14:00:45 -07001777 .dev = {.platform_data = &qcom_wcnss_pdata},
Yunsen Wang5c1a7392011-07-09 19:10:16 -07001778};
1779
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001780#if defined(CONFIG_CRYPTO_DEV_QCRYPTO) || \
1781 defined(CONFIG_CRYPTO_DEV_QCRYPTO_MODULE) || \
1782 defined(CONFIG_CRYPTO_DEV_QCEDEV) || \
1783 defined(CONFIG_CRYPTO_DEV_QCEDEV_MODULE)
1784
1785#define QCE_SIZE 0x10000
1786#define QCE_0_BASE 0x18500000
1787
1788#define QCE_HW_KEY_SUPPORT 0
1789#define QCE_SHA_HMAC_SUPPORT 1
1790#define QCE_SHARE_CE_RESOURCE 1
1791#define QCE_CE_SHARED 0
1792
1793static struct resource qcrypto_resources[] = {
1794 [0] = {
1795 .start = QCE_0_BASE,
1796 .end = QCE_0_BASE + QCE_SIZE - 1,
1797 .flags = IORESOURCE_MEM,
1798 },
1799 [1] = {
1800 .name = "crypto_channels",
1801 .start = DMOV_CE_IN_CHAN,
1802 .end = DMOV_CE_OUT_CHAN,
1803 .flags = IORESOURCE_DMA,
1804 },
1805 [2] = {
1806 .name = "crypto_crci_in",
1807 .start = DMOV_CE_IN_CRCI,
1808 .end = DMOV_CE_IN_CRCI,
1809 .flags = IORESOURCE_DMA,
1810 },
1811 [3] = {
1812 .name = "crypto_crci_out",
1813 .start = DMOV_CE_OUT_CRCI,
1814 .end = DMOV_CE_OUT_CRCI,
1815 .flags = IORESOURCE_DMA,
1816 },
1817};
1818
1819static struct resource qcedev_resources[] = {
1820 [0] = {
1821 .start = QCE_0_BASE,
1822 .end = QCE_0_BASE + QCE_SIZE - 1,
1823 .flags = IORESOURCE_MEM,
1824 },
1825 [1] = {
1826 .name = "crypto_channels",
1827 .start = DMOV_CE_IN_CHAN,
1828 .end = DMOV_CE_OUT_CHAN,
1829 .flags = IORESOURCE_DMA,
1830 },
1831 [2] = {
1832 .name = "crypto_crci_in",
1833 .start = DMOV_CE_IN_CRCI,
1834 .end = DMOV_CE_IN_CRCI,
1835 .flags = IORESOURCE_DMA,
1836 },
1837 [3] = {
1838 .name = "crypto_crci_out",
1839 .start = DMOV_CE_OUT_CRCI,
1840 .end = DMOV_CE_OUT_CRCI,
1841 .flags = IORESOURCE_DMA,
1842 },
1843};
1844
1845#endif
1846
1847#if defined(CONFIG_CRYPTO_DEV_QCRYPTO) || \
1848 defined(CONFIG_CRYPTO_DEV_QCRYPTO_MODULE)
1849
1850static struct msm_ce_hw_support qcrypto_ce_hw_suppport = {
1851 .ce_shared = QCE_CE_SHARED,
1852 .shared_ce_resource = QCE_SHARE_CE_RESOURCE,
1853 .hw_key_support = QCE_HW_KEY_SUPPORT,
1854 .sha_hmac = QCE_SHA_HMAC_SUPPORT,
1855};
1856
1857static struct platform_device qcrypto_device = {
1858 .name = "qcrypto",
1859 .id = 0,
1860 .num_resources = ARRAY_SIZE(qcrypto_resources),
1861 .resource = qcrypto_resources,
1862 .dev = {
1863 .coherent_dma_mask = DMA_BIT_MASK(32),
1864 .platform_data = &qcrypto_ce_hw_suppport,
1865 },
1866};
1867#endif
1868
1869#if defined(CONFIG_CRYPTO_DEV_QCEDEV) || \
1870 defined(CONFIG_CRYPTO_DEV_QCEDEV_MODULE)
1871
1872static struct msm_ce_hw_support qcedev_ce_hw_suppport = {
1873 .ce_shared = QCE_CE_SHARED,
1874 .shared_ce_resource = QCE_SHARE_CE_RESOURCE,
1875 .hw_key_support = QCE_HW_KEY_SUPPORT,
1876 .sha_hmac = QCE_SHA_HMAC_SUPPORT,
1877};
1878
1879static struct platform_device qcedev_device = {
1880 .name = "qce",
1881 .id = 0,
1882 .num_resources = ARRAY_SIZE(qcedev_resources),
1883 .resource = qcedev_resources,
1884 .dev = {
1885 .coherent_dma_mask = DMA_BIT_MASK(32),
1886 .platform_data = &qcedev_ce_hw_suppport,
1887 },
1888};
1889#endif
1890
1891
1892static int __init gpiomux_init(void)
1893{
1894 int rc;
1895
1896 rc = msm_gpiomux_init(NR_GPIO_IRQS);
1897 if (rc) {
1898 pr_err(KERN_ERR "msm_gpiomux_init failed %d\n", rc);
1899 return rc;
1900 }
1901
1902 msm_gpiomux_install(msm8960_cam_configs,
1903 ARRAY_SIZE(msm8960_cam_configs));
1904
1905 msm_gpiomux_install(msm8960_gpiomux_configs,
Stepan Moskovchenkod2a45a82011-08-09 17:02:57 -07001906 ARRAY_SIZE(msm8960_gpiomux_configs));
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001907
1908 msm_gpiomux_install(msm8960_gsbi_configs,
1909 ARRAY_SIZE(msm8960_gsbi_configs));
1910
1911 msm_gpiomux_install(msm8960_cyts_configs,
1912 ARRAY_SIZE(msm8960_cyts_configs));
1913
1914 msm_gpiomux_install(msm8960_slimbus_config,
1915 ARRAY_SIZE(msm8960_slimbus_config));
1916
1917 msm_gpiomux_install(msm8960_audio_codec_configs,
1918 ARRAY_SIZE(msm8960_audio_codec_configs));
1919
1920#ifdef CONFIG_FB_MSM_HDMI_MSM_PANEL
1921 msm_gpiomux_install(msm8960_hdmi_configs,
1922 ARRAY_SIZE(msm8960_hdmi_configs));
1923#endif
1924
Ravishangar Kalyanamba99e512011-07-20 12:57:19 -07001925 msm_gpiomux_install(msm8960_mdp_vsync_configs,
1926 ARRAY_SIZE(msm8960_mdp_vsync_configs));
1927
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001928 msm_gpiomux_install(wcnss_5wire_interface,
1929 ARRAY_SIZE(wcnss_5wire_interface));
1930
1931 return 0;
1932}
1933
1934static struct msm_acpu_clock_platform_data msm8960_acpu_clock_data = {
1935 .acpu_switch_time_us = 0,
1936 .vdd_switch_time_us = 0,
1937};
1938
1939#define MSM_SHARED_RAM_PHYS 0x80000000
1940
1941static struct pm8921_adc_amux pm8921_adc_channels_data[] = {
1942 {"vcoin", CHANNEL_VCOIN, CHAN_PATH_SCALING2, AMUX_RSV1,
1943 ADC_DECIMATION_TYPE2, ADC_SCALE_DEFAULT},
1944 {"vbat", CHANNEL_VBAT, CHAN_PATH_SCALING2, AMUX_RSV1,
1945 ADC_DECIMATION_TYPE2, ADC_SCALE_DEFAULT},
1946 {"dcin", CHANNEL_DCIN, CHAN_PATH_SCALING4, AMUX_RSV1,
1947 ADC_DECIMATION_TYPE2, ADC_SCALE_DEFAULT},
1948 {"ichg", CHANNEL_ICHG, CHAN_PATH_SCALING1, AMUX_RSV1,
1949 ADC_DECIMATION_TYPE2, ADC_SCALE_DEFAULT},
1950 {"vph_pwr", CHANNEL_VPH_PWR, CHAN_PATH_SCALING2, AMUX_RSV1,
1951 ADC_DECIMATION_TYPE2, ADC_SCALE_DEFAULT},
1952 {"ibat", CHANNEL_IBAT, CHAN_PATH_SCALING1, AMUX_RSV1,
1953 ADC_DECIMATION_TYPE2, ADC_SCALE_DEFAULT},
1954 {"m4", CHANNEL_MPP_1, CHAN_PATH_SCALING1, AMUX_RSV1,
1955 ADC_DECIMATION_TYPE2, ADC_SCALE_DEFAULT},
1956 {"m5", CHANNEL_MPP_2, CHAN_PATH_SCALING2, AMUX_RSV1,
1957 ADC_DECIMATION_TYPE2, ADC_SCALE_DEFAULT},
1958 {"batt_therm", CHANNEL_BATT_THERM, CHAN_PATH_SCALING1, AMUX_RSV2,
1959 ADC_DECIMATION_TYPE2, ADC_SCALE_BATT_THERM},
1960 {"batt_id", CHANNEL_BATT_ID, CHAN_PATH_SCALING1, AMUX_RSV1,
1961 ADC_DECIMATION_TYPE2, ADC_SCALE_DEFAULT},
1962 {"usbin", CHANNEL_USBIN, CHAN_PATH_SCALING3, AMUX_RSV1,
1963 ADC_DECIMATION_TYPE2, ADC_SCALE_DEFAULT},
1964 {"pmic_therm", CHANNEL_DIE_TEMP, CHAN_PATH_SCALING1, AMUX_RSV1,
1965 ADC_DECIMATION_TYPE2, ADC_SCALE_PMIC_THERM},
1966 {"625mv", CHANNEL_625MV, CHAN_PATH_SCALING1, AMUX_RSV1,
1967 ADC_DECIMATION_TYPE2, ADC_SCALE_DEFAULT},
1968 {"125v", CHANNEL_125V, CHAN_PATH_SCALING1, AMUX_RSV1,
1969 ADC_DECIMATION_TYPE2, ADC_SCALE_DEFAULT},
1970 {"chg_temp", CHANNEL_CHG_TEMP, CHAN_PATH_SCALING1, AMUX_RSV1,
1971 ADC_DECIMATION_TYPE2, ADC_SCALE_DEFAULT},
1972};
1973
1974static struct pm8921_adc_properties pm8921_adc_data = {
1975 .adc_vdd_reference = 1800, /* milli-voltage for this adc */
1976 .bitresolution = 15,
1977 .bipolar = 0,
1978};
1979
1980static struct pm8921_adc_platform_data pm8921_adc_pdata = {
1981 .adc_channel = pm8921_adc_channels_data,
1982 .adc_num_channel = ARRAY_SIZE(pm8921_adc_channels_data),
1983 .adc_prop = &pm8921_adc_data,
1984};
Stepan Moskovchenkod056fca2011-01-27 12:12:07 -08001985
Stepan Moskovchenkof441ca22010-12-01 19:31:16 -08001986static void __init msm8960_map_io(void)
1987{
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001988 msm_shared_ram_phys = MSM_SHARED_RAM_PHYS;
Stepan Moskovchenkof441ca22010-12-01 19:31:16 -08001989 msm_map_msm8960_io();
1990}
1991
1992static void __init msm8960_init_irq(void)
1993{
1994 unsigned int i;
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001995
1996 msm_mpm_irq_extn_init();
Stepan Moskovchenkof441ca22010-12-01 19:31:16 -08001997 gic_init(0, GIC_PPI_START, MSM_QGIC_DIST_BASE,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001998 (void *)MSM_QGIC_CPU_BASE);
Stepan Moskovchenkof441ca22010-12-01 19:31:16 -08001999
2000 /* Edge trigger PPIs except AVS_SVICINT and AVS_SVICINTSWDONE */
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002001 writel_relaxed(0xFFFFD7FF, MSM_QGIC_DIST_BASE + GIC_DIST_CONFIG + 4);
Stepan Moskovchenkof441ca22010-12-01 19:31:16 -08002002
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002003 writel_relaxed(0x0000FFFF, MSM_QGIC_DIST_BASE + GIC_DIST_ENABLE_SET);
2004 mb();
Stepan Moskovchenko50ede4e2010-12-13 18:12:19 -08002005
Stepan Moskovchenkof441ca22010-12-01 19:31:16 -08002006 /* FIXME: Not installing AVS_SVICINT and AVS_SVICINTSWDONE yet
2007 * as they are configured as level, which does not play nice with
2008 * handle_percpu_irq.
2009 */
2010 for (i = GIC_PPI_START; i < GIC_SPI_START; i++) {
2011 if (i != AVS_SVICINT && i != AVS_SVICINTSWDONE)
Thomas Gleixner6845664a2011-03-24 13:25:22 +01002012 irq_set_handler(i, handle_percpu_irq);
Stepan Moskovchenkof441ca22010-12-01 19:31:16 -08002013 }
2014}
2015
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002016/* MSM8960 have 5 SDCC controllers */
2017enum sdcc_controllers {
2018 SDCC1,
2019 SDCC2,
2020 SDCC3,
2021 SDCC4,
2022 SDCC5,
2023 MAX_SDCC_CONTROLLER
2024};
2025
2026/* All SDCC controllers requires VDD/VCC voltage */
2027static struct msm_mmc_reg_data mmc_vdd_reg_data[MAX_SDCC_CONTROLLER] = {
2028 /* SDCC1 : eMMC card connected */
2029 [SDCC1] = {
2030 .name = "sdc_vdd",
2031 .set_voltage_sup = 1,
Subhash Jadavani99ba53a2011-08-01 16:04:18 +05302032 .high_vol_level = 2950000,
2033 .low_vol_level = 2950000,
Subhash Jadavanidd7ef892011-08-18 16:49:57 +05302034 .always_on = 1,
2035 .lpm_sup = 1,
2036 .lpm_uA = 9000,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002037 .hpm_uA = 200000, /* 200mA */
2038 },
2039 /* SDCC3 : External card slot connected */
2040 [SDCC3] = {
2041 .name = "sdc_vdd",
2042 .set_voltage_sup = 1,
Subhash Jadavani99ba53a2011-08-01 16:04:18 +05302043 .high_vol_level = 2950000,
2044 .low_vol_level = 2950000,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002045 .hpm_uA = 600000, /* 600mA */
2046 }
2047};
2048
2049/* Only slots having eMMC card will require VCCQ voltage */
2050static struct msm_mmc_reg_data mmc_vccq_reg_data[1] = {
2051 /* SDCC1 : eMMC card connected */
2052 [SDCC1] = {
2053 .name = "sdc_vccq",
2054 .set_voltage_sup = 1,
2055 .always_on = 1,
Subhash Jadavani99ba53a2011-08-01 16:04:18 +05302056 .high_vol_level = 1800000,
2057 .low_vol_level = 1800000,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002058 .hpm_uA = 200000, /* 200mA */
2059 }
2060};
2061
2062/* All SDCC controllers may require voting for VDD PAD voltage */
2063static struct msm_mmc_reg_data mmc_vddp_reg_data[MAX_SDCC_CONTROLLER] = {
2064 /* SDCC3 : External card slot connected */
2065 [SDCC3] = {
2066 .name = "sdc_vddp",
2067 .set_voltage_sup = 1,
Subhash Jadavani99ba53a2011-08-01 16:04:18 +05302068 .high_vol_level = 2950000,
2069 .low_vol_level = 1850000,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002070 .always_on = 1,
2071 .lpm_sup = 1,
2072 /* Max. Active current required is 16 mA */
2073 .hpm_uA = 16000,
2074 /*
2075 * Sleep current required is ~300 uA. But min. vote can be
2076 * in terms of mA (min. 1 mA). So let's vote for 2 mA
2077 * during sleep.
2078 */
2079 .lpm_uA = 2000,
2080 }
2081};
2082
2083static struct msm_mmc_slot_reg_data mmc_slot_vreg_data[MAX_SDCC_CONTROLLER] = {
2084 /* SDCC1 : eMMC card connected */
2085 [SDCC1] = {
2086 .vdd_data = &mmc_vdd_reg_data[SDCC1],
2087 .vccq_data = &mmc_vccq_reg_data[SDCC1],
2088 },
2089 /* SDCC3 : External card slot connected */
2090 [SDCC3] = {
2091 .vdd_data = &mmc_vdd_reg_data[SDCC3],
2092 .vddp_data = &mmc_vddp_reg_data[SDCC3],
2093 }
2094};
2095
2096/* SDC1 pad data */
2097static struct msm_mmc_pad_drv sdc1_pad_drv_on_cfg[] = {
2098 {TLMM_HDRV_SDC1_CLK, GPIO_CFG_16MA},
Subhash Jadavani87bda5a2011-08-30 17:40:44 +05302099 {TLMM_HDRV_SDC1_CMD, GPIO_CFG_10MA},
2100 {TLMM_HDRV_SDC1_DATA, GPIO_CFG_10MA}
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002101};
2102
2103static struct msm_mmc_pad_drv sdc1_pad_drv_off_cfg[] = {
2104 {TLMM_HDRV_SDC1_CLK, GPIO_CFG_2MA},
2105 {TLMM_HDRV_SDC1_CMD, GPIO_CFG_2MA},
2106 {TLMM_HDRV_SDC1_DATA, GPIO_CFG_2MA}
2107};
2108
2109static struct msm_mmc_pad_pull sdc1_pad_pull_on_cfg[] = {
2110 {TLMM_PULL_SDC1_CMD, GPIO_CFG_PULL_UP},
2111 {TLMM_PULL_SDC1_DATA, GPIO_CFG_PULL_UP}
2112};
2113
2114static struct msm_mmc_pad_pull sdc1_pad_pull_off_cfg[] = {
2115 {TLMM_PULL_SDC1_CMD, GPIO_CFG_PULL_DOWN},
2116 {TLMM_PULL_SDC1_DATA, GPIO_CFG_PULL_DOWN}
2117};
2118
2119/* SDC3 pad data */
2120static struct msm_mmc_pad_drv sdc3_pad_drv_on_cfg[] = {
2121 {TLMM_HDRV_SDC3_CLK, GPIO_CFG_8MA},
2122 {TLMM_HDRV_SDC3_CMD, GPIO_CFG_8MA},
2123 {TLMM_HDRV_SDC3_DATA, GPIO_CFG_8MA}
2124};
2125
2126static struct msm_mmc_pad_drv sdc3_pad_drv_off_cfg[] = {
2127 {TLMM_HDRV_SDC3_CLK, GPIO_CFG_2MA},
2128 {TLMM_HDRV_SDC3_CMD, GPIO_CFG_2MA},
2129 {TLMM_HDRV_SDC3_DATA, GPIO_CFG_2MA}
2130};
2131
2132static struct msm_mmc_pad_pull sdc3_pad_pull_on_cfg[] = {
2133 {TLMM_PULL_SDC3_CMD, GPIO_CFG_PULL_UP},
2134 {TLMM_PULL_SDC3_DATA, GPIO_CFG_PULL_UP}
2135};
2136
2137static struct msm_mmc_pad_pull sdc3_pad_pull_off_cfg[] = {
2138 {TLMM_PULL_SDC3_CMD, GPIO_CFG_PULL_DOWN},
2139 {TLMM_PULL_SDC3_DATA, GPIO_CFG_PULL_DOWN}
2140};
2141
2142struct msm_mmc_pad_pull_data mmc_pad_pull_data[MAX_SDCC_CONTROLLER] = {
2143 [SDCC1] = {
2144 .on = sdc1_pad_pull_on_cfg,
2145 .off = sdc1_pad_pull_off_cfg,
2146 .size = ARRAY_SIZE(sdc1_pad_pull_on_cfg)
2147 },
2148 [SDCC3] = {
2149 .on = sdc3_pad_pull_on_cfg,
2150 .off = sdc3_pad_pull_off_cfg,
2151 .size = ARRAY_SIZE(sdc3_pad_pull_on_cfg)
2152 },
2153};
2154
2155struct msm_mmc_pad_drv_data mmc_pad_drv_data[MAX_SDCC_CONTROLLER] = {
2156 [SDCC1] = {
2157 .on = sdc1_pad_drv_on_cfg,
2158 .off = sdc1_pad_drv_off_cfg,
2159 .size = ARRAY_SIZE(sdc1_pad_drv_on_cfg)
2160 },
2161 [SDCC3] = {
2162 .on = sdc3_pad_drv_on_cfg,
2163 .off = sdc3_pad_drv_off_cfg,
2164 .size = ARRAY_SIZE(sdc3_pad_drv_on_cfg)
2165 },
2166};
2167
2168struct msm_mmc_pad_data mmc_pad_data[MAX_SDCC_CONTROLLER] = {
2169 [SDCC1] = {
2170 .pull = &mmc_pad_pull_data[SDCC1],
2171 .drv = &mmc_pad_drv_data[SDCC1]
2172 },
2173 [SDCC3] = {
2174 .pull = &mmc_pad_pull_data[SDCC3],
2175 .drv = &mmc_pad_drv_data[SDCC3]
2176 },
2177};
2178
2179struct msm_mmc_pin_data mmc_slot_pin_data[MAX_SDCC_CONTROLLER] = {
2180 [SDCC1] = {
2181 .pad_data = &mmc_pad_data[SDCC1],
2182 },
2183 [SDCC3] = {
2184 .pad_data = &mmc_pad_data[SDCC3],
2185 },
2186};
2187
2188static unsigned int sdc1_sup_clk_rates[] = {
Subhash Jadavani0e027b72011-08-30 17:40:55 +05302189 400000, 24000000, 48000000
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002190};
2191
2192static unsigned int sdc3_sup_clk_rates[] = {
2193 400000, 24000000, 48000000, 96000000
2194};
2195
2196#ifdef CONFIG_MMC_MSM_SDC1_SUPPORT
2197static struct mmc_platform_data msm8960_sdc1_data = {
2198 .ocr_mask = MMC_VDD_27_28 | MMC_VDD_28_29,
2199#ifdef CONFIG_MMC_MSM_SDC1_8_BIT_SUPPORT
2200 .mmc_bus_width = MMC_CAP_8_BIT_DATA,
2201#else
2202 .mmc_bus_width = MMC_CAP_4_BIT_DATA,
2203#endif
2204 .sup_clk_table = sdc1_sup_clk_rates,
2205 .sup_clk_cnt = ARRAY_SIZE(sdc1_sup_clk_rates),
2206 .nonremovable = 1,
2207 .sdcc_v4_sup = true,
2208 .vreg_data = &mmc_slot_vreg_data[SDCC1],
Subhash Jadavani0e027b72011-08-30 17:40:55 +05302209 .pin_data = &mmc_slot_pin_data[SDCC1]
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002210};
2211#endif
2212
2213#ifdef CONFIG_MMC_MSM_SDC3_SUPPORT
2214static struct mmc_platform_data msm8960_sdc3_data = {
2215 .ocr_mask = MMC_VDD_27_28 | MMC_VDD_28_29,
2216 .mmc_bus_width = MMC_CAP_4_BIT_DATA,
2217 .sup_clk_table = sdc3_sup_clk_rates,
2218 .sup_clk_cnt = ARRAY_SIZE(sdc3_sup_clk_rates),
2219 .wpswitch_gpio = PM8921_GPIO_PM_TO_SYS(16),
2220 .sdcc_v4_sup = true,
2221 .vreg_data = &mmc_slot_vreg_data[SDCC3],
2222 .pin_data = &mmc_slot_pin_data[SDCC3],
2223#ifdef CONFIG_MMC_MSM_CARD_HW_DETECTION
2224 .status_gpio = PM8921_GPIO_PM_TO_SYS(26),
2225 .status_irq = PM8921_GPIO_IRQ(PM8921_IRQ_BASE, 26),
2226 .irq_flags = IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING,
2227#endif
2228 .xpc_cap = 1,
2229 .uhs_caps = (MMC_CAP_UHS_SDR12 | MMC_CAP_UHS_SDR25 |
2230 MMC_CAP_UHS_SDR50 | MMC_CAP_UHS_DDR50 |
Subhash Jadavani0e027b72011-08-30 17:40:55 +05302231 MMC_CAP_MAX_CURRENT_600)
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002232};
2233#endif
2234
2235static void __init msm8960_init_mmc(void)
2236{
2237#ifdef CONFIG_MMC_MSM_SDC1_SUPPORT
2238 /* SDC1 : eMMC card connected */
2239 msm_add_sdcc(1, &msm8960_sdc1_data);
2240#endif
2241#ifdef CONFIG_MMC_MSM_SDC3_SUPPORT
2242 /* SDC3: External card slot */
2243 msm_add_sdcc(3, &msm8960_sdc3_data);
2244#endif
2245}
2246
2247static void __init msm8960_init_buses(void)
2248{
2249#ifdef CONFIG_MSM_BUS_SCALING
2250 msm_bus_apps_fabric_pdata.rpm_enabled = 1;
2251 msm_bus_sys_fabric_pdata.rpm_enabled = 1;
2252 msm_bus_mm_fabric_pdata.rpm_enabled = 1;
2253 msm_bus_sys_fpb_pdata.rpm_enabled = 1;
2254 msm_bus_cpss_fpb_pdata.rpm_enabled = 1;
2255 msm_bus_apps_fabric.dev.platform_data = &msm_bus_apps_fabric_pdata;
2256 msm_bus_sys_fabric.dev.platform_data = &msm_bus_sys_fabric_pdata;
2257 msm_bus_mm_fabric.dev.platform_data = &msm_bus_mm_fabric_pdata;
2258 msm_bus_sys_fpb.dev.platform_data = &msm_bus_sys_fpb_pdata;
2259 msm_bus_cpss_fpb.dev.platform_data = &msm_bus_cpss_fpb_pdata;
2260#endif
2261}
2262
2263static struct msm_spi_platform_data msm8960_qup_spi_gsbi1_pdata = {
2264 .max_clock_speed = 15060000,
2265};
2266
2267#ifdef CONFIG_USB_MSM_OTG_72K
2268static struct msm_otg_platform_data msm_otg_pdata;
2269#else
2270#define USB_5V_EN 42
2271static void msm_hsusb_vbus_power(bool on)
2272{
2273 int rc;
2274 static bool vbus_is_on;
2275 static struct regulator *mvs_otg_switch;
2276 struct pm_gpio param = {
2277 .direction = PM_GPIO_DIR_OUT,
2278 .output_buffer = PM_GPIO_OUT_BUF_CMOS,
2279 .output_value = 1,
2280 .pull = PM_GPIO_PULL_NO,
2281 .vin_sel = PM_GPIO_VIN_S4,
2282 .out_strength = PM_GPIO_STRENGTH_MED,
2283 .function = PM_GPIO_FUNC_NORMAL,
2284 };
2285
2286 if (vbus_is_on == on)
2287 return;
2288
2289 if (on) {
Stepan Moskovchenko14aa6492011-08-08 15:15:01 -07002290 mvs_otg_switch = regulator_get(&msm8960_device_otg.dev,
2291 "vbus_otg");
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002292 if (IS_ERR(mvs_otg_switch)) {
2293 pr_err("Unable to get mvs_otg_switch\n");
2294 return;
2295 }
2296
2297 rc = gpio_request(PM8921_GPIO_PM_TO_SYS(USB_5V_EN),
2298 "usb_5v_en");
2299 if (rc < 0) {
2300 pr_err("failed to request usb_5v_en gpio\n");
2301 goto put_mvs_otg;
2302 }
2303
2304 if (regulator_enable(mvs_otg_switch)) {
2305 pr_err("unable to enable mvs_otg_switch\n");
2306 goto free_usb_5v_en;
2307 }
2308
2309 rc = pm8xxx_gpio_config(PM8921_GPIO_PM_TO_SYS(USB_5V_EN),
2310 &param);
2311 if (rc < 0) {
2312 pr_err("failed to configure usb_5v_en gpio\n");
2313 goto disable_mvs_otg;
2314 }
2315 vbus_is_on = true;
2316 return;
2317 }
2318disable_mvs_otg:
2319 regulator_disable(mvs_otg_switch);
2320free_usb_5v_en:
2321 gpio_free(PM8921_GPIO_PM_TO_SYS(USB_5V_EN));
2322put_mvs_otg:
2323 regulator_put(mvs_otg_switch);
2324 vbus_is_on = false;
2325}
2326
2327static struct msm_otg_platform_data msm_otg_pdata = {
2328 .mode = USB_OTG,
2329 .otg_control = OTG_PMIC_CONTROL,
2330 .phy_type = SNPS_28NM_INTEGRATED_PHY,
2331 .pclk_src_name = "dfab_usb_hs_clk",
2332 .pmic_id_irq = PM8921_USB_ID_IN_IRQ(PM8921_IRQ_BASE),
2333 .vbus_power = msm_hsusb_vbus_power,
2334};
2335#endif
2336
2337#define PID_MAGIC_ID 0x71432909
2338#define SERIAL_NUM_MAGIC_ID 0x61945374
2339#define SERIAL_NUMBER_LENGTH 127
2340#define DLOAD_USB_BASE_ADD 0x2A03F0C8
2341
2342struct magic_num_struct {
2343 uint32_t pid;
2344 uint32_t serial_num;
2345};
2346
2347struct dload_struct {
2348 uint32_t reserved1;
2349 uint32_t reserved2;
2350 uint32_t reserved3;
2351 uint16_t reserved4;
2352 uint16_t pid;
2353 char serial_number[SERIAL_NUMBER_LENGTH];
2354 uint16_t reserved5;
2355 struct magic_num_struct magic_struct;
2356};
2357
2358static int usb_diag_update_pid_and_serial_num(uint32_t pid, const char *snum)
2359{
2360 struct dload_struct __iomem *dload = 0;
2361
2362 dload = ioremap(DLOAD_USB_BASE_ADD, sizeof(*dload));
2363 if (!dload) {
2364 pr_err("%s: cannot remap I/O memory region: %08x\n",
2365 __func__, DLOAD_USB_BASE_ADD);
2366 return -ENXIO;
2367 }
2368
2369 pr_debug("%s: dload:%p pid:%x serial_num:%s\n",
2370 __func__, dload, pid, snum);
2371 /* update pid */
2372 dload->magic_struct.pid = PID_MAGIC_ID;
2373 dload->pid = pid;
2374
2375 /* update serial number */
2376 dload->magic_struct.serial_num = 0;
2377 if (!snum) {
2378 memset(dload->serial_number, 0, SERIAL_NUMBER_LENGTH);
2379 goto out;
2380 }
2381
2382 dload->magic_struct.serial_num = SERIAL_NUM_MAGIC_ID;
2383 strncpy(dload->serial_number, snum, SERIAL_NUMBER_LENGTH);
2384 dload->serial_number[SERIAL_NUMBER_LENGTH - 1] = '\0';
2385out:
2386 iounmap(dload);
2387 return 0;
2388}
2389
2390static struct android_usb_platform_data android_usb_pdata = {
2391 .update_pid_and_serial_num = usb_diag_update_pid_and_serial_num,
2392};
2393
Stepan Moskovchenko14aa6492011-08-08 15:15:01 -07002394static struct platform_device android_usb_device = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002395 .name = "android_usb",
2396 .id = -1,
2397 .dev = {
2398 .platform_data = &android_usb_pdata,
2399 },
2400};
2401
2402static uint8_t spm_wfi_cmd_sequence[] __initdata = {
2403 0x03, 0x0f,
2404};
2405
2406static uint8_t spm_power_collapse_without_rpm[] __initdata = {
2407 0x00, 0x24, 0x54, 0x10,
2408 0x09, 0x03, 0x01,
2409 0x10, 0x54, 0x30, 0x0C,
2410 0x24, 0x30, 0x0f,
2411};
2412
2413static uint8_t spm_power_collapse_with_rpm[] __initdata = {
2414 0x00, 0x24, 0x54, 0x10,
2415 0x09, 0x07, 0x01, 0x0B,
2416 0x10, 0x54, 0x30, 0x0C,
2417 0x24, 0x30, 0x0f,
2418};
2419
2420static struct msm_spm_seq_entry msm_spm_seq_list[] __initdata = {
2421 [0] = {
2422 .mode = MSM_SPM_MODE_CLOCK_GATING,
2423 .notify_rpm = false,
2424 .cmd = spm_wfi_cmd_sequence,
2425 },
2426 [1] = {
2427 .mode = MSM_SPM_MODE_POWER_COLLAPSE,
2428 .notify_rpm = false,
2429 .cmd = spm_power_collapse_without_rpm,
2430 },
2431 [2] = {
2432 .mode = MSM_SPM_MODE_POWER_COLLAPSE,
2433 .notify_rpm = true,
2434 .cmd = spm_power_collapse_with_rpm,
2435 },
2436};
2437
2438static struct msm_spm_platform_data msm_spm_data[] __initdata = {
2439 [0] = {
2440 .reg_base_addr = MSM_SAW0_BASE,
2441 .reg_init_values[MSM_SPM_REG_SAW2_SECURE] = 0x00,
2442 .reg_init_values[MSM_SPM_REG_SAW2_CFG] = 0x1F,
2443 .reg_init_values[MSM_SPM_REG_SAW2_VCTL] = 0x9C,
2444#if defined(CONFIG_MSM_AVS_HW)
2445 .reg_init_values[MSM_SPM_REG_SAW2_AVS_CTL] = 0x00,
2446 .reg_init_values[MSM_SPM_REG_SAW2_AVS_HYSTERESIS] = 0x00,
2447#endif
2448 .reg_init_values[MSM_SPM_REG_SAW2_SPM_CTL] = 0x01,
2449 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DLY] = 0x02020202,
2450 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_0] = 0x0060009C,
2451 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_1] = 0x0000001C,
2452 .vctl_timeout_us = 50,
2453 .num_modes = ARRAY_SIZE(msm_spm_seq_list),
2454 .modes = msm_spm_seq_list,
2455 },
2456 [1] = {
2457 .reg_base_addr = MSM_SAW1_BASE,
2458 .reg_init_values[MSM_SPM_REG_SAW2_SECURE] = 0x00,
2459 .reg_init_values[MSM_SPM_REG_SAW2_CFG] = 0x1F,
2460 .reg_init_values[MSM_SPM_REG_SAW2_VCTL] = 0x9C,
2461#if defined(CONFIG_MSM_AVS_HW)
2462 .reg_init_values[MSM_SPM_REG_SAW2_AVS_CTL] = 0x00,
2463 .reg_init_values[MSM_SPM_REG_SAW2_AVS_HYSTERESIS] = 0x00,
2464#endif
2465 .reg_init_values[MSM_SPM_REG_SAW2_SPM_CTL] = 0x01,
2466 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DLY] = 0x02020202,
2467 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_0] = 0x0060009C,
2468 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_1] = 0x0000001C,
2469 .vctl_timeout_us = 50,
2470 .num_modes = ARRAY_SIZE(msm_spm_seq_list),
2471 .modes = msm_spm_seq_list,
2472 },
2473};
2474
2475static uint8_t l2_spm_wfi_cmd_sequence[] __initdata = {
2476 0x00, 0x20, 0x03, 0x20,
2477 0x00, 0x0f,
2478};
2479
2480static uint8_t l2_spm_gdhs_cmd_sequence[] __initdata = {
2481 0x00, 0x20, 0x34, 0x64,
2482 0x48, 0x07, 0x48, 0x20,
2483 0x50, 0x64, 0x04, 0x34,
2484 0x50, 0x0f,
2485};
2486static uint8_t l2_spm_power_off_cmd_sequence[] __initdata = {
2487 0x00, 0x10, 0x34, 0x64,
2488 0x48, 0x07, 0x48, 0x10,
2489 0x50, 0x64, 0x04, 0x34,
2490 0x50, 0x0F,
2491};
2492
2493static struct msm_spm_seq_entry msm_spm_l2_seq_list[] __initdata = {
2494 [0] = {
2495 .mode = MSM_SPM_L2_MODE_RETENTION,
2496 .notify_rpm = false,
2497 .cmd = l2_spm_wfi_cmd_sequence,
2498 },
2499 [1] = {
2500 .mode = MSM_SPM_L2_MODE_GDHS,
2501 .notify_rpm = true,
2502 .cmd = l2_spm_gdhs_cmd_sequence,
2503 },
2504 [2] = {
2505 .mode = MSM_SPM_L2_MODE_POWER_COLLAPSE,
2506 .notify_rpm = true,
2507 .cmd = l2_spm_power_off_cmd_sequence,
2508 },
2509};
2510
2511
2512static struct msm_spm_platform_data msm_spm_l2_data[] __initdata = {
2513 [0] = {
2514 .reg_base_addr = MSM_SAW_L2_BASE,
2515 .reg_init_values[MSM_SPM_REG_SAW2_SECURE] = 0x00,
2516 .reg_init_values[MSM_SPM_REG_SAW2_SPM_CTL] = 0x00,
2517 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DLY] = 0x02020202,
2518 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_0] = 0x00A000AE,
2519 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_1] = 0x00A00020,
2520 .modes = msm_spm_l2_seq_list,
2521 .num_modes = ARRAY_SIZE(msm_spm_l2_seq_list),
2522 },
2523};
2524
2525#define CYTTSP_TS_GPIO_IRQ 11
2526#define CYTTSP_TS_SLEEP_GPIO 50
2527#define CYTTSP_TS_RESOUT_N_GPIO 52
2528
2529/*virtual key support */
2530static ssize_t tma340_vkeys_show(struct kobject *kobj,
2531 struct kobj_attribute *attr, char *buf)
2532{
2533 return snprintf(buf, 200,
2534 __stringify(EV_KEY) ":" __stringify(KEY_BACK) ":73:1120:97:97"
2535 ":" __stringify(EV_KEY) ":" __stringify(KEY_MENU) ":230:1120:97:97"
2536 ":" __stringify(EV_KEY) ":" __stringify(KEY_HOME) ":389:1120:97:97"
2537 ":" __stringify(EV_KEY) ":" __stringify(KEY_SEARCH) ":544:1120:97:97"
2538 "\n");
2539}
2540
2541static struct kobj_attribute tma340_vkeys_attr = {
2542 .attr = {
2543 .mode = S_IRUGO,
2544 },
2545 .show = &tma340_vkeys_show,
2546};
2547
2548static struct attribute *tma340_properties_attrs[] = {
2549 &tma340_vkeys_attr.attr,
2550 NULL
2551};
2552
2553static struct attribute_group tma340_properties_attr_group = {
2554 .attrs = tma340_properties_attrs,
2555};
2556
2557
2558static int cyttsp_platform_init(struct i2c_client *client)
2559{
2560 int rc = 0;
2561 static struct kobject *tma340_properties_kobj;
2562
2563 tma340_vkeys_attr.attr.name = "virtualkeys.cyttsp-i2c";
2564 tma340_properties_kobj = kobject_create_and_add("board_properties",
2565 NULL);
2566 if (tma340_properties_kobj)
2567 rc = sysfs_create_group(tma340_properties_kobj,
2568 &tma340_properties_attr_group);
2569 if (!tma340_properties_kobj || rc)
2570 pr_err("%s: failed to create board_properties\n",
2571 __func__);
2572
2573 return 0;
2574}
2575
2576static struct cyttsp_regulator regulator_data[] = {
2577 {
2578 .name = "vdd",
2579 .min_uV = CY_TMA300_VTG_MIN_UV,
2580 .max_uV = CY_TMA300_VTG_MAX_UV,
2581 .load_uA = CY_TMA300_CURR_24HZ_UA,
2582 },
2583 /* TODO: Remove after runtime PM is enabled in I2C driver */
2584 {
2585 .name = "vcc_i2c",
2586 .min_uV = CY_I2C_VTG_MIN_UV,
2587 .max_uV = CY_I2C_VTG_MAX_UV,
2588 .load_uA = CY_I2C_CURR_UA,
2589 },
2590};
2591
2592static struct cyttsp_platform_data cyttsp_pdata = {
2593 .panel_maxx = 634,
2594 .panel_maxy = 1166,
2595 .disp_maxx = 616,
2596 .disp_maxy = 1023,
2597 .disp_minx = 0,
2598 .disp_miny = 16,
2599 .flags = 0x01,
2600 .gen = CY_GEN3, /* or */
2601 .use_st = CY_USE_ST,
2602 .use_mt = CY_USE_MT,
2603 .use_hndshk = CY_SEND_HNDSHK,
2604 .use_trk_id = CY_USE_TRACKING_ID,
Anirudh Ghayale96f66d2011-08-11 14:06:38 +05302605 .use_sleep = CY_USE_DEEP_SLEEP_SEL | CY_USE_LOW_POWER_SEL,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002606 .use_gestures = CY_USE_GESTURES,
2607 .fw_fname = "cyttsp_8960_cdp.hex",
2608 /* activate up to 4 groups
2609 * and set active distance
2610 */
2611 .gest_set = CY_GEST_GRP1 | CY_GEST_GRP2 |
2612 CY_GEST_GRP3 | CY_GEST_GRP4 |
2613 CY_ACT_DIST,
2614 /* change act_intrvl to customize the Active power state
2615 * scanning/processing refresh interval for Operating mode
2616 */
2617 .act_intrvl = CY_ACT_INTRVL_DFLT,
2618 /* change tch_tmout to customize the touch timeout for the
2619 * Active power state for Operating mode
2620 */
2621 .tch_tmout = CY_TCH_TMOUT_DFLT,
2622 /* change lp_intrvl to customize the Low Power power state
2623 * scanning/processing refresh interval for Operating mode
2624 */
2625 .lp_intrvl = CY_LP_INTRVL_DFLT,
2626 .sleep_gpio = CYTTSP_TS_SLEEP_GPIO,
2627 .resout_gpio = CYTTSP_TS_RESOUT_N_GPIO,
2628 .irq_gpio = CYTTSP_TS_GPIO_IRQ,
2629 .regulator_info = regulator_data,
2630 .num_regulators = ARRAY_SIZE(regulator_data),
2631 .init = cyttsp_platform_init,
Mohan Pallaka49c37d62011-08-01 11:52:00 +05302632 .correct_fw_ver = 9,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002633};
2634
2635static struct i2c_board_info cyttsp_info[] __initdata = {
2636 {
2637 I2C_BOARD_INFO(CY_I2C_NAME, 0x24),
2638 .platform_data = &cyttsp_pdata,
2639#ifndef CY_USE_TIMER
2640 .irq = MSM_GPIO_TO_INT(CYTTSP_TS_GPIO_IRQ),
2641#endif /* CY_USE_TIMER */
2642 },
2643};
2644
2645static void gsbi_qup_i2c_gpio_config(int adap_id, int config_type)
2646{
2647}
2648
2649static struct msm_i2c_platform_data msm8960_i2c_qup_gsbi4_pdata = {
2650 .clk_freq = 100000,
2651 .src_clk_rate = 24000000,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002652 .msm_i2c_config_gpio = gsbi_qup_i2c_gpio_config,
2653};
2654
2655static struct msm_i2c_platform_data msm8960_i2c_qup_gsbi3_pdata = {
2656 .clk_freq = 100000,
2657 .src_clk_rate = 24000000,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002658 .msm_i2c_config_gpio = gsbi_qup_i2c_gpio_config,
2659};
2660
2661static struct msm_i2c_platform_data msm8960_i2c_qup_gsbi10_pdata = {
2662 .clk_freq = 100000,
2663 .src_clk_rate = 24000000,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002664 .msm_i2c_config_gpio = gsbi_qup_i2c_gpio_config,
2665};
2666
2667static struct msm_i2c_platform_data msm8960_i2c_qup_gsbi12_pdata = {
2668 .clk_freq = 100000,
2669 .src_clk_rate = 24000000,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002670 .msm_i2c_config_gpio = gsbi_qup_i2c_gpio_config,
2671};
2672
2673static struct msm_rpm_platform_data msm_rpm_data = {
2674 .reg_base_addrs = {
2675 [MSM_RPM_PAGE_STATUS] = MSM_RPM_BASE,
2676 [MSM_RPM_PAGE_CTRL] = MSM_RPM_BASE + 0x400,
2677 [MSM_RPM_PAGE_REQ] = MSM_RPM_BASE + 0x600,
2678 [MSM_RPM_PAGE_ACK] = MSM_RPM_BASE + 0xa00,
2679 },
2680
2681 .irq_ack = RPM_APCC_CPU0_GP_HIGH_IRQ,
2682 .irq_err = RPM_APCC_CPU0_GP_LOW_IRQ,
2683 .irq_vmpm = RPM_APCC_CPU0_GP_MEDIUM_IRQ,
2684 .msm_apps_ipc_rpm_reg = MSM_APCS_GCC_BASE + 0x008,
2685 .msm_apps_ipc_rpm_val = 4,
2686};
2687
Praveen Chidambaram043f4ce2011-08-02 09:37:59 -06002688static struct platform_device msm_rpm_device = {
2689 .name = "msm_rpm",
2690 .id = -1,
2691};
2692
2693
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002694static struct spi_board_info spi_board_info[] __initdata = {
2695 {
2696 .modalias = "ks8851",
2697 .irq = MSM_GPIO_TO_INT(KS8851_IRQ_GPIO),
2698 .max_speed_hz = 19200000,
2699 .bus_num = 0,
2700 .chip_select = 0,
2701 .mode = SPI_MODE_0,
2702 },
2703};
2704
2705static struct platform_device msm_device_saw_core0 = {
2706 .name = "saw-regulator",
2707 .id = 0,
2708 .dev = {
2709 .platform_data = &msm_saw_regulator_pdata_s5,
2710 },
2711};
2712
2713static struct platform_device msm_device_saw_core1 = {
2714 .name = "saw-regulator",
2715 .id = 1,
2716 .dev = {
2717 .platform_data = &msm_saw_regulator_pdata_s6,
2718 },
2719};
2720
2721#ifdef CONFIG_MSM_FAKE_BATTERY
2722static struct platform_device fish_battery_device = {
2723 .name = "fish_battery",
2724};
2725#endif
2726
David Collins26f05562011-06-20 09:56:28 -07002727static struct platform_device msm8960_device_ext_5v_vreg __devinitdata = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002728 .name = GPIO_REGULATOR_DEV_NAME,
2729 .id = PM8921_MPP_PM_TO_SYS(7),
2730 .dev = {
2731 .platform_data = &msm_gpio_regulator_pdata[GPIO_VREG_ID_EXT_5V],
2732 },
2733};
2734
David Collins26f05562011-06-20 09:56:28 -07002735static struct platform_device msm8960_device_ext_l2_vreg __devinitdata = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002736 .name = GPIO_REGULATOR_DEV_NAME,
2737 .id = 91,
2738 .dev = {
2739 .platform_data = &msm_gpio_regulator_pdata[GPIO_VREG_ID_EXT_L2],
2740 },
2741};
2742
David Collins26f05562011-06-20 09:56:28 -07002743static struct platform_device msm8960_device_rpm_regulator __devinitdata = {
2744 .name = "rpm-regulator",
2745 .id = -1,
2746 .dev = {
2747 .platform_data = &msm_rpm_regulator_pdata,
2748 },
2749};
2750
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002751static struct platform_device *common_devices[] __initdata = {
Stepan Moskovchenkodf13d342011-08-03 19:01:25 -07002752 &msm8960_device_dmov,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002753 &msm_device_smd,
2754 &msm8960_device_uart_gsbi5,
Mayank Rana9f51f582011-08-04 18:35:59 +05302755 &msm_device_uart_dm6,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002756 &msm_device_saw_core0,
2757 &msm_device_saw_core1,
2758 &msm8960_device_ext_5v_vreg,
2759 &msm8960_device_ext_l2_vreg,
2760 &msm8960_device_ssbi_pm8921,
2761 &msm8960_device_qup_spi_gsbi1,
2762 &msm8960_device_qup_i2c_gsbi3,
2763 &msm8960_device_qup_i2c_gsbi4,
2764 &msm8960_device_qup_i2c_gsbi10,
2765#ifndef CONFIG_MSM_DSPS
2766 &msm8960_device_qup_i2c_gsbi12,
2767#endif
2768 &msm_slim_ctrl,
2769 &msm_device_wcnss_wlan,
2770#if defined(CONFIG_CRYPTO_DEV_QCRYPTO) || \
2771 defined(CONFIG_CRYPTO_DEV_QCRYPTO_MODULE)
2772 &qcrypto_device,
2773#endif
2774
2775#if defined(CONFIG_CRYPTO_DEV_QCEDEV) || \
2776 defined(CONFIG_CRYPTO_DEV_QCEDEV_MODULE)
2777 &qcedev_device,
2778#endif
2779#ifdef CONFIG_MSM_ROTATOR
2780 &msm_rotator_device,
2781#endif
2782 &msm_device_sps,
2783#ifdef CONFIG_MSM_FAKE_BATTERY
2784 &fish_battery_device,
2785#endif
2786#ifdef CONFIG_ANDROID_PMEM
2787 &android_pmem_device,
2788 &android_pmem_adsp_device,
2789 &android_pmem_audio_device,
2790#endif
2791 &msm_fb_device,
2792 &msm_device_vidc,
2793 &msm_device_bam_dmux,
2794 &msm_fm_platform_init,
Mona Hossain9c430e32011-07-27 11:04:47 -07002795
2796#ifdef CONFIG_HW_RANDOM_MSM
2797 &msm_device_rng,
2798#endif
Praveen Chidambaram043f4ce2011-08-02 09:37:59 -06002799 &msm_rpm_device,
Laura Abbottd6183792011-08-19 13:42:24 -07002800#ifdef CONFIG_ION_MSM
2801 &ion_dev,
2802#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002803};
2804
Stepan Moskovchenkod056fca2011-01-27 12:12:07 -08002805static struct platform_device *sim_devices[] __initdata = {
Stepan Moskovchenko14aa6492011-08-08 15:15:01 -07002806 &msm8960_device_otg,
2807 &msm8960_device_gadget_peripheral,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002808 &msm_device_hsusb_host,
2809 &android_usb_device,
2810 &msm_device_vidc,
2811 &mipi_dsi_simulator_panel_device,
2812 &msm_bus_apps_fabric,
2813 &msm_bus_sys_fabric,
2814 &msm_bus_mm_fabric,
2815 &msm_bus_sys_fpb,
2816 &msm_bus_cpss_fpb,
2817 &msm_pcm,
2818 &msm_pcm_routing,
2819 &msm_cpudai0,
2820 &msm_cpudai1,
2821 &msm_cpudai_hdmi_rx,
2822 &msm_cpudai_bt_rx,
2823 &msm_cpudai_bt_tx,
2824 &msm_cpudai_fm_rx,
2825 &msm_cpudai_fm_tx,
2826 &msm_cpu_fe,
2827 &msm_stub_codec,
2828 &msm_voice,
2829 &msm_voip,
2830 &msm_lpa_pcm,
2831
2832#if defined(CONFIG_CRYPTO_DEV_QCRYPTO) || \
2833 defined(CONFIG_CRYPTO_DEV_QCRYPTO_MODULE)
2834 &qcrypto_device,
2835#endif
2836
2837#if defined(CONFIG_CRYPTO_DEV_QCEDEV) || \
2838 defined(CONFIG_CRYPTO_DEV_QCEDEV_MODULE)
2839 &qcedev_device,
2840#endif
Stepan Moskovchenkod056fca2011-01-27 12:12:07 -08002841};
2842
2843static struct platform_device *rumi3_devices[] __initdata = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002844 &msm_kgsl_3d0,
2845 &msm_kgsl_2d0,
2846 &msm_kgsl_2d1,
2847 &mipi_dsi_renesas_panel_device,
2848#ifdef CONFIG_MSM_GEMINI
2849 &msm8960_gemini_device,
2850#endif
Stepan Moskovchenkod056fca2011-01-27 12:12:07 -08002851};
2852
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002853static struct platform_device *cdp_devices[] __initdata = {
Stepan Moskovchenko14aa6492011-08-08 15:15:01 -07002854 &msm8960_device_otg,
2855 &msm8960_device_gadget_peripheral,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002856 &msm_device_hsusb_host,
2857 &android_usb_device,
2858 &msm_pcm,
2859 &msm_pcm_routing,
2860 &msm_cpudai0,
2861 &msm_cpudai1,
2862 &msm_cpudai_hdmi_rx,
2863 &msm_cpudai_bt_rx,
2864 &msm_cpudai_bt_tx,
2865 &msm_cpudai_fm_rx,
2866 &msm_cpudai_fm_tx,
2867 &msm_cpu_fe,
2868 &msm_stub_codec,
2869 &msm_kgsl_3d0,
2870#ifdef CONFIG_MSM_KGSL_2D
2871 &msm_kgsl_2d0,
2872 &msm_kgsl_2d1,
2873#endif
2874 &mipi_dsi_toshiba_panel_device,
2875#ifdef CONFIG_MSM_GEMINI
2876 &msm8960_gemini_device,
2877#endif
2878 &msm_voice,
2879 &msm_voip,
2880 &msm_lpa_pcm,
2881#ifdef CONFIG_FB_MSM_HDMI_MSM_PANEL
2882 &hdmi_msm_device,
2883#endif
2884 &msm_pcm_hostless,
2885 &msm_bus_apps_fabric,
2886 &msm_bus_sys_fabric,
2887 &msm_bus_mm_fabric,
2888 &msm_bus_sys_fpb,
2889 &msm_bus_cpss_fpb,
2890};
2891
2892static void __init msm8960_i2c_init(void)
2893{
2894 msm8960_device_qup_i2c_gsbi4.dev.platform_data =
2895 &msm8960_i2c_qup_gsbi4_pdata;
2896
2897 msm8960_device_qup_i2c_gsbi3.dev.platform_data =
2898 &msm8960_i2c_qup_gsbi3_pdata;
2899
2900 msm8960_device_qup_i2c_gsbi10.dev.platform_data =
2901 &msm8960_i2c_qup_gsbi10_pdata;
2902
2903 msm8960_device_qup_i2c_gsbi12.dev.platform_data =
2904 &msm8960_i2c_qup_gsbi12_pdata;
2905}
2906
Lucille Sylvester34ec3692011-08-16 16:28:04 -06002907static void __init msm8960_gfx_init(void)
2908{
2909 uint32_t soc_platform_version = socinfo_get_platform_version();
2910 if (SOCINFO_VERSION_MAJOR(soc_platform_version) == 1) {
2911 struct kgsl_device_platform_data *kgsl_3d0_pdata =
2912 msm_kgsl_3d0.dev.platform_data;
2913 kgsl_3d0_pdata->pwr_data.pwrlevel[0].gpu_freq =
2914 320000000;
2915 kgsl_3d0_pdata->pwr_data.pwrlevel[1].gpu_freq =
2916 266667000;
2917 }
2918}
2919
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002920static struct pm8xxx_irq_platform_data pm8xxx_irq_pdata __devinitdata = {
2921 .irq_base = PM8921_IRQ_BASE,
2922 .devirq = MSM_GPIO_TO_INT(104),
2923 .irq_trigger_flag = IRQF_TRIGGER_LOW,
2924};
2925
2926static struct pm8xxx_gpio_platform_data pm8xxx_gpio_pdata __devinitdata = {
2927 .gpio_base = PM8921_GPIO_PM_TO_SYS(1),
2928};
2929
2930static struct pm8xxx_mpp_platform_data pm8xxx_mpp_pdata __devinitdata = {
2931 .mpp_base = PM8921_MPP_PM_TO_SYS(1),
2932};
2933
2934static struct pm8xxx_rtc_platform_data pm8xxx_rtc_pdata __devinitdata = {
2935 .rtc_write_enable = false,
2936};
2937
2938static struct pm8xxx_pwrkey_platform_data pm8xxx_pwrkey_pdata = {
2939 .pull_up = 1,
2940 .kpd_trigger_delay_us = 970,
2941 .wakeup = 1,
2942};
2943
2944static const unsigned int keymap[] = {
2945 KEY(0, 0, KEY_VOLUMEUP),
2946 KEY(0, 1, KEY_VOLUMEDOWN),
2947 KEY(0, 2, KEY_CAMERA_SNAPSHOT),
2948 KEY(0, 3, KEY_CAMERA_FOCUS),
2949};
2950
2951static struct matrix_keymap_data keymap_data = {
2952 .keymap_size = ARRAY_SIZE(keymap),
2953 .keymap = keymap,
2954};
2955
2956static struct pm8xxx_keypad_platform_data keypad_data = {
2957 .input_name = "keypad_8960",
2958 .input_phys_device = "keypad_8960/input0",
2959 .num_rows = 1,
2960 .num_cols = 5,
2961 .rows_gpio_start = PM8921_GPIO_PM_TO_SYS(9),
2962 .cols_gpio_start = PM8921_GPIO_PM_TO_SYS(1),
2963 .debounce_ms = 15,
2964 .scan_delay_ms = 32,
2965 .row_hold_ns = 91500,
2966 .wakeup = 1,
2967 .keymap_data = &keymap_data,
2968};
2969
2970static const unsigned int keymap_sim[] = {
2971 KEY(0, 0, KEY_7),
2972 KEY(0, 1, KEY_DOWN),
2973 KEY(0, 2, KEY_UP),
2974 KEY(0, 3, KEY_RIGHT),
2975 KEY(0, 4, KEY_ENTER),
2976 KEY(0, 5, KEY_L),
2977 KEY(0, 6, KEY_BACK),
2978 KEY(0, 7, KEY_M),
2979
2980 KEY(1, 0, KEY_LEFT),
2981 KEY(1, 1, KEY_SEND),
2982 KEY(1, 2, KEY_1),
2983 KEY(1, 3, KEY_4),
2984 KEY(1, 4, KEY_CLEAR),
2985 KEY(1, 5, KEY_MSDOS),
2986 KEY(1, 6, KEY_SPACE),
2987 KEY(1, 7, KEY_COMMA),
2988
2989 KEY(2, 0, KEY_6),
2990 KEY(2, 1, KEY_5),
2991 KEY(2, 2, KEY_8),
2992 KEY(2, 3, KEY_3),
2993 KEY(2, 4, KEY_NUMERIC_STAR),
2994 KEY(2, 5, KEY_UP),
2995 KEY(2, 6, KEY_DOWN),
2996 KEY(2, 7, KEY_LEFTSHIFT),
2997
2998 KEY(3, 0, KEY_9),
2999 KEY(3, 1, KEY_NUMERIC_POUND),
3000 KEY(3, 2, KEY_0),
3001 KEY(3, 3, KEY_2),
3002 KEY(3, 4, KEY_SLEEP),
3003 KEY(3, 5, KEY_F1),
3004 KEY(3, 6, KEY_F2),
3005 KEY(3, 7, KEY_F3),
3006
3007 KEY(4, 0, KEY_BACK),
3008 KEY(4, 1, KEY_HOME),
3009 KEY(4, 2, KEY_MENU),
3010 KEY(4, 3, KEY_VOLUMEUP),
3011 KEY(4, 4, KEY_VOLUMEDOWN),
3012 KEY(4, 5, KEY_F4),
3013 KEY(4, 6, KEY_F5),
3014 KEY(4, 7, KEY_F6),
3015
3016 KEY(5, 0, KEY_R),
3017 KEY(5, 1, KEY_T),
3018 KEY(5, 2, KEY_Y),
3019 KEY(5, 3, KEY_LEFTALT),
3020 KEY(5, 4, KEY_KPENTER),
3021 KEY(5, 5, KEY_Q),
3022 KEY(5, 6, KEY_W),
3023 KEY(5, 7, KEY_E),
3024
3025 KEY(6, 0, KEY_F),
3026 KEY(6, 1, KEY_G),
3027 KEY(6, 2, KEY_H),
3028 KEY(6, 3, KEY_CAPSLOCK),
3029 KEY(6, 4, KEY_PAGEUP),
3030 KEY(6, 5, KEY_A),
3031 KEY(6, 6, KEY_S),
3032 KEY(6, 7, KEY_D),
3033
3034 KEY(7, 0, KEY_V),
3035 KEY(7, 1, KEY_B),
3036 KEY(7, 2, KEY_N),
3037 KEY(7, 3, KEY_MENU),
3038 KEY(7, 4, KEY_PAGEDOWN),
3039 KEY(7, 5, KEY_Z),
3040 KEY(7, 6, KEY_X),
3041 KEY(7, 7, KEY_C),
3042
3043 KEY(8, 0, KEY_P),
3044 KEY(8, 1, KEY_J),
3045 KEY(8, 2, KEY_K),
3046 KEY(8, 3, KEY_INSERT),
3047 KEY(8, 4, KEY_LINEFEED),
3048 KEY(8, 5, KEY_U),
3049 KEY(8, 6, KEY_I),
3050 KEY(8, 7, KEY_O),
3051
3052 KEY(9, 0, KEY_4),
3053 KEY(9, 1, KEY_5),
3054 KEY(9, 2, KEY_6),
3055 KEY(9, 3, KEY_7),
3056 KEY(9, 4, KEY_8),
3057 KEY(9, 5, KEY_1),
3058 KEY(9, 6, KEY_2),
3059 KEY(9, 7, KEY_3),
3060
3061 KEY(10, 0, KEY_F7),
3062 KEY(10, 1, KEY_F8),
3063 KEY(10, 2, KEY_F9),
3064 KEY(10, 3, KEY_F10),
3065 KEY(10, 4, KEY_FN),
3066 KEY(10, 5, KEY_9),
3067 KEY(10, 6, KEY_0),
3068 KEY(10, 7, KEY_DOT),
3069
3070 KEY(11, 0, KEY_LEFTCTRL),
3071 KEY(11, 1, KEY_F11),
3072 KEY(11, 2, KEY_ENTER),
3073 KEY(11, 3, KEY_SEARCH),
3074 KEY(11, 4, KEY_DELETE),
3075 KEY(11, 5, KEY_RIGHT),
3076 KEY(11, 6, KEY_LEFT),
3077 KEY(11, 7, KEY_RIGHTSHIFT),
3078 KEY(0, 0, KEY_VOLUMEUP),
3079 KEY(0, 1, KEY_VOLUMEDOWN),
3080 KEY(0, 2, KEY_CAMERA_SNAPSHOT),
3081 KEY(0, 3, KEY_CAMERA_FOCUS),
3082};
3083
3084static struct matrix_keymap_data keymap_data_sim = {
3085 .keymap_size = ARRAY_SIZE(keymap_sim),
3086 .keymap = keymap_sim,
3087};
3088
3089static struct pm8xxx_keypad_platform_data keypad_data_sim = {
3090 .input_name = "keypad_8960",
3091 .input_phys_device = "keypad_8960/input0",
3092 .num_rows = 12,
3093 .num_cols = 8,
3094 .rows_gpio_start = PM8921_GPIO_PM_TO_SYS(9),
3095 .cols_gpio_start = PM8921_GPIO_PM_TO_SYS(1),
3096 .debounce_ms = 15,
3097 .scan_delay_ms = 32,
3098 .row_hold_ns = 91500,
3099 .wakeup = 1,
3100 .keymap_data = &keymap_data_sim,
3101};
3102
3103static struct pm8921_charger_platform_data pm8921_chg_pdata __devinitdata = {
Abhijeet Dharmapurikar34059332011-08-16 19:19:39 -07003104 .safety_time = 180,
3105 .update_time = 1,
3106 .max_voltage = 4200,
3107 .min_voltage = 3200,
3108 .resume_voltage = 4100,
3109 .term_current = 100,
3110 .cool_temp = 10,
3111 .warm_temp = 40,
3112 .temp_check_period = 1,
3113 .max_bat_chg_current = 400,
3114 .cool_bat_chg_current = 350,
3115 .warm_bat_chg_current = 350,
3116 .cool_bat_voltage = 4100,
3117 .warm_bat_voltage = 4100,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003118};
3119
3120static struct pm8xxx_misc_platform_data pm8xxx_misc_pdata = {
3121 .priority = 0,
3122};
3123
3124static struct pm8921_bms_platform_data pm8921_bms_pdata __devinitdata = {
3125 .r_sense = 10,
3126 .i_test = 2500,
3127 .v_failure = 3000,
3128 .calib_delay_ms = 600000,
3129 .batt_data = &palladium_1500_data,
3130};
3131
Jay Chokshide4cefb2011-08-04 18:10:44 -07003132#define PM8921_LC_LED_MAX_CURRENT 4 /* I = 4mA */
3133
3134/**
3135 * 'flag' stores three values; led id, led mode, and max current of led.
3136 * The bit packing format is as follow,
3137 * reserved (1 byte) | max_current (2 bytes) | led_mode (1 nibble) |
3138 * led_id (1 nibble)
3139 */
3140#define PM8XXX_SET_FLAG(led_id, led_mode, led_max_current) \
3141 (((led_id << PM8XXX_LED_ID_SHIFT) & PM8XXX_LED_ID_MASK) |\
3142 ((led_mode << PM8XXX_LED_MODE_SHIFT) & PM8XXX_LED_MODE_MASK) |\
3143 ((led_max_current << PM8XXX_LED_MAX_CURRENT_SHIFT) & \
3144 PM8XXX_LED_MAX_CURRENT_MASK))
3145
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003146static struct led_info pm8921_led_info[] = {
3147 [0] = {
Jay Chokshide4cefb2011-08-04 18:10:44 -07003148 .name = "led:usb",
3149 .default_trigger = "usb-online",
3150 .flags = PM8XXX_SET_FLAG(PM8XXX_ID_LED_0,
3151 PM8XXX_LED_MODE_MANUAL,
3152 PM8921_LC_LED_MAX_CURRENT),
3153 },
3154 [1] = {
3155 .name = "led:ac",
3156 .default_trigger = "ac-online",
3157 .flags = PM8XXX_SET_FLAG(PM8XXX_ID_LED_1,
3158 PM8XXX_LED_MODE_MANUAL,
3159 PM8921_LC_LED_MAX_CURRENT),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003160 },
3161};
3162
3163static struct led_platform_data pm8xxx_leds_pdata = {
3164 .num_leds = ARRAY_SIZE(pm8921_led_info),
3165 .leds = pm8921_led_info,
3166};
3167
3168static struct pm8921_platform_data pm8921_platform_data __devinitdata = {
3169 .irq_pdata = &pm8xxx_irq_pdata,
3170 .gpio_pdata = &pm8xxx_gpio_pdata,
3171 .mpp_pdata = &pm8xxx_mpp_pdata,
3172 .rtc_pdata = &pm8xxx_rtc_pdata,
3173 .pwrkey_pdata = &pm8xxx_pwrkey_pdata,
3174 .keypad_pdata = &keypad_data,
3175 .misc_pdata = &pm8xxx_misc_pdata,
3176 .regulator_pdatas = msm_pm8921_regulator_pdata,
3177 .charger_pdata = &pm8921_chg_pdata,
3178 .bms_pdata = &pm8921_bms_pdata,
3179 .adc_pdata = &pm8921_adc_pdata,
3180 .leds_pdata = &pm8xxx_leds_pdata,
3181};
3182
3183static struct msm_ssbi_platform_data msm8960_ssbi_pm8921_pdata __devinitdata = {
3184 .controller_type = MSM_SBI_CTRL_PMIC_ARBITER,
3185 .slave = {
3186 .name = "pm8921-core",
3187 .platform_data = &pm8921_platform_data,
3188 },
3189};
3190
3191static void msm8960_wcnss_init(void)
3192{
3193 int i, ret, j;
3194
3195 for (i = 0; i < ARRAY_SIZE(wcnss_5wire_interface); i++) {
3196 ret = gpio_request(wcnss_5wire_interface[i].gpio,
3197 "wcnss_5_wire");
3198 if (ret) {
3199 pr_err("wcnss_5_wire gpio %d failed: %d\n",
3200 wcnss_5wire_interface[i].gpio, ret);
3201 goto fail;
3202 }
3203 }
3204
3205 pr_info("%s: Iris 5-wire gpios configured\n", __func__);
3206
3207 return;
3208
3209fail:
3210 for (j = 0; j < i; j++)
3211 gpio_free(wcnss_5wire_interface[j].gpio);
3212}
3213
Stepan Moskovchenko41d168272011-08-09 17:09:42 -07003214#ifdef CONFIG_KS8851
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003215static int ethernet_init(void)
3216{
3217 int ret;
3218 ret = gpio_request(KS8851_IRQ_GPIO, "ks8851_irq");
3219 if (ret) {
3220 pr_err("ks8851 gpio_request failed: %d\n", ret);
3221 goto fail;
3222 }
3223
3224 ret = gpio_request(KS8851_RST_GPIO, "ks8851_rst");
3225 if (ret) {
3226 pr_err("ks8851 gpio_request failed: %d\n", ret);
3227 goto fail_rst;
3228 }
3229
3230 ret = gpio_request(FPGA_CS_GPIO, "fpga_cs");
3231 if (ret) {
3232 pr_err("ks8851 gpio_request failed: %d\n", ret);
3233 goto fail_cs;
3234 }
3235
3236 gpio_direction_output(FPGA_CS_GPIO, 1);
3237 gpio_direction_output(KS8851_RST_GPIO, 1);
3238 return 0;
3239fail_cs:
3240 gpio_free(KS8851_RST_GPIO);
3241fail_rst:
3242 gpio_free(KS8851_IRQ_GPIO);
3243fail:
3244 return ret;
3245}
Stepan Moskovchenko41d168272011-08-09 17:09:42 -07003246#else
3247static int ethernet_init(void)
3248{
3249 return 0;
3250}
3251#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003252
3253static struct msm_cpuidle_state msm_cstates[] __initdata = {
3254 {0, 0, "C0", "WFI",
3255 MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT},
3256
3257 {0, 1, "C1", "STANDALONE_POWER_COLLAPSE",
3258 MSM_PM_SLEEP_MODE_POWER_COLLAPSE_STANDALONE},
3259
3260 {0, 2, "C2", "POWER_COLLAPSE",
3261 MSM_PM_SLEEP_MODE_POWER_COLLAPSE},
3262
3263 {1, 0, "C0", "WFI",
3264 MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT},
3265
3266 {1, 1, "C1", "STANDALONE_POWER_COLLAPSE",
3267 MSM_PM_SLEEP_MODE_POWER_COLLAPSE_STANDALONE},
3268};
3269
3270static struct msm_pm_platform_data msm_pm_data[MSM_PM_SLEEP_MODE_NR * 2] = {
3271 [MSM_PM_MODE(0, MSM_PM_SLEEP_MODE_POWER_COLLAPSE)] = {
3272 .idle_supported = 1,
3273 .suspend_supported = 1,
3274 .idle_enabled = 0,
3275 .suspend_enabled = 0,
3276 .latency = 4000,
3277 .residency = 13000,
3278 },
3279
3280 [MSM_PM_MODE(0, MSM_PM_SLEEP_MODE_POWER_COLLAPSE_STANDALONE)] = {
3281 .idle_supported = 1,
3282 .suspend_supported = 1,
3283 .idle_enabled = 0,
3284 .suspend_enabled = 0,
3285 .latency = 500,
3286 .residency = 6000,
3287 },
3288
3289 [MSM_PM_MODE(0, MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT)] = {
3290 .idle_supported = 1,
3291 .suspend_supported = 1,
3292 .idle_enabled = 1,
3293 .suspend_enabled = 1,
3294 .latency = 2,
3295 .residency = 0,
3296 },
3297
3298 [MSM_PM_MODE(1, MSM_PM_SLEEP_MODE_POWER_COLLAPSE)] = {
3299 .idle_supported = 0,
3300 .suspend_supported = 1,
3301 .idle_enabled = 0,
3302 .suspend_enabled = 0,
3303 .latency = 600,
3304 .residency = 7200,
3305 },
3306
3307 [MSM_PM_MODE(1, MSM_PM_SLEEP_MODE_POWER_COLLAPSE_STANDALONE)] = {
3308 .idle_supported = 1,
3309 .suspend_supported = 1,
3310 .idle_enabled = 0,
3311 .suspend_enabled = 0,
3312 .latency = 500,
3313 .residency = 6000,
3314 },
3315
3316 [MSM_PM_MODE(1, MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT)] = {
3317 .idle_supported = 1,
3318 .suspend_supported = 0,
3319 .idle_enabled = 1,
3320 .suspend_enabled = 0,
3321 .latency = 2,
3322 .residency = 0,
3323 },
3324};
3325
3326static struct msm_rpmrs_level msm_rpmrs_levels[] __initdata = {
3327 {
3328 MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT,
3329 MSM_RPMRS_LIMITS(ON, ACTIVE, MAX, ACTIVE),
3330 true,
3331 1, 8000, 100000, 1,
3332 },
3333
3334 {
3335 MSM_PM_SLEEP_MODE_POWER_COLLAPSE_STANDALONE,
3336 MSM_RPMRS_LIMITS(ON, ACTIVE, MAX, ACTIVE),
3337 true,
3338 1500, 5000, 60100000, 3000,
3339 },
3340
3341 {
3342 MSM_PM_SLEEP_MODE_POWER_COLLAPSE,
3343 MSM_RPMRS_LIMITS(ON, GDHS, MAX, ACTIVE),
3344 false,
3345 1800, 5000, 60350000, 3500,
3346 },
3347
3348 {
3349 MSM_PM_SLEEP_MODE_POWER_COLLAPSE,
3350 MSM_RPMRS_LIMITS(ON, HSFS_OPEN, MAX, ACTIVE),
3351 false,
3352 2800, 2500, 65350000, 4800,
3353 },
3354
3355 {
3356 MSM_PM_SLEEP_MODE_POWER_COLLAPSE,
3357 MSM_RPMRS_LIMITS(OFF, GDHS, MAX, ACTIVE),
3358 false,
3359 3800, 4500, 67850000, 5500,
3360 },
3361
3362 {
3363 MSM_PM_SLEEP_MODE_POWER_COLLAPSE,
3364 MSM_RPMRS_LIMITS(OFF, HSFS_OPEN, MAX, ACTIVE),
3365 false,
3366 4800, 2000, 71850000, 6800,
3367 },
3368
3369 {
3370 MSM_PM_SLEEP_MODE_POWER_COLLAPSE,
3371 MSM_RPMRS_LIMITS(OFF, HSFS_OPEN, ACTIVE, RET_HIGH),
3372 false,
3373 6800, 500, 75850000, 8800,
3374 },
3375
3376 {
3377 MSM_PM_SLEEP_MODE_POWER_COLLAPSE,
3378 MSM_RPMRS_LIMITS(OFF, HSFS_OPEN, RET_HIGH, RET_LOW),
3379 false,
3380 7800, 0, 76350000, 9800,
3381 },
3382};
3383
3384#ifdef CONFIG_I2C
3385#define I2C_SURF 1
3386#define I2C_FFA (1 << 1)
3387#define I2C_RUMI (1 << 2)
3388#define I2C_SIM (1 << 3)
3389#define I2C_FLUID (1 << 4)
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003390
3391struct i2c_registry {
3392 u8 machs;
3393 int bus;
3394 struct i2c_board_info *info;
3395 int len;
3396};
3397
3398#ifdef CONFIG_MSM_CAMERA
3399static struct i2c_board_info msm_camera_boardinfo[] __initdata = {
3400#ifdef CONFIG_IMX074
3401 {
3402 I2C_BOARD_INFO("imx074", 0x1A),
3403 },
3404#endif
3405#ifdef CONFIG_OV2720
3406 {
3407 I2C_BOARD_INFO("ov2720", 0x6C),
3408 },
3409#endif
Kevin Chandfecce22011-07-13 10:52:41 -07003410 {
3411 I2C_BOARD_INFO("qs_mt9p017", 0x6C >> 1),
3412 },
Nishant Pandit474f2252011-07-23 23:17:56 +05303413#ifdef CONFIG_MSM_CAMERA_FLASH_SC628A
3414 {
3415 I2C_BOARD_INFO("sc628a", 0x6E),
3416 },
3417#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003418};
3419#endif
3420
3421/* Sensors DSPS platform data */
3422#ifdef CONFIG_MSM_DSPS
3423#define DSPS_PIL_GENERIC_NAME "dsps"
3424#endif /* CONFIG_MSM_DSPS */
3425
3426static void __init msm8960_init_dsps(void)
3427{
3428#ifdef CONFIG_MSM_DSPS
3429 struct msm_dsps_platform_data *pdata =
3430 msm_dsps_device.dev.platform_data;
3431 pdata->pil_name = DSPS_PIL_GENERIC_NAME;
3432 pdata->gpios = NULL;
3433 pdata->gpios_num = 0;
3434
3435 platform_device_register(&msm_dsps_device);
3436#endif /* CONFIG_MSM_DSPS */
3437}
3438
3439static struct i2c_registry msm8960_i2c_devices[] __initdata = {
3440#ifdef CONFIG_MSM_CAMERA
3441 {
3442 I2C_SURF | I2C_FFA | I2C_FLUID | I2C_RUMI,
3443 MSM_8960_GSBI4_QUP_I2C_BUS_ID,
3444 msm_camera_boardinfo,
3445 ARRAY_SIZE(msm_camera_boardinfo),
3446 },
3447#endif
3448 {
3449 I2C_SURF | I2C_FFA | I2C_FLUID,
3450 MSM_8960_GSBI3_QUP_I2C_BUS_ID,
3451 cyttsp_info,
3452 ARRAY_SIZE(cyttsp_info),
Rohit Vaswanicd2a59b2011-07-19 12:00:48 -07003453 },
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003454};
3455#endif /* CONFIG_I2C */
3456
3457static void __init register_i2c_devices(void)
3458{
3459#ifdef CONFIG_I2C
3460 u8 mach_mask = 0;
3461 int i;
3462
3463 /* Build the matching 'supported_machs' bitmask */
3464 if (machine_is_msm8960_cdp())
3465 mach_mask = I2C_SURF;
3466 else if (machine_is_msm8960_rumi3())
3467 mach_mask = I2C_RUMI;
3468 else if (machine_is_msm8960_sim())
3469 mach_mask = I2C_SIM;
Amy Maloche2d028032011-07-20 14:08:06 -07003470 else if (machine_is_msm8960_fluid())
3471 mach_mask = I2C_FLUID;
Amy Maloche1b0663f2011-08-02 16:46:22 -07003472 else if (machine_is_msm8960_mtp())
3473 mach_mask = I2C_FFA;
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003474 else
3475 pr_err("unmatched machine ID in register_i2c_devices\n");
3476
3477 /* Run the array and install devices as appropriate */
3478 for (i = 0; i < ARRAY_SIZE(msm8960_i2c_devices); ++i) {
3479 if (msm8960_i2c_devices[i].machs & mach_mask)
3480 i2c_register_board_info(msm8960_i2c_devices[i].bus,
3481 msm8960_i2c_devices[i].info,
3482 msm8960_i2c_devices[i].len);
3483 }
3484#endif
3485}
3486
Stepan Moskovchenkod056fca2011-01-27 12:12:07 -08003487static void __init msm8960_sim_init(void)
3488{
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003489 if (socinfo_init() < 0)
3490 pr_err("socinfo_init() failed!\n");
3491
3492 BUG_ON(msm_rpm_init(&msm_rpm_data));
3493 BUG_ON(msm_rpmrs_levels_init(msm_rpmrs_levels,
3494 ARRAY_SIZE(msm_rpmrs_levels)));
3495 regulator_suppress_info_printing();
David Collins26f05562011-06-20 09:56:28 -07003496 platform_device_register(&msm8960_device_rpm_regulator);
Stephen Boydbb600ae2011-08-02 20:11:40 -07003497 msm_clock_init(&msm8960_clock_init_data);
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003498 msm8960_device_ssbi_pm8921.dev.platform_data =
3499 &msm8960_ssbi_pm8921_pdata;
3500 pm8921_platform_data.num_regulators = msm_pm8921_regulator_pdata_len;
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003501
3502 /* Simulator supports a QWERTY keypad */
3503 pm8921_platform_data.keypad_pdata = &keypad_data_sim;
3504
Stepan Moskovchenko14aa6492011-08-08 15:15:01 -07003505 msm8960_device_otg.dev.platform_data = &msm_otg_pdata;
3506 msm8960_device_gadget_peripheral.dev.parent = &msm8960_device_otg.dev;
3507 msm_device_hsusb_host.dev.parent = &msm8960_device_otg.dev;
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003508 gpiomux_init();
3509 ethernet_init();
3510 msm8960_i2c_init();
3511 msm_spm_init(msm_spm_data, ARRAY_SIZE(msm_spm_data));
3512 msm_spm_l2_init(msm_spm_l2_data);
3513 msm8960_init_buses();
3514 platform_add_devices(common_devices, ARRAY_SIZE(common_devices));
3515 pm8921_gpio_mpp_init();
Stepan Moskovchenkod056fca2011-01-27 12:12:07 -08003516 platform_add_devices(sim_devices, ARRAY_SIZE(sim_devices));
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003517 msm_acpu_clock_init(&msm8960_acpu_clock_data);
3518
3519 msm8960_device_qup_spi_gsbi1.dev.platform_data =
3520 &msm8960_qup_spi_gsbi1_pdata;
3521 spi_register_board_info(spi_board_info, ARRAY_SIZE(spi_board_info));
3522
3523 msm8960_init_mmc();
3524 msm_fb_add_devices();
3525 slim_register_board_info(msm_slim_devices,
3526 ARRAY_SIZE(msm_slim_devices));
3527 msm_pm_set_platform_data(msm_pm_data, ARRAY_SIZE(msm_pm_data));
3528 msm_pm_set_rpm_wakeup_irq(RPM_APCC_CPU0_WAKE_UP_IRQ);
3529 msm_cpuidle_set_states(msm_cstates, ARRAY_SIZE(msm_cstates),
3530 msm_pm_data);
Stepan Moskovchenkod056fca2011-01-27 12:12:07 -08003531}
3532
3533static void __init msm8960_rumi3_init(void)
3534{
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003535 if (socinfo_init() < 0)
3536 pr_err("socinfo_init() failed!\n");
3537
3538 BUG_ON(msm_rpm_init(&msm_rpm_data));
3539 BUG_ON(msm_rpmrs_levels_init(msm_rpmrs_levels,
3540 ARRAY_SIZE(msm_rpmrs_levels)));
3541 regulator_suppress_info_printing();
David Collins26f05562011-06-20 09:56:28 -07003542 platform_device_register(&msm8960_device_rpm_regulator);
Stephen Boydbb600ae2011-08-02 20:11:40 -07003543 msm_clock_init(&msm8960_dummy_clock_init_data);
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003544 gpiomux_init();
3545 ethernet_init();
3546 msm8960_device_ssbi_pm8921.dev.platform_data =
3547 &msm8960_ssbi_pm8921_pdata;
3548 pm8921_platform_data.num_regulators = msm_pm8921_regulator_pdata_len;
3549 msm8960_device_qup_spi_gsbi1.dev.platform_data =
3550 &msm8960_qup_spi_gsbi1_pdata;
3551 spi_register_board_info(spi_board_info, ARRAY_SIZE(spi_board_info));
3552 msm8960_i2c_init();
3553 msm_spm_init(msm_spm_data, ARRAY_SIZE(msm_spm_data));
3554 msm_spm_l2_init(msm_spm_l2_data);
3555 platform_add_devices(common_devices, ARRAY_SIZE(common_devices));
3556 pm8921_gpio_mpp_init();
Stepan Moskovchenkod056fca2011-01-27 12:12:07 -08003557 platform_add_devices(rumi3_devices, ARRAY_SIZE(rumi3_devices));
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003558 msm8960_init_mmc();
3559
3560 register_i2c_devices();
3561 msm_fb_add_devices();
3562 slim_register_board_info(msm_slim_devices,
3563 ARRAY_SIZE(msm_slim_devices));
3564 msm_pm_set_platform_data(msm_pm_data, ARRAY_SIZE(msm_pm_data));
3565 msm_pm_set_rpm_wakeup_irq(RPM_APCC_CPU0_WAKE_UP_IRQ);
3566 msm_cpuidle_set_states(msm_cstates, ARRAY_SIZE(msm_cstates),
3567 msm_pm_data);
3568}
3569
3570static void __init msm8960_cdp_init(void)
3571{
3572 if (socinfo_init() < 0)
3573 pr_err("socinfo_init() failed!\n");
3574
3575 BUG_ON(msm_rpm_init(&msm_rpm_data));
3576 BUG_ON(msm_rpmrs_levels_init(msm_rpmrs_levels,
3577 ARRAY_SIZE(msm_rpmrs_levels)));
3578 regulator_suppress_info_printing();
3579 if (msm_xo_init())
3580 pr_err("Failed to initialize XO votes\n");
David Collins26f05562011-06-20 09:56:28 -07003581 platform_device_register(&msm8960_device_rpm_regulator);
Stephen Boydbb600ae2011-08-02 20:11:40 -07003582 msm_clock_init(&msm8960_clock_init_data);
Stepan Moskovchenko14aa6492011-08-08 15:15:01 -07003583 msm8960_device_otg.dev.platform_data = &msm_otg_pdata;
3584 msm8960_device_gadget_peripheral.dev.parent = &msm8960_device_otg.dev;
3585 msm_device_hsusb_host.dev.parent = &msm8960_device_otg.dev;
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003586 gpiomux_init();
3587 ethernet_init();
3588 msm8960_device_qup_spi_gsbi1.dev.platform_data =
3589 &msm8960_qup_spi_gsbi1_pdata;
3590 spi_register_board_info(spi_board_info, ARRAY_SIZE(spi_board_info));
3591 msm8960_device_ssbi_pm8921.dev.platform_data =
3592 &msm8960_ssbi_pm8921_pdata;
3593 pm8921_platform_data.num_regulators = msm_pm8921_regulator_pdata_len;
3594 msm8960_i2c_init();
Lucille Sylvester34ec3692011-08-16 16:28:04 -06003595 msm8960_gfx_init();
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003596 msm_spm_init(msm_spm_data, ARRAY_SIZE(msm_spm_data));
3597 msm_spm_l2_init(msm_spm_l2_data);
3598 msm8960_init_buses();
3599 platform_add_devices(msm_footswitch_devices,
3600 msm_num_footswitch_devices);
3601 platform_add_devices(common_devices, ARRAY_SIZE(common_devices));
3602 pm8921_gpio_mpp_init();
3603 platform_add_devices(cdp_devices, ARRAY_SIZE(cdp_devices));
3604 msm8960_init_cam();
3605 msm8960_init_mmc();
3606 msm_acpu_clock_init(&msm8960_acpu_clock_data);
3607 register_i2c_devices();
3608 msm8960_wcnss_init();
3609 msm_fb_add_devices();
3610 slim_register_board_info(msm_slim_devices,
3611 ARRAY_SIZE(msm_slim_devices));
3612 msm8960_init_dsps();
3613 msm_pm_set_platform_data(msm_pm_data, ARRAY_SIZE(msm_pm_data));
3614 msm_pm_set_rpm_wakeup_irq(RPM_APCC_CPU0_WAKE_UP_IRQ);
3615 msm_cpuidle_set_states(msm_cstates, ARRAY_SIZE(msm_cstates),
3616 msm_pm_data);
Larry Bassela7eadea2011-07-14 10:46:00 -07003617 change_memory_power = &msm8960_change_memory_power;
Stepan Moskovchenkod056fca2011-01-27 12:12:07 -08003618}
3619
Stepan Moskovchenkof441ca22010-12-01 19:31:16 -08003620MACHINE_START(MSM8960_SIM, "QCT MSM8960 SIMULATOR")
3621 .map_io = msm8960_map_io,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003622 .reserve = msm8960_reserve,
Stepan Moskovchenkof441ca22010-12-01 19:31:16 -08003623 .init_irq = msm8960_init_irq,
3624 .timer = &msm_timer,
Stepan Moskovchenkod056fca2011-01-27 12:12:07 -08003625 .init_machine = msm8960_sim_init,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003626 .init_early = msm8960_allocate_memory_regions,
Stepan Moskovchenkof441ca22010-12-01 19:31:16 -08003627MACHINE_END
Stepan Moskovchenko50ede4e2010-12-13 18:12:19 -08003628
3629MACHINE_START(MSM8960_RUMI3, "QCT MSM8960 RUMI3")
3630 .map_io = msm8960_map_io,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003631 .reserve = msm8960_reserve,
Stepan Moskovchenko50ede4e2010-12-13 18:12:19 -08003632 .init_irq = msm8960_init_irq,
3633 .timer = &msm_timer,
Stepan Moskovchenkod056fca2011-01-27 12:12:07 -08003634 .init_machine = msm8960_rumi3_init,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003635 .init_early = msm8960_allocate_memory_regions,
Stepan Moskovchenko50ede4e2010-12-13 18:12:19 -08003636MACHINE_END
3637
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003638MACHINE_START(MSM8960_CDP, "QCT MSM8960 CDP")
3639 .map_io = msm8960_map_io,
3640 .reserve = msm8960_reserve,
3641 .init_irq = msm8960_init_irq,
3642 .timer = &msm_timer,
3643 .init_machine = msm8960_cdp_init,
3644 .init_early = msm8960_allocate_memory_regions,
3645MACHINE_END
3646
3647MACHINE_START(MSM8960_MTP, "QCT MSM8960 MTP")
3648 .map_io = msm8960_map_io,
3649 .reserve = msm8960_reserve,
3650 .init_irq = msm8960_init_irq,
3651 .timer = &msm_timer,
3652 .init_machine = msm8960_cdp_init,
3653 .init_early = msm8960_allocate_memory_regions,
3654MACHINE_END
3655
3656MACHINE_START(MSM8960_FLUID, "QCT MSM8960 FLUID")
3657 .map_io = msm8960_map_io,
3658 .reserve = msm8960_reserve,
3659 .init_irq = msm8960_init_irq,
3660 .timer = &msm_timer,
3661 .init_machine = msm8960_cdp_init,
3662 .init_early = msm8960_allocate_memory_regions,
3663MACHINE_END
Amir Samuelov0d1f8ae2011-07-28 11:13:58 +03003664
3665MACHINE_START(MSM8960_LIQUID, "QCT MSM8960 LIQUID")
3666 .map_io = msm8960_map_io,
3667 .reserve = msm8960_reserve,
3668 .init_irq = msm8960_init_irq,
3669 .timer = &msm_timer,
3670 .init_machine = msm8960_cdp_init,
3671 .init_early = msm8960_allocate_memory_regions,
3672MACHINE_END