blob: 488277287b8a90e62beefd5733df82c4e2b39700 [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,
Nagamalleswararao Ganjiad31c982011-08-15 23:24:17 -07001322 160000000,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001323 200000000,
1324};
1325
1326static struct msm_panel_common_pdata mdp_pdata = {
1327 .gpio = MDP_VSYNC_GPIO,
1328 .mdp_core_clk_rate = 85330000,
1329 .mdp_core_clk_table = mdp_core_clk_rate_table,
1330 .num_mdp_clk = ARRAY_SIZE(mdp_core_clk_rate_table),
1331#ifdef CONFIG_MSM_BUS_SCALING
1332 .mdp_bus_scale_table = &mdp_bus_scale_pdata,
1333#endif
1334 .mdp_rev = MDP_REV_42,
1335};
1336
1337static struct platform_device mipi_dsi_renesas_panel_device = {
1338 .name = "mipi_renesas",
1339 .id = 0,
1340};
1341
1342static struct platform_device mipi_dsi_simulator_panel_device = {
1343 .name = "mipi_simulator",
1344 .id = 0,
1345};
1346
Nagamalleswararao Ganjieac5dfa2011-07-23 17:31:16 -07001347#define LPM_CHANNEL0 0
1348static int toshiba_gpio[] = {LPM_CHANNEL0};
1349
1350static struct mipi_dsi_panel_platform_data toshiba_pdata = {
1351 .gpio = toshiba_gpio,
1352};
1353
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001354static struct platform_device mipi_dsi_toshiba_panel_device = {
1355 .name = "mipi_toshiba",
1356 .id = 0,
Nagamalleswararao Ganjieac5dfa2011-07-23 17:31:16 -07001357 .dev = {
1358 .platform_data = &toshiba_pdata,
1359 }
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001360};
1361
1362#ifdef CONFIG_FB_MSM_HDMI_MSM_PANEL
1363static struct resource hdmi_msm_resources[] = {
1364 {
1365 .name = "hdmi_msm_qfprom_addr",
1366 .start = 0x00700000,
1367 .end = 0x007060FF,
1368 .flags = IORESOURCE_MEM,
1369 },
1370 {
1371 .name = "hdmi_msm_hdmi_addr",
1372 .start = 0x04A00000,
1373 .end = 0x04A00FFF,
1374 .flags = IORESOURCE_MEM,
1375 },
1376 {
1377 .name = "hdmi_msm_irq",
1378 .start = HDMI_IRQ,
1379 .end = HDMI_IRQ,
1380 .flags = IORESOURCE_IRQ,
1381 },
1382};
1383
1384static int hdmi_enable_5v(int on);
1385static int hdmi_core_power(int on, int show);
1386static int hdmi_cec_power(int on);
1387
1388static struct msm_hdmi_platform_data hdmi_msm_data = {
1389 .irq = HDMI_IRQ,
1390 .enable_5v = hdmi_enable_5v,
1391 .core_power = hdmi_core_power,
1392 .cec_power = hdmi_cec_power,
1393};
1394
1395static struct platform_device hdmi_msm_device = {
1396 .name = "hdmi_msm",
1397 .id = 0,
1398 .num_resources = ARRAY_SIZE(hdmi_msm_resources),
1399 .resource = hdmi_msm_resources,
1400 .dev.platform_data = &hdmi_msm_data,
1401};
1402#endif /* CONFIG_FB_MSM_HDMI_MSM_PANEL */
1403
Ravishangar Kalyanam882930f2011-07-08 17:51:52 -07001404#ifdef CONFIG_MSM_BUS_SCALING
1405static struct msm_bus_vectors dtv_bus_init_vectors[] = {
1406 {
1407 .src = MSM_BUS_MASTER_MDP_PORT0,
1408 .dst = MSM_BUS_SLAVE_EBI_CH0,
1409 .ab = 0,
1410 .ib = 0,
1411 },
1412};
1413static struct msm_bus_vectors dtv_bus_def_vectors[] = {
1414 {
1415 .src = MSM_BUS_MASTER_MDP_PORT0,
1416 .dst = MSM_BUS_SLAVE_EBI_CH0,
1417 .ab = 566092800 * 2,
1418 .ib = 707616000 * 2,
1419 },
1420};
1421static struct msm_bus_paths dtv_bus_scale_usecases[] = {
1422 {
1423 ARRAY_SIZE(dtv_bus_init_vectors),
1424 dtv_bus_init_vectors,
1425 },
1426 {
1427 ARRAY_SIZE(dtv_bus_def_vectors),
1428 dtv_bus_def_vectors,
1429 },
1430};
1431static struct msm_bus_scale_pdata dtv_bus_scale_pdata = {
1432 dtv_bus_scale_usecases,
1433 ARRAY_SIZE(dtv_bus_scale_usecases),
1434 .name = "dtv",
1435};
1436
1437static struct lcdc_platform_data dtv_pdata = {
1438 .bus_scale_table = &dtv_bus_scale_pdata,
1439};
1440#endif
1441
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001442static void __init msm_fb_add_devices(void)
1443{
1444 if (machine_is_msm8x60_rumi3()) {
1445 msm_fb_register_device("mdp", NULL);
1446 mipi_dsi_pdata.target_type = 1;
1447 } else
1448 msm_fb_register_device("mdp", &mdp_pdata);
1449 msm_fb_register_device("mipi_dsi", &mipi_dsi_pdata);
Ravishangar Kalyanam882930f2011-07-08 17:51:52 -07001450#ifdef CONFIG_MSM_BUS_SCALING
1451 msm_fb_register_device("dtv", &dtv_pdata);
1452#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001453}
1454
Ravishangar Kalyanamba99e512011-07-20 12:57:19 -07001455static struct gpiomux_setting mdp_vsync_suspend_cfg = {
1456 .func = GPIOMUX_FUNC_GPIO,
1457 .drv = GPIOMUX_DRV_2MA,
1458 .pull = GPIOMUX_PULL_DOWN,
1459};
1460
1461static struct gpiomux_setting mdp_vsync_active_cfg = {
1462 .func = GPIOMUX_FUNC_1,
1463 .drv = GPIOMUX_DRV_2MA,
1464 .pull = GPIOMUX_PULL_DOWN,
1465};
1466
1467static struct msm_gpiomux_config msm8960_mdp_vsync_configs[] __initdata = {
1468 {
1469 .gpio = MDP_VSYNC_GPIO,
1470 .settings = {
1471 [GPIOMUX_ACTIVE] = &mdp_vsync_active_cfg,
1472 [GPIOMUX_SUSPENDED] = &mdp_vsync_suspend_cfg,
1473 },
1474 }
1475};
1476
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001477#ifdef CONFIG_FB_MSM_HDMI_MSM_PANEL
1478static struct gpiomux_setting hdmi_suspend_cfg = {
1479 .func = GPIOMUX_FUNC_GPIO,
1480 .drv = GPIOMUX_DRV_2MA,
1481 .pull = GPIOMUX_PULL_DOWN,
1482};
1483
1484static struct gpiomux_setting hdmi_active_1_cfg = {
1485 .func = GPIOMUX_FUNC_1,
1486 .drv = GPIOMUX_DRV_2MA,
1487 .pull = GPIOMUX_PULL_UP,
1488};
1489
1490static struct gpiomux_setting hdmi_active_2_cfg = {
1491 .func = GPIOMUX_FUNC_1,
1492 .drv = GPIOMUX_DRV_2MA,
1493 .pull = GPIOMUX_PULL_DOWN,
1494};
1495
1496static struct msm_gpiomux_config msm8960_hdmi_configs[] __initdata = {
1497 {
1498 .gpio = 99,
1499 .settings = {
1500 [GPIOMUX_ACTIVE] = &hdmi_active_1_cfg,
1501 [GPIOMUX_SUSPENDED] = &hdmi_suspend_cfg,
1502 },
1503 },
1504 {
1505 .gpio = 100,
1506 .settings = {
1507 [GPIOMUX_ACTIVE] = &hdmi_active_1_cfg,
1508 [GPIOMUX_SUSPENDED] = &hdmi_suspend_cfg,
1509 },
1510 },
1511 {
1512 .gpio = 101,
1513 .settings = {
1514 [GPIOMUX_ACTIVE] = &hdmi_active_1_cfg,
1515 [GPIOMUX_SUSPENDED] = &hdmi_suspend_cfg,
1516 },
1517 },
1518 {
1519 .gpio = 102,
1520 .settings = {
1521 [GPIOMUX_ACTIVE] = &hdmi_active_2_cfg,
1522 [GPIOMUX_SUSPENDED] = &hdmi_suspend_cfg,
1523 },
1524 },
1525};
1526
1527static int hdmi_enable_5v(int on)
1528{
1529 /* TBD: PM8921 regulator instead of 8901 */
1530 static struct regulator *reg_8921_hdmi_mvs; /* HDMI_5V */
1531 static int prev_on;
1532 int rc;
1533
1534 if (on == prev_on)
1535 return 0;
1536
1537 if (!reg_8921_hdmi_mvs)
1538 reg_8921_hdmi_mvs = regulator_get(&hdmi_msm_device.dev,
1539 "hdmi_mvs");
1540
1541 if (on) {
1542 rc = regulator_enable(reg_8921_hdmi_mvs);
1543 if (rc) {
1544 pr_err("'%s' regulator enable failed, rc=%d\n",
1545 "8921_hdmi_mvs", rc);
1546 return rc;
1547 }
1548 pr_debug("%s(on): success\n", __func__);
1549 } else {
1550 rc = regulator_disable(reg_8921_hdmi_mvs);
1551 if (rc)
1552 pr_warning("'%s' regulator disable failed, rc=%d\n",
1553 "8921_hdmi_mvs", rc);
1554 pr_debug("%s(off): success\n", __func__);
1555 }
1556
1557 prev_on = on;
1558
1559 return 0;
1560}
1561
1562static int hdmi_core_power(int on, int show)
1563{
1564 static struct regulator *reg_8921_l23, *reg_8921_s4;
1565 static int prev_on;
1566 int rc;
1567
1568 if (on == prev_on)
1569 return 0;
1570
1571 /* TBD: PM8921 regulator instead of 8901 */
1572 if (!reg_8921_l23)
1573 reg_8921_l23 = regulator_get(&hdmi_msm_device.dev, "hdmi_avdd");
1574
1575 if (!reg_8921_s4)
1576 reg_8921_s4 = regulator_get(&hdmi_msm_device.dev, "hdmi_vcc");
1577
1578 if (on) {
1579 rc = regulator_set_optimum_mode(reg_8921_l23, 100000);
1580 if (rc < 0) {
1581 pr_err("set_optimum_mode l23 failed, rc=%d\n", rc);
1582 return -EINVAL;
1583 }
1584
1585 rc = regulator_set_voltage(reg_8921_l23, 1800000, 1800000);
1586 if (!rc)
1587 rc = regulator_enable(reg_8921_l23);
1588 if (rc) {
1589 pr_err("'%s' regulator enable failed, rc=%d\n",
1590 "hdmi_avdd", rc);
1591 return rc;
1592 }
1593 rc = regulator_set_voltage(reg_8921_s4, 1800000, 1800000);
1594 if (!rc)
1595 rc = regulator_enable(reg_8921_s4);
1596 if (rc) {
1597 pr_err("'%s' regulator enable failed, rc=%d\n",
1598 "hdmi_vcc", rc);
1599 return rc;
1600 }
1601
1602 rc = gpio_request(100, "HDMI_DDC_CLK");
1603 if (rc) {
1604 pr_err("'%s'(%d) gpio_request failed, rc=%d\n",
1605 "HDMI_DDC_CLK", 100, rc);
1606 goto error1;
1607 }
1608 rc = gpio_request(101, "HDMI_DDC_DATA");
1609 if (rc) {
1610 pr_err("'%s'(%d) gpio_request failed, rc=%d\n",
1611 "HDMI_DDC_DATA", 101, rc);
1612 goto error2;
1613 }
1614 rc = gpio_request(102, "HDMI_HPD");
1615 if (rc) {
1616 pr_err("'%s'(%d) gpio_request failed, rc=%d\n",
1617 "HDMI_HPD", 102, rc);
1618 goto error3;
1619 }
1620 pr_debug("%s(on): success\n", __func__);
1621 } else {
1622 gpio_free(100);
1623 gpio_free(101);
1624 gpio_free(102);
1625
1626 rc = regulator_set_optimum_mode(reg_8921_l23, 100);
1627 if (rc < 0) {
1628 pr_err("set_optimum_mode l23 failed, rc=%d\n", rc);
1629 return -EINVAL;
1630 }
1631
1632 pr_debug("%s(off): success\n", __func__);
1633 }
1634
1635 prev_on = on;
1636
1637 return 0;
1638
1639error3:
1640 gpio_free(101);
1641error2:
1642 gpio_free(100);
1643error1:
1644 regulator_disable(reg_8921_l23);
1645 return rc;
1646}
1647
1648static int hdmi_cec_power(int on)
1649{
1650 static int prev_on;
1651 int rc;
1652
1653 if (on == prev_on)
1654 return 0;
1655
1656 if (on) {
1657 rc = gpio_request(99, "HDMI_CEC_VAR");
1658 if (rc) {
1659 pr_err("'%s'(%d) gpio_request failed, rc=%d\n",
1660 "HDMI_CEC_VAR", 99, rc);
1661 goto error;
1662 }
1663 pr_debug("%s(on): success\n", __func__);
1664 } else {
1665 gpio_free(99);
1666 pr_debug("%s(off): success\n", __func__);
1667 }
1668
1669 prev_on = on;
1670
1671 return 0;
1672error:
1673 return rc;
1674}
1675#endif /* CONFIG_FB_MSM_HDMI_MSM_PANEL */
1676
1677static void __init msm8960_allocate_memory_regions(void)
1678{
1679 void *addr;
1680 unsigned long size;
1681
1682 size = MSM_FB_SIZE;
1683 addr = alloc_bootmem_align(size, 0x1000);
1684 msm_fb_resources[0].start = __pa(addr);
1685 msm_fb_resources[0].end = msm_fb_resources[0].start + size - 1;
1686 pr_info("allocating %lu bytes at %p (%lx physical) for fb\n",
1687 size, addr, __pa(addr));
1688
1689}
1690#ifdef CONFIG_WCD9310_CODEC
1691
1692#define TABLA_INTERRUPT_BASE (NR_MSM_IRQS + NR_GPIO_IRQS + NR_PM8921_IRQS)
1693
Patrick Lai3043fba2011-08-01 14:15:57 -07001694/* Micbias setting is based on 8660 CDP/MTP/FLUID requirement
1695 * 4 micbiases are used to power various analog and digital
1696 * microphones operating at 1800 mV. Technically, all micbiases
1697 * can source from single cfilter since all microphones operate
1698 * at the same voltage level. The arrangement below is to make
1699 * sure all cfilters are exercised. LDO_H regulator ouput level
1700 * does not need to be as high as 2.85V. It is choosen for
1701 * microphone sensitivity purpose.
1702 */
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001703static struct tabla_pdata tabla_platform_data = {
1704 .slimbus_slave_device = {
1705 .name = "tabla-slave",
1706 .e_addr = {0, 0, 0x10, 0, 0x17, 2},
1707 },
1708 .irq = MSM_GPIO_TO_INT(62),
1709 .irq_base = TABLA_INTERRUPT_BASE,
1710 .num_irqs = NR_TABLA_IRQS,
1711 .reset_gpio = PM8921_GPIO_PM_TO_SYS(34),
Patrick Lai3043fba2011-08-01 14:15:57 -07001712 .micbias = {
1713 .ldoh_v = TABLA_LDOH_2P85_V,
1714 .cfilt1_mv = 1800,
1715 .cfilt2_mv = 1800,
1716 .cfilt3_mv = 1800,
1717 .bias1_cfilt_sel = TABLA_CFILT1_SEL,
1718 .bias2_cfilt_sel = TABLA_CFILT2_SEL,
1719 .bias3_cfilt_sel = TABLA_CFILT3_SEL,
1720 .bias4_cfilt_sel = TABLA_CFILT3_SEL,
1721 }
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001722};
1723
1724static struct slim_device msm_slim_tabla = {
1725 .name = "tabla-slim",
1726 .e_addr = {0, 1, 0x10, 0, 0x17, 2},
1727 .dev = {
1728 .platform_data = &tabla_platform_data,
1729 },
1730};
1731#endif
1732
1733static struct slim_boardinfo msm_slim_devices[] = {
1734#ifdef CONFIG_WCD9310_CODEC
1735 {
1736 .bus_num = 1,
1737 .slim_slave = &msm_slim_tabla,
1738 },
1739#endif
1740 /* add more slimbus slaves as needed */
1741};
1742
Yunsen Wang5c1a7392011-07-09 19:10:16 -07001743#define MSM_WCNSS_PHYS 0x03000000
1744#define MSM_WCNSS_SIZE 0x280000
1745
1746static struct resource resources_wcnss_wlan[] = {
1747 {
1748 .start = RIVA_APPS_WLAN_RX_DATA_AVAIL_IRQ,
1749 .end = RIVA_APPS_WLAN_RX_DATA_AVAIL_IRQ,
1750 .name = "wcnss_wlanrx_irq",
1751 .flags = IORESOURCE_IRQ,
1752 },
1753 {
1754 .start = RIVA_APPS_WLAN_DATA_XFER_DONE_IRQ,
1755 .end = RIVA_APPS_WLAN_DATA_XFER_DONE_IRQ,
1756 .name = "wcnss_wlantx_irq",
1757 .flags = IORESOURCE_IRQ,
1758 },
1759 {
1760 .start = MSM_WCNSS_PHYS,
1761 .end = MSM_WCNSS_PHYS + MSM_WCNSS_SIZE - 1,
1762 .name = "wcnss_mmio",
1763 .flags = IORESOURCE_MEM,
1764 },
1765};
1766
Ankur Nandwanib0039b02011-08-09 14:00:45 -07001767static struct qcom_wcnss_opts qcom_wcnss_pdata = {
1768 .has_48mhz_xo = 1,
1769};
1770
Yunsen Wang5c1a7392011-07-09 19:10:16 -07001771static struct platform_device msm_device_wcnss_wlan = {
1772 .name = "wcnss_wlan",
1773 .id = 0,
1774 .num_resources = ARRAY_SIZE(resources_wcnss_wlan),
1775 .resource = resources_wcnss_wlan,
Ankur Nandwanib0039b02011-08-09 14:00:45 -07001776 .dev = {.platform_data = &qcom_wcnss_pdata},
Yunsen Wang5c1a7392011-07-09 19:10:16 -07001777};
1778
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001779#if defined(CONFIG_CRYPTO_DEV_QCRYPTO) || \
1780 defined(CONFIG_CRYPTO_DEV_QCRYPTO_MODULE) || \
1781 defined(CONFIG_CRYPTO_DEV_QCEDEV) || \
1782 defined(CONFIG_CRYPTO_DEV_QCEDEV_MODULE)
1783
1784#define QCE_SIZE 0x10000
1785#define QCE_0_BASE 0x18500000
1786
1787#define QCE_HW_KEY_SUPPORT 0
1788#define QCE_SHA_HMAC_SUPPORT 1
1789#define QCE_SHARE_CE_RESOURCE 1
1790#define QCE_CE_SHARED 0
1791
1792static struct resource qcrypto_resources[] = {
1793 [0] = {
1794 .start = QCE_0_BASE,
1795 .end = QCE_0_BASE + QCE_SIZE - 1,
1796 .flags = IORESOURCE_MEM,
1797 },
1798 [1] = {
1799 .name = "crypto_channels",
1800 .start = DMOV_CE_IN_CHAN,
1801 .end = DMOV_CE_OUT_CHAN,
1802 .flags = IORESOURCE_DMA,
1803 },
1804 [2] = {
1805 .name = "crypto_crci_in",
1806 .start = DMOV_CE_IN_CRCI,
1807 .end = DMOV_CE_IN_CRCI,
1808 .flags = IORESOURCE_DMA,
1809 },
1810 [3] = {
1811 .name = "crypto_crci_out",
1812 .start = DMOV_CE_OUT_CRCI,
1813 .end = DMOV_CE_OUT_CRCI,
1814 .flags = IORESOURCE_DMA,
1815 },
1816};
1817
1818static struct resource qcedev_resources[] = {
1819 [0] = {
1820 .start = QCE_0_BASE,
1821 .end = QCE_0_BASE + QCE_SIZE - 1,
1822 .flags = IORESOURCE_MEM,
1823 },
1824 [1] = {
1825 .name = "crypto_channels",
1826 .start = DMOV_CE_IN_CHAN,
1827 .end = DMOV_CE_OUT_CHAN,
1828 .flags = IORESOURCE_DMA,
1829 },
1830 [2] = {
1831 .name = "crypto_crci_in",
1832 .start = DMOV_CE_IN_CRCI,
1833 .end = DMOV_CE_IN_CRCI,
1834 .flags = IORESOURCE_DMA,
1835 },
1836 [3] = {
1837 .name = "crypto_crci_out",
1838 .start = DMOV_CE_OUT_CRCI,
1839 .end = DMOV_CE_OUT_CRCI,
1840 .flags = IORESOURCE_DMA,
1841 },
1842};
1843
1844#endif
1845
1846#if defined(CONFIG_CRYPTO_DEV_QCRYPTO) || \
1847 defined(CONFIG_CRYPTO_DEV_QCRYPTO_MODULE)
1848
1849static struct msm_ce_hw_support qcrypto_ce_hw_suppport = {
1850 .ce_shared = QCE_CE_SHARED,
1851 .shared_ce_resource = QCE_SHARE_CE_RESOURCE,
1852 .hw_key_support = QCE_HW_KEY_SUPPORT,
1853 .sha_hmac = QCE_SHA_HMAC_SUPPORT,
1854};
1855
1856static struct platform_device qcrypto_device = {
1857 .name = "qcrypto",
1858 .id = 0,
1859 .num_resources = ARRAY_SIZE(qcrypto_resources),
1860 .resource = qcrypto_resources,
1861 .dev = {
1862 .coherent_dma_mask = DMA_BIT_MASK(32),
1863 .platform_data = &qcrypto_ce_hw_suppport,
1864 },
1865};
1866#endif
1867
1868#if defined(CONFIG_CRYPTO_DEV_QCEDEV) || \
1869 defined(CONFIG_CRYPTO_DEV_QCEDEV_MODULE)
1870
1871static struct msm_ce_hw_support qcedev_ce_hw_suppport = {
1872 .ce_shared = QCE_CE_SHARED,
1873 .shared_ce_resource = QCE_SHARE_CE_RESOURCE,
1874 .hw_key_support = QCE_HW_KEY_SUPPORT,
1875 .sha_hmac = QCE_SHA_HMAC_SUPPORT,
1876};
1877
1878static struct platform_device qcedev_device = {
1879 .name = "qce",
1880 .id = 0,
1881 .num_resources = ARRAY_SIZE(qcedev_resources),
1882 .resource = qcedev_resources,
1883 .dev = {
1884 .coherent_dma_mask = DMA_BIT_MASK(32),
1885 .platform_data = &qcedev_ce_hw_suppport,
1886 },
1887};
1888#endif
1889
1890
1891static int __init gpiomux_init(void)
1892{
1893 int rc;
1894
1895 rc = msm_gpiomux_init(NR_GPIO_IRQS);
1896 if (rc) {
1897 pr_err(KERN_ERR "msm_gpiomux_init failed %d\n", rc);
1898 return rc;
1899 }
1900
1901 msm_gpiomux_install(msm8960_cam_configs,
1902 ARRAY_SIZE(msm8960_cam_configs));
1903
1904 msm_gpiomux_install(msm8960_gpiomux_configs,
Stepan Moskovchenkod2a45a82011-08-09 17:02:57 -07001905 ARRAY_SIZE(msm8960_gpiomux_configs));
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001906
1907 msm_gpiomux_install(msm8960_gsbi_configs,
1908 ARRAY_SIZE(msm8960_gsbi_configs));
1909
1910 msm_gpiomux_install(msm8960_cyts_configs,
1911 ARRAY_SIZE(msm8960_cyts_configs));
1912
1913 msm_gpiomux_install(msm8960_slimbus_config,
1914 ARRAY_SIZE(msm8960_slimbus_config));
1915
1916 msm_gpiomux_install(msm8960_audio_codec_configs,
1917 ARRAY_SIZE(msm8960_audio_codec_configs));
1918
1919#ifdef CONFIG_FB_MSM_HDMI_MSM_PANEL
1920 msm_gpiomux_install(msm8960_hdmi_configs,
1921 ARRAY_SIZE(msm8960_hdmi_configs));
1922#endif
1923
Ravishangar Kalyanamba99e512011-07-20 12:57:19 -07001924 msm_gpiomux_install(msm8960_mdp_vsync_configs,
1925 ARRAY_SIZE(msm8960_mdp_vsync_configs));
1926
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001927 msm_gpiomux_install(wcnss_5wire_interface,
1928 ARRAY_SIZE(wcnss_5wire_interface));
1929
1930 return 0;
1931}
1932
1933static struct msm_acpu_clock_platform_data msm8960_acpu_clock_data = {
1934 .acpu_switch_time_us = 0,
1935 .vdd_switch_time_us = 0,
1936};
1937
1938#define MSM_SHARED_RAM_PHYS 0x80000000
1939
1940static struct pm8921_adc_amux pm8921_adc_channels_data[] = {
1941 {"vcoin", CHANNEL_VCOIN, CHAN_PATH_SCALING2, AMUX_RSV1,
1942 ADC_DECIMATION_TYPE2, ADC_SCALE_DEFAULT},
1943 {"vbat", CHANNEL_VBAT, CHAN_PATH_SCALING2, AMUX_RSV1,
1944 ADC_DECIMATION_TYPE2, ADC_SCALE_DEFAULT},
1945 {"dcin", CHANNEL_DCIN, CHAN_PATH_SCALING4, AMUX_RSV1,
1946 ADC_DECIMATION_TYPE2, ADC_SCALE_DEFAULT},
1947 {"ichg", CHANNEL_ICHG, CHAN_PATH_SCALING1, AMUX_RSV1,
1948 ADC_DECIMATION_TYPE2, ADC_SCALE_DEFAULT},
1949 {"vph_pwr", CHANNEL_VPH_PWR, CHAN_PATH_SCALING2, AMUX_RSV1,
1950 ADC_DECIMATION_TYPE2, ADC_SCALE_DEFAULT},
1951 {"ibat", CHANNEL_IBAT, CHAN_PATH_SCALING1, AMUX_RSV1,
1952 ADC_DECIMATION_TYPE2, ADC_SCALE_DEFAULT},
1953 {"m4", CHANNEL_MPP_1, CHAN_PATH_SCALING1, AMUX_RSV1,
1954 ADC_DECIMATION_TYPE2, ADC_SCALE_DEFAULT},
1955 {"m5", CHANNEL_MPP_2, CHAN_PATH_SCALING2, AMUX_RSV1,
1956 ADC_DECIMATION_TYPE2, ADC_SCALE_DEFAULT},
1957 {"batt_therm", CHANNEL_BATT_THERM, CHAN_PATH_SCALING1, AMUX_RSV2,
1958 ADC_DECIMATION_TYPE2, ADC_SCALE_BATT_THERM},
1959 {"batt_id", CHANNEL_BATT_ID, CHAN_PATH_SCALING1, AMUX_RSV1,
1960 ADC_DECIMATION_TYPE2, ADC_SCALE_DEFAULT},
1961 {"usbin", CHANNEL_USBIN, CHAN_PATH_SCALING3, AMUX_RSV1,
1962 ADC_DECIMATION_TYPE2, ADC_SCALE_DEFAULT},
1963 {"pmic_therm", CHANNEL_DIE_TEMP, CHAN_PATH_SCALING1, AMUX_RSV1,
1964 ADC_DECIMATION_TYPE2, ADC_SCALE_PMIC_THERM},
1965 {"625mv", CHANNEL_625MV, CHAN_PATH_SCALING1, AMUX_RSV1,
1966 ADC_DECIMATION_TYPE2, ADC_SCALE_DEFAULT},
1967 {"125v", CHANNEL_125V, CHAN_PATH_SCALING1, AMUX_RSV1,
1968 ADC_DECIMATION_TYPE2, ADC_SCALE_DEFAULT},
1969 {"chg_temp", CHANNEL_CHG_TEMP, CHAN_PATH_SCALING1, AMUX_RSV1,
1970 ADC_DECIMATION_TYPE2, ADC_SCALE_DEFAULT},
1971};
1972
1973static struct pm8921_adc_properties pm8921_adc_data = {
1974 .adc_vdd_reference = 1800, /* milli-voltage for this adc */
1975 .bitresolution = 15,
1976 .bipolar = 0,
1977};
1978
1979static struct pm8921_adc_platform_data pm8921_adc_pdata = {
1980 .adc_channel = pm8921_adc_channels_data,
1981 .adc_num_channel = ARRAY_SIZE(pm8921_adc_channels_data),
1982 .adc_prop = &pm8921_adc_data,
1983};
Stepan Moskovchenkod056fca2011-01-27 12:12:07 -08001984
Stepan Moskovchenkof441ca22010-12-01 19:31:16 -08001985static void __init msm8960_map_io(void)
1986{
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001987 msm_shared_ram_phys = MSM_SHARED_RAM_PHYS;
Stepan Moskovchenkof441ca22010-12-01 19:31:16 -08001988 msm_map_msm8960_io();
1989}
1990
1991static void __init msm8960_init_irq(void)
1992{
1993 unsigned int i;
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001994
1995 msm_mpm_irq_extn_init();
Stepan Moskovchenkof441ca22010-12-01 19:31:16 -08001996 gic_init(0, GIC_PPI_START, MSM_QGIC_DIST_BASE,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001997 (void *)MSM_QGIC_CPU_BASE);
Stepan Moskovchenkof441ca22010-12-01 19:31:16 -08001998
1999 /* Edge trigger PPIs except AVS_SVICINT and AVS_SVICINTSWDONE */
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002000 writel_relaxed(0xFFFFD7FF, MSM_QGIC_DIST_BASE + GIC_DIST_CONFIG + 4);
Stepan Moskovchenkof441ca22010-12-01 19:31:16 -08002001
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002002 writel_relaxed(0x0000FFFF, MSM_QGIC_DIST_BASE + GIC_DIST_ENABLE_SET);
2003 mb();
Stepan Moskovchenko50ede4e2010-12-13 18:12:19 -08002004
Stepan Moskovchenkof441ca22010-12-01 19:31:16 -08002005 /* FIXME: Not installing AVS_SVICINT and AVS_SVICINTSWDONE yet
2006 * as they are configured as level, which does not play nice with
2007 * handle_percpu_irq.
2008 */
2009 for (i = GIC_PPI_START; i < GIC_SPI_START; i++) {
2010 if (i != AVS_SVICINT && i != AVS_SVICINTSWDONE)
Thomas Gleixner6845664a2011-03-24 13:25:22 +01002011 irq_set_handler(i, handle_percpu_irq);
Stepan Moskovchenkof441ca22010-12-01 19:31:16 -08002012 }
2013}
2014
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002015/* MSM8960 have 5 SDCC controllers */
2016enum sdcc_controllers {
2017 SDCC1,
2018 SDCC2,
2019 SDCC3,
2020 SDCC4,
2021 SDCC5,
2022 MAX_SDCC_CONTROLLER
2023};
2024
2025/* All SDCC controllers requires VDD/VCC voltage */
2026static struct msm_mmc_reg_data mmc_vdd_reg_data[MAX_SDCC_CONTROLLER] = {
2027 /* SDCC1 : eMMC card connected */
2028 [SDCC1] = {
2029 .name = "sdc_vdd",
2030 .set_voltage_sup = 1,
Subhash Jadavani99ba53a2011-08-01 16:04:18 +05302031 .high_vol_level = 2950000,
2032 .low_vol_level = 2950000,
Subhash Jadavanidd7ef892011-08-18 16:49:57 +05302033 .always_on = 1,
2034 .lpm_sup = 1,
2035 .lpm_uA = 9000,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002036 .hpm_uA = 200000, /* 200mA */
2037 },
2038 /* SDCC3 : External card slot connected */
2039 [SDCC3] = {
2040 .name = "sdc_vdd",
2041 .set_voltage_sup = 1,
Subhash Jadavani99ba53a2011-08-01 16:04:18 +05302042 .high_vol_level = 2950000,
2043 .low_vol_level = 2950000,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002044 .hpm_uA = 600000, /* 600mA */
2045 }
2046};
2047
2048/* Only slots having eMMC card will require VCCQ voltage */
2049static struct msm_mmc_reg_data mmc_vccq_reg_data[1] = {
2050 /* SDCC1 : eMMC card connected */
2051 [SDCC1] = {
2052 .name = "sdc_vccq",
2053 .set_voltage_sup = 1,
2054 .always_on = 1,
Subhash Jadavani99ba53a2011-08-01 16:04:18 +05302055 .high_vol_level = 1800000,
2056 .low_vol_level = 1800000,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002057 .hpm_uA = 200000, /* 200mA */
2058 }
2059};
2060
2061/* All SDCC controllers may require voting for VDD PAD voltage */
2062static struct msm_mmc_reg_data mmc_vddp_reg_data[MAX_SDCC_CONTROLLER] = {
2063 /* SDCC3 : External card slot connected */
2064 [SDCC3] = {
2065 .name = "sdc_vddp",
2066 .set_voltage_sup = 1,
Subhash Jadavani99ba53a2011-08-01 16:04:18 +05302067 .high_vol_level = 2950000,
2068 .low_vol_level = 1850000,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002069 .always_on = 1,
2070 .lpm_sup = 1,
2071 /* Max. Active current required is 16 mA */
2072 .hpm_uA = 16000,
2073 /*
2074 * Sleep current required is ~300 uA. But min. vote can be
2075 * in terms of mA (min. 1 mA). So let's vote for 2 mA
2076 * during sleep.
2077 */
2078 .lpm_uA = 2000,
2079 }
2080};
2081
2082static struct msm_mmc_slot_reg_data mmc_slot_vreg_data[MAX_SDCC_CONTROLLER] = {
2083 /* SDCC1 : eMMC card connected */
2084 [SDCC1] = {
2085 .vdd_data = &mmc_vdd_reg_data[SDCC1],
2086 .vccq_data = &mmc_vccq_reg_data[SDCC1],
2087 },
2088 /* SDCC3 : External card slot connected */
2089 [SDCC3] = {
2090 .vdd_data = &mmc_vdd_reg_data[SDCC3],
2091 .vddp_data = &mmc_vddp_reg_data[SDCC3],
2092 }
2093};
2094
2095/* SDC1 pad data */
2096static struct msm_mmc_pad_drv sdc1_pad_drv_on_cfg[] = {
2097 {TLMM_HDRV_SDC1_CLK, GPIO_CFG_16MA},
Subhash Jadavani87bda5a2011-08-30 17:40:44 +05302098 {TLMM_HDRV_SDC1_CMD, GPIO_CFG_10MA},
2099 {TLMM_HDRV_SDC1_DATA, GPIO_CFG_10MA}
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002100};
2101
2102static struct msm_mmc_pad_drv sdc1_pad_drv_off_cfg[] = {
2103 {TLMM_HDRV_SDC1_CLK, GPIO_CFG_2MA},
2104 {TLMM_HDRV_SDC1_CMD, GPIO_CFG_2MA},
2105 {TLMM_HDRV_SDC1_DATA, GPIO_CFG_2MA}
2106};
2107
2108static struct msm_mmc_pad_pull sdc1_pad_pull_on_cfg[] = {
2109 {TLMM_PULL_SDC1_CMD, GPIO_CFG_PULL_UP},
2110 {TLMM_PULL_SDC1_DATA, GPIO_CFG_PULL_UP}
2111};
2112
2113static struct msm_mmc_pad_pull sdc1_pad_pull_off_cfg[] = {
2114 {TLMM_PULL_SDC1_CMD, GPIO_CFG_PULL_DOWN},
2115 {TLMM_PULL_SDC1_DATA, GPIO_CFG_PULL_DOWN}
2116};
2117
2118/* SDC3 pad data */
2119static struct msm_mmc_pad_drv sdc3_pad_drv_on_cfg[] = {
2120 {TLMM_HDRV_SDC3_CLK, GPIO_CFG_8MA},
2121 {TLMM_HDRV_SDC3_CMD, GPIO_CFG_8MA},
2122 {TLMM_HDRV_SDC3_DATA, GPIO_CFG_8MA}
2123};
2124
2125static struct msm_mmc_pad_drv sdc3_pad_drv_off_cfg[] = {
2126 {TLMM_HDRV_SDC3_CLK, GPIO_CFG_2MA},
2127 {TLMM_HDRV_SDC3_CMD, GPIO_CFG_2MA},
2128 {TLMM_HDRV_SDC3_DATA, GPIO_CFG_2MA}
2129};
2130
2131static struct msm_mmc_pad_pull sdc3_pad_pull_on_cfg[] = {
2132 {TLMM_PULL_SDC3_CMD, GPIO_CFG_PULL_UP},
2133 {TLMM_PULL_SDC3_DATA, GPIO_CFG_PULL_UP}
2134};
2135
2136static struct msm_mmc_pad_pull sdc3_pad_pull_off_cfg[] = {
2137 {TLMM_PULL_SDC3_CMD, GPIO_CFG_PULL_DOWN},
2138 {TLMM_PULL_SDC3_DATA, GPIO_CFG_PULL_DOWN}
2139};
2140
2141struct msm_mmc_pad_pull_data mmc_pad_pull_data[MAX_SDCC_CONTROLLER] = {
2142 [SDCC1] = {
2143 .on = sdc1_pad_pull_on_cfg,
2144 .off = sdc1_pad_pull_off_cfg,
2145 .size = ARRAY_SIZE(sdc1_pad_pull_on_cfg)
2146 },
2147 [SDCC3] = {
2148 .on = sdc3_pad_pull_on_cfg,
2149 .off = sdc3_pad_pull_off_cfg,
2150 .size = ARRAY_SIZE(sdc3_pad_pull_on_cfg)
2151 },
2152};
2153
2154struct msm_mmc_pad_drv_data mmc_pad_drv_data[MAX_SDCC_CONTROLLER] = {
2155 [SDCC1] = {
2156 .on = sdc1_pad_drv_on_cfg,
2157 .off = sdc1_pad_drv_off_cfg,
2158 .size = ARRAY_SIZE(sdc1_pad_drv_on_cfg)
2159 },
2160 [SDCC3] = {
2161 .on = sdc3_pad_drv_on_cfg,
2162 .off = sdc3_pad_drv_off_cfg,
2163 .size = ARRAY_SIZE(sdc3_pad_drv_on_cfg)
2164 },
2165};
2166
2167struct msm_mmc_pad_data mmc_pad_data[MAX_SDCC_CONTROLLER] = {
2168 [SDCC1] = {
2169 .pull = &mmc_pad_pull_data[SDCC1],
2170 .drv = &mmc_pad_drv_data[SDCC1]
2171 },
2172 [SDCC3] = {
2173 .pull = &mmc_pad_pull_data[SDCC3],
2174 .drv = &mmc_pad_drv_data[SDCC3]
2175 },
2176};
2177
2178struct msm_mmc_pin_data mmc_slot_pin_data[MAX_SDCC_CONTROLLER] = {
2179 [SDCC1] = {
2180 .pad_data = &mmc_pad_data[SDCC1],
2181 },
2182 [SDCC3] = {
2183 .pad_data = &mmc_pad_data[SDCC3],
2184 },
2185};
2186
2187static unsigned int sdc1_sup_clk_rates[] = {
Subhash Jadavani0e027b72011-08-30 17:40:55 +05302188 400000, 24000000, 48000000
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002189};
2190
2191static unsigned int sdc3_sup_clk_rates[] = {
2192 400000, 24000000, 48000000, 96000000
2193};
2194
2195#ifdef CONFIG_MMC_MSM_SDC1_SUPPORT
2196static struct mmc_platform_data msm8960_sdc1_data = {
2197 .ocr_mask = MMC_VDD_27_28 | MMC_VDD_28_29,
2198#ifdef CONFIG_MMC_MSM_SDC1_8_BIT_SUPPORT
2199 .mmc_bus_width = MMC_CAP_8_BIT_DATA,
2200#else
2201 .mmc_bus_width = MMC_CAP_4_BIT_DATA,
2202#endif
2203 .sup_clk_table = sdc1_sup_clk_rates,
2204 .sup_clk_cnt = ARRAY_SIZE(sdc1_sup_clk_rates),
2205 .nonremovable = 1,
2206 .sdcc_v4_sup = true,
2207 .vreg_data = &mmc_slot_vreg_data[SDCC1],
Subhash Jadavani0e027b72011-08-30 17:40:55 +05302208 .pin_data = &mmc_slot_pin_data[SDCC1]
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002209};
2210#endif
2211
2212#ifdef CONFIG_MMC_MSM_SDC3_SUPPORT
2213static struct mmc_platform_data msm8960_sdc3_data = {
2214 .ocr_mask = MMC_VDD_27_28 | MMC_VDD_28_29,
2215 .mmc_bus_width = MMC_CAP_4_BIT_DATA,
2216 .sup_clk_table = sdc3_sup_clk_rates,
2217 .sup_clk_cnt = ARRAY_SIZE(sdc3_sup_clk_rates),
2218 .wpswitch_gpio = PM8921_GPIO_PM_TO_SYS(16),
2219 .sdcc_v4_sup = true,
2220 .vreg_data = &mmc_slot_vreg_data[SDCC3],
2221 .pin_data = &mmc_slot_pin_data[SDCC3],
2222#ifdef CONFIG_MMC_MSM_CARD_HW_DETECTION
2223 .status_gpio = PM8921_GPIO_PM_TO_SYS(26),
2224 .status_irq = PM8921_GPIO_IRQ(PM8921_IRQ_BASE, 26),
2225 .irq_flags = IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING,
2226#endif
2227 .xpc_cap = 1,
2228 .uhs_caps = (MMC_CAP_UHS_SDR12 | MMC_CAP_UHS_SDR25 |
2229 MMC_CAP_UHS_SDR50 | MMC_CAP_UHS_DDR50 |
Subhash Jadavani0e027b72011-08-30 17:40:55 +05302230 MMC_CAP_MAX_CURRENT_600)
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002231};
2232#endif
2233
2234static void __init msm8960_init_mmc(void)
2235{
2236#ifdef CONFIG_MMC_MSM_SDC1_SUPPORT
2237 /* SDC1 : eMMC card connected */
2238 msm_add_sdcc(1, &msm8960_sdc1_data);
2239#endif
2240#ifdef CONFIG_MMC_MSM_SDC3_SUPPORT
2241 /* SDC3: External card slot */
2242 msm_add_sdcc(3, &msm8960_sdc3_data);
2243#endif
2244}
2245
2246static void __init msm8960_init_buses(void)
2247{
2248#ifdef CONFIG_MSM_BUS_SCALING
2249 msm_bus_apps_fabric_pdata.rpm_enabled = 1;
2250 msm_bus_sys_fabric_pdata.rpm_enabled = 1;
2251 msm_bus_mm_fabric_pdata.rpm_enabled = 1;
2252 msm_bus_sys_fpb_pdata.rpm_enabled = 1;
2253 msm_bus_cpss_fpb_pdata.rpm_enabled = 1;
2254 msm_bus_apps_fabric.dev.platform_data = &msm_bus_apps_fabric_pdata;
2255 msm_bus_sys_fabric.dev.platform_data = &msm_bus_sys_fabric_pdata;
2256 msm_bus_mm_fabric.dev.platform_data = &msm_bus_mm_fabric_pdata;
2257 msm_bus_sys_fpb.dev.platform_data = &msm_bus_sys_fpb_pdata;
2258 msm_bus_cpss_fpb.dev.platform_data = &msm_bus_cpss_fpb_pdata;
2259#endif
2260}
2261
2262static struct msm_spi_platform_data msm8960_qup_spi_gsbi1_pdata = {
2263 .max_clock_speed = 15060000,
2264};
2265
2266#ifdef CONFIG_USB_MSM_OTG_72K
2267static struct msm_otg_platform_data msm_otg_pdata;
2268#else
2269#define USB_5V_EN 42
2270static void msm_hsusb_vbus_power(bool on)
2271{
2272 int rc;
2273 static bool vbus_is_on;
2274 static struct regulator *mvs_otg_switch;
2275 struct pm_gpio param = {
2276 .direction = PM_GPIO_DIR_OUT,
2277 .output_buffer = PM_GPIO_OUT_BUF_CMOS,
2278 .output_value = 1,
2279 .pull = PM_GPIO_PULL_NO,
2280 .vin_sel = PM_GPIO_VIN_S4,
2281 .out_strength = PM_GPIO_STRENGTH_MED,
2282 .function = PM_GPIO_FUNC_NORMAL,
2283 };
2284
2285 if (vbus_is_on == on)
2286 return;
2287
2288 if (on) {
Stepan Moskovchenko14aa6492011-08-08 15:15:01 -07002289 mvs_otg_switch = regulator_get(&msm8960_device_otg.dev,
2290 "vbus_otg");
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002291 if (IS_ERR(mvs_otg_switch)) {
2292 pr_err("Unable to get mvs_otg_switch\n");
2293 return;
2294 }
2295
2296 rc = gpio_request(PM8921_GPIO_PM_TO_SYS(USB_5V_EN),
2297 "usb_5v_en");
2298 if (rc < 0) {
2299 pr_err("failed to request usb_5v_en gpio\n");
2300 goto put_mvs_otg;
2301 }
2302
2303 if (regulator_enable(mvs_otg_switch)) {
2304 pr_err("unable to enable mvs_otg_switch\n");
2305 goto free_usb_5v_en;
2306 }
2307
2308 rc = pm8xxx_gpio_config(PM8921_GPIO_PM_TO_SYS(USB_5V_EN),
2309 &param);
2310 if (rc < 0) {
2311 pr_err("failed to configure usb_5v_en gpio\n");
2312 goto disable_mvs_otg;
2313 }
2314 vbus_is_on = true;
2315 return;
2316 }
2317disable_mvs_otg:
2318 regulator_disable(mvs_otg_switch);
2319free_usb_5v_en:
2320 gpio_free(PM8921_GPIO_PM_TO_SYS(USB_5V_EN));
2321put_mvs_otg:
2322 regulator_put(mvs_otg_switch);
2323 vbus_is_on = false;
2324}
2325
2326static struct msm_otg_platform_data msm_otg_pdata = {
2327 .mode = USB_OTG,
2328 .otg_control = OTG_PMIC_CONTROL,
2329 .phy_type = SNPS_28NM_INTEGRATED_PHY,
2330 .pclk_src_name = "dfab_usb_hs_clk",
2331 .pmic_id_irq = PM8921_USB_ID_IN_IRQ(PM8921_IRQ_BASE),
2332 .vbus_power = msm_hsusb_vbus_power,
2333};
2334#endif
2335
2336#define PID_MAGIC_ID 0x71432909
2337#define SERIAL_NUM_MAGIC_ID 0x61945374
2338#define SERIAL_NUMBER_LENGTH 127
2339#define DLOAD_USB_BASE_ADD 0x2A03F0C8
2340
2341struct magic_num_struct {
2342 uint32_t pid;
2343 uint32_t serial_num;
2344};
2345
2346struct dload_struct {
2347 uint32_t reserved1;
2348 uint32_t reserved2;
2349 uint32_t reserved3;
2350 uint16_t reserved4;
2351 uint16_t pid;
2352 char serial_number[SERIAL_NUMBER_LENGTH];
2353 uint16_t reserved5;
2354 struct magic_num_struct magic_struct;
2355};
2356
2357static int usb_diag_update_pid_and_serial_num(uint32_t pid, const char *snum)
2358{
2359 struct dload_struct __iomem *dload = 0;
2360
2361 dload = ioremap(DLOAD_USB_BASE_ADD, sizeof(*dload));
2362 if (!dload) {
2363 pr_err("%s: cannot remap I/O memory region: %08x\n",
2364 __func__, DLOAD_USB_BASE_ADD);
2365 return -ENXIO;
2366 }
2367
2368 pr_debug("%s: dload:%p pid:%x serial_num:%s\n",
2369 __func__, dload, pid, snum);
2370 /* update pid */
2371 dload->magic_struct.pid = PID_MAGIC_ID;
2372 dload->pid = pid;
2373
2374 /* update serial number */
2375 dload->magic_struct.serial_num = 0;
2376 if (!snum) {
2377 memset(dload->serial_number, 0, SERIAL_NUMBER_LENGTH);
2378 goto out;
2379 }
2380
2381 dload->magic_struct.serial_num = SERIAL_NUM_MAGIC_ID;
2382 strncpy(dload->serial_number, snum, SERIAL_NUMBER_LENGTH);
2383 dload->serial_number[SERIAL_NUMBER_LENGTH - 1] = '\0';
2384out:
2385 iounmap(dload);
2386 return 0;
2387}
2388
2389static struct android_usb_platform_data android_usb_pdata = {
2390 .update_pid_and_serial_num = usb_diag_update_pid_and_serial_num,
2391};
2392
Stepan Moskovchenko14aa6492011-08-08 15:15:01 -07002393static struct platform_device android_usb_device = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002394 .name = "android_usb",
2395 .id = -1,
2396 .dev = {
2397 .platform_data = &android_usb_pdata,
2398 },
2399};
2400
2401static uint8_t spm_wfi_cmd_sequence[] __initdata = {
2402 0x03, 0x0f,
2403};
2404
2405static uint8_t spm_power_collapse_without_rpm[] __initdata = {
2406 0x00, 0x24, 0x54, 0x10,
2407 0x09, 0x03, 0x01,
2408 0x10, 0x54, 0x30, 0x0C,
2409 0x24, 0x30, 0x0f,
2410};
2411
2412static uint8_t spm_power_collapse_with_rpm[] __initdata = {
2413 0x00, 0x24, 0x54, 0x10,
2414 0x09, 0x07, 0x01, 0x0B,
2415 0x10, 0x54, 0x30, 0x0C,
2416 0x24, 0x30, 0x0f,
2417};
2418
2419static struct msm_spm_seq_entry msm_spm_seq_list[] __initdata = {
2420 [0] = {
2421 .mode = MSM_SPM_MODE_CLOCK_GATING,
2422 .notify_rpm = false,
2423 .cmd = spm_wfi_cmd_sequence,
2424 },
2425 [1] = {
2426 .mode = MSM_SPM_MODE_POWER_COLLAPSE,
2427 .notify_rpm = false,
2428 .cmd = spm_power_collapse_without_rpm,
2429 },
2430 [2] = {
2431 .mode = MSM_SPM_MODE_POWER_COLLAPSE,
2432 .notify_rpm = true,
2433 .cmd = spm_power_collapse_with_rpm,
2434 },
2435};
2436
2437static struct msm_spm_platform_data msm_spm_data[] __initdata = {
2438 [0] = {
2439 .reg_base_addr = MSM_SAW0_BASE,
2440 .reg_init_values[MSM_SPM_REG_SAW2_SECURE] = 0x00,
2441 .reg_init_values[MSM_SPM_REG_SAW2_CFG] = 0x1F,
2442 .reg_init_values[MSM_SPM_REG_SAW2_VCTL] = 0x9C,
2443#if defined(CONFIG_MSM_AVS_HW)
2444 .reg_init_values[MSM_SPM_REG_SAW2_AVS_CTL] = 0x00,
2445 .reg_init_values[MSM_SPM_REG_SAW2_AVS_HYSTERESIS] = 0x00,
2446#endif
2447 .reg_init_values[MSM_SPM_REG_SAW2_SPM_CTL] = 0x01,
2448 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DLY] = 0x02020202,
2449 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_0] = 0x0060009C,
2450 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_1] = 0x0000001C,
2451 .vctl_timeout_us = 50,
2452 .num_modes = ARRAY_SIZE(msm_spm_seq_list),
2453 .modes = msm_spm_seq_list,
2454 },
2455 [1] = {
2456 .reg_base_addr = MSM_SAW1_BASE,
2457 .reg_init_values[MSM_SPM_REG_SAW2_SECURE] = 0x00,
2458 .reg_init_values[MSM_SPM_REG_SAW2_CFG] = 0x1F,
2459 .reg_init_values[MSM_SPM_REG_SAW2_VCTL] = 0x9C,
2460#if defined(CONFIG_MSM_AVS_HW)
2461 .reg_init_values[MSM_SPM_REG_SAW2_AVS_CTL] = 0x00,
2462 .reg_init_values[MSM_SPM_REG_SAW2_AVS_HYSTERESIS] = 0x00,
2463#endif
2464 .reg_init_values[MSM_SPM_REG_SAW2_SPM_CTL] = 0x01,
2465 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DLY] = 0x02020202,
2466 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_0] = 0x0060009C,
2467 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_1] = 0x0000001C,
2468 .vctl_timeout_us = 50,
2469 .num_modes = ARRAY_SIZE(msm_spm_seq_list),
2470 .modes = msm_spm_seq_list,
2471 },
2472};
2473
2474static uint8_t l2_spm_wfi_cmd_sequence[] __initdata = {
2475 0x00, 0x20, 0x03, 0x20,
2476 0x00, 0x0f,
2477};
2478
2479static uint8_t l2_spm_gdhs_cmd_sequence[] __initdata = {
2480 0x00, 0x20, 0x34, 0x64,
2481 0x48, 0x07, 0x48, 0x20,
2482 0x50, 0x64, 0x04, 0x34,
2483 0x50, 0x0f,
2484};
2485static uint8_t l2_spm_power_off_cmd_sequence[] __initdata = {
2486 0x00, 0x10, 0x34, 0x64,
2487 0x48, 0x07, 0x48, 0x10,
2488 0x50, 0x64, 0x04, 0x34,
2489 0x50, 0x0F,
2490};
2491
2492static struct msm_spm_seq_entry msm_spm_l2_seq_list[] __initdata = {
2493 [0] = {
2494 .mode = MSM_SPM_L2_MODE_RETENTION,
2495 .notify_rpm = false,
2496 .cmd = l2_spm_wfi_cmd_sequence,
2497 },
2498 [1] = {
2499 .mode = MSM_SPM_L2_MODE_GDHS,
2500 .notify_rpm = true,
2501 .cmd = l2_spm_gdhs_cmd_sequence,
2502 },
2503 [2] = {
2504 .mode = MSM_SPM_L2_MODE_POWER_COLLAPSE,
2505 .notify_rpm = true,
2506 .cmd = l2_spm_power_off_cmd_sequence,
2507 },
2508};
2509
2510
2511static struct msm_spm_platform_data msm_spm_l2_data[] __initdata = {
2512 [0] = {
2513 .reg_base_addr = MSM_SAW_L2_BASE,
2514 .reg_init_values[MSM_SPM_REG_SAW2_SECURE] = 0x00,
2515 .reg_init_values[MSM_SPM_REG_SAW2_SPM_CTL] = 0x00,
2516 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DLY] = 0x02020202,
2517 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_0] = 0x00A000AE,
2518 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_1] = 0x00A00020,
2519 .modes = msm_spm_l2_seq_list,
2520 .num_modes = ARRAY_SIZE(msm_spm_l2_seq_list),
2521 },
2522};
2523
2524#define CYTTSP_TS_GPIO_IRQ 11
2525#define CYTTSP_TS_SLEEP_GPIO 50
2526#define CYTTSP_TS_RESOUT_N_GPIO 52
2527
2528/*virtual key support */
2529static ssize_t tma340_vkeys_show(struct kobject *kobj,
2530 struct kobj_attribute *attr, char *buf)
2531{
2532 return snprintf(buf, 200,
2533 __stringify(EV_KEY) ":" __stringify(KEY_BACK) ":73:1120:97:97"
2534 ":" __stringify(EV_KEY) ":" __stringify(KEY_MENU) ":230:1120:97:97"
2535 ":" __stringify(EV_KEY) ":" __stringify(KEY_HOME) ":389:1120:97:97"
2536 ":" __stringify(EV_KEY) ":" __stringify(KEY_SEARCH) ":544:1120:97:97"
2537 "\n");
2538}
2539
2540static struct kobj_attribute tma340_vkeys_attr = {
2541 .attr = {
2542 .mode = S_IRUGO,
2543 },
2544 .show = &tma340_vkeys_show,
2545};
2546
2547static struct attribute *tma340_properties_attrs[] = {
2548 &tma340_vkeys_attr.attr,
2549 NULL
2550};
2551
2552static struct attribute_group tma340_properties_attr_group = {
2553 .attrs = tma340_properties_attrs,
2554};
2555
2556
2557static int cyttsp_platform_init(struct i2c_client *client)
2558{
2559 int rc = 0;
2560 static struct kobject *tma340_properties_kobj;
2561
2562 tma340_vkeys_attr.attr.name = "virtualkeys.cyttsp-i2c";
2563 tma340_properties_kobj = kobject_create_and_add("board_properties",
2564 NULL);
2565 if (tma340_properties_kobj)
2566 rc = sysfs_create_group(tma340_properties_kobj,
2567 &tma340_properties_attr_group);
2568 if (!tma340_properties_kobj || rc)
2569 pr_err("%s: failed to create board_properties\n",
2570 __func__);
2571
2572 return 0;
2573}
2574
2575static struct cyttsp_regulator regulator_data[] = {
2576 {
2577 .name = "vdd",
2578 .min_uV = CY_TMA300_VTG_MIN_UV,
2579 .max_uV = CY_TMA300_VTG_MAX_UV,
2580 .load_uA = CY_TMA300_CURR_24HZ_UA,
2581 },
2582 /* TODO: Remove after runtime PM is enabled in I2C driver */
2583 {
2584 .name = "vcc_i2c",
2585 .min_uV = CY_I2C_VTG_MIN_UV,
2586 .max_uV = CY_I2C_VTG_MAX_UV,
2587 .load_uA = CY_I2C_CURR_UA,
2588 },
2589};
2590
2591static struct cyttsp_platform_data cyttsp_pdata = {
2592 .panel_maxx = 634,
2593 .panel_maxy = 1166,
2594 .disp_maxx = 616,
2595 .disp_maxy = 1023,
2596 .disp_minx = 0,
2597 .disp_miny = 16,
2598 .flags = 0x01,
2599 .gen = CY_GEN3, /* or */
2600 .use_st = CY_USE_ST,
2601 .use_mt = CY_USE_MT,
2602 .use_hndshk = CY_SEND_HNDSHK,
2603 .use_trk_id = CY_USE_TRACKING_ID,
Anirudh Ghayale96f66d2011-08-11 14:06:38 +05302604 .use_sleep = CY_USE_DEEP_SLEEP_SEL | CY_USE_LOW_POWER_SEL,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002605 .use_gestures = CY_USE_GESTURES,
2606 .fw_fname = "cyttsp_8960_cdp.hex",
2607 /* activate up to 4 groups
2608 * and set active distance
2609 */
2610 .gest_set = CY_GEST_GRP1 | CY_GEST_GRP2 |
2611 CY_GEST_GRP3 | CY_GEST_GRP4 |
2612 CY_ACT_DIST,
2613 /* change act_intrvl to customize the Active power state
2614 * scanning/processing refresh interval for Operating mode
2615 */
2616 .act_intrvl = CY_ACT_INTRVL_DFLT,
2617 /* change tch_tmout to customize the touch timeout for the
2618 * Active power state for Operating mode
2619 */
2620 .tch_tmout = CY_TCH_TMOUT_DFLT,
2621 /* change lp_intrvl to customize the Low Power power state
2622 * scanning/processing refresh interval for Operating mode
2623 */
2624 .lp_intrvl = CY_LP_INTRVL_DFLT,
2625 .sleep_gpio = CYTTSP_TS_SLEEP_GPIO,
2626 .resout_gpio = CYTTSP_TS_RESOUT_N_GPIO,
2627 .irq_gpio = CYTTSP_TS_GPIO_IRQ,
2628 .regulator_info = regulator_data,
2629 .num_regulators = ARRAY_SIZE(regulator_data),
2630 .init = cyttsp_platform_init,
Mohan Pallaka49c37d62011-08-01 11:52:00 +05302631 .correct_fw_ver = 9,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002632};
2633
2634static struct i2c_board_info cyttsp_info[] __initdata = {
2635 {
2636 I2C_BOARD_INFO(CY_I2C_NAME, 0x24),
2637 .platform_data = &cyttsp_pdata,
2638#ifndef CY_USE_TIMER
2639 .irq = MSM_GPIO_TO_INT(CYTTSP_TS_GPIO_IRQ),
2640#endif /* CY_USE_TIMER */
2641 },
2642};
2643
2644static void gsbi_qup_i2c_gpio_config(int adap_id, int config_type)
2645{
2646}
2647
2648static struct msm_i2c_platform_data msm8960_i2c_qup_gsbi4_pdata = {
2649 .clk_freq = 100000,
2650 .src_clk_rate = 24000000,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002651 .msm_i2c_config_gpio = gsbi_qup_i2c_gpio_config,
2652};
2653
2654static struct msm_i2c_platform_data msm8960_i2c_qup_gsbi3_pdata = {
2655 .clk_freq = 100000,
2656 .src_clk_rate = 24000000,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002657 .msm_i2c_config_gpio = gsbi_qup_i2c_gpio_config,
2658};
2659
2660static struct msm_i2c_platform_data msm8960_i2c_qup_gsbi10_pdata = {
2661 .clk_freq = 100000,
2662 .src_clk_rate = 24000000,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002663 .msm_i2c_config_gpio = gsbi_qup_i2c_gpio_config,
2664};
2665
2666static struct msm_i2c_platform_data msm8960_i2c_qup_gsbi12_pdata = {
2667 .clk_freq = 100000,
2668 .src_clk_rate = 24000000,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002669 .msm_i2c_config_gpio = gsbi_qup_i2c_gpio_config,
2670};
2671
2672static struct msm_rpm_platform_data msm_rpm_data = {
2673 .reg_base_addrs = {
2674 [MSM_RPM_PAGE_STATUS] = MSM_RPM_BASE,
2675 [MSM_RPM_PAGE_CTRL] = MSM_RPM_BASE + 0x400,
2676 [MSM_RPM_PAGE_REQ] = MSM_RPM_BASE + 0x600,
2677 [MSM_RPM_PAGE_ACK] = MSM_RPM_BASE + 0xa00,
2678 },
2679
2680 .irq_ack = RPM_APCC_CPU0_GP_HIGH_IRQ,
2681 .irq_err = RPM_APCC_CPU0_GP_LOW_IRQ,
2682 .irq_vmpm = RPM_APCC_CPU0_GP_MEDIUM_IRQ,
2683 .msm_apps_ipc_rpm_reg = MSM_APCS_GCC_BASE + 0x008,
2684 .msm_apps_ipc_rpm_val = 4,
2685};
2686
Praveen Chidambaram043f4ce2011-08-02 09:37:59 -06002687static struct platform_device msm_rpm_device = {
2688 .name = "msm_rpm",
2689 .id = -1,
2690};
2691
2692
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002693static struct spi_board_info spi_board_info[] __initdata = {
2694 {
2695 .modalias = "ks8851",
2696 .irq = MSM_GPIO_TO_INT(KS8851_IRQ_GPIO),
2697 .max_speed_hz = 19200000,
2698 .bus_num = 0,
2699 .chip_select = 0,
2700 .mode = SPI_MODE_0,
2701 },
2702};
2703
2704static struct platform_device msm_device_saw_core0 = {
2705 .name = "saw-regulator",
2706 .id = 0,
2707 .dev = {
2708 .platform_data = &msm_saw_regulator_pdata_s5,
2709 },
2710};
2711
2712static struct platform_device msm_device_saw_core1 = {
2713 .name = "saw-regulator",
2714 .id = 1,
2715 .dev = {
2716 .platform_data = &msm_saw_regulator_pdata_s6,
2717 },
2718};
2719
2720#ifdef CONFIG_MSM_FAKE_BATTERY
2721static struct platform_device fish_battery_device = {
2722 .name = "fish_battery",
2723};
2724#endif
2725
David Collins26f05562011-06-20 09:56:28 -07002726static struct platform_device msm8960_device_ext_5v_vreg __devinitdata = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002727 .name = GPIO_REGULATOR_DEV_NAME,
2728 .id = PM8921_MPP_PM_TO_SYS(7),
2729 .dev = {
2730 .platform_data = &msm_gpio_regulator_pdata[GPIO_VREG_ID_EXT_5V],
2731 },
2732};
2733
David Collins26f05562011-06-20 09:56:28 -07002734static struct platform_device msm8960_device_ext_l2_vreg __devinitdata = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002735 .name = GPIO_REGULATOR_DEV_NAME,
2736 .id = 91,
2737 .dev = {
2738 .platform_data = &msm_gpio_regulator_pdata[GPIO_VREG_ID_EXT_L2],
2739 },
2740};
2741
David Collinsb10be1d2011-09-02 10:29:31 -07002742static struct platform_device msm8960_device_ext_3p3v_vreg __devinitdata = {
2743 .name = GPIO_REGULATOR_DEV_NAME,
2744 .id = PM8921_GPIO_PM_TO_SYS(17),
2745 .dev = {
2746 .platform_data =
2747 &msm_gpio_regulator_pdata[GPIO_VREG_ID_EXT_3P3V],
2748 },
2749};
2750
David Collins26f05562011-06-20 09:56:28 -07002751static struct platform_device msm8960_device_rpm_regulator __devinitdata = {
2752 .name = "rpm-regulator",
2753 .id = -1,
2754 .dev = {
2755 .platform_data = &msm_rpm_regulator_pdata,
2756 },
2757};
2758
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002759static struct platform_device *common_devices[] __initdata = {
Stepan Moskovchenkodf13d342011-08-03 19:01:25 -07002760 &msm8960_device_dmov,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002761 &msm_device_smd,
2762 &msm8960_device_uart_gsbi5,
Mayank Rana9f51f582011-08-04 18:35:59 +05302763 &msm_device_uart_dm6,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002764 &msm_device_saw_core0,
2765 &msm_device_saw_core1,
2766 &msm8960_device_ext_5v_vreg,
2767 &msm8960_device_ext_l2_vreg,
2768 &msm8960_device_ssbi_pm8921,
2769 &msm8960_device_qup_spi_gsbi1,
2770 &msm8960_device_qup_i2c_gsbi3,
2771 &msm8960_device_qup_i2c_gsbi4,
2772 &msm8960_device_qup_i2c_gsbi10,
2773#ifndef CONFIG_MSM_DSPS
2774 &msm8960_device_qup_i2c_gsbi12,
2775#endif
2776 &msm_slim_ctrl,
2777 &msm_device_wcnss_wlan,
2778#if defined(CONFIG_CRYPTO_DEV_QCRYPTO) || \
2779 defined(CONFIG_CRYPTO_DEV_QCRYPTO_MODULE)
2780 &qcrypto_device,
2781#endif
2782
2783#if defined(CONFIG_CRYPTO_DEV_QCEDEV) || \
2784 defined(CONFIG_CRYPTO_DEV_QCEDEV_MODULE)
2785 &qcedev_device,
2786#endif
2787#ifdef CONFIG_MSM_ROTATOR
2788 &msm_rotator_device,
2789#endif
2790 &msm_device_sps,
2791#ifdef CONFIG_MSM_FAKE_BATTERY
2792 &fish_battery_device,
2793#endif
2794#ifdef CONFIG_ANDROID_PMEM
2795 &android_pmem_device,
2796 &android_pmem_adsp_device,
2797 &android_pmem_audio_device,
2798#endif
2799 &msm_fb_device,
2800 &msm_device_vidc,
2801 &msm_device_bam_dmux,
2802 &msm_fm_platform_init,
Mona Hossain9c430e32011-07-27 11:04:47 -07002803
2804#ifdef CONFIG_HW_RANDOM_MSM
2805 &msm_device_rng,
2806#endif
Praveen Chidambaram043f4ce2011-08-02 09:37:59 -06002807 &msm_rpm_device,
Laura Abbottd6183792011-08-19 13:42:24 -07002808#ifdef CONFIG_ION_MSM
2809 &ion_dev,
2810#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002811};
2812
Stepan Moskovchenkod056fca2011-01-27 12:12:07 -08002813static struct platform_device *sim_devices[] __initdata = {
Stepan Moskovchenko14aa6492011-08-08 15:15:01 -07002814 &msm8960_device_otg,
2815 &msm8960_device_gadget_peripheral,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002816 &msm_device_hsusb_host,
2817 &android_usb_device,
2818 &msm_device_vidc,
2819 &mipi_dsi_simulator_panel_device,
2820 &msm_bus_apps_fabric,
2821 &msm_bus_sys_fabric,
2822 &msm_bus_mm_fabric,
2823 &msm_bus_sys_fpb,
2824 &msm_bus_cpss_fpb,
2825 &msm_pcm,
2826 &msm_pcm_routing,
2827 &msm_cpudai0,
2828 &msm_cpudai1,
2829 &msm_cpudai_hdmi_rx,
2830 &msm_cpudai_bt_rx,
2831 &msm_cpudai_bt_tx,
2832 &msm_cpudai_fm_rx,
2833 &msm_cpudai_fm_tx,
2834 &msm_cpu_fe,
2835 &msm_stub_codec,
2836 &msm_voice,
2837 &msm_voip,
2838 &msm_lpa_pcm,
2839
2840#if defined(CONFIG_CRYPTO_DEV_QCRYPTO) || \
2841 defined(CONFIG_CRYPTO_DEV_QCRYPTO_MODULE)
2842 &qcrypto_device,
2843#endif
2844
2845#if defined(CONFIG_CRYPTO_DEV_QCEDEV) || \
2846 defined(CONFIG_CRYPTO_DEV_QCEDEV_MODULE)
2847 &qcedev_device,
2848#endif
Stepan Moskovchenkod056fca2011-01-27 12:12:07 -08002849};
2850
2851static struct platform_device *rumi3_devices[] __initdata = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002852 &msm_kgsl_3d0,
2853 &msm_kgsl_2d0,
2854 &msm_kgsl_2d1,
2855 &mipi_dsi_renesas_panel_device,
2856#ifdef CONFIG_MSM_GEMINI
2857 &msm8960_gemini_device,
2858#endif
Stepan Moskovchenkod056fca2011-01-27 12:12:07 -08002859};
2860
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002861static struct platform_device *cdp_devices[] __initdata = {
Stepan Moskovchenko14aa6492011-08-08 15:15:01 -07002862 &msm8960_device_otg,
2863 &msm8960_device_gadget_peripheral,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002864 &msm_device_hsusb_host,
2865 &android_usb_device,
2866 &msm_pcm,
2867 &msm_pcm_routing,
2868 &msm_cpudai0,
2869 &msm_cpudai1,
2870 &msm_cpudai_hdmi_rx,
2871 &msm_cpudai_bt_rx,
2872 &msm_cpudai_bt_tx,
2873 &msm_cpudai_fm_rx,
2874 &msm_cpudai_fm_tx,
2875 &msm_cpu_fe,
2876 &msm_stub_codec,
2877 &msm_kgsl_3d0,
2878#ifdef CONFIG_MSM_KGSL_2D
2879 &msm_kgsl_2d0,
2880 &msm_kgsl_2d1,
2881#endif
2882 &mipi_dsi_toshiba_panel_device,
2883#ifdef CONFIG_MSM_GEMINI
2884 &msm8960_gemini_device,
2885#endif
2886 &msm_voice,
2887 &msm_voip,
2888 &msm_lpa_pcm,
2889#ifdef CONFIG_FB_MSM_HDMI_MSM_PANEL
2890 &hdmi_msm_device,
2891#endif
2892 &msm_pcm_hostless,
2893 &msm_bus_apps_fabric,
2894 &msm_bus_sys_fabric,
2895 &msm_bus_mm_fabric,
2896 &msm_bus_sys_fpb,
2897 &msm_bus_cpss_fpb,
2898};
2899
2900static void __init msm8960_i2c_init(void)
2901{
2902 msm8960_device_qup_i2c_gsbi4.dev.platform_data =
2903 &msm8960_i2c_qup_gsbi4_pdata;
2904
2905 msm8960_device_qup_i2c_gsbi3.dev.platform_data =
2906 &msm8960_i2c_qup_gsbi3_pdata;
2907
2908 msm8960_device_qup_i2c_gsbi10.dev.platform_data =
2909 &msm8960_i2c_qup_gsbi10_pdata;
2910
2911 msm8960_device_qup_i2c_gsbi12.dev.platform_data =
2912 &msm8960_i2c_qup_gsbi12_pdata;
2913}
2914
Lucille Sylvester34ec3692011-08-16 16:28:04 -06002915static void __init msm8960_gfx_init(void)
2916{
2917 uint32_t soc_platform_version = socinfo_get_platform_version();
2918 if (SOCINFO_VERSION_MAJOR(soc_platform_version) == 1) {
2919 struct kgsl_device_platform_data *kgsl_3d0_pdata =
2920 msm_kgsl_3d0.dev.platform_data;
2921 kgsl_3d0_pdata->pwr_data.pwrlevel[0].gpu_freq =
2922 320000000;
2923 kgsl_3d0_pdata->pwr_data.pwrlevel[1].gpu_freq =
2924 266667000;
2925 }
2926}
2927
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002928static struct pm8xxx_irq_platform_data pm8xxx_irq_pdata __devinitdata = {
2929 .irq_base = PM8921_IRQ_BASE,
2930 .devirq = MSM_GPIO_TO_INT(104),
2931 .irq_trigger_flag = IRQF_TRIGGER_LOW,
2932};
2933
2934static struct pm8xxx_gpio_platform_data pm8xxx_gpio_pdata __devinitdata = {
2935 .gpio_base = PM8921_GPIO_PM_TO_SYS(1),
2936};
2937
2938static struct pm8xxx_mpp_platform_data pm8xxx_mpp_pdata __devinitdata = {
2939 .mpp_base = PM8921_MPP_PM_TO_SYS(1),
2940};
2941
2942static struct pm8xxx_rtc_platform_data pm8xxx_rtc_pdata __devinitdata = {
2943 .rtc_write_enable = false,
2944};
2945
2946static struct pm8xxx_pwrkey_platform_data pm8xxx_pwrkey_pdata = {
2947 .pull_up = 1,
2948 .kpd_trigger_delay_us = 970,
2949 .wakeup = 1,
2950};
2951
2952static const unsigned int keymap[] = {
2953 KEY(0, 0, KEY_VOLUMEUP),
2954 KEY(0, 1, KEY_VOLUMEDOWN),
2955 KEY(0, 2, KEY_CAMERA_SNAPSHOT),
2956 KEY(0, 3, KEY_CAMERA_FOCUS),
2957};
2958
2959static struct matrix_keymap_data keymap_data = {
2960 .keymap_size = ARRAY_SIZE(keymap),
2961 .keymap = keymap,
2962};
2963
2964static struct pm8xxx_keypad_platform_data keypad_data = {
2965 .input_name = "keypad_8960",
2966 .input_phys_device = "keypad_8960/input0",
2967 .num_rows = 1,
2968 .num_cols = 5,
2969 .rows_gpio_start = PM8921_GPIO_PM_TO_SYS(9),
2970 .cols_gpio_start = PM8921_GPIO_PM_TO_SYS(1),
2971 .debounce_ms = 15,
2972 .scan_delay_ms = 32,
2973 .row_hold_ns = 91500,
2974 .wakeup = 1,
2975 .keymap_data = &keymap_data,
2976};
2977
2978static const unsigned int keymap_sim[] = {
2979 KEY(0, 0, KEY_7),
2980 KEY(0, 1, KEY_DOWN),
2981 KEY(0, 2, KEY_UP),
2982 KEY(0, 3, KEY_RIGHT),
2983 KEY(0, 4, KEY_ENTER),
2984 KEY(0, 5, KEY_L),
2985 KEY(0, 6, KEY_BACK),
2986 KEY(0, 7, KEY_M),
2987
2988 KEY(1, 0, KEY_LEFT),
2989 KEY(1, 1, KEY_SEND),
2990 KEY(1, 2, KEY_1),
2991 KEY(1, 3, KEY_4),
2992 KEY(1, 4, KEY_CLEAR),
2993 KEY(1, 5, KEY_MSDOS),
2994 KEY(1, 6, KEY_SPACE),
2995 KEY(1, 7, KEY_COMMA),
2996
2997 KEY(2, 0, KEY_6),
2998 KEY(2, 1, KEY_5),
2999 KEY(2, 2, KEY_8),
3000 KEY(2, 3, KEY_3),
3001 KEY(2, 4, KEY_NUMERIC_STAR),
3002 KEY(2, 5, KEY_UP),
3003 KEY(2, 6, KEY_DOWN),
3004 KEY(2, 7, KEY_LEFTSHIFT),
3005
3006 KEY(3, 0, KEY_9),
3007 KEY(3, 1, KEY_NUMERIC_POUND),
3008 KEY(3, 2, KEY_0),
3009 KEY(3, 3, KEY_2),
3010 KEY(3, 4, KEY_SLEEP),
3011 KEY(3, 5, KEY_F1),
3012 KEY(3, 6, KEY_F2),
3013 KEY(3, 7, KEY_F3),
3014
3015 KEY(4, 0, KEY_BACK),
3016 KEY(4, 1, KEY_HOME),
3017 KEY(4, 2, KEY_MENU),
3018 KEY(4, 3, KEY_VOLUMEUP),
3019 KEY(4, 4, KEY_VOLUMEDOWN),
3020 KEY(4, 5, KEY_F4),
3021 KEY(4, 6, KEY_F5),
3022 KEY(4, 7, KEY_F6),
3023
3024 KEY(5, 0, KEY_R),
3025 KEY(5, 1, KEY_T),
3026 KEY(5, 2, KEY_Y),
3027 KEY(5, 3, KEY_LEFTALT),
3028 KEY(5, 4, KEY_KPENTER),
3029 KEY(5, 5, KEY_Q),
3030 KEY(5, 6, KEY_W),
3031 KEY(5, 7, KEY_E),
3032
3033 KEY(6, 0, KEY_F),
3034 KEY(6, 1, KEY_G),
3035 KEY(6, 2, KEY_H),
3036 KEY(6, 3, KEY_CAPSLOCK),
3037 KEY(6, 4, KEY_PAGEUP),
3038 KEY(6, 5, KEY_A),
3039 KEY(6, 6, KEY_S),
3040 KEY(6, 7, KEY_D),
3041
3042 KEY(7, 0, KEY_V),
3043 KEY(7, 1, KEY_B),
3044 KEY(7, 2, KEY_N),
3045 KEY(7, 3, KEY_MENU),
3046 KEY(7, 4, KEY_PAGEDOWN),
3047 KEY(7, 5, KEY_Z),
3048 KEY(7, 6, KEY_X),
3049 KEY(7, 7, KEY_C),
3050
3051 KEY(8, 0, KEY_P),
3052 KEY(8, 1, KEY_J),
3053 KEY(8, 2, KEY_K),
3054 KEY(8, 3, KEY_INSERT),
3055 KEY(8, 4, KEY_LINEFEED),
3056 KEY(8, 5, KEY_U),
3057 KEY(8, 6, KEY_I),
3058 KEY(8, 7, KEY_O),
3059
3060 KEY(9, 0, KEY_4),
3061 KEY(9, 1, KEY_5),
3062 KEY(9, 2, KEY_6),
3063 KEY(9, 3, KEY_7),
3064 KEY(9, 4, KEY_8),
3065 KEY(9, 5, KEY_1),
3066 KEY(9, 6, KEY_2),
3067 KEY(9, 7, KEY_3),
3068
3069 KEY(10, 0, KEY_F7),
3070 KEY(10, 1, KEY_F8),
3071 KEY(10, 2, KEY_F9),
3072 KEY(10, 3, KEY_F10),
3073 KEY(10, 4, KEY_FN),
3074 KEY(10, 5, KEY_9),
3075 KEY(10, 6, KEY_0),
3076 KEY(10, 7, KEY_DOT),
3077
3078 KEY(11, 0, KEY_LEFTCTRL),
3079 KEY(11, 1, KEY_F11),
3080 KEY(11, 2, KEY_ENTER),
3081 KEY(11, 3, KEY_SEARCH),
3082 KEY(11, 4, KEY_DELETE),
3083 KEY(11, 5, KEY_RIGHT),
3084 KEY(11, 6, KEY_LEFT),
3085 KEY(11, 7, KEY_RIGHTSHIFT),
3086 KEY(0, 0, KEY_VOLUMEUP),
3087 KEY(0, 1, KEY_VOLUMEDOWN),
3088 KEY(0, 2, KEY_CAMERA_SNAPSHOT),
3089 KEY(0, 3, KEY_CAMERA_FOCUS),
3090};
3091
3092static struct matrix_keymap_data keymap_data_sim = {
3093 .keymap_size = ARRAY_SIZE(keymap_sim),
3094 .keymap = keymap_sim,
3095};
3096
3097static struct pm8xxx_keypad_platform_data keypad_data_sim = {
3098 .input_name = "keypad_8960",
3099 .input_phys_device = "keypad_8960/input0",
3100 .num_rows = 12,
3101 .num_cols = 8,
3102 .rows_gpio_start = PM8921_GPIO_PM_TO_SYS(9),
3103 .cols_gpio_start = PM8921_GPIO_PM_TO_SYS(1),
3104 .debounce_ms = 15,
3105 .scan_delay_ms = 32,
3106 .row_hold_ns = 91500,
3107 .wakeup = 1,
3108 .keymap_data = &keymap_data_sim,
3109};
3110
3111static struct pm8921_charger_platform_data pm8921_chg_pdata __devinitdata = {
Abhijeet Dharmapurikar34059332011-08-16 19:19:39 -07003112 .safety_time = 180,
3113 .update_time = 1,
3114 .max_voltage = 4200,
3115 .min_voltage = 3200,
3116 .resume_voltage = 4100,
3117 .term_current = 100,
3118 .cool_temp = 10,
3119 .warm_temp = 40,
3120 .temp_check_period = 1,
3121 .max_bat_chg_current = 400,
3122 .cool_bat_chg_current = 350,
3123 .warm_bat_chg_current = 350,
3124 .cool_bat_voltage = 4100,
3125 .warm_bat_voltage = 4100,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003126};
3127
3128static struct pm8xxx_misc_platform_data pm8xxx_misc_pdata = {
3129 .priority = 0,
3130};
3131
3132static struct pm8921_bms_platform_data pm8921_bms_pdata __devinitdata = {
3133 .r_sense = 10,
3134 .i_test = 2500,
3135 .v_failure = 3000,
3136 .calib_delay_ms = 600000,
3137 .batt_data = &palladium_1500_data,
3138};
3139
Jay Chokshide4cefb2011-08-04 18:10:44 -07003140#define PM8921_LC_LED_MAX_CURRENT 4 /* I = 4mA */
3141
3142/**
3143 * 'flag' stores three values; led id, led mode, and max current of led.
3144 * The bit packing format is as follow,
3145 * reserved (1 byte) | max_current (2 bytes) | led_mode (1 nibble) |
3146 * led_id (1 nibble)
3147 */
3148#define PM8XXX_SET_FLAG(led_id, led_mode, led_max_current) \
3149 (((led_id << PM8XXX_LED_ID_SHIFT) & PM8XXX_LED_ID_MASK) |\
3150 ((led_mode << PM8XXX_LED_MODE_SHIFT) & PM8XXX_LED_MODE_MASK) |\
3151 ((led_max_current << PM8XXX_LED_MAX_CURRENT_SHIFT) & \
3152 PM8XXX_LED_MAX_CURRENT_MASK))
3153
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003154static struct led_info pm8921_led_info[] = {
3155 [0] = {
Jay Chokshide4cefb2011-08-04 18:10:44 -07003156 .name = "led:usb",
3157 .default_trigger = "usb-online",
3158 .flags = PM8XXX_SET_FLAG(PM8XXX_ID_LED_0,
3159 PM8XXX_LED_MODE_MANUAL,
3160 PM8921_LC_LED_MAX_CURRENT),
3161 },
3162 [1] = {
3163 .name = "led:ac",
3164 .default_trigger = "ac-online",
3165 .flags = PM8XXX_SET_FLAG(PM8XXX_ID_LED_1,
3166 PM8XXX_LED_MODE_MANUAL,
3167 PM8921_LC_LED_MAX_CURRENT),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003168 },
3169};
3170
3171static struct led_platform_data pm8xxx_leds_pdata = {
3172 .num_leds = ARRAY_SIZE(pm8921_led_info),
3173 .leds = pm8921_led_info,
3174};
3175
3176static struct pm8921_platform_data pm8921_platform_data __devinitdata = {
3177 .irq_pdata = &pm8xxx_irq_pdata,
3178 .gpio_pdata = &pm8xxx_gpio_pdata,
3179 .mpp_pdata = &pm8xxx_mpp_pdata,
3180 .rtc_pdata = &pm8xxx_rtc_pdata,
3181 .pwrkey_pdata = &pm8xxx_pwrkey_pdata,
3182 .keypad_pdata = &keypad_data,
3183 .misc_pdata = &pm8xxx_misc_pdata,
3184 .regulator_pdatas = msm_pm8921_regulator_pdata,
3185 .charger_pdata = &pm8921_chg_pdata,
3186 .bms_pdata = &pm8921_bms_pdata,
3187 .adc_pdata = &pm8921_adc_pdata,
3188 .leds_pdata = &pm8xxx_leds_pdata,
3189};
3190
3191static struct msm_ssbi_platform_data msm8960_ssbi_pm8921_pdata __devinitdata = {
3192 .controller_type = MSM_SBI_CTRL_PMIC_ARBITER,
3193 .slave = {
3194 .name = "pm8921-core",
3195 .platform_data = &pm8921_platform_data,
3196 },
3197};
3198
3199static void msm8960_wcnss_init(void)
3200{
3201 int i, ret, j;
3202
3203 for (i = 0; i < ARRAY_SIZE(wcnss_5wire_interface); i++) {
3204 ret = gpio_request(wcnss_5wire_interface[i].gpio,
3205 "wcnss_5_wire");
3206 if (ret) {
3207 pr_err("wcnss_5_wire gpio %d failed: %d\n",
3208 wcnss_5wire_interface[i].gpio, ret);
3209 goto fail;
3210 }
3211 }
3212
3213 pr_info("%s: Iris 5-wire gpios configured\n", __func__);
3214
3215 return;
3216
3217fail:
3218 for (j = 0; j < i; j++)
3219 gpio_free(wcnss_5wire_interface[j].gpio);
3220}
3221
Stepan Moskovchenko41d168272011-08-09 17:09:42 -07003222#ifdef CONFIG_KS8851
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003223static int ethernet_init(void)
3224{
3225 int ret;
3226 ret = gpio_request(KS8851_IRQ_GPIO, "ks8851_irq");
3227 if (ret) {
3228 pr_err("ks8851 gpio_request failed: %d\n", ret);
3229 goto fail;
3230 }
3231
3232 ret = gpio_request(KS8851_RST_GPIO, "ks8851_rst");
3233 if (ret) {
3234 pr_err("ks8851 gpio_request failed: %d\n", ret);
3235 goto fail_rst;
3236 }
3237
3238 ret = gpio_request(FPGA_CS_GPIO, "fpga_cs");
3239 if (ret) {
3240 pr_err("ks8851 gpio_request failed: %d\n", ret);
3241 goto fail_cs;
3242 }
3243
3244 gpio_direction_output(FPGA_CS_GPIO, 1);
3245 gpio_direction_output(KS8851_RST_GPIO, 1);
3246 return 0;
3247fail_cs:
3248 gpio_free(KS8851_RST_GPIO);
3249fail_rst:
3250 gpio_free(KS8851_IRQ_GPIO);
3251fail:
3252 return ret;
3253}
Stepan Moskovchenko41d168272011-08-09 17:09:42 -07003254#else
3255static int ethernet_init(void)
3256{
3257 return 0;
3258}
3259#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003260
3261static struct msm_cpuidle_state msm_cstates[] __initdata = {
3262 {0, 0, "C0", "WFI",
3263 MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT},
3264
3265 {0, 1, "C1", "STANDALONE_POWER_COLLAPSE",
3266 MSM_PM_SLEEP_MODE_POWER_COLLAPSE_STANDALONE},
3267
3268 {0, 2, "C2", "POWER_COLLAPSE",
3269 MSM_PM_SLEEP_MODE_POWER_COLLAPSE},
3270
3271 {1, 0, "C0", "WFI",
3272 MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT},
3273
3274 {1, 1, "C1", "STANDALONE_POWER_COLLAPSE",
3275 MSM_PM_SLEEP_MODE_POWER_COLLAPSE_STANDALONE},
3276};
3277
3278static struct msm_pm_platform_data msm_pm_data[MSM_PM_SLEEP_MODE_NR * 2] = {
3279 [MSM_PM_MODE(0, MSM_PM_SLEEP_MODE_POWER_COLLAPSE)] = {
3280 .idle_supported = 1,
3281 .suspend_supported = 1,
3282 .idle_enabled = 0,
3283 .suspend_enabled = 0,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003284 },
3285
3286 [MSM_PM_MODE(0, MSM_PM_SLEEP_MODE_POWER_COLLAPSE_STANDALONE)] = {
3287 .idle_supported = 1,
3288 .suspend_supported = 1,
3289 .idle_enabled = 0,
3290 .suspend_enabled = 0,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003291 },
3292
3293 [MSM_PM_MODE(0, MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT)] = {
3294 .idle_supported = 1,
3295 .suspend_supported = 1,
3296 .idle_enabled = 1,
3297 .suspend_enabled = 1,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003298 },
3299
3300 [MSM_PM_MODE(1, MSM_PM_SLEEP_MODE_POWER_COLLAPSE)] = {
3301 .idle_supported = 0,
3302 .suspend_supported = 1,
3303 .idle_enabled = 0,
3304 .suspend_enabled = 0,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003305 },
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,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003312 },
3313
3314 [MSM_PM_MODE(1, MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT)] = {
3315 .idle_supported = 1,
3316 .suspend_supported = 0,
3317 .idle_enabled = 1,
3318 .suspend_enabled = 0,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003319 },
3320};
3321
3322static struct msm_rpmrs_level msm_rpmrs_levels[] __initdata = {
3323 {
3324 MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT,
3325 MSM_RPMRS_LIMITS(ON, ACTIVE, MAX, ACTIVE),
3326 true,
3327 1, 8000, 100000, 1,
3328 },
3329
3330 {
3331 MSM_PM_SLEEP_MODE_POWER_COLLAPSE_STANDALONE,
3332 MSM_RPMRS_LIMITS(ON, ACTIVE, MAX, ACTIVE),
3333 true,
3334 1500, 5000, 60100000, 3000,
3335 },
3336
3337 {
3338 MSM_PM_SLEEP_MODE_POWER_COLLAPSE,
3339 MSM_RPMRS_LIMITS(ON, GDHS, MAX, ACTIVE),
3340 false,
3341 1800, 5000, 60350000, 3500,
3342 },
3343
3344 {
3345 MSM_PM_SLEEP_MODE_POWER_COLLAPSE,
3346 MSM_RPMRS_LIMITS(ON, HSFS_OPEN, MAX, ACTIVE),
3347 false,
3348 2800, 2500, 65350000, 4800,
3349 },
3350
3351 {
3352 MSM_PM_SLEEP_MODE_POWER_COLLAPSE,
3353 MSM_RPMRS_LIMITS(OFF, GDHS, MAX, ACTIVE),
3354 false,
3355 3800, 4500, 67850000, 5500,
3356 },
3357
3358 {
3359 MSM_PM_SLEEP_MODE_POWER_COLLAPSE,
3360 MSM_RPMRS_LIMITS(OFF, HSFS_OPEN, MAX, ACTIVE),
3361 false,
3362 4800, 2000, 71850000, 6800,
3363 },
3364
3365 {
3366 MSM_PM_SLEEP_MODE_POWER_COLLAPSE,
3367 MSM_RPMRS_LIMITS(OFF, HSFS_OPEN, ACTIVE, RET_HIGH),
3368 false,
3369 6800, 500, 75850000, 8800,
3370 },
3371
3372 {
3373 MSM_PM_SLEEP_MODE_POWER_COLLAPSE,
3374 MSM_RPMRS_LIMITS(OFF, HSFS_OPEN, RET_HIGH, RET_LOW),
3375 false,
3376 7800, 0, 76350000, 9800,
3377 },
3378};
3379
3380#ifdef CONFIG_I2C
3381#define I2C_SURF 1
3382#define I2C_FFA (1 << 1)
3383#define I2C_RUMI (1 << 2)
3384#define I2C_SIM (1 << 3)
3385#define I2C_FLUID (1 << 4)
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003386
3387struct i2c_registry {
3388 u8 machs;
3389 int bus;
3390 struct i2c_board_info *info;
3391 int len;
3392};
3393
3394#ifdef CONFIG_MSM_CAMERA
3395static struct i2c_board_info msm_camera_boardinfo[] __initdata = {
3396#ifdef CONFIG_IMX074
3397 {
3398 I2C_BOARD_INFO("imx074", 0x1A),
3399 },
3400#endif
3401#ifdef CONFIG_OV2720
3402 {
3403 I2C_BOARD_INFO("ov2720", 0x6C),
3404 },
3405#endif
Kevin Chandfecce22011-07-13 10:52:41 -07003406 {
3407 I2C_BOARD_INFO("qs_mt9p017", 0x6C >> 1),
3408 },
Nishant Pandit474f2252011-07-23 23:17:56 +05303409#ifdef CONFIG_MSM_CAMERA_FLASH_SC628A
3410 {
3411 I2C_BOARD_INFO("sc628a", 0x6E),
3412 },
3413#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003414};
3415#endif
3416
3417/* Sensors DSPS platform data */
3418#ifdef CONFIG_MSM_DSPS
3419#define DSPS_PIL_GENERIC_NAME "dsps"
3420#endif /* CONFIG_MSM_DSPS */
3421
3422static void __init msm8960_init_dsps(void)
3423{
3424#ifdef CONFIG_MSM_DSPS
3425 struct msm_dsps_platform_data *pdata =
3426 msm_dsps_device.dev.platform_data;
3427 pdata->pil_name = DSPS_PIL_GENERIC_NAME;
3428 pdata->gpios = NULL;
3429 pdata->gpios_num = 0;
3430
3431 platform_device_register(&msm_dsps_device);
3432#endif /* CONFIG_MSM_DSPS */
3433}
3434
3435static struct i2c_registry msm8960_i2c_devices[] __initdata = {
3436#ifdef CONFIG_MSM_CAMERA
3437 {
3438 I2C_SURF | I2C_FFA | I2C_FLUID | I2C_RUMI,
3439 MSM_8960_GSBI4_QUP_I2C_BUS_ID,
3440 msm_camera_boardinfo,
3441 ARRAY_SIZE(msm_camera_boardinfo),
3442 },
3443#endif
3444 {
3445 I2C_SURF | I2C_FFA | I2C_FLUID,
3446 MSM_8960_GSBI3_QUP_I2C_BUS_ID,
3447 cyttsp_info,
3448 ARRAY_SIZE(cyttsp_info),
Rohit Vaswanicd2a59b2011-07-19 12:00:48 -07003449 },
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003450};
3451#endif /* CONFIG_I2C */
3452
3453static void __init register_i2c_devices(void)
3454{
3455#ifdef CONFIG_I2C
3456 u8 mach_mask = 0;
3457 int i;
3458
3459 /* Build the matching 'supported_machs' bitmask */
3460 if (machine_is_msm8960_cdp())
3461 mach_mask = I2C_SURF;
3462 else if (machine_is_msm8960_rumi3())
3463 mach_mask = I2C_RUMI;
3464 else if (machine_is_msm8960_sim())
3465 mach_mask = I2C_SIM;
Amy Maloche2d028032011-07-20 14:08:06 -07003466 else if (machine_is_msm8960_fluid())
3467 mach_mask = I2C_FLUID;
Amy Maloche1b0663f2011-08-02 16:46:22 -07003468 else if (machine_is_msm8960_mtp())
3469 mach_mask = I2C_FFA;
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003470 else
3471 pr_err("unmatched machine ID in register_i2c_devices\n");
3472
3473 /* Run the array and install devices as appropriate */
3474 for (i = 0; i < ARRAY_SIZE(msm8960_i2c_devices); ++i) {
3475 if (msm8960_i2c_devices[i].machs & mach_mask)
3476 i2c_register_board_info(msm8960_i2c_devices[i].bus,
3477 msm8960_i2c_devices[i].info,
3478 msm8960_i2c_devices[i].len);
3479 }
3480#endif
3481}
3482
Stepan Moskovchenkod056fca2011-01-27 12:12:07 -08003483static void __init msm8960_sim_init(void)
3484{
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003485 if (socinfo_init() < 0)
3486 pr_err("socinfo_init() failed!\n");
3487
3488 BUG_ON(msm_rpm_init(&msm_rpm_data));
3489 BUG_ON(msm_rpmrs_levels_init(msm_rpmrs_levels,
3490 ARRAY_SIZE(msm_rpmrs_levels)));
3491 regulator_suppress_info_printing();
David Collins26f05562011-06-20 09:56:28 -07003492 platform_device_register(&msm8960_device_rpm_regulator);
Stephen Boydbb600ae2011-08-02 20:11:40 -07003493 msm_clock_init(&msm8960_clock_init_data);
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003494 msm8960_device_ssbi_pm8921.dev.platform_data =
3495 &msm8960_ssbi_pm8921_pdata;
3496 pm8921_platform_data.num_regulators = msm_pm8921_regulator_pdata_len;
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003497
3498 /* Simulator supports a QWERTY keypad */
3499 pm8921_platform_data.keypad_pdata = &keypad_data_sim;
3500
Stepan Moskovchenko14aa6492011-08-08 15:15:01 -07003501 msm8960_device_otg.dev.platform_data = &msm_otg_pdata;
3502 msm8960_device_gadget_peripheral.dev.parent = &msm8960_device_otg.dev;
3503 msm_device_hsusb_host.dev.parent = &msm8960_device_otg.dev;
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003504 gpiomux_init();
3505 ethernet_init();
3506 msm8960_i2c_init();
3507 msm_spm_init(msm_spm_data, ARRAY_SIZE(msm_spm_data));
3508 msm_spm_l2_init(msm_spm_l2_data);
3509 msm8960_init_buses();
3510 platform_add_devices(common_devices, ARRAY_SIZE(common_devices));
3511 pm8921_gpio_mpp_init();
Stepan Moskovchenkod056fca2011-01-27 12:12:07 -08003512 platform_add_devices(sim_devices, ARRAY_SIZE(sim_devices));
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003513 msm_acpu_clock_init(&msm8960_acpu_clock_data);
3514
3515 msm8960_device_qup_spi_gsbi1.dev.platform_data =
3516 &msm8960_qup_spi_gsbi1_pdata;
3517 spi_register_board_info(spi_board_info, ARRAY_SIZE(spi_board_info));
3518
3519 msm8960_init_mmc();
3520 msm_fb_add_devices();
3521 slim_register_board_info(msm_slim_devices,
3522 ARRAY_SIZE(msm_slim_devices));
3523 msm_pm_set_platform_data(msm_pm_data, ARRAY_SIZE(msm_pm_data));
3524 msm_pm_set_rpm_wakeup_irq(RPM_APCC_CPU0_WAKE_UP_IRQ);
3525 msm_cpuidle_set_states(msm_cstates, ARRAY_SIZE(msm_cstates),
3526 msm_pm_data);
Stepan Moskovchenkod056fca2011-01-27 12:12:07 -08003527}
3528
3529static void __init msm8960_rumi3_init(void)
3530{
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003531 if (socinfo_init() < 0)
3532 pr_err("socinfo_init() failed!\n");
3533
3534 BUG_ON(msm_rpm_init(&msm_rpm_data));
3535 BUG_ON(msm_rpmrs_levels_init(msm_rpmrs_levels,
3536 ARRAY_SIZE(msm_rpmrs_levels)));
3537 regulator_suppress_info_printing();
David Collins26f05562011-06-20 09:56:28 -07003538 platform_device_register(&msm8960_device_rpm_regulator);
Stephen Boydbb600ae2011-08-02 20:11:40 -07003539 msm_clock_init(&msm8960_dummy_clock_init_data);
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003540 gpiomux_init();
3541 ethernet_init();
3542 msm8960_device_ssbi_pm8921.dev.platform_data =
3543 &msm8960_ssbi_pm8921_pdata;
3544 pm8921_platform_data.num_regulators = msm_pm8921_regulator_pdata_len;
3545 msm8960_device_qup_spi_gsbi1.dev.platform_data =
3546 &msm8960_qup_spi_gsbi1_pdata;
3547 spi_register_board_info(spi_board_info, ARRAY_SIZE(spi_board_info));
3548 msm8960_i2c_init();
3549 msm_spm_init(msm_spm_data, ARRAY_SIZE(msm_spm_data));
3550 msm_spm_l2_init(msm_spm_l2_data);
3551 platform_add_devices(common_devices, ARRAY_SIZE(common_devices));
3552 pm8921_gpio_mpp_init();
Stepan Moskovchenkod056fca2011-01-27 12:12:07 -08003553 platform_add_devices(rumi3_devices, ARRAY_SIZE(rumi3_devices));
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003554 msm8960_init_mmc();
3555
3556 register_i2c_devices();
3557 msm_fb_add_devices();
3558 slim_register_board_info(msm_slim_devices,
3559 ARRAY_SIZE(msm_slim_devices));
3560 msm_pm_set_platform_data(msm_pm_data, ARRAY_SIZE(msm_pm_data));
3561 msm_pm_set_rpm_wakeup_irq(RPM_APCC_CPU0_WAKE_UP_IRQ);
3562 msm_cpuidle_set_states(msm_cstates, ARRAY_SIZE(msm_cstates),
3563 msm_pm_data);
3564}
3565
3566static void __init msm8960_cdp_init(void)
3567{
3568 if (socinfo_init() < 0)
3569 pr_err("socinfo_init() failed!\n");
3570
3571 BUG_ON(msm_rpm_init(&msm_rpm_data));
3572 BUG_ON(msm_rpmrs_levels_init(msm_rpmrs_levels,
3573 ARRAY_SIZE(msm_rpmrs_levels)));
3574 regulator_suppress_info_printing();
3575 if (msm_xo_init())
3576 pr_err("Failed to initialize XO votes\n");
David Collins26f05562011-06-20 09:56:28 -07003577 platform_device_register(&msm8960_device_rpm_regulator);
Stephen Boydbb600ae2011-08-02 20:11:40 -07003578 msm_clock_init(&msm8960_clock_init_data);
Stepan Moskovchenko14aa6492011-08-08 15:15:01 -07003579 msm8960_device_otg.dev.platform_data = &msm_otg_pdata;
3580 msm8960_device_gadget_peripheral.dev.parent = &msm8960_device_otg.dev;
3581 msm_device_hsusb_host.dev.parent = &msm8960_device_otg.dev;
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003582 gpiomux_init();
3583 ethernet_init();
3584 msm8960_device_qup_spi_gsbi1.dev.platform_data =
3585 &msm8960_qup_spi_gsbi1_pdata;
3586 spi_register_board_info(spi_board_info, ARRAY_SIZE(spi_board_info));
3587 msm8960_device_ssbi_pm8921.dev.platform_data =
3588 &msm8960_ssbi_pm8921_pdata;
3589 pm8921_platform_data.num_regulators = msm_pm8921_regulator_pdata_len;
3590 msm8960_i2c_init();
Lucille Sylvester34ec3692011-08-16 16:28:04 -06003591 msm8960_gfx_init();
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003592 msm_spm_init(msm_spm_data, ARRAY_SIZE(msm_spm_data));
3593 msm_spm_l2_init(msm_spm_l2_data);
3594 msm8960_init_buses();
3595 platform_add_devices(msm_footswitch_devices,
3596 msm_num_footswitch_devices);
David Collinsb10be1d2011-09-02 10:29:31 -07003597 if (machine_is_msm8960_liquid())
3598 platform_device_register(&msm8960_device_ext_3p3v_vreg);
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003599 platform_add_devices(common_devices, ARRAY_SIZE(common_devices));
3600 pm8921_gpio_mpp_init();
3601 platform_add_devices(cdp_devices, ARRAY_SIZE(cdp_devices));
3602 msm8960_init_cam();
3603 msm8960_init_mmc();
3604 msm_acpu_clock_init(&msm8960_acpu_clock_data);
3605 register_i2c_devices();
3606 msm8960_wcnss_init();
3607 msm_fb_add_devices();
3608 slim_register_board_info(msm_slim_devices,
3609 ARRAY_SIZE(msm_slim_devices));
3610 msm8960_init_dsps();
3611 msm_pm_set_platform_data(msm_pm_data, ARRAY_SIZE(msm_pm_data));
3612 msm_pm_set_rpm_wakeup_irq(RPM_APCC_CPU0_WAKE_UP_IRQ);
3613 msm_cpuidle_set_states(msm_cstates, ARRAY_SIZE(msm_cstates),
3614 msm_pm_data);
Larry Bassela7eadea2011-07-14 10:46:00 -07003615 change_memory_power = &msm8960_change_memory_power;
Stepan Moskovchenkod056fca2011-01-27 12:12:07 -08003616}
3617
Stepan Moskovchenkof441ca22010-12-01 19:31:16 -08003618MACHINE_START(MSM8960_SIM, "QCT MSM8960 SIMULATOR")
3619 .map_io = msm8960_map_io,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003620 .reserve = msm8960_reserve,
Stepan Moskovchenkof441ca22010-12-01 19:31:16 -08003621 .init_irq = msm8960_init_irq,
3622 .timer = &msm_timer,
Stepan Moskovchenkod056fca2011-01-27 12:12:07 -08003623 .init_machine = msm8960_sim_init,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003624 .init_early = msm8960_allocate_memory_regions,
Stepan Moskovchenkof441ca22010-12-01 19:31:16 -08003625MACHINE_END
Stepan Moskovchenko50ede4e2010-12-13 18:12:19 -08003626
3627MACHINE_START(MSM8960_RUMI3, "QCT MSM8960 RUMI3")
3628 .map_io = msm8960_map_io,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003629 .reserve = msm8960_reserve,
Stepan Moskovchenko50ede4e2010-12-13 18:12:19 -08003630 .init_irq = msm8960_init_irq,
3631 .timer = &msm_timer,
Stepan Moskovchenkod056fca2011-01-27 12:12:07 -08003632 .init_machine = msm8960_rumi3_init,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003633 .init_early = msm8960_allocate_memory_regions,
Stepan Moskovchenko50ede4e2010-12-13 18:12:19 -08003634MACHINE_END
3635
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003636MACHINE_START(MSM8960_CDP, "QCT MSM8960 CDP")
3637 .map_io = msm8960_map_io,
3638 .reserve = msm8960_reserve,
3639 .init_irq = msm8960_init_irq,
3640 .timer = &msm_timer,
3641 .init_machine = msm8960_cdp_init,
3642 .init_early = msm8960_allocate_memory_regions,
3643MACHINE_END
3644
3645MACHINE_START(MSM8960_MTP, "QCT MSM8960 MTP")
3646 .map_io = msm8960_map_io,
3647 .reserve = msm8960_reserve,
3648 .init_irq = msm8960_init_irq,
3649 .timer = &msm_timer,
3650 .init_machine = msm8960_cdp_init,
3651 .init_early = msm8960_allocate_memory_regions,
3652MACHINE_END
3653
3654MACHINE_START(MSM8960_FLUID, "QCT MSM8960 FLUID")
3655 .map_io = msm8960_map_io,
3656 .reserve = msm8960_reserve,
3657 .init_irq = msm8960_init_irq,
3658 .timer = &msm_timer,
3659 .init_machine = msm8960_cdp_init,
3660 .init_early = msm8960_allocate_memory_regions,
3661MACHINE_END
Amir Samuelov0d1f8ae2011-07-28 11:13:58 +03003662
3663MACHINE_START(MSM8960_LIQUID, "QCT MSM8960 LIQUID")
3664 .map_io = msm8960_map_io,
3665 .reserve = msm8960_reserve,
3666 .init_irq = msm8960_init_irq,
3667 .timer = &msm_timer,
3668 .init_machine = msm8960_cdp_init,
3669 .init_early = msm8960_allocate_memory_regions,
3670MACHINE_END