blob: 103a2249751ffca2cf8d08d3d9eb88453210ef1f [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>
Amir Samuelov5137e392011-09-21 17:31:25 +030019#include <linux/i2c/isl9519.h>
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070020#include <linux/gpio.h>
21#include <linux/msm_ssbi.h>
22#include <linux/regulator/gpio-regulator.h>
23#include <linux/mfd/pm8xxx/pm8921.h>
Siddartha Mohanadoss77d106e2011-09-20 16:25:59 -070024#include <linux/mfd/pm8xxx/pm8921-adc.h>
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070025#include <linux/regulator/consumer.h>
26#include <linux/spi/spi.h>
27#include <linux/slimbus/slimbus.h>
28#include <linux/bootmem.h>
Lucille Sylvester34ec3692011-08-16 16:28:04 -060029#include <linux/msm_kgsl.h>
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070030#ifdef CONFIG_ANDROID_PMEM
31#include <linux/android_pmem.h>
32#endif
33#include <linux/cyttsp.h>
34#include <linux/dma-mapping.h>
35#include <linux/platform_data/qcom_crypto_device.h>
Ankur Nandwanib0039b02011-08-09 14:00:45 -070036#include <linux/platform_data/qcom_wcnss_device.h>
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070037#include <linux/leds.h>
38#include <linux/leds-pm8xxx.h>
Mohan Pallaka50837382011-09-07 11:00:57 +053039#include <linux/i2c/atmel_mxt_ts.h>
Siddartha Mohanadossba21fdd2011-08-18 10:05:27 -070040#include <linux/msm_tsens.h>
Stepan Moskovchenko93d79ec2011-09-21 16:52:16 -070041#include <linux/ks8851.h>
Stepan Moskovchenkof441ca22010-12-01 19:31:16 -080042
43#include <asm/mach-types.h>
44#include <asm/mach/arch.h>
Larry Basselb4126da2011-07-18 14:31:33 -070045#include <asm/setup.h>
Stepan Moskovchenkof441ca22010-12-01 19:31:16 -080046#include <asm/hardware/gic.h>
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070047#include <asm/mach/mmc.h>
Stepan Moskovchenkof441ca22010-12-01 19:31:16 -080048
49#include <mach/board.h>
50#include <mach/msm_iomap.h>
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070051#include <mach/msm_spi.h>
52#ifdef CONFIG_USB_MSM_OTG_72K
53#include <mach/msm_hsusb.h>
54#else
55#include <linux/usb/msm_hsusb.h>
56#endif
57#include <linux/usb/android.h>
58#include <mach/usbdiag.h>
59#include <mach/socinfo.h>
60#include <mach/rpm.h>
61#include <mach/gpio.h>
Rohit Vaswania513aa8d2011-07-18 15:14:28 -070062#include <mach/gpiomux.h>
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070063#include <mach/msm_bus_board.h>
64#include <mach/msm_memtypes.h>
65#include <mach/dma.h>
66#include <mach/msm_dsps.h>
67#include <mach/msm_xo.h>
Abhijeet Dharmapurikar6d565fd2011-09-15 18:49:56 -070068#include <mach/restart.h>
Stepan Moskovchenkof441ca22010-12-01 19:31:16 -080069
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070070#ifdef CONFIG_WCD9310_CODEC
71#include <linux/slimbus/slimbus.h>
72#include <linux/mfd/wcd9310/core.h>
73#include <linux/mfd/wcd9310/pdata.h>
74#endif
75
Laura Abbottd6183792011-08-19 13:42:24 -070076#include <linux/ion.h>
77#include <mach/ion.h>
78
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070079#include "timer.h"
Stepan Moskovchenkod056fca2011-01-27 12:12:07 -080080#include "devices.h"
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070081#include "devices-msm8x60.h"
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070082#include "spm.h"
83#include "board-msm8960.h"
84#include "pm.h"
85#include "cpuidle.h"
86#include "rpm_resources.h"
87#include "mpm.h"
Matt Wagantall6d9ebee2011-08-26 12:15:24 -070088#include "acpuclock.h"
David Collins4c31a872011-08-31 10:07:10 -070089#include "rpm_log.h"
Naveen Ramaraj76483ad2011-09-06 14:25:44 -070090#include "smd_private.h"
Maheshkumar Sivasubramanian8ccc16e2011-10-25 15:59:57 -060091#include "pm-boot.h"
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070092
93static struct platform_device msm_fm_platform_init = {
94 .name = "iris_fm",
95 .id = -1,
96};
97
98struct pm8xxx_gpio_init {
99 unsigned gpio;
100 struct pm_gpio config;
101};
102
103struct pm8xxx_mpp_init {
104 unsigned mpp;
105 struct pm8xxx_mpp_config_data config;
106};
107
108#define PM8XXX_GPIO_INIT(_gpio, _dir, _buf, _val, _pull, _vin, _out_strength, \
109 _func, _inv, _disable) \
110{ \
111 .gpio = PM8921_GPIO_PM_TO_SYS(_gpio), \
112 .config = { \
113 .direction = _dir, \
114 .output_buffer = _buf, \
115 .output_value = _val, \
116 .pull = _pull, \
117 .vin_sel = _vin, \
118 .out_strength = _out_strength, \
119 .function = _func, \
120 .inv_int_pol = _inv, \
121 .disable_pin = _disable, \
122 } \
123}
124
125#define PM8XXX_MPP_INIT(_mpp, _type, _level, _control) \
126{ \
127 .mpp = PM8921_MPP_PM_TO_SYS(_mpp), \
128 .config = { \
129 .type = PM8XXX_MPP_TYPE_##_type, \
130 .level = _level, \
131 .control = PM8XXX_MPP_##_control, \
132 } \
133}
134
135#define PM8XXX_GPIO_DISABLE(_gpio) \
136 PM8XXX_GPIO_INIT(_gpio, PM_GPIO_DIR_IN, 0, 0, 0, PM_GPIO_VIN_S4, \
137 0, 0, 0, 1)
138
139#define PM8XXX_GPIO_OUTPUT(_gpio, _val) \
140 PM8XXX_GPIO_INIT(_gpio, PM_GPIO_DIR_OUT, PM_GPIO_OUT_BUF_CMOS, _val, \
141 PM_GPIO_PULL_NO, PM_GPIO_VIN_S4, \
142 PM_GPIO_STRENGTH_HIGH, \
143 PM_GPIO_FUNC_NORMAL, 0, 0)
144
145#define PM8XXX_GPIO_INPUT(_gpio, _pull) \
146 PM8XXX_GPIO_INIT(_gpio, PM_GPIO_DIR_IN, PM_GPIO_OUT_BUF_CMOS, 0, \
147 _pull, PM_GPIO_VIN_S4, \
148 PM_GPIO_STRENGTH_NO, \
149 PM_GPIO_FUNC_NORMAL, 0, 0)
150
151#define PM8XXX_GPIO_OUTPUT_FUNC(_gpio, _val, _func) \
152 PM8XXX_GPIO_INIT(_gpio, PM_GPIO_DIR_OUT, PM_GPIO_OUT_BUF_CMOS, _val, \
153 PM_GPIO_PULL_NO, PM_GPIO_VIN_S4, \
154 PM_GPIO_STRENGTH_HIGH, \
155 _func, 0, 0)
156
157/* Initial PM8921 GPIO configurations */
158static struct pm8xxx_gpio_init pm8921_gpios[] __initdata = {
159 PM8XXX_GPIO_DISABLE(6), /* Disable unused */
160 PM8XXX_GPIO_DISABLE(7), /* Disable NFC */
161 PM8XXX_GPIO_INPUT(16, PM_GPIO_PULL_UP_30), /* SD_CARD_WP */
Amir Samuelov0c7270f2011-09-07 03:13:47 +0300162 /* External regulator shared by display and touchscreen on LiQUID */
163 PM8XXX_GPIO_OUTPUT(17, 0), /* DISP 3.3 V Boost */
164 PM8XXX_GPIO_OUTPUT(21, 1), /* Backlight Enable */
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700165 PM8XXX_GPIO_DISABLE(22), /* Disable NFC */
Nagamalleswararao Ganjieac5dfa2011-07-23 17:31:16 -0700166 PM8XXX_GPIO_OUTPUT_FUNC(24, 0, PM_GPIO_FUNC_2), /* Bl: Off, PWM mode */
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700167 PM8XXX_GPIO_INPUT(26, PM_GPIO_PULL_UP_30), /* SD_CARD_DET_N */
Nagamalleswararao Ganjica0adc02011-09-22 20:35:53 -0700168 PM8XXX_GPIO_OUTPUT(43, PM_GPIO_PULL_UP_30), /* DISP_RESET_N */
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700169};
170
171/* Initial PM8921 MPP configurations */
172static struct pm8xxx_mpp_init pm8921_mpps[] __initdata = {
173 /* External 5V regulator enable; shared by HDMI and USB_OTG switches. */
174 PM8XXX_MPP_INIT(7, D_INPUT, PM8921_MPP_DIG_LEVEL_VPH, DIN_TO_INT),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700175 PM8XXX_MPP_INIT(PM8921_AMUX_MPP_8, A_INPUT, PM8XXX_MPP_AIN_AMUX_CH8,
176 DOUT_CTRL_LOW),
177};
178
179static void __init pm8921_gpio_mpp_init(void)
180{
181 int i, rc;
182
183 for (i = 0; i < ARRAY_SIZE(pm8921_gpios); i++) {
184 rc = pm8xxx_gpio_config(pm8921_gpios[i].gpio,
185 &pm8921_gpios[i].config);
186 if (rc) {
187 pr_err("%s: pm8xxx_gpio_config: rc=%d\n", __func__, rc);
188 break;
189 }
190 }
191
192 for (i = 0; i < ARRAY_SIZE(pm8921_mpps); i++) {
193 rc = pm8xxx_mpp_config(pm8921_mpps[i].mpp,
194 &pm8921_mpps[i].config);
195 if (rc) {
196 pr_err("%s: pm8xxx_mpp_config: rc=%d\n", __func__, rc);
197 break;
198 }
199 }
200}
201
202#define FPGA_CS_GPIO 14
203#define KS8851_RST_GPIO 89
204#define KS8851_IRQ_GPIO 90
205
Rohit Vaswanicd2a59b2011-07-19 12:00:48 -0700206#if defined(CONFIG_GPIO_SX150X) || defined(CONFIG_GPIO_SX150X_MODULE)
207enum {
Abhijeet Dharmapurikar0fda5602011-08-17 18:00:55 -0700208 GPIO_EXPANDER_IRQ_BASE = (PM8921_IRQ_BASE + PM8921_NR_IRQS),
Rohit Vaswanicd2a59b2011-07-19 12:00:48 -0700209 GPIO_EXPANDER_GPIO_BASE = (PM8921_MPP_BASE + PM8921_NR_MPPS),
210 /* CAM Expander */
211 GPIO_CAM_EXPANDER_BASE = GPIO_EXPANDER_GPIO_BASE,
212 GPIO_CAM_GP_STROBE_READY = GPIO_CAM_EXPANDER_BASE,
213 GPIO_CAM_GP_AFBUSY,
214 GPIO_CAM_GP_STROBE_CE,
215 GPIO_CAM_GP_CAM1MP_XCLR,
216 GPIO_CAM_GP_CAMIF_RESET_N,
217 GPIO_CAM_GP_XMT_FLASH_INT,
218 GPIO_CAM_GP_LED_EN1,
219 GPIO_CAM_GP_LED_EN2,
220
221};
222#endif
223
Harini Jayaraman608d0462011-08-09 19:10:03 -0600224/* The SPI configurations apply to GSBI 1*/
225static struct gpiomux_setting spi_active = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700226 .func = GPIOMUX_FUNC_1,
Stepan Moskovchenkoa69f9052011-10-26 17:47:18 -0700227 .drv = GPIOMUX_DRV_12MA,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700228 .pull = GPIOMUX_PULL_NONE,
229};
230
Harini Jayaraman608d0462011-08-09 19:10:03 -0600231static struct gpiomux_setting spi_suspended_config = {
232 .func = GPIOMUX_FUNC_GPIO,
233 .drv = GPIOMUX_DRV_2MA,
234 .pull = GPIOMUX_PULL_DOWN,
235};
236
Mohan Pallakafd9a8f12011-09-23 11:50:38 +0530237static struct gpiomux_setting gsbi3_suspended_cfg = {
238 .func = GPIOMUX_FUNC_1,
239 .drv = GPIOMUX_DRV_2MA,
240 .pull = GPIOMUX_PULL_KEEPER,
241};
242
243static struct gpiomux_setting gsbi3_active_cfg = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700244 .func = GPIOMUX_FUNC_1,
245 .drv = GPIOMUX_DRV_8MA,
246 .pull = GPIOMUX_PULL_NONE,
247};
248
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700249static struct gpiomux_setting gsbi5 = {
250 .func = GPIOMUX_FUNC_1,
251 .drv = GPIOMUX_DRV_8MA,
252 .pull = GPIOMUX_PULL_NONE,
253};
254
255static struct gpiomux_setting gsbi10 = {
256 .func = GPIOMUX_FUNC_2,
257 .drv = GPIOMUX_DRV_8MA,
258 .pull = GPIOMUX_PULL_NONE,
259};
260
261static struct gpiomux_setting gsbi12 = {
262 .func = GPIOMUX_FUNC_1,
263 .drv = GPIOMUX_DRV_8MA,
264 .pull = GPIOMUX_PULL_NONE,
265};
266
267static struct gpiomux_setting cdc_mclk = {
268 .func = GPIOMUX_FUNC_1,
269 .drv = GPIOMUX_DRV_8MA,
270 .pull = GPIOMUX_PULL_NONE,
271};
272
Bhalchandra Gajare0e795c42011-08-15 18:10:30 -0700273static struct gpiomux_setting audio_auxpcm[] = {
274 /* Suspended state */
275 {
276 .func = GPIOMUX_FUNC_GPIO,
277 .drv = GPIOMUX_DRV_2MA,
278 .pull = GPIOMUX_PULL_NONE,
279 },
280 /* Active state */
281 {
282 .func = GPIOMUX_FUNC_1,
283 .drv = GPIOMUX_DRV_2MA,
284 .pull = GPIOMUX_PULL_NONE,
285 },
286};
287
Stepan Moskovchenko93d79ec2011-09-21 16:52:16 -0700288#if defined(CONFIG_KS8851) || defined(CONFIG_KS8851_MODULE)
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700289static struct gpiomux_setting gpio_eth_config = {
290 .pull = GPIOMUX_PULL_NONE,
291 .drv = GPIOMUX_DRV_8MA,
292 .func = GPIOMUX_FUNC_GPIO,
293};
Stepan Moskovchenko41d168272011-08-09 17:09:42 -0700294#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700295
296static struct gpiomux_setting slimbus = {
297 .func = GPIOMUX_FUNC_1,
298 .drv = GPIOMUX_DRV_8MA,
299 .pull = GPIOMUX_PULL_KEEPER,
300};
301
302struct msm_gpiomux_config msm8960_gpiomux_configs[NR_GPIO_IRQS] = {
Stepan Moskovchenko93d79ec2011-09-21 16:52:16 -0700303#if defined(CONFIG_KS8851) || defined(CONFIG_KS8851_MODULE)
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700304 {
305 .gpio = KS8851_IRQ_GPIO,
306 .settings = {
307 [GPIOMUX_SUSPENDED] = &gpio_eth_config,
308 }
309 },
310 {
311 .gpio = KS8851_RST_GPIO,
312 .settings = {
313 [GPIOMUX_SUSPENDED] = &gpio_eth_config,
314 }
315 },
316 {
317 .gpio = FPGA_CS_GPIO,
318 .settings = {
319 [GPIOMUX_SUSPENDED] = &gpio_eth_config,
320 }
321 },
Stepan Moskovchenko41d168272011-08-09 17:09:42 -0700322#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700323};
324
325static struct msm_gpiomux_config msm8960_gsbi_configs[] __initdata = {
326 {
327 .gpio = 6, /* GSBI1 QUP SPI_DATA_MOSI */
328 .settings = {
Harini Jayaraman608d0462011-08-09 19:10:03 -0600329 [GPIOMUX_SUSPENDED] = &spi_suspended_config,
330 [GPIOMUX_ACTIVE] = &spi_active,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700331 },
332 },
333 {
334 .gpio = 7, /* GSBI1 QUP SPI_DATA_MISO */
335 .settings = {
Harini Jayaraman608d0462011-08-09 19:10:03 -0600336 [GPIOMUX_SUSPENDED] = &spi_suspended_config,
337 [GPIOMUX_ACTIVE] = &spi_active,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700338 },
339 },
340 {
341 .gpio = 8, /* GSBI1 QUP SPI_CS_N */
342 .settings = {
Harini Jayaraman608d0462011-08-09 19:10:03 -0600343 [GPIOMUX_SUSPENDED] = &spi_suspended_config,
344 [GPIOMUX_ACTIVE] = &spi_active,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700345 },
346 },
347 {
348 .gpio = 9, /* GSBI1 QUP SPI_CLK */
349 .settings = {
Harini Jayaraman608d0462011-08-09 19:10:03 -0600350 [GPIOMUX_SUSPENDED] = &spi_suspended_config,
351 [GPIOMUX_ACTIVE] = &spi_active,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700352 },
353 },
354 {
355 .gpio = 16, /* GSBI3 I2C QUP SDA */
356 .settings = {
Mohan Pallakafd9a8f12011-09-23 11:50:38 +0530357 [GPIOMUX_SUSPENDED] = &gsbi3_suspended_cfg,
358 [GPIOMUX_ACTIVE] = &gsbi3_active_cfg,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700359 },
360 },
361 {
362 .gpio = 17, /* GSBI3 I2C QUP SCL */
363 .settings = {
Mohan Pallakafd9a8f12011-09-23 11:50:38 +0530364 [GPIOMUX_SUSPENDED] = &gsbi3_suspended_cfg,
365 [GPIOMUX_ACTIVE] = &gsbi3_active_cfg,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700366 },
367 },
368 {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700369 .gpio = 22, /* GSBI5 UART2 */
370 .settings = {
371 [GPIOMUX_SUSPENDED] = &gsbi5,
372 },
373 },
374 {
375 .gpio = 23, /* GSBI5 UART2 */
376 .settings = {
377 [GPIOMUX_SUSPENDED] = &gsbi5,
378 },
379 },
380 {
381 .gpio = 24, /* GSBI5 UART2 */
382 .settings = {
383 [GPIOMUX_SUSPENDED] = &gsbi5,
384 },
385 },
386 {
387 .gpio = 25, /* GSBI5 UART2 */
388 .settings = {
389 [GPIOMUX_SUSPENDED] = &gsbi5,
390 },
391 },
392 {
393 .gpio = 44, /* GSBI12 I2C QUP SDA */
394 .settings = {
395 [GPIOMUX_SUSPENDED] = &gsbi12,
396 },
397 },
398 {
399 .gpio = 45, /* GSBI12 I2C QUP SCL */
400 .settings = {
401 [GPIOMUX_SUSPENDED] = &gsbi12,
402 },
403 },
404 {
405 .gpio = 73, /* GSBI10 I2C QUP SDA */
406 .settings = {
407 [GPIOMUX_SUSPENDED] = &gsbi10,
408 },
409 },
410 {
411 .gpio = 74, /* GSBI10 I2C QUP SCL */
412 .settings = {
413 [GPIOMUX_SUSPENDED] = &gsbi10,
414 },
415 },
416};
417
418static struct msm_gpiomux_config msm8960_slimbus_config[] __initdata = {
419 {
420 .gpio = 60, /* slimbus data */
421 .settings = {
422 [GPIOMUX_SUSPENDED] = &slimbus,
423 },
424 },
425 {
426 .gpio = 61, /* slimbus clk */
427 .settings = {
428 [GPIOMUX_SUSPENDED] = &slimbus,
429 },
430 },
431};
432
433static struct msm_gpiomux_config msm8960_audio_codec_configs[] __initdata = {
434 {
435 .gpio = 59,
436 .settings = {
437 [GPIOMUX_SUSPENDED] = &cdc_mclk,
438 },
439 },
440};
Bhalchandra Gajare0e795c42011-08-15 18:10:30 -0700441
442static struct msm_gpiomux_config msm8960_audio_auxpcm_configs[] __initdata = {
443 {
444 .gpio = 63,
445 .settings = {
446 [GPIOMUX_SUSPENDED] = &audio_auxpcm[0],
447 [GPIOMUX_ACTIVE] = &audio_auxpcm[1],
448 },
449 },
450 {
451 .gpio = 64,
452 .settings = {
453 [GPIOMUX_SUSPENDED] = &audio_auxpcm[0],
454 [GPIOMUX_ACTIVE] = &audio_auxpcm[1],
455 },
456 },
457 {
458 .gpio = 65,
459 .settings = {
460 [GPIOMUX_SUSPENDED] = &audio_auxpcm[0],
461 [GPIOMUX_ACTIVE] = &audio_auxpcm[1],
462 },
463 },
464 {
465 .gpio = 66,
466 .settings = {
467 [GPIOMUX_SUSPENDED] = &audio_auxpcm[0],
468 [GPIOMUX_ACTIVE] = &audio_auxpcm[1],
469 },
470 },
471};
472
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700473static struct gpiomux_setting wcnss_5wire_suspend_cfg = {
474 .func = GPIOMUX_FUNC_GPIO,
475 .drv = GPIOMUX_DRV_2MA,
Ankur Nandwaniad0d9ac2011-09-26 11:49:25 -0700476 .pull = GPIOMUX_PULL_UP,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700477};
478
479static struct gpiomux_setting wcnss_5wire_active_cfg = {
480 .func = GPIOMUX_FUNC_1,
481 .drv = GPIOMUX_DRV_6MA,
482 .pull = GPIOMUX_PULL_DOWN,
483};
484
485static struct msm_gpiomux_config wcnss_5wire_interface[] = {
486 {
487 .gpio = 84,
488 .settings = {
489 [GPIOMUX_ACTIVE] = &wcnss_5wire_active_cfg,
490 [GPIOMUX_SUSPENDED] = &wcnss_5wire_suspend_cfg,
491 },
492 },
493 {
494 .gpio = 85,
495 .settings = {
496 [GPIOMUX_ACTIVE] = &wcnss_5wire_active_cfg,
497 [GPIOMUX_SUSPENDED] = &wcnss_5wire_suspend_cfg,
498 },
499 },
500 {
501 .gpio = 86,
502 .settings = {
503 [GPIOMUX_ACTIVE] = &wcnss_5wire_active_cfg,
504 [GPIOMUX_SUSPENDED] = &wcnss_5wire_suspend_cfg,
505 },
506 },
507 {
508 .gpio = 87,
509 .settings = {
510 [GPIOMUX_ACTIVE] = &wcnss_5wire_active_cfg,
511 [GPIOMUX_SUSPENDED] = &wcnss_5wire_suspend_cfg,
512 },
513 },
514 {
515 .gpio = 88,
516 .settings = {
517 [GPIOMUX_ACTIVE] = &wcnss_5wire_active_cfg,
518 [GPIOMUX_SUSPENDED] = &wcnss_5wire_suspend_cfg,
519 },
520 },
521};
Nishant Pandit24153d82011-08-27 16:05:13 +0530522static struct gpiomux_setting cam_settings[] = {
Nishant Pandit474f2252011-07-23 23:17:56 +0530523 {
524 .func = GPIOMUX_FUNC_GPIO, /*suspend*/
525 .drv = GPIOMUX_DRV_2MA,
526 .pull = GPIOMUX_PULL_DOWN,
527 },
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700528
Nishant Pandit474f2252011-07-23 23:17:56 +0530529 {
530 .func = GPIOMUX_FUNC_1, /*active 1*/
531 .drv = GPIOMUX_DRV_2MA,
532 .pull = GPIOMUX_PULL_NONE,
533 },
534
535 {
536 .func = GPIOMUX_FUNC_GPIO, /*active 2*/
537 .drv = GPIOMUX_DRV_2MA,
538 .pull = GPIOMUX_PULL_NONE,
539 },
540
541 {
542 .func = GPIOMUX_FUNC_1, /*active 3*/
543 .drv = GPIOMUX_DRV_8MA,
Kevin Chan4c58d292011-09-13 11:03:25 -0700544 .pull = GPIOMUX_PULL_NONE,
Nishant Pandit474f2252011-07-23 23:17:56 +0530545 },
Nishant Pandit24153d82011-08-27 16:05:13 +0530546
547 {
548 .func = GPIOMUX_FUNC_5, /*active 4*/
549 .drv = GPIOMUX_DRV_8MA,
550 .pull = GPIOMUX_PULL_UP,
551 },
552
553 {
554 .func = GPIOMUX_FUNC_6, /*active 5*/
555 .drv = GPIOMUX_DRV_8MA,
556 .pull = GPIOMUX_PULL_UP,
557 },
558
559 {
560 .func = GPIOMUX_FUNC_2, /*active 6*/
561 .drv = GPIOMUX_DRV_2MA,
562 .pull = GPIOMUX_PULL_UP,
563 },
564
565 {
566 .func = GPIOMUX_FUNC_3, /*active 7*/
567 .drv = GPIOMUX_DRV_8MA,
568 .pull = GPIOMUX_PULL_UP,
569 },
570
Kevin Chan4c58d292011-09-13 11:03:25 -0700571 {
572 .func = GPIOMUX_FUNC_GPIO, /*i2c suspend*/
573 .drv = GPIOMUX_DRV_2MA,
574 .pull = GPIOMUX_PULL_KEEPER,
575 },
576
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700577};
578
Nishant Pandit24153d82011-08-27 16:05:13 +0530579static struct msm_gpiomux_config msm8960_cam_common_configs[] = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700580 {
581 .gpio = 2,
582 .settings = {
Nishant Pandit474f2252011-07-23 23:17:56 +0530583 [GPIOMUX_ACTIVE] = &cam_settings[2],
584 [GPIOMUX_SUSPENDED] = &cam_settings[0],
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700585 },
586 },
587 {
588 .gpio = 3,
589 .settings = {
Nishant Pandit474f2252011-07-23 23:17:56 +0530590 [GPIOMUX_ACTIVE] = &cam_settings[1],
591 [GPIOMUX_SUSPENDED] = &cam_settings[0],
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700592 },
593 },
594 {
595 .gpio = 4,
596 .settings = {
Nishant Pandit474f2252011-07-23 23:17:56 +0530597 [GPIOMUX_ACTIVE] = &cam_settings[1],
598 [GPIOMUX_SUSPENDED] = &cam_settings[0],
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700599 },
600 },
601 {
602 .gpio = 5,
603 .settings = {
Nishant Pandit474f2252011-07-23 23:17:56 +0530604 [GPIOMUX_ACTIVE] = &cam_settings[1],
605 [GPIOMUX_SUSPENDED] = &cam_settings[0],
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700606 },
607 },
608 {
Nishant Pandit24153d82011-08-27 16:05:13 +0530609 .gpio = 76,
610 .settings = {
611 [GPIOMUX_ACTIVE] = &cam_settings[2],
612 [GPIOMUX_SUSPENDED] = &cam_settings[0],
613 },
614 },
615 {
616 .gpio = 107,
617 .settings = {
618 [GPIOMUX_ACTIVE] = &cam_settings[2],
619 [GPIOMUX_SUSPENDED] = &cam_settings[0],
620 },
621 },
622};
623
624static struct msm_gpiomux_config msm8960_cam_2d_configs[] = {
625 {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700626 .gpio = 18,
627 .settings = {
Nishant Pandit474f2252011-07-23 23:17:56 +0530628 [GPIOMUX_ACTIVE] = &cam_settings[3],
Kevin Chan4c58d292011-09-13 11:03:25 -0700629 [GPIOMUX_SUSPENDED] = &cam_settings[8],
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700630 },
631 },
632 {
633 .gpio = 19,
634 .settings = {
Nishant Pandit474f2252011-07-23 23:17:56 +0530635 [GPIOMUX_ACTIVE] = &cam_settings[3],
Kevin Chan4c58d292011-09-13 11:03:25 -0700636 [GPIOMUX_SUSPENDED] = &cam_settings[8],
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700637 },
638 },
639 {
640 .gpio = 20,
641 .settings = {
Nishant Pandit474f2252011-07-23 23:17:56 +0530642 [GPIOMUX_ACTIVE] = &cam_settings[3],
Kevin Chan4c58d292011-09-13 11:03:25 -0700643 [GPIOMUX_SUSPENDED] = &cam_settings[8],
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700644 },
645 },
646 {
647 .gpio = 21,
648 .settings = {
Nishant Pandit474f2252011-07-23 23:17:56 +0530649 [GPIOMUX_ACTIVE] = &cam_settings[3],
Kevin Chan4c58d292011-09-13 11:03:25 -0700650 [GPIOMUX_SUSPENDED] = &cam_settings[8],
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700651 },
652 },
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700653};
654
655static struct gpiomux_setting cyts_resout_sus_cfg = {
656 .func = GPIOMUX_FUNC_GPIO,
657 .drv = GPIOMUX_DRV_6MA,
658 .pull = GPIOMUX_PULL_UP,
659};
660
661static struct gpiomux_setting cyts_resout_act_cfg = {
662 .func = GPIOMUX_FUNC_GPIO,
663 .drv = GPIOMUX_DRV_6MA,
664 .pull = GPIOMUX_PULL_UP,
665};
666
667static struct gpiomux_setting cyts_sleep_sus_cfg = {
668 .func = GPIOMUX_FUNC_GPIO,
669 .drv = GPIOMUX_DRV_6MA,
670 .pull = GPIOMUX_PULL_DOWN,
671};
672
673static struct gpiomux_setting cyts_sleep_act_cfg = {
674 .func = GPIOMUX_FUNC_GPIO,
675 .drv = GPIOMUX_DRV_6MA,
676 .pull = GPIOMUX_PULL_DOWN,
677};
678
679static struct gpiomux_setting cyts_int_act_cfg = {
680 .func = GPIOMUX_FUNC_GPIO,
681 .drv = GPIOMUX_DRV_8MA,
682 .pull = GPIOMUX_PULL_UP,
683};
684
685static struct gpiomux_setting cyts_int_sus_cfg = {
686 .func = GPIOMUX_FUNC_GPIO,
687 .drv = GPIOMUX_DRV_2MA,
Mohan Pallakacbc5d162011-09-13 15:23:21 +0530688 .pull = GPIOMUX_PULL_DOWN,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700689};
690
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700691static struct msm_gpiomux_config msm8960_cyts_configs[] __initdata = {
692 { /* TS INTERRUPT */
693 .gpio = 11,
694 .settings = {
695 [GPIOMUX_ACTIVE] = &cyts_int_act_cfg,
696 [GPIOMUX_SUSPENDED] = &cyts_int_sus_cfg,
697 },
698 },
699 { /* TS SLEEP */
700 .gpio = 50,
701 .settings = {
702 [GPIOMUX_ACTIVE] = &cyts_sleep_act_cfg,
703 [GPIOMUX_SUSPENDED] = &cyts_sleep_sus_cfg,
704 },
705 },
706 { /* TS RESOUT */
707 .gpio = 52,
708 .settings = {
709 [GPIOMUX_ACTIVE] = &cyts_resout_act_cfg,
710 [GPIOMUX_SUSPENDED] = &cyts_resout_sus_cfg,
711 },
712 },
713};
714
Vijayavardhan Vennapusae3316a12011-10-15 06:05:17 +0530715#ifdef CONFIG_USB_EHCI_MSM_HSIC
716static struct gpiomux_setting hsic_act_cfg = {
717 .func = GPIOMUX_FUNC_1,
718 .drv = GPIOMUX_DRV_12MA,
719 .pull = GPIOMUX_PULL_NONE,
720};
721
722static struct gpiomux_setting hsic_sus_cfg = {
723 .func = GPIOMUX_FUNC_GPIO,
724 .drv = GPIOMUX_DRV_2MA,
725 .pull = GPIOMUX_PULL_DOWN,
726};
727
728static struct msm_gpiomux_config msm8960_hsic_configs[] = {
729 {
730 .gpio = 150, /*HSIC_STROBE */
731 .settings = {
732 [GPIOMUX_ACTIVE] = &hsic_act_cfg,
733 [GPIOMUX_SUSPENDED] = &hsic_sus_cfg,
734 },
735 },
736 {
737 .gpio = 151, /* HSIC_DATA */
738 .settings = {
739 [GPIOMUX_ACTIVE] = &hsic_act_cfg,
740 [GPIOMUX_SUSPENDED] = &hsic_sus_cfg,
741 },
742 },
743};
744#endif
745
Rohit Vaswanicd2a59b2011-07-19 12:00:48 -0700746#if defined(CONFIG_GPIO_SX150X) || defined(CONFIG_GPIO_SX150X_MODULE)
747enum {
748 SX150X_CAM,
749};
750
Nishant Pandit474f2252011-07-23 23:17:56 +0530751static struct sx150x_platform_data sx150x_data[] = {
Rohit Vaswanicd2a59b2011-07-19 12:00:48 -0700752 [SX150X_CAM] = {
753 .gpio_base = GPIO_CAM_EXPANDER_BASE,
754 .oscio_is_gpo = false,
755 .io_pullup_ena = 0x0,
Nishant Pandit474f2252011-07-23 23:17:56 +0530756 .io_pulldn_ena = 0xc0,
Rohit Vaswanicd2a59b2011-07-19 12:00:48 -0700757 .io_open_drain_ena = 0x0,
758 .irq_summary = -1,
759 },
760};
Nishant Pandit474f2252011-07-23 23:17:56 +0530761
762#endif
763
764#ifdef CONFIG_I2C
765
766#define MSM_8960_GSBI4_QUP_I2C_BUS_ID 4
767#define MSM_8960_GSBI3_QUP_I2C_BUS_ID 3
Amir Samuelov5137e392011-09-21 17:31:25 +0300768#define MSM_8960_GSBI10_QUP_I2C_BUS_ID 10
Nishant Pandit474f2252011-07-23 23:17:56 +0530769
770#if defined(CONFIG_GPIO_SX150X) || defined(CONFIG_GPIO_SX150X_MODULE)
771
772static struct i2c_board_info cam_expander_i2c_info[] = {
773 {
774 I2C_BOARD_INFO("sx1508q", 0x22),
775 .platform_data = &sx150x_data[SX150X_CAM]
776 },
777};
778
779static struct msm_cam_expander_info cam_expander_info[] = {
780 {
781 cam_expander_i2c_info,
782 MSM_8960_GSBI4_QUP_I2C_BUS_ID,
783 },
784};
785#endif
Rohit Vaswanicd2a59b2011-07-19 12:00:48 -0700786#endif
787
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700788#define MSM_PMEM_KERNEL_EBI1_SIZE 0x110C000
789#define MSM_PMEM_ADSP_SIZE 0x3800000
Ben Romberger09e462d2011-08-09 15:24:37 -0700790#define MSM_PMEM_AUDIO_SIZE 0x28B000
Ravishangar Kalyanamf4ef7282011-10-10 17:39:48 -0700791#ifdef CONFIG_FB_MSM_HDMI_AS_PRIMARY
792#define MSM_PMEM_SIZE 0x4000000 /* 64 Mbytes */
793#else
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700794#define MSM_PMEM_SIZE 0x1800000 /* 24 Mbytes */
Ravishangar Kalyanamf4ef7282011-10-10 17:39:48 -0700795#endif
Laura Abbott2d1760b2011-09-29 21:31:24 -0700796
797
798#ifdef CONFIG_MSM_MULTIMEDIA_USE_ION
799#define MSM_ION_EBI_SIZE MSM_PMEM_SIZE
800#define MSM_ION_ADSP_SIZE MSM_PMEM_ADSP_SIZE
801#define MSM_ION_HEAP_NUM 4
802#else
803#define MSM_ION_HEAP_NUM 2
804#endif
Laura Abbottd6183792011-08-19 13:42:24 -0700805
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700806#ifdef CONFIG_KERNEL_PMEM_EBI_REGION
807static unsigned pmem_kernel_ebi1_size = MSM_PMEM_KERNEL_EBI1_SIZE;
808static int __init pmem_kernel_ebi1_size_setup(char *p)
809{
810 pmem_kernel_ebi1_size = memparse(p, NULL);
811 return 0;
812}
813early_param("pmem_kernel_ebi1_size", pmem_kernel_ebi1_size_setup);
814#endif
815
816#ifdef CONFIG_ANDROID_PMEM
817static unsigned pmem_size = MSM_PMEM_SIZE;
818static int __init pmem_size_setup(char *p)
819{
820 pmem_size = memparse(p, NULL);
821 return 0;
822}
823early_param("pmem_size", pmem_size_setup);
824
825static unsigned pmem_adsp_size = MSM_PMEM_ADSP_SIZE;
826
827static int __init pmem_adsp_size_setup(char *p)
828{
829 pmem_adsp_size = memparse(p, NULL);
830 return 0;
831}
832early_param("pmem_adsp_size", pmem_adsp_size_setup);
833
834static unsigned pmem_audio_size = MSM_PMEM_AUDIO_SIZE;
835
836static int __init pmem_audio_size_setup(char *p)
837{
838 pmem_audio_size = memparse(p, NULL);
839 return 0;
840}
841early_param("pmem_audio_size", pmem_audio_size_setup);
842#endif
843
844#ifdef CONFIG_ANDROID_PMEM
Laura Abbott2d1760b2011-09-29 21:31:24 -0700845#ifndef CONFIG_MSM_MULTIMEDIA_USE_ION
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700846static struct android_pmem_platform_data android_pmem_pdata = {
847 .name = "pmem",
848 .allocator_type = PMEM_ALLOCATORTYPE_ALLORNOTHING,
849 .cached = 1,
850 .memory_type = MEMTYPE_EBI1,
851};
852
853static struct platform_device android_pmem_device = {
854 .name = "android_pmem",
855 .id = 0,
856 .dev = {.platform_data = &android_pmem_pdata},
857};
858
859static struct android_pmem_platform_data android_pmem_adsp_pdata = {
860 .name = "pmem_adsp",
861 .allocator_type = PMEM_ALLOCATORTYPE_BITMAP,
862 .cached = 0,
863 .memory_type = MEMTYPE_EBI1,
864};
865static struct platform_device android_pmem_adsp_device = {
866 .name = "android_pmem",
867 .id = 2,
868 .dev = { .platform_data = &android_pmem_adsp_pdata },
869};
Laura Abbott2d1760b2011-09-29 21:31:24 -0700870#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700871
872static struct android_pmem_platform_data android_pmem_audio_pdata = {
873 .name = "pmem_audio",
874 .allocator_type = PMEM_ALLOCATORTYPE_BITMAP,
875 .cached = 0,
876 .memory_type = MEMTYPE_EBI1,
877};
878
879static struct platform_device android_pmem_audio_device = {
880 .name = "android_pmem",
881 .id = 4,
882 .dev = { .platform_data = &android_pmem_audio_pdata },
883};
884#endif
885
Swaminathan Sathappanb77c65e92011-09-30 18:36:09 -0700886#define DSP_RAM_BASE_8960 0x8da00000
887#define DSP_RAM_SIZE_8960 0x1800000
888static int dspcrashd_pdata_8960 = 0xDEADDEAD;
889
890static struct resource resources_dspcrashd_8960[] = {
891 {
892 .name = "msm_dspcrashd",
893 .start = DSP_RAM_BASE_8960,
894 .end = DSP_RAM_BASE_8960 + DSP_RAM_SIZE_8960,
895 .flags = IORESOURCE_DMA,
896 },
897};
898
899struct platform_device msm_device_dspcrashd_8960 = {
900 .name = "msm_dspcrashd",
901 .num_resources = ARRAY_SIZE(resources_dspcrashd_8960),
902 .resource = resources_dspcrashd_8960,
903 .dev = { .platform_data = &dspcrashd_pdata_8960 },
904};
905
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700906static struct memtype_reserve msm8960_reserve_table[] __initdata = {
907 [MEMTYPE_SMI] = {
908 },
909 [MEMTYPE_EBI0] = {
910 .flags = MEMTYPE_FLAGS_1M_ALIGN,
911 },
912 [MEMTYPE_EBI1] = {
913 .flags = MEMTYPE_FLAGS_1M_ALIGN,
914 },
915};
916
917static void __init size_pmem_devices(void)
918{
919#ifdef CONFIG_ANDROID_PMEM
Laura Abbott2d1760b2011-09-29 21:31:24 -0700920#ifndef CONFIG_MSM_MULTIMEDIA_USE_ION
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700921 android_pmem_adsp_pdata.size = pmem_adsp_size;
922 android_pmem_pdata.size = pmem_size;
Laura Abbott2d1760b2011-09-29 21:31:24 -0700923#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700924 android_pmem_audio_pdata.size = MSM_PMEM_AUDIO_SIZE;
925#endif
926}
927
928static void __init reserve_memory_for(struct android_pmem_platform_data *p)
929{
930 msm8960_reserve_table[p->memory_type].size += p->size;
931}
932
933static void __init reserve_pmem_memory(void)
934{
935#ifdef CONFIG_ANDROID_PMEM
Laura Abbott2d1760b2011-09-29 21:31:24 -0700936#ifndef CONFIG_MSM_MULTIMEDIA_USE_ION
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700937 reserve_memory_for(&android_pmem_adsp_pdata);
938 reserve_memory_for(&android_pmem_pdata);
Laura Abbott2d1760b2011-09-29 21:31:24 -0700939#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700940 reserve_memory_for(&android_pmem_audio_pdata);
941 msm8960_reserve_table[MEMTYPE_EBI1].size += pmem_kernel_ebi1_size;
942#endif
943}
944
Larry Basselb4126da2011-07-18 14:31:33 -0700945static int msm8960_paddr_to_memtype(unsigned int paddr)
946{
947 return MEMTYPE_EBI1;
948}
949
Laura Abbottd6183792011-08-19 13:42:24 -0700950#ifdef CONFIG_ION_MSM
951struct ion_platform_data ion_pdata = {
Laura Abbott2d1760b2011-09-29 21:31:24 -0700952 .nr = MSM_ION_HEAP_NUM,
Laura Abbottd6183792011-08-19 13:42:24 -0700953 .heaps = {
954 {
955 .id = ION_HEAP_SYSTEM_ID,
956 .type = ION_HEAP_TYPE_SYSTEM,
957 .name = ION_KMALLOC_HEAP_NAME,
958 },
959 {
960 .id = ION_HEAP_SYSTEM_CONTIG_ID,
961 .type = ION_HEAP_TYPE_SYSTEM_CONTIG,
962 .name = ION_VMALLOC_HEAP_NAME,
963 },
Laura Abbott2d1760b2011-09-29 21:31:24 -0700964#ifdef CONFIG_MSM_MULTIMEDIA_USE_ION
Laura Abbottd6183792011-08-19 13:42:24 -0700965 {
966 .id = ION_HEAP_EBI_ID,
967 .type = ION_HEAP_TYPE_CARVEOUT,
968 .name = ION_EBI1_HEAP_NAME,
969 .size = MSM_ION_EBI_SIZE,
970 .memory_type = ION_EBI_TYPE,
971 },
Laura Abbott2d1760b2011-09-29 21:31:24 -0700972 {
973 .id = ION_HEAP_ADSP_ID,
974 .type = ION_HEAP_TYPE_CARVEOUT,
975 .name = ION_ADSP_HEAP_NAME,
976 .size = MSM_ION_ADSP_SIZE,
977 .memory_type = ION_EBI_TYPE,
978 },
979#endif
Laura Abbottd6183792011-08-19 13:42:24 -0700980 }
981};
982
983struct platform_device ion_dev = {
984 .name = "ion-msm",
985 .id = 1,
986 .dev = { .platform_data = &ion_pdata },
987};
988#endif
989
990static void reserve_ion_memory(void)
991{
Laura Abbott2d1760b2011-09-29 21:31:24 -0700992#if defined(CONFIG_ION_MSM) && defined(CONFIG_MSM_MULTIMEDIA_USE_ION)
Laura Abbottd6183792011-08-19 13:42:24 -0700993 msm8960_reserve_table[MEMTYPE_EBI1].size += MSM_ION_EBI_SIZE;
Laura Abbott2d1760b2011-09-29 21:31:24 -0700994 msm8960_reserve_table[MEMTYPE_EBI1].size += MSM_ION_ADSP_SIZE;
Laura Abbottd6183792011-08-19 13:42:24 -0700995#endif
996}
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700997static void __init msm8960_calculate_reserve_sizes(void)
998{
999 size_pmem_devices();
1000 reserve_pmem_memory();
Laura Abbottd6183792011-08-19 13:42:24 -07001001 reserve_ion_memory();
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001002}
1003
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001004static struct reserve_info msm8960_reserve_info __initdata = {
1005 .memtype_reserve_table = msm8960_reserve_table,
1006 .calculate_reserve_sizes = msm8960_calculate_reserve_sizes,
1007 .paddr_to_memtype = msm8960_paddr_to_memtype,
1008};
1009
Larry Basselb4126da2011-07-18 14:31:33 -07001010static int msm8960_memory_bank_size(void)
1011{
1012 return 1<<29;
1013}
1014
1015static void __init locate_unstable_memory(void)
1016{
1017 struct membank *mb = &meminfo.bank[meminfo.nr_banks - 1];
1018 unsigned long bank_size;
1019 unsigned long low, high;
1020
1021 bank_size = msm8960_memory_bank_size();
1022 low = meminfo.bank[0].start;
1023 high = mb->start + mb->size;
1024 low &= ~(bank_size - 1);
1025
1026 if (high - low <= bank_size)
1027 return;
1028 msm8960_reserve_info.low_unstable_address = low + bank_size;
1029 msm8960_reserve_info.max_unstable_size = high - low - bank_size;
1030 msm8960_reserve_info.bank_size = bank_size;
1031 pr_info("low unstable address %lx max size %lx bank size %lx\n",
1032 msm8960_reserve_info.low_unstable_address,
1033 msm8960_reserve_info.max_unstable_size,
1034 msm8960_reserve_info.bank_size);
1035}
1036
Larry Basselb830e182011-10-14 10:46:55 -07001037static void __init place_movable_zone(void)
1038{
1039 movable_reserved_start = msm8960_reserve_info.low_unstable_address;
1040 movable_reserved_size = msm8960_reserve_info.max_unstable_size;
1041 pr_info("movable zone start %lx size %lx\n",
1042 movable_reserved_start, movable_reserved_size);
1043}
1044
1045static void __init msm8960_early_memory(void)
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001046{
1047 reserve_info = &msm8960_reserve_info;
Larry Basselb4126da2011-07-18 14:31:33 -07001048 locate_unstable_memory();
Larry Basselb830e182011-10-14 10:46:55 -07001049 place_movable_zone();
1050}
1051
1052static void __init msm8960_reserve(void)
1053{
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001054 msm_reserve();
1055}
1056
Larry Bassela4414b12011-08-04 11:11:02 -07001057static int msm8960_change_memory_power(u64 start, u64 size,
1058 int change_type)
Larry Bassela7eadea2011-07-14 10:46:00 -07001059{
Naveen Ramarajb03bb1b2011-09-12 14:34:31 -07001060 return soc_change_memory_power(start, size, change_type);
Larry Bassela7eadea2011-07-14 10:46:00 -07001061}
1062
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001063#ifdef CONFIG_MSM_CAMERA
1064
Nishant Pandit24153d82011-08-27 16:05:13 +05301065static uint16_t msm_cam_gpio_2d_tbl[] = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001066 5, /*CAMIF_MCLK*/
1067 20, /*CAMIF_I2C_DATA*/
1068 21, /*CAMIF_I2C_CLK*/
1069};
1070
Nishant Pandit24153d82011-08-27 16:05:13 +05301071static struct msm_camera_gpio_conf gpio_conf = {
1072 .cam_gpiomux_conf_tbl = msm8960_cam_2d_configs,
1073 .cam_gpiomux_conf_tbl_size = ARRAY_SIZE(msm8960_cam_2d_configs),
1074 .cam_gpio_tbl = msm_cam_gpio_2d_tbl,
1075 .cam_gpio_tbl_size = ARRAY_SIZE(msm_cam_gpio_2d_tbl),
1076};
1077
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001078#define VFE_CAMIF_TIMER1_GPIO 2
1079#define VFE_CAMIF_TIMER2_GPIO 3
1080#define VFE_CAMIF_TIMER3_GPIO_INT 4
1081struct msm_camera_sensor_strobe_flash_data strobe_flash_xenon = {
1082 .flash_trigger = VFE_CAMIF_TIMER2_GPIO,
1083 .flash_charge = VFE_CAMIF_TIMER1_GPIO,
1084 .flash_charge_done = VFE_CAMIF_TIMER3_GPIO_INT,
1085 .flash_recharge_duration = 50000,
1086 .irq = MSM_GPIO_TO_INT(VFE_CAMIF_TIMER3_GPIO_INT),
1087};
1088
Nishant Pandit474f2252011-07-23 23:17:56 +05301089#ifdef CONFIG_MSM_CAMERA_FLASH
1090static struct msm_camera_sensor_flash_src msm_flash_src = {
1091 .flash_sr_type = MSM_CAMERA_FLASH_SRC_EXT,
1092 ._fsrc.ext_driver_src.led_en = GPIO_CAM_GP_LED_EN1,
1093 ._fsrc.ext_driver_src.led_flash_en = GPIO_CAM_GP_LED_EN2,
1094#if defined(CONFIG_I2C) && (defined(CONFIG_GPIO_SX150X) || \
1095 defined(CONFIG_GPIO_SX150X_MODULE))
1096 ._fsrc.ext_driver_src.expander_info = cam_expander_info,
1097#endif
1098};
1099#endif
1100
Shuzhen Wang65c3b1d2011-09-20 12:53:08 -07001101static struct msm_bus_vectors cam_init_vectors[] = {
1102 {
1103 .src = MSM_BUS_MASTER_VFE,
1104 .dst = MSM_BUS_SLAVE_EBI_CH0,
1105 .ab = 0,
1106 .ib = 0,
1107 },
1108 {
1109 .src = MSM_BUS_MASTER_VPE,
1110 .dst = MSM_BUS_SLAVE_EBI_CH0,
1111 .ab = 0,
1112 .ib = 0,
1113 },
1114 {
1115 .src = MSM_BUS_MASTER_JPEG_ENC,
1116 .dst = MSM_BUS_SLAVE_EBI_CH0,
1117 .ab = 0,
1118 .ib = 0,
1119 },
1120};
1121
1122static struct msm_bus_vectors cam_preview_vectors[] = {
1123 {
1124 .src = MSM_BUS_MASTER_VFE,
1125 .dst = MSM_BUS_SLAVE_EBI_CH0,
1126 .ab = 27648000,
1127 .ib = 110592000,
1128 },
1129 {
1130 .src = MSM_BUS_MASTER_VPE,
1131 .dst = MSM_BUS_SLAVE_EBI_CH0,
1132 .ab = 0,
1133 .ib = 0,
1134 },
1135 {
1136 .src = MSM_BUS_MASTER_JPEG_ENC,
1137 .dst = MSM_BUS_SLAVE_EBI_CH0,
1138 .ab = 0,
1139 .ib = 0,
1140 },
1141};
1142
1143static struct msm_bus_vectors cam_video_vectors[] = {
1144 {
1145 .src = MSM_BUS_MASTER_VFE,
1146 .dst = MSM_BUS_SLAVE_EBI_CH0,
1147 .ab = 140451840,
1148 .ib = 561807360,
1149 },
1150 {
1151 .src = MSM_BUS_MASTER_VPE,
1152 .dst = MSM_BUS_SLAVE_EBI_CH0,
1153 .ab = 206807040,
1154 .ib = 488816640,
1155 },
1156 {
1157 .src = MSM_BUS_MASTER_JPEG_ENC,
1158 .dst = MSM_BUS_SLAVE_EBI_CH0,
1159 .ab = 0,
1160 .ib = 0,
1161 },
1162};
1163
1164static struct msm_bus_vectors cam_snapshot_vectors[] = {
1165 {
1166 .src = MSM_BUS_MASTER_VFE,
1167 .dst = MSM_BUS_SLAVE_EBI_CH0,
1168 .ab = 274423680,
1169 .ib = 1097694720,
1170 },
1171 {
1172 .src = MSM_BUS_MASTER_VPE,
1173 .dst = MSM_BUS_SLAVE_EBI_CH0,
1174 .ab = 0,
1175 .ib = 0,
1176 },
1177 {
1178 .src = MSM_BUS_MASTER_JPEG_ENC,
1179 .dst = MSM_BUS_SLAVE_EBI_CH0,
1180 .ab = 540000000,
1181 .ib = 1350000000,
1182 },
1183};
1184
1185static struct msm_bus_vectors cam_zsl_vectors[] = {
1186 {
1187 .src = MSM_BUS_MASTER_VFE,
1188 .dst = MSM_BUS_SLAVE_EBI_CH0,
1189 .ab = 302071680,
1190 .ib = 1208286720,
1191 },
1192 {
1193 .src = MSM_BUS_MASTER_VPE,
1194 .dst = MSM_BUS_SLAVE_EBI_CH0,
1195 .ab = 0,
1196 .ib = 0,
1197 },
1198 {
1199 .src = MSM_BUS_MASTER_JPEG_ENC,
1200 .dst = MSM_BUS_SLAVE_EBI_CH0,
1201 .ab = 540000000,
1202 .ib = 1350000000,
1203 },
1204};
1205
1206static struct msm_bus_paths cam_bus_client_config[] = {
1207 {
1208 ARRAY_SIZE(cam_init_vectors),
1209 cam_init_vectors,
1210 },
1211 {
1212 ARRAY_SIZE(cam_preview_vectors),
1213 cam_preview_vectors,
1214 },
1215 {
1216 ARRAY_SIZE(cam_video_vectors),
1217 cam_video_vectors,
1218 },
1219 {
1220 ARRAY_SIZE(cam_snapshot_vectors),
1221 cam_snapshot_vectors,
1222 },
1223 {
1224 ARRAY_SIZE(cam_zsl_vectors),
1225 cam_zsl_vectors,
1226 },
1227};
1228
1229static struct msm_bus_scale_pdata cam_bus_client_pdata = {
1230 cam_bus_client_config,
1231 ARRAY_SIZE(cam_bus_client_config),
1232 .name = "msm_camera",
1233};
Shuzhen Wang65c3b1d2011-09-20 12:53:08 -07001234
Nishant Pandit24153d82011-08-27 16:05:13 +05301235struct msm_camera_device_platform_data msm_camera_csi_device_data[] = {
1236 {
1237 .ioclk.mclk_clk_rate = 24000000,
1238 .ioclk.vfe_clk_rate = 228570000,
1239 .csid_core = 0,
Shuzhen Wang65c3b1d2011-09-20 12:53:08 -07001240 .cam_bus_scale_table = &cam_bus_client_pdata,
Nishant Pandit24153d82011-08-27 16:05:13 +05301241 },
1242 {
1243 .ioclk.mclk_clk_rate = 24000000,
1244 .ioclk.vfe_clk_rate = 228570000,
1245 .csid_core = 1,
Shuzhen Wang65c3b1d2011-09-20 12:53:08 -07001246 .cam_bus_scale_table = &cam_bus_client_pdata,
Nishant Pandit24153d82011-08-27 16:05:13 +05301247 },
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001248};
1249
Sreesudhan Ramakrish Ramkumarb54fd242011-09-12 17:11:19 -07001250#ifdef CONFIG_IMX074_ACT
1251static struct i2c_board_info imx074_actuator_i2c_info = {
1252 I2C_BOARD_INFO("imx074_act", 0x11),
1253};
1254
1255static struct msm_actuator_info imx074_actuator_info = {
1256 .board_info = &imx074_actuator_i2c_info,
1257 .bus_id = MSM_8960_GSBI4_QUP_I2C_BUS_ID,
1258 .vcm_pwd = 0,
1259 .vcm_enable = 1,
1260};
1261#endif
1262
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001263#ifdef CONFIG_IMX074
1264static struct msm_camera_sensor_flash_data flash_imx074 = {
1265 .flash_type = MSM_CAMERA_FLASH_LED,
Nishant Pandit474f2252011-07-23 23:17:56 +05301266#ifdef CONFIG_MSM_CAMERA_FLASH
1267 .flash_src = &msm_flash_src
1268#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001269};
1270
Nishant Pandit24153d82011-08-27 16:05:13 +05301271static struct msm_camera_sensor_platform_info sensor_board_info_imx074 = {
1272 .mount_angle = 90,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001273 .sensor_reset = 107,
1274 .sensor_pwd = 85,
1275 .vcm_pwd = 0,
1276 .vcm_enable = 1,
Nishant Pandit24153d82011-08-27 16:05:13 +05301277};
1278
1279static struct msm_camera_sensor_info msm_camera_sensor_imx074_data = {
1280 .sensor_name = "imx074",
1281 .pdata = &msm_camera_csi_device_data[0],
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001282 .flash_data = &flash_imx074,
1283 .strobe_flash_data = &strobe_flash_xenon,
Nishant Pandit24153d82011-08-27 16:05:13 +05301284 .sensor_platform_info = &sensor_board_info_imx074,
1285 .gpio_conf = &gpio_conf,
1286 .csi_if = 1,
1287 .camera_type = BACK_CAMERA_2D,
Sreesudhan Ramakrish Ramkumarb54fd242011-09-12 17:11:19 -07001288#ifdef CONFIG_IMX074_ACT
1289 .actuator_info = &imx074_actuator_info
1290#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001291};
1292
1293struct platform_device msm8960_camera_sensor_imx074 = {
1294 .name = "msm_camera_imx074",
1295 .dev = {
1296 .platform_data = &msm_camera_sensor_imx074_data,
1297 },
1298};
1299#endif
1300#ifdef CONFIG_OV2720
1301static struct msm_camera_sensor_flash_data flash_ov2720 = {
Kevin Chan1a990332011-07-26 20:31:23 -07001302 .flash_type = MSM_CAMERA_FLASH_NONE,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001303};
1304
Nishant Pandit24153d82011-08-27 16:05:13 +05301305static struct msm_camera_sensor_platform_info sensor_board_info_ov2720 = {
1306 .mount_angle = 0,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001307 .sensor_reset = 76,
1308 .sensor_pwd = 85,
1309 .vcm_pwd = 0,
1310 .vcm_enable = 1,
Nishant Pandit24153d82011-08-27 16:05:13 +05301311};
1312
1313static struct msm_camera_sensor_info msm_camera_sensor_ov2720_data = {
1314 .sensor_name = "ov2720",
1315 .pdata = &msm_camera_csi_device_data[1],
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001316 .flash_data = &flash_ov2720,
Nishant Pandit24153d82011-08-27 16:05:13 +05301317 .sensor_platform_info = &sensor_board_info_ov2720,
1318 .gpio_conf = &gpio_conf,
1319 .csi_if = 1,
1320 .camera_type = FRONT_CAMERA_2D,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001321};
1322
1323struct platform_device msm8960_camera_sensor_ov2720 = {
1324 .name = "msm_camera_ov2720",
1325 .dev = {
1326 .platform_data = &msm_camera_sensor_ov2720_data,
1327 },
1328};
1329#endif
Kevin Chandfecce22011-07-13 10:52:41 -07001330
1331static struct msm_camera_sensor_flash_data flash_qs_mt9p017 = {
1332 .flash_type = MSM_CAMERA_FLASH_LED,
1333};
1334
Nishant Pandit24153d82011-08-27 16:05:13 +05301335static struct msm_camera_sensor_platform_info sensor_board_info_qs_mt9p017 = {
1336 .mount_angle = 270,
Kevin Chandfecce22011-07-13 10:52:41 -07001337 .sensor_reset = 107,
1338 .sensor_pwd = 85,
1339 .vcm_pwd = 0,
1340 .vcm_enable = 1,
Nishant Pandit24153d82011-08-27 16:05:13 +05301341};
1342
1343static struct msm_camera_sensor_info msm_camera_sensor_qs_mt9p017_data = {
1344 .sensor_name = "qs_mt9p017",
1345 .pdata = &msm_camera_csi_device_data[0],
Kevin Chandfecce22011-07-13 10:52:41 -07001346 .flash_data = &flash_qs_mt9p017,
Nishant Pandit24153d82011-08-27 16:05:13 +05301347 .sensor_platform_info = &sensor_board_info_qs_mt9p017,
1348 .gpio_conf = &gpio_conf,
1349 .csi_if = 1,
1350 .camera_type = BACK_CAMERA_3D,
Kevin Chandfecce22011-07-13 10:52:41 -07001351};
1352
1353struct platform_device msm8960_camera_sensor_qs_mt9p017 = {
1354 .name = "msm_camera_qs_mt9p017",
1355 .dev = {
1356 .platform_data = &msm_camera_sensor_qs_mt9p017_data,
1357 },
1358};
1359
Kevin Chan8b0d2322011-09-10 21:06:31 -07001360static struct msm8960_privacy_light_cfg privacy_light_info = {
1361 .mpp = PM8921_MPP_PM_TO_SYS(12),
1362};
1363
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001364static void __init msm8960_init_cam(void)
1365{
1366 int i;
1367 struct platform_device *cam_dev[] = {
1368 &msm8960_camera_sensor_imx074,
1369 &msm8960_camera_sensor_ov2720,
Kevin Chandfecce22011-07-13 10:52:41 -07001370 &msm8960_camera_sensor_qs_mt9p017,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001371 };
1372
Kevin Chan8b0d2322011-09-10 21:06:31 -07001373 if (machine_is_msm8960_liquid()) {
1374 struct msm_camera_sensor_info *s_info;
1375 s_info = msm8960_camera_sensor_imx074.dev.platform_data;
1376 s_info->sensor_platform_info->mount_angle = 180;
1377 s_info = msm8960_camera_sensor_ov2720.dev.platform_data;
1378 s_info->sensor_platform_info->privacy_light = 1;
1379 s_info->sensor_platform_info->privacy_light_info =
1380 &privacy_light_info;
1381 }
1382
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001383 for (i = 0; i < ARRAY_SIZE(cam_dev); i++) {
1384 struct msm_camera_sensor_info *s_info;
1385 s_info = cam_dev[i]->dev.platform_data;
1386 msm_get_cam_resources(s_info);
1387 platform_device_register(cam_dev[i]);
1388 }
1389}
1390#endif
1391
1392#ifdef CONFIG_FB_MSM_TRIPLE_BUFFER
kuogee hsieh3830eb92011-09-12 15:25:57 -07001393#define MSM_FB_PRIM_BUF_SIZE (1376 * 768 * 4 * 3) /* 4 bpp x 3 pages */
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001394#else
kuogee hsieh3830eb92011-09-12 15:25:57 -07001395#define MSM_FB_PRIM_BUF_SIZE (1376 * 768 * 4 * 2) /* 4 bpp x 2 pages */
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001396#endif
1397
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001398
1399#ifdef CONFIG_FB_MSM_HDMI_MSM_PANEL
kuogee hsieh3830eb92011-09-12 15:25:57 -07001400#define MSM_FB_EXT_BUF_SIZE (1920 * 1088 * 2 * 1) /* 2 bpp x 1 page */
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001401#elif defined(CONFIG_FB_MSM_TVOUT)
kuogee hsieh3830eb92011-09-12 15:25:57 -07001402#define MSM_FB_EXT_BUF_SIZE (720 * 576 * 2 * 2) /* 2 bpp x 2 pages */
1403#else
1404#define MSM_FB_EXT_BUF_SIZE 0
1405#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001406
kuogee hsieh3830eb92011-09-12 15:25:57 -07001407#ifdef CONFIG_FB_MSM_OVERLAY_WRITEBACK
1408/* width x height x 3 bpp x 2 frame buffer */
1409#define MSM_FB_WRITEBACK_SIZE (1376 * 768 * 3 * 2)
1410#define MSM_FB_WRITEBACK_OFFSET \
1411 (MSM_FB_PRIM_BUF_SIZE + MSM_FB_EXT_BUF_SIZE)
1412#else
1413#define MSM_FB_WRITEBACK_SIZE 0
1414#define MSM_FB_WRITEBACK_OFFSET 0
1415#endif
1416
Ravishangar Kalyanamf4ef7282011-10-10 17:39:48 -07001417#ifdef CONFIG_FB_MSM_HDMI_AS_PRIMARY
1418/* 4 bpp x 2 page HDMI case */
1419#define MSM_FB_SIZE roundup((1920 * 1088 * 4 * 2), 4096)
1420#else
kuogee hsieh3830eb92011-09-12 15:25:57 -07001421/* Note: must be multiple of 4096 */
1422#define MSM_FB_SIZE roundup(MSM_FB_PRIM_BUF_SIZE + MSM_FB_EXT_BUF_SIZE + \
1423 MSM_FB_WRITEBACK_SIZE, 4096)
Ravishangar Kalyanamf4ef7282011-10-10 17:39:48 -07001424#endif
kuogee hsieh3830eb92011-09-12 15:25:57 -07001425
1426static int writeback_offset(void)
1427{
1428 return MSM_FB_WRITEBACK_OFFSET;
1429}
1430
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001431
1432#define MDP_VSYNC_GPIO 0
1433
Ravishangar Kalyanamf8e21952011-07-28 16:47:44 -07001434#define PANEL_NAME_MAX_LEN 30
1435#define MIPI_CMD_NOVATEK_QHD_PANEL_NAME "mipi_cmd_novatek_qhd"
1436#define MIPI_VIDEO_NOVATEK_QHD_PANEL_NAME "mipi_video_novatek_qhd"
1437#define MIPI_VIDEO_TOSHIBA_WSVGA_PANEL_NAME "mipi_video_toshiba_wsvga"
1438#define MIPI_VIDEO_CHIMEI_WXGA_PANEL_NAME "mipi_video_chimei_wxga"
1439#define MIPI_VIDEO_SIMULATOR_VGA_PANEL_NAME "mipi_video_simulator_vga"
1440#define MIPI_CMD_RENESAS_FWVGA_PANEL_NAME "mipi_cmd_renesas_fwvga"
1441#define HDMI_PANEL_NAME "hdmi_msm"
1442#define TVOUT_PANEL_NAME "tvout_msm"
Amir Samuelov0c7270f2011-09-07 03:13:47 +03001443
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001444static struct resource msm_fb_resources[] = {
1445 {
1446 .flags = IORESOURCE_DMA,
1447 }
1448};
1449
Amir Samuelov0c7270f2011-09-07 03:13:47 +03001450static int msm_fb_detect_panel(const char *name)
1451{
1452 if (machine_is_msm8960_liquid()) {
Ravishangar Kalyanamf8e21952011-07-28 16:47:44 -07001453 if (!strncmp(name, MIPI_VIDEO_CHIMEI_WXGA_PANEL_NAME,
1454 strnlen(MIPI_VIDEO_CHIMEI_WXGA_PANEL_NAME,
1455 PANEL_NAME_MAX_LEN)))
Amir Samuelov0c7270f2011-09-07 03:13:47 +03001456 return 0;
1457 } else {
Ravishangar Kalyanamf8e21952011-07-28 16:47:44 -07001458 if (!strncmp(name, MIPI_VIDEO_TOSHIBA_WSVGA_PANEL_NAME,
1459 strnlen(MIPI_VIDEO_TOSHIBA_WSVGA_PANEL_NAME,
1460 PANEL_NAME_MAX_LEN)))
Amir Samuelov0c7270f2011-09-07 03:13:47 +03001461 return 0;
Ravishangar Kalyanamf8e21952011-07-28 16:47:44 -07001462
1463#ifndef CONFIG_FB_MSM_MIPI_PANEL_DETECT
1464 if (!strncmp(name, MIPI_VIDEO_NOVATEK_QHD_PANEL_NAME,
1465 strnlen(MIPI_VIDEO_NOVATEK_QHD_PANEL_NAME,
1466 PANEL_NAME_MAX_LEN)))
1467 return 0;
1468
1469 if (!strncmp(name, MIPI_CMD_NOVATEK_QHD_PANEL_NAME,
1470 strnlen(MIPI_CMD_NOVATEK_QHD_PANEL_NAME,
1471 PANEL_NAME_MAX_LEN)))
1472 return 0;
1473
1474 if (!strncmp(name, MIPI_VIDEO_SIMULATOR_VGA_PANEL_NAME,
1475 strnlen(MIPI_VIDEO_SIMULATOR_VGA_PANEL_NAME,
1476 PANEL_NAME_MAX_LEN)))
1477 return 0;
1478
1479 if (!strncmp(name, MIPI_CMD_RENESAS_FWVGA_PANEL_NAME,
1480 strnlen(MIPI_CMD_RENESAS_FWVGA_PANEL_NAME,
1481 PANEL_NAME_MAX_LEN)))
1482 return 0;
1483#endif
Amir Samuelov0c7270f2011-09-07 03:13:47 +03001484 }
1485
Ravishangar Kalyanamf8e21952011-07-28 16:47:44 -07001486 if (!strncmp(name, HDMI_PANEL_NAME,
1487 strnlen(HDMI_PANEL_NAME,
1488 PANEL_NAME_MAX_LEN)))
1489 return 0;
Amir Samuelov0c7270f2011-09-07 03:13:47 +03001490
Ravishangar Kalyanamf8e21952011-07-28 16:47:44 -07001491 if (!strncmp(name, TVOUT_PANEL_NAME,
1492 strnlen(TVOUT_PANEL_NAME,
1493 PANEL_NAME_MAX_LEN)))
1494 return 0;
1495
1496 pr_warning("%s: not supported '%s'", __func__, name);
Amir Samuelov0c7270f2011-09-07 03:13:47 +03001497 return -ENODEV;
1498}
1499
1500static struct msm_fb_platform_data msm_fb_pdata = {
1501 .detect_client = msm_fb_detect_panel,
1502};
Amir Samuelov0c7270f2011-09-07 03:13:47 +03001503
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001504static struct platform_device msm_fb_device = {
1505 .name = "msm_fb",
1506 .id = 0,
1507 .num_resources = ARRAY_SIZE(msm_fb_resources),
1508 .resource = msm_fb_resources,
Amir Samuelov0c7270f2011-09-07 03:13:47 +03001509 .dev.platform_data = &msm_fb_pdata,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001510};
1511
1512static bool dsi_power_on;
1513
Amir Samuelov0c7270f2011-09-07 03:13:47 +03001514/**
1515 * LiQUID panel on/off
1516 *
1517 * @param on
1518 *
1519 * @return int
1520 */
1521static int mipi_dsi_liquid_panel_power(int on)
1522{
1523 static struct regulator *reg_l2, *reg_ext_3p3v;
1524 static int gpio21, gpio24, gpio43;
1525 int rc;
1526
1527 pr_info("%s: on=%d\n", __func__, on);
1528
1529 gpio21 = PM8921_GPIO_PM_TO_SYS(21); /* disp power enable_n */
1530 gpio43 = PM8921_GPIO_PM_TO_SYS(43); /* Displays Enable (rst_n)*/
1531 gpio24 = PM8921_GPIO_PM_TO_SYS(24); /* Backlight PWM */
1532
1533 if (!dsi_power_on) {
1534
1535 reg_l2 = regulator_get(&msm_mipi_dsi1_device.dev,
1536 "dsi_vdda");
1537 if (IS_ERR(reg_l2)) {
1538 pr_err("could not get 8921_l2, rc = %ld\n",
1539 PTR_ERR(reg_l2));
1540 return -ENODEV;
1541 }
1542
1543 rc = regulator_set_voltage(reg_l2, 1200000, 1200000);
1544 if (rc) {
1545 pr_err("set_voltage l2 failed, rc=%d\n", rc);
1546 return -EINVAL;
1547 }
1548
1549 reg_ext_3p3v = regulator_get(&msm_mipi_dsi1_device.dev,
1550 "vdd_lvds_3p3v");
1551 if (IS_ERR(reg_ext_3p3v)) {
1552 pr_err("could not get reg_ext_3p3v, rc = %ld\n",
1553 PTR_ERR(reg_ext_3p3v));
1554 return -ENODEV;
1555 }
1556
1557 rc = gpio_request(gpio21, "disp_pwr_en_n");
1558 if (rc) {
1559 pr_err("request gpio 21 failed, rc=%d\n", rc);
1560 return -ENODEV;
1561 }
1562
1563 rc = gpio_request(gpio43, "disp_rst_n");
1564 if (rc) {
1565 pr_err("request gpio 43 failed, rc=%d\n", rc);
1566 return -ENODEV;
1567 }
1568
1569 rc = gpio_request(gpio24, "disp_backlight_pwm");
1570 if (rc) {
1571 pr_err("request gpio 24 failed, rc=%d\n", rc);
1572 return -ENODEV;
1573 }
1574
1575 dsi_power_on = true;
1576 }
1577
1578 if (on) {
1579 rc = regulator_set_optimum_mode(reg_l2, 100000);
1580 if (rc < 0) {
1581 pr_err("set_optimum_mode l2 failed, rc=%d\n", rc);
1582 return -EINVAL;
1583 }
1584 rc = regulator_enable(reg_l2);
1585 if (rc) {
1586 pr_err("enable l2 failed, rc=%d\n", rc);
1587 return -ENODEV;
1588 }
1589
1590 rc = regulator_enable(reg_ext_3p3v);
1591 if (rc) {
1592 pr_err("enable reg_ext_3p3v failed, rc=%d\n", rc);
1593 return -ENODEV;
1594 }
1595
1596 /* set reset pin before power enable */
1597 gpio_set_value_cansleep(gpio43, 0); /* disp disable (resx=0) */
1598
1599 gpio_set_value_cansleep(gpio21, 0); /* disp power enable_n */
1600 msleep(20);
1601 gpio_set_value_cansleep(gpio43, 1); /* disp enable */
1602 msleep(20);
1603 gpio_set_value_cansleep(gpio43, 0); /* disp enable */
1604 msleep(20);
1605 gpio_set_value_cansleep(gpio43, 1); /* disp enable */
1606 msleep(20);
1607 } else {
1608 gpio_set_value_cansleep(gpio43, 0);
1609 gpio_set_value_cansleep(gpio21, 1);
1610
1611 rc = regulator_disable(reg_l2);
1612 if (rc) {
1613 pr_err("disable reg_l2 failed, rc=%d\n", rc);
1614 return -ENODEV;
1615 }
1616 rc = regulator_disable(reg_ext_3p3v);
1617 if (rc) {
1618 pr_err("disable reg_ext_3p3v failed, rc=%d\n", rc);
1619 return -ENODEV;
1620 }
1621 rc = regulator_set_optimum_mode(reg_l2, 100);
1622 if (rc < 0) {
1623 pr_err("set_optimum_mode l2 failed, rc=%d\n", rc);
1624 return -EINVAL;
1625 }
1626 }
1627
1628 return 0;
1629}
1630
1631static int mipi_dsi_cdp_panel_power(int on)
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001632{
1633 static struct regulator *reg_l8, *reg_l23, *reg_l2;
Nagamalleswararao Ganjieac5dfa2011-07-23 17:31:16 -07001634 static int gpio43;
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001635 int rc;
1636
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001637 pr_info("%s: state : %d\n", __func__, on);
1638
1639 if (!dsi_power_on) {
1640
1641 reg_l8 = regulator_get(&msm_mipi_dsi1_device.dev,
1642 "dsi_vdc");
1643 if (IS_ERR(reg_l8)) {
1644 pr_err("could not get 8921_l8, rc = %ld\n",
1645 PTR_ERR(reg_l8));
1646 return -ENODEV;
1647 }
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001648 reg_l23 = regulator_get(&msm_mipi_dsi1_device.dev,
1649 "dsi_vddio");
1650 if (IS_ERR(reg_l23)) {
1651 pr_err("could not get 8921_l23, rc = %ld\n",
1652 PTR_ERR(reg_l23));
1653 return -ENODEV;
1654 }
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001655 reg_l2 = regulator_get(&msm_mipi_dsi1_device.dev,
1656 "dsi_vdda");
1657 if (IS_ERR(reg_l2)) {
1658 pr_err("could not get 8921_l2, rc = %ld\n",
1659 PTR_ERR(reg_l2));
1660 return -ENODEV;
1661 }
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001662 rc = regulator_set_voltage(reg_l8, 2800000, 3000000);
1663 if (rc) {
1664 pr_err("set_voltage l8 failed, rc=%d\n", rc);
1665 return -EINVAL;
1666 }
1667 rc = regulator_set_voltage(reg_l23, 1800000, 1800000);
1668 if (rc) {
1669 pr_err("set_voltage l23 failed, rc=%d\n", rc);
1670 return -EINVAL;
1671 }
1672 rc = regulator_set_voltage(reg_l2, 1200000, 1200000);
1673 if (rc) {
1674 pr_err("set_voltage l2 failed, rc=%d\n", rc);
1675 return -EINVAL;
1676 }
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001677 gpio43 = PM8921_GPIO_PM_TO_SYS(43);
1678 rc = gpio_request(gpio43, "disp_rst_n");
1679 if (rc) {
1680 pr_err("request gpio 43 failed, rc=%d\n", rc);
1681 return -ENODEV;
1682 }
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001683 dsi_power_on = true;
1684 }
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001685 if (on) {
1686 rc = regulator_set_optimum_mode(reg_l8, 100000);
1687 if (rc < 0) {
1688 pr_err("set_optimum_mode l8 failed, rc=%d\n", rc);
1689 return -EINVAL;
1690 }
1691 rc = regulator_set_optimum_mode(reg_l23, 100000);
1692 if (rc < 0) {
1693 pr_err("set_optimum_mode l23 failed, rc=%d\n", rc);
1694 return -EINVAL;
1695 }
1696 rc = regulator_set_optimum_mode(reg_l2, 100000);
1697 if (rc < 0) {
1698 pr_err("set_optimum_mode l2 failed, rc=%d\n", rc);
1699 return -EINVAL;
1700 }
1701 rc = regulator_enable(reg_l8);
1702 if (rc) {
1703 pr_err("enable l8 failed, rc=%d\n", rc);
1704 return -ENODEV;
1705 }
1706 rc = regulator_enable(reg_l23);
1707 if (rc) {
1708 pr_err("enable l8 failed, rc=%d\n", rc);
1709 return -ENODEV;
1710 }
1711 rc = regulator_enable(reg_l2);
1712 if (rc) {
1713 pr_err("enable l2 failed, rc=%d\n", rc);
1714 return -ENODEV;
1715 }
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001716 gpio_set_value_cansleep(gpio43, 1);
1717 } else {
Nagamalleswararao Ganjica0adc02011-09-22 20:35:53 -07001718 rc = regulator_disable(reg_l2);
1719 if (rc) {
1720 pr_err("disable reg_l2 failed, rc=%d\n", rc);
1721 return -ENODEV;
1722 }
1723 rc = regulator_disable(reg_l8);
1724 if (rc) {
1725 pr_err("disable reg_l8 failed, rc=%d\n", rc);
1726 return -ENODEV;
1727 }
1728 rc = regulator_disable(reg_l23);
1729 if (rc) {
1730 pr_err("disable reg_l23 failed, rc=%d\n", rc);
1731 return -ENODEV;
1732 }
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001733 rc = regulator_set_optimum_mode(reg_l8, 100);
1734 if (rc < 0) {
1735 pr_err("set_optimum_mode l8 failed, rc=%d\n", rc);
1736 return -EINVAL;
1737 }
1738 rc = regulator_set_optimum_mode(reg_l23, 100);
1739 if (rc < 0) {
1740 pr_err("set_optimum_mode l23 failed, rc=%d\n", rc);
1741 return -EINVAL;
1742 }
1743 rc = regulator_set_optimum_mode(reg_l2, 100);
1744 if (rc < 0) {
1745 pr_err("set_optimum_mode l2 failed, rc=%d\n", rc);
1746 return -EINVAL;
1747 }
1748 gpio_set_value_cansleep(gpio43, 0);
1749 }
1750 return 0;
1751}
1752
Amir Samuelov0c7270f2011-09-07 03:13:47 +03001753static int mipi_dsi_panel_power(int on)
1754{
1755 int ret;
1756
1757 pr_info("%s: on=%d\n", __func__, on);
1758
1759 if (machine_is_msm8960_liquid())
1760 ret = mipi_dsi_liquid_panel_power(on);
1761 else
1762 ret = mipi_dsi_cdp_panel_power(on);
1763
1764 return ret;
1765}
1766
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001767static struct mipi_dsi_platform_data mipi_dsi_pdata = {
1768 .vsync_gpio = MDP_VSYNC_GPIO,
1769 .dsi_power_save = mipi_dsi_panel_power,
1770};
1771
1772#ifdef CONFIG_MSM_BUS_SCALING
1773
1774static struct msm_bus_vectors mdp_init_vectors[] = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001775 {
1776 .src = MSM_BUS_MASTER_MDP_PORT0,
1777 .dst = MSM_BUS_SLAVE_EBI_CH0,
1778 .ab = 0,
1779 .ib = 0,
1780 },
Ravishangar Kalyanam882930f2011-07-08 17:51:52 -07001781};
1782
Ravishangar Kalyanamf4ef7282011-10-10 17:39:48 -07001783#ifdef CONFIG_FB_MSM_HDMI_AS_PRIMARY
1784static struct msm_bus_vectors hdmi_as_primary_vectors[] = {
1785 /* If HDMI is used as primary */
1786 {
1787 .src = MSM_BUS_MASTER_MDP_PORT0,
1788 .dst = MSM_BUS_SLAVE_EBI_CH0,
1789 .ab = 2000000000,
1790 .ib = 2000000000,
1791 },
1792};
1793static struct msm_bus_paths mdp_bus_scale_usecases[] = {
1794 {
1795 ARRAY_SIZE(mdp_init_vectors),
1796 mdp_init_vectors,
1797 },
1798 {
1799 ARRAY_SIZE(hdmi_as_primary_vectors),
1800 hdmi_as_primary_vectors,
1801 },
1802 {
1803 ARRAY_SIZE(hdmi_as_primary_vectors),
1804 hdmi_as_primary_vectors,
1805 },
1806 {
1807 ARRAY_SIZE(hdmi_as_primary_vectors),
1808 hdmi_as_primary_vectors,
1809 },
1810 {
1811 ARRAY_SIZE(hdmi_as_primary_vectors),
1812 hdmi_as_primary_vectors,
1813 },
1814 {
1815 ARRAY_SIZE(hdmi_as_primary_vectors),
1816 hdmi_as_primary_vectors,
1817 },
1818};
1819#else
Ravishangar Kalyanam882930f2011-07-08 17:51:52 -07001820static struct msm_bus_vectors mdp_ui_vectors[] = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001821 {
1822 .src = MSM_BUS_MASTER_MDP_PORT0,
1823 .dst = MSM_BUS_SLAVE_EBI_CH0,
Ravishangar Kalyanam882930f2011-07-08 17:51:52 -07001824 .ab = 216000000 * 2,
1825 .ib = 270000000 * 2,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001826 },
1827};
1828
1829static struct msm_bus_vectors mdp_vga_vectors[] = {
1830 /* VGA and less video */
1831 {
1832 .src = MSM_BUS_MASTER_MDP_PORT0,
1833 .dst = MSM_BUS_SLAVE_EBI_CH0,
Ravishangar Kalyanam882930f2011-07-08 17:51:52 -07001834 .ab = 216000000 * 2,
1835 .ib = 270000000 * 2,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001836 },
1837};
1838
1839static struct msm_bus_vectors mdp_720p_vectors[] = {
1840 /* 720p and less video */
1841 {
1842 .src = MSM_BUS_MASTER_MDP_PORT0,
1843 .dst = MSM_BUS_SLAVE_EBI_CH0,
Ravishangar Kalyanam882930f2011-07-08 17:51:52 -07001844 .ab = 230400000 * 2,
1845 .ib = 288000000 * 2,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001846 },
1847};
1848
1849static struct msm_bus_vectors mdp_1080p_vectors[] = {
1850 /* 1080p and less video */
1851 {
1852 .src = MSM_BUS_MASTER_MDP_PORT0,
1853 .dst = MSM_BUS_SLAVE_EBI_CH0,
Ravishangar Kalyanam882930f2011-07-08 17:51:52 -07001854 .ab = 334080000 * 2,
1855 .ib = 417600000 * 2,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001856 },
1857};
1858
1859static struct msm_bus_paths mdp_bus_scale_usecases[] = {
1860 {
1861 ARRAY_SIZE(mdp_init_vectors),
1862 mdp_init_vectors,
1863 },
1864 {
Ravishangar Kalyanam882930f2011-07-08 17:51:52 -07001865 ARRAY_SIZE(mdp_ui_vectors),
1866 mdp_ui_vectors,
1867 },
1868 {
1869 ARRAY_SIZE(mdp_ui_vectors),
1870 mdp_ui_vectors,
1871 },
1872 {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001873 ARRAY_SIZE(mdp_vga_vectors),
1874 mdp_vga_vectors,
1875 },
1876 {
1877 ARRAY_SIZE(mdp_720p_vectors),
1878 mdp_720p_vectors,
1879 },
1880 {
1881 ARRAY_SIZE(mdp_1080p_vectors),
1882 mdp_1080p_vectors,
1883 },
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001884};
Ravishangar Kalyanamf4ef7282011-10-10 17:39:48 -07001885#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001886
1887static struct msm_bus_scale_pdata mdp_bus_scale_pdata = {
1888 mdp_bus_scale_usecases,
1889 ARRAY_SIZE(mdp_bus_scale_usecases),
1890 .name = "mdp",
1891};
1892
1893#endif
1894
Ravishangar Kalyanamf4ef7282011-10-10 17:39:48 -07001895#ifdef CONFIG_FB_MSM_HDMI_AS_PRIMARY
1896int mdp_core_clk_rate_table[] = {
1897 200000000,
1898 200000000,
1899 200000000,
1900 200000000,
1901};
1902#else
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001903int mdp_core_clk_rate_table[] = {
1904 85330000,
1905 85330000,
Nagamalleswararao Ganjiad31c982011-08-15 23:24:17 -07001906 160000000,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001907 200000000,
1908};
Ravishangar Kalyanamf4ef7282011-10-10 17:39:48 -07001909#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001910
1911static struct msm_panel_common_pdata mdp_pdata = {
1912 .gpio = MDP_VSYNC_GPIO,
Ravishangar Kalyanamf4ef7282011-10-10 17:39:48 -07001913#ifdef CONFIG_FB_MSM_HDMI_AS_PRIMARY
1914 .mdp_core_clk_rate = 200000000,
1915#else
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001916 .mdp_core_clk_rate = 85330000,
Ravishangar Kalyanamf4ef7282011-10-10 17:39:48 -07001917#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001918 .mdp_core_clk_table = mdp_core_clk_rate_table,
1919 .num_mdp_clk = ARRAY_SIZE(mdp_core_clk_rate_table),
1920#ifdef CONFIG_MSM_BUS_SCALING
1921 .mdp_bus_scale_table = &mdp_bus_scale_pdata,
1922#endif
1923 .mdp_rev = MDP_REV_42,
kuogee hsieh3830eb92011-09-12 15:25:57 -07001924 .writeback_offset = writeback_offset,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001925};
1926
1927static struct platform_device mipi_dsi_renesas_panel_device = {
1928 .name = "mipi_renesas",
1929 .id = 0,
1930};
1931
1932static struct platform_device mipi_dsi_simulator_panel_device = {
1933 .name = "mipi_simulator",
1934 .id = 0,
1935};
1936
Nagamalleswararao Ganjieac5dfa2011-07-23 17:31:16 -07001937#define LPM_CHANNEL0 0
1938static int toshiba_gpio[] = {LPM_CHANNEL0};
1939
1940static struct mipi_dsi_panel_platform_data toshiba_pdata = {
1941 .gpio = toshiba_gpio,
1942};
1943
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001944static struct platform_device mipi_dsi_toshiba_panel_device = {
1945 .name = "mipi_toshiba",
1946 .id = 0,
Nagamalleswararao Ganjieac5dfa2011-07-23 17:31:16 -07001947 .dev = {
1948 .platform_data = &toshiba_pdata,
1949 }
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001950};
1951
Amir Samuelov0c7270f2011-09-07 03:13:47 +03001952static int dsi2lvds_gpio[2] = {
1953 0,/* Backlight PWM-ID=0 for PMIC-GPIO#24 */
1954 0x1F08 /* DSI2LVDS Bridge GPIO Output, mask=0x1f, out=0x08 */
1955 };
1956
1957static struct msm_panel_common_pdata mipi_dsi2lvds_pdata = {
1958 .gpio_num = dsi2lvds_gpio,
1959};
1960
Chandan Uddaraju83eac3c2011-09-11 18:32:23 -07001961static struct mipi_dsi_phy_ctrl dsi_novatek_cmd_mode_phy_db = {
1962
1963/* DSI_BIT_CLK at 500MHz, 2 lane, RGB888 */
1964 {0x0F, 0x0a, 0x04, 0x00, 0x20}, /* regulator */
1965 /* timing */
1966 {0xab, 0x8a, 0x18, 0x00, 0x92, 0x97, 0x1b, 0x8c,
1967 0x0c, 0x03, 0x04, 0xa0},
1968 {0x5f, 0x00, 0x00, 0x10}, /* phy ctrl */
1969 {0xff, 0x00, 0x06, 0x00}, /* strength */
1970 /* pll control */
1971 {0x40, 0xf9, 0x30, 0xda, 0x00, 0x40, 0x03, 0x62,
1972 0x40, 0x07, 0x03,
1973 0x00, 0x1a, 0x00, 0x00, 0x02, 0x00, 0x20, 0x00, 0x01},
1974};
1975
1976static struct mipi_dsi_panel_platform_data novatek_pdata = {
1977 .phy_ctrl_settings = &dsi_novatek_cmd_mode_phy_db,
1978};
1979
1980static struct platform_device mipi_dsi_novatek_panel_device = {
1981 .name = "mipi_novatek",
1982 .id = 0,
1983 .dev = {
1984 .platform_data = &novatek_pdata,
1985 }
1986};
1987
Amir Samuelov0c7270f2011-09-07 03:13:47 +03001988static struct platform_device mipi_dsi2lvds_bridge_device = {
1989 .name = "mipi_tc358764",
1990 .id = 0,
1991 .dev.platform_data = &mipi_dsi2lvds_pdata,
1992};
1993
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001994#ifdef CONFIG_FB_MSM_HDMI_MSM_PANEL
1995static struct resource hdmi_msm_resources[] = {
1996 {
1997 .name = "hdmi_msm_qfprom_addr",
1998 .start = 0x00700000,
1999 .end = 0x007060FF,
2000 .flags = IORESOURCE_MEM,
2001 },
2002 {
2003 .name = "hdmi_msm_hdmi_addr",
2004 .start = 0x04A00000,
2005 .end = 0x04A00FFF,
2006 .flags = IORESOURCE_MEM,
2007 },
2008 {
2009 .name = "hdmi_msm_irq",
2010 .start = HDMI_IRQ,
2011 .end = HDMI_IRQ,
2012 .flags = IORESOURCE_IRQ,
2013 },
2014};
2015
2016static int hdmi_enable_5v(int on);
2017static int hdmi_core_power(int on, int show);
2018static int hdmi_cec_power(int on);
2019
2020static struct msm_hdmi_platform_data hdmi_msm_data = {
2021 .irq = HDMI_IRQ,
2022 .enable_5v = hdmi_enable_5v,
2023 .core_power = hdmi_core_power,
2024 .cec_power = hdmi_cec_power,
2025};
2026
2027static struct platform_device hdmi_msm_device = {
2028 .name = "hdmi_msm",
2029 .id = 0,
2030 .num_resources = ARRAY_SIZE(hdmi_msm_resources),
2031 .resource = hdmi_msm_resources,
2032 .dev.platform_data = &hdmi_msm_data,
2033};
2034#endif /* CONFIG_FB_MSM_HDMI_MSM_PANEL */
2035
Ravishangar Kalyanam882930f2011-07-08 17:51:52 -07002036#ifdef CONFIG_MSM_BUS_SCALING
2037static struct msm_bus_vectors dtv_bus_init_vectors[] = {
2038 {
2039 .src = MSM_BUS_MASTER_MDP_PORT0,
2040 .dst = MSM_BUS_SLAVE_EBI_CH0,
2041 .ab = 0,
2042 .ib = 0,
2043 },
2044};
Ravishangar Kalyanamf4ef7282011-10-10 17:39:48 -07002045
2046#ifdef CONFIG_FB_MSM_HDMI_AS_PRIMARY
2047static struct msm_bus_vectors dtv_bus_def_vectors[] = {
2048 {
2049 .src = MSM_BUS_MASTER_MDP_PORT0,
2050 .dst = MSM_BUS_SLAVE_EBI_CH0,
2051 .ab = 2000000000,
2052 .ib = 2000000000,
2053 },
2054};
2055#else
Ravishangar Kalyanam882930f2011-07-08 17:51:52 -07002056static struct msm_bus_vectors dtv_bus_def_vectors[] = {
2057 {
2058 .src = MSM_BUS_MASTER_MDP_PORT0,
2059 .dst = MSM_BUS_SLAVE_EBI_CH0,
2060 .ab = 566092800 * 2,
2061 .ib = 707616000 * 2,
2062 },
2063};
Ravishangar Kalyanamf4ef7282011-10-10 17:39:48 -07002064#endif
2065
Ravishangar Kalyanam882930f2011-07-08 17:51:52 -07002066static struct msm_bus_paths dtv_bus_scale_usecases[] = {
2067 {
2068 ARRAY_SIZE(dtv_bus_init_vectors),
2069 dtv_bus_init_vectors,
2070 },
2071 {
2072 ARRAY_SIZE(dtv_bus_def_vectors),
2073 dtv_bus_def_vectors,
2074 },
2075};
2076static struct msm_bus_scale_pdata dtv_bus_scale_pdata = {
2077 dtv_bus_scale_usecases,
2078 ARRAY_SIZE(dtv_bus_scale_usecases),
2079 .name = "dtv",
2080};
2081
2082static struct lcdc_platform_data dtv_pdata = {
2083 .bus_scale_table = &dtv_bus_scale_pdata,
2084};
2085#endif
2086
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002087static void __init msm_fb_add_devices(void)
2088{
Amir Samuelov0c7270f2011-09-07 03:13:47 +03002089 struct platform_device *ptr = NULL;
2090
2091 if (machine_is_msm8960_liquid())
2092 ptr = &mipi_dsi2lvds_bridge_device;
2093 else
2094 ptr = &mipi_dsi_toshiba_panel_device;
2095 platform_add_devices(&ptr, 1);
2096
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002097 if (machine_is_msm8x60_rumi3()) {
2098 msm_fb_register_device("mdp", NULL);
2099 mipi_dsi_pdata.target_type = 1;
2100 } else
2101 msm_fb_register_device("mdp", &mdp_pdata);
2102 msm_fb_register_device("mipi_dsi", &mipi_dsi_pdata);
Ravishangar Kalyanam882930f2011-07-08 17:51:52 -07002103#ifdef CONFIG_MSM_BUS_SCALING
2104 msm_fb_register_device("dtv", &dtv_pdata);
2105#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002106}
2107
Ravishangar Kalyanamba99e512011-07-20 12:57:19 -07002108static struct gpiomux_setting mdp_vsync_suspend_cfg = {
2109 .func = GPIOMUX_FUNC_GPIO,
2110 .drv = GPIOMUX_DRV_2MA,
2111 .pull = GPIOMUX_PULL_DOWN,
2112};
2113
2114static struct gpiomux_setting mdp_vsync_active_cfg = {
2115 .func = GPIOMUX_FUNC_1,
2116 .drv = GPIOMUX_DRV_2MA,
2117 .pull = GPIOMUX_PULL_DOWN,
2118};
2119
2120static struct msm_gpiomux_config msm8960_mdp_vsync_configs[] __initdata = {
2121 {
2122 .gpio = MDP_VSYNC_GPIO,
2123 .settings = {
2124 [GPIOMUX_ACTIVE] = &mdp_vsync_active_cfg,
2125 [GPIOMUX_SUSPENDED] = &mdp_vsync_suspend_cfg,
2126 },
2127 }
2128};
2129
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002130#ifdef CONFIG_FB_MSM_HDMI_MSM_PANEL
2131static struct gpiomux_setting hdmi_suspend_cfg = {
2132 .func = GPIOMUX_FUNC_GPIO,
2133 .drv = GPIOMUX_DRV_2MA,
2134 .pull = GPIOMUX_PULL_DOWN,
2135};
2136
2137static struct gpiomux_setting hdmi_active_1_cfg = {
2138 .func = GPIOMUX_FUNC_1,
2139 .drv = GPIOMUX_DRV_2MA,
2140 .pull = GPIOMUX_PULL_UP,
2141};
2142
2143static struct gpiomux_setting hdmi_active_2_cfg = {
2144 .func = GPIOMUX_FUNC_1,
2145 .drv = GPIOMUX_DRV_2MA,
2146 .pull = GPIOMUX_PULL_DOWN,
2147};
2148
2149static struct msm_gpiomux_config msm8960_hdmi_configs[] __initdata = {
2150 {
2151 .gpio = 99,
2152 .settings = {
2153 [GPIOMUX_ACTIVE] = &hdmi_active_1_cfg,
2154 [GPIOMUX_SUSPENDED] = &hdmi_suspend_cfg,
2155 },
2156 },
2157 {
2158 .gpio = 100,
2159 .settings = {
2160 [GPIOMUX_ACTIVE] = &hdmi_active_1_cfg,
2161 [GPIOMUX_SUSPENDED] = &hdmi_suspend_cfg,
2162 },
2163 },
2164 {
2165 .gpio = 101,
2166 .settings = {
2167 [GPIOMUX_ACTIVE] = &hdmi_active_1_cfg,
2168 [GPIOMUX_SUSPENDED] = &hdmi_suspend_cfg,
2169 },
2170 },
2171 {
2172 .gpio = 102,
2173 .settings = {
2174 [GPIOMUX_ACTIVE] = &hdmi_active_2_cfg,
2175 [GPIOMUX_SUSPENDED] = &hdmi_suspend_cfg,
2176 },
2177 },
2178};
2179
2180static int hdmi_enable_5v(int on)
2181{
2182 /* TBD: PM8921 regulator instead of 8901 */
2183 static struct regulator *reg_8921_hdmi_mvs; /* HDMI_5V */
2184 static int prev_on;
2185 int rc;
2186
2187 if (on == prev_on)
2188 return 0;
2189
2190 if (!reg_8921_hdmi_mvs)
2191 reg_8921_hdmi_mvs = regulator_get(&hdmi_msm_device.dev,
2192 "hdmi_mvs");
2193
2194 if (on) {
2195 rc = regulator_enable(reg_8921_hdmi_mvs);
2196 if (rc) {
2197 pr_err("'%s' regulator enable failed, rc=%d\n",
2198 "8921_hdmi_mvs", rc);
2199 return rc;
2200 }
2201 pr_debug("%s(on): success\n", __func__);
2202 } else {
2203 rc = regulator_disable(reg_8921_hdmi_mvs);
2204 if (rc)
2205 pr_warning("'%s' regulator disable failed, rc=%d\n",
2206 "8921_hdmi_mvs", rc);
2207 pr_debug("%s(off): success\n", __func__);
2208 }
2209
2210 prev_on = on;
2211
2212 return 0;
2213}
2214
2215static int hdmi_core_power(int on, int show)
2216{
2217 static struct regulator *reg_8921_l23, *reg_8921_s4;
2218 static int prev_on;
2219 int rc;
2220
2221 if (on == prev_on)
2222 return 0;
2223
2224 /* TBD: PM8921 regulator instead of 8901 */
Nagamalleswararao Ganjica0adc02011-09-22 20:35:53 -07002225 if (!reg_8921_l23) {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002226 reg_8921_l23 = regulator_get(&hdmi_msm_device.dev, "hdmi_avdd");
Nagamalleswararao Ganjica0adc02011-09-22 20:35:53 -07002227 if (IS_ERR(reg_8921_l23)) {
2228 pr_err("could not get reg_8921_l23, rc = %ld\n",
2229 PTR_ERR(reg_8921_l23));
2230 return -ENODEV;
2231 }
2232 rc = regulator_set_voltage(reg_8921_l23, 1800000, 1800000);
2233 if (rc) {
2234 pr_err("set_voltage failed for 8921_l23, rc=%d\n", rc);
2235 return -EINVAL;
2236 }
2237 }
2238 if (!reg_8921_s4) {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002239 reg_8921_s4 = regulator_get(&hdmi_msm_device.dev, "hdmi_vcc");
Nagamalleswararao Ganjica0adc02011-09-22 20:35:53 -07002240 if (IS_ERR(reg_8921_s4)) {
2241 pr_err("could not get reg_8921_s4, rc = %ld\n",
2242 PTR_ERR(reg_8921_s4));
2243 return -ENODEV;
2244 }
2245 rc = regulator_set_voltage(reg_8921_s4, 1800000, 1800000);
2246 if (rc) {
2247 pr_err("set_voltage failed for 8921_s4, rc=%d\n", rc);
2248 return -EINVAL;
2249 }
2250 }
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002251
2252 if (on) {
2253 rc = regulator_set_optimum_mode(reg_8921_l23, 100000);
2254 if (rc < 0) {
2255 pr_err("set_optimum_mode l23 failed, rc=%d\n", rc);
2256 return -EINVAL;
2257 }
Nagamalleswararao Ganjica0adc02011-09-22 20:35:53 -07002258 rc = regulator_enable(reg_8921_l23);
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002259 if (rc) {
2260 pr_err("'%s' regulator enable failed, rc=%d\n",
2261 "hdmi_avdd", rc);
2262 return rc;
2263 }
Nagamalleswararao Ganjica0adc02011-09-22 20:35:53 -07002264 rc = regulator_enable(reg_8921_s4);
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002265 if (rc) {
2266 pr_err("'%s' regulator enable failed, rc=%d\n",
2267 "hdmi_vcc", rc);
2268 return rc;
2269 }
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002270 rc = gpio_request(100, "HDMI_DDC_CLK");
2271 if (rc) {
2272 pr_err("'%s'(%d) gpio_request failed, rc=%d\n",
2273 "HDMI_DDC_CLK", 100, rc);
2274 goto error1;
2275 }
2276 rc = gpio_request(101, "HDMI_DDC_DATA");
2277 if (rc) {
2278 pr_err("'%s'(%d) gpio_request failed, rc=%d\n",
2279 "HDMI_DDC_DATA", 101, rc);
2280 goto error2;
2281 }
2282 rc = gpio_request(102, "HDMI_HPD");
2283 if (rc) {
2284 pr_err("'%s'(%d) gpio_request failed, rc=%d\n",
2285 "HDMI_HPD", 102, rc);
2286 goto error3;
2287 }
2288 pr_debug("%s(on): success\n", __func__);
2289 } else {
2290 gpio_free(100);
2291 gpio_free(101);
2292 gpio_free(102);
2293
Nagamalleswararao Ganjica0adc02011-09-22 20:35:53 -07002294 rc = regulator_disable(reg_8921_l23);
2295 if (rc) {
2296 pr_err("disable reg_8921_l23 failed, rc=%d\n", rc);
2297 return -ENODEV;
2298 }
2299 rc = regulator_disable(reg_8921_s4);
2300 if (rc) {
2301 pr_err("disable reg_8921_s4 failed, rc=%d\n", rc);
2302 return -ENODEV;
2303 }
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002304 rc = regulator_set_optimum_mode(reg_8921_l23, 100);
2305 if (rc < 0) {
2306 pr_err("set_optimum_mode l23 failed, rc=%d\n", rc);
2307 return -EINVAL;
2308 }
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002309 pr_debug("%s(off): success\n", __func__);
2310 }
2311
2312 prev_on = on;
2313
2314 return 0;
2315
2316error3:
2317 gpio_free(101);
2318error2:
2319 gpio_free(100);
2320error1:
2321 regulator_disable(reg_8921_l23);
Nagamalleswararao Ganjica0adc02011-09-22 20:35:53 -07002322 regulator_disable(reg_8921_s4);
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002323 return rc;
2324}
2325
2326static int hdmi_cec_power(int on)
2327{
2328 static int prev_on;
2329 int rc;
2330
2331 if (on == prev_on)
2332 return 0;
2333
2334 if (on) {
2335 rc = gpio_request(99, "HDMI_CEC_VAR");
2336 if (rc) {
2337 pr_err("'%s'(%d) gpio_request failed, rc=%d\n",
2338 "HDMI_CEC_VAR", 99, rc);
2339 goto error;
2340 }
2341 pr_debug("%s(on): success\n", __func__);
2342 } else {
2343 gpio_free(99);
2344 pr_debug("%s(off): success\n", __func__);
2345 }
2346
2347 prev_on = on;
2348
2349 return 0;
2350error:
2351 return rc;
2352}
2353#endif /* CONFIG_FB_MSM_HDMI_MSM_PANEL */
2354
2355static void __init msm8960_allocate_memory_regions(void)
2356{
2357 void *addr;
2358 unsigned long size;
2359
2360 size = MSM_FB_SIZE;
2361 addr = alloc_bootmem_align(size, 0x1000);
2362 msm_fb_resources[0].start = __pa(addr);
2363 msm_fb_resources[0].end = msm_fb_resources[0].start + size - 1;
2364 pr_info("allocating %lu bytes at %p (%lx physical) for fb\n",
2365 size, addr, __pa(addr));
2366
2367}
2368#ifdef CONFIG_WCD9310_CODEC
2369
2370#define TABLA_INTERRUPT_BASE (NR_MSM_IRQS + NR_GPIO_IRQS + NR_PM8921_IRQS)
2371
Patrick Lai3043fba2011-08-01 14:15:57 -07002372/* Micbias setting is based on 8660 CDP/MTP/FLUID requirement
2373 * 4 micbiases are used to power various analog and digital
2374 * microphones operating at 1800 mV. Technically, all micbiases
2375 * can source from single cfilter since all microphones operate
2376 * at the same voltage level. The arrangement below is to make
2377 * sure all cfilters are exercised. LDO_H regulator ouput level
2378 * does not need to be as high as 2.85V. It is choosen for
2379 * microphone sensitivity purpose.
2380 */
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002381static struct tabla_pdata tabla_platform_data = {
2382 .slimbus_slave_device = {
2383 .name = "tabla-slave",
2384 .e_addr = {0, 0, 0x10, 0, 0x17, 2},
2385 },
2386 .irq = MSM_GPIO_TO_INT(62),
2387 .irq_base = TABLA_INTERRUPT_BASE,
2388 .num_irqs = NR_TABLA_IRQS,
2389 .reset_gpio = PM8921_GPIO_PM_TO_SYS(34),
Patrick Lai3043fba2011-08-01 14:15:57 -07002390 .micbias = {
2391 .ldoh_v = TABLA_LDOH_2P85_V,
2392 .cfilt1_mv = 1800,
2393 .cfilt2_mv = 1800,
2394 .cfilt3_mv = 1800,
2395 .bias1_cfilt_sel = TABLA_CFILT1_SEL,
2396 .bias2_cfilt_sel = TABLA_CFILT2_SEL,
2397 .bias3_cfilt_sel = TABLA_CFILT3_SEL,
2398 .bias4_cfilt_sel = TABLA_CFILT3_SEL,
2399 }
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002400};
2401
2402static struct slim_device msm_slim_tabla = {
2403 .name = "tabla-slim",
2404 .e_addr = {0, 1, 0x10, 0, 0x17, 2},
2405 .dev = {
2406 .platform_data = &tabla_platform_data,
2407 },
2408};
Santosh Mardi60e19d92011-10-28 01:15:14 +05302409
2410static struct tabla_pdata tabla20_platform_data = {
2411 .slimbus_slave_device = {
2412 .name = "tabla-slave",
2413 .e_addr = {0, 0, 0x60, 0, 0x17, 2},
2414 },
2415 .irq = MSM_GPIO_TO_INT(62),
2416 .irq_base = TABLA_INTERRUPT_BASE,
2417 .num_irqs = NR_TABLA_IRQS,
2418 .reset_gpio = PM8921_GPIO_PM_TO_SYS(34),
2419 .micbias = {
2420 .ldoh_v = TABLA_LDOH_2P85_V,
2421 .cfilt1_mv = 1800,
2422 .cfilt2_mv = 1800,
2423 .cfilt3_mv = 1800,
2424 .bias1_cfilt_sel = TABLA_CFILT1_SEL,
2425 .bias2_cfilt_sel = TABLA_CFILT2_SEL,
2426 .bias3_cfilt_sel = TABLA_CFILT3_SEL,
2427 .bias4_cfilt_sel = TABLA_CFILT3_SEL,
2428 }
2429};
2430
2431static struct slim_device msm_slim_tabla20 = {
2432 .name = "tabla2x-slim",
2433 .e_addr = {0, 1, 0x60, 0, 0x17, 2},
2434 .dev = {
2435 .platform_data = &tabla20_platform_data,
2436 },
2437};
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002438#endif
2439
2440static struct slim_boardinfo msm_slim_devices[] = {
2441#ifdef CONFIG_WCD9310_CODEC
2442 {
2443 .bus_num = 1,
2444 .slim_slave = &msm_slim_tabla,
2445 },
Santosh Mardi60e19d92011-10-28 01:15:14 +05302446 {
2447 .bus_num = 1,
2448 .slim_slave = &msm_slim_tabla20,
2449 },
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002450#endif
2451 /* add more slimbus slaves as needed */
2452};
2453
Yunsen Wang5c1a7392011-07-09 19:10:16 -07002454#define MSM_WCNSS_PHYS 0x03000000
2455#define MSM_WCNSS_SIZE 0x280000
2456
2457static struct resource resources_wcnss_wlan[] = {
2458 {
2459 .start = RIVA_APPS_WLAN_RX_DATA_AVAIL_IRQ,
2460 .end = RIVA_APPS_WLAN_RX_DATA_AVAIL_IRQ,
2461 .name = "wcnss_wlanrx_irq",
2462 .flags = IORESOURCE_IRQ,
2463 },
2464 {
2465 .start = RIVA_APPS_WLAN_DATA_XFER_DONE_IRQ,
2466 .end = RIVA_APPS_WLAN_DATA_XFER_DONE_IRQ,
2467 .name = "wcnss_wlantx_irq",
2468 .flags = IORESOURCE_IRQ,
2469 },
2470 {
2471 .start = MSM_WCNSS_PHYS,
2472 .end = MSM_WCNSS_PHYS + MSM_WCNSS_SIZE - 1,
2473 .name = "wcnss_mmio",
2474 .flags = IORESOURCE_MEM,
2475 },
Ankur Nandwaniad0d9ac2011-09-26 11:49:25 -07002476 {
2477 .start = 84,
2478 .end = 88,
2479 .name = "wcnss_gpios_5wire",
2480 .flags = IORESOURCE_IO,
2481 },
Yunsen Wang5c1a7392011-07-09 19:10:16 -07002482};
2483
Ankur Nandwanib0039b02011-08-09 14:00:45 -07002484static struct qcom_wcnss_opts qcom_wcnss_pdata = {
2485 .has_48mhz_xo = 1,
2486};
2487
Yunsen Wang5c1a7392011-07-09 19:10:16 -07002488static struct platform_device msm_device_wcnss_wlan = {
2489 .name = "wcnss_wlan",
2490 .id = 0,
2491 .num_resources = ARRAY_SIZE(resources_wcnss_wlan),
2492 .resource = resources_wcnss_wlan,
Ankur Nandwanib0039b02011-08-09 14:00:45 -07002493 .dev = {.platform_data = &qcom_wcnss_pdata},
Yunsen Wang5c1a7392011-07-09 19:10:16 -07002494};
2495
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002496#if defined(CONFIG_CRYPTO_DEV_QCRYPTO) || \
2497 defined(CONFIG_CRYPTO_DEV_QCRYPTO_MODULE) || \
2498 defined(CONFIG_CRYPTO_DEV_QCEDEV) || \
2499 defined(CONFIG_CRYPTO_DEV_QCEDEV_MODULE)
2500
2501#define QCE_SIZE 0x10000
2502#define QCE_0_BASE 0x18500000
2503
2504#define QCE_HW_KEY_SUPPORT 0
2505#define QCE_SHA_HMAC_SUPPORT 1
2506#define QCE_SHARE_CE_RESOURCE 1
2507#define QCE_CE_SHARED 0
2508
2509static struct resource qcrypto_resources[] = {
2510 [0] = {
2511 .start = QCE_0_BASE,
2512 .end = QCE_0_BASE + QCE_SIZE - 1,
2513 .flags = IORESOURCE_MEM,
2514 },
2515 [1] = {
2516 .name = "crypto_channels",
2517 .start = DMOV_CE_IN_CHAN,
2518 .end = DMOV_CE_OUT_CHAN,
2519 .flags = IORESOURCE_DMA,
2520 },
2521 [2] = {
2522 .name = "crypto_crci_in",
2523 .start = DMOV_CE_IN_CRCI,
2524 .end = DMOV_CE_IN_CRCI,
2525 .flags = IORESOURCE_DMA,
2526 },
2527 [3] = {
2528 .name = "crypto_crci_out",
2529 .start = DMOV_CE_OUT_CRCI,
2530 .end = DMOV_CE_OUT_CRCI,
2531 .flags = IORESOURCE_DMA,
2532 },
2533};
2534
2535static struct resource qcedev_resources[] = {
2536 [0] = {
2537 .start = QCE_0_BASE,
2538 .end = QCE_0_BASE + QCE_SIZE - 1,
2539 .flags = IORESOURCE_MEM,
2540 },
2541 [1] = {
2542 .name = "crypto_channels",
2543 .start = DMOV_CE_IN_CHAN,
2544 .end = DMOV_CE_OUT_CHAN,
2545 .flags = IORESOURCE_DMA,
2546 },
2547 [2] = {
2548 .name = "crypto_crci_in",
2549 .start = DMOV_CE_IN_CRCI,
2550 .end = DMOV_CE_IN_CRCI,
2551 .flags = IORESOURCE_DMA,
2552 },
2553 [3] = {
2554 .name = "crypto_crci_out",
2555 .start = DMOV_CE_OUT_CRCI,
2556 .end = DMOV_CE_OUT_CRCI,
2557 .flags = IORESOURCE_DMA,
2558 },
2559};
2560
2561#endif
2562
2563#if defined(CONFIG_CRYPTO_DEV_QCRYPTO) || \
2564 defined(CONFIG_CRYPTO_DEV_QCRYPTO_MODULE)
2565
2566static struct msm_ce_hw_support qcrypto_ce_hw_suppport = {
2567 .ce_shared = QCE_CE_SHARED,
2568 .shared_ce_resource = QCE_SHARE_CE_RESOURCE,
2569 .hw_key_support = QCE_HW_KEY_SUPPORT,
2570 .sha_hmac = QCE_SHA_HMAC_SUPPORT,
2571};
2572
2573static struct platform_device qcrypto_device = {
2574 .name = "qcrypto",
2575 .id = 0,
2576 .num_resources = ARRAY_SIZE(qcrypto_resources),
2577 .resource = qcrypto_resources,
2578 .dev = {
2579 .coherent_dma_mask = DMA_BIT_MASK(32),
2580 .platform_data = &qcrypto_ce_hw_suppport,
2581 },
2582};
2583#endif
2584
2585#if defined(CONFIG_CRYPTO_DEV_QCEDEV) || \
2586 defined(CONFIG_CRYPTO_DEV_QCEDEV_MODULE)
2587
2588static struct msm_ce_hw_support qcedev_ce_hw_suppport = {
2589 .ce_shared = QCE_CE_SHARED,
2590 .shared_ce_resource = QCE_SHARE_CE_RESOURCE,
2591 .hw_key_support = QCE_HW_KEY_SUPPORT,
2592 .sha_hmac = QCE_SHA_HMAC_SUPPORT,
2593};
2594
2595static struct platform_device qcedev_device = {
2596 .name = "qce",
2597 .id = 0,
2598 .num_resources = ARRAY_SIZE(qcedev_resources),
2599 .resource = qcedev_resources,
2600 .dev = {
2601 .coherent_dma_mask = DMA_BIT_MASK(32),
2602 .platform_data = &qcedev_ce_hw_suppport,
2603 },
2604};
2605#endif
2606
2607
2608static int __init gpiomux_init(void)
2609{
2610 int rc;
2611
2612 rc = msm_gpiomux_init(NR_GPIO_IRQS);
2613 if (rc) {
2614 pr_err(KERN_ERR "msm_gpiomux_init failed %d\n", rc);
2615 return rc;
2616 }
2617
Nishant Pandit24153d82011-08-27 16:05:13 +05302618 msm_gpiomux_install(msm8960_cam_common_configs,
2619 ARRAY_SIZE(msm8960_cam_common_configs));
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002620
2621 msm_gpiomux_install(msm8960_gpiomux_configs,
Stepan Moskovchenkod2a45a82011-08-09 17:02:57 -07002622 ARRAY_SIZE(msm8960_gpiomux_configs));
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002623
2624 msm_gpiomux_install(msm8960_gsbi_configs,
2625 ARRAY_SIZE(msm8960_gsbi_configs));
2626
2627 msm_gpiomux_install(msm8960_cyts_configs,
2628 ARRAY_SIZE(msm8960_cyts_configs));
2629
2630 msm_gpiomux_install(msm8960_slimbus_config,
2631 ARRAY_SIZE(msm8960_slimbus_config));
2632
2633 msm_gpiomux_install(msm8960_audio_codec_configs,
2634 ARRAY_SIZE(msm8960_audio_codec_configs));
2635
Bhalchandra Gajare0e795c42011-08-15 18:10:30 -07002636 msm_gpiomux_install(msm8960_audio_auxpcm_configs,
2637 ARRAY_SIZE(msm8960_audio_auxpcm_configs));
2638
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002639#ifdef CONFIG_FB_MSM_HDMI_MSM_PANEL
2640 msm_gpiomux_install(msm8960_hdmi_configs,
2641 ARRAY_SIZE(msm8960_hdmi_configs));
2642#endif
2643
Ravishangar Kalyanamba99e512011-07-20 12:57:19 -07002644 msm_gpiomux_install(msm8960_mdp_vsync_configs,
2645 ARRAY_SIZE(msm8960_mdp_vsync_configs));
2646
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002647 msm_gpiomux_install(wcnss_5wire_interface,
2648 ARRAY_SIZE(wcnss_5wire_interface));
2649
Vijayavardhan Vennapusae3316a12011-10-15 06:05:17 +05302650#ifdef CONFIG_USB_EHCI_MSM_HSIC
2651 msm_gpiomux_install(msm8960_hsic_configs,
2652 ARRAY_SIZE(msm8960_hsic_configs));
2653#endif
2654
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002655 return 0;
2656}
2657
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002658#define MSM_SHARED_RAM_PHYS 0x80000000
2659
2660static struct pm8921_adc_amux pm8921_adc_channels_data[] = {
2661 {"vcoin", CHANNEL_VCOIN, CHAN_PATH_SCALING2, AMUX_RSV1,
2662 ADC_DECIMATION_TYPE2, ADC_SCALE_DEFAULT},
2663 {"vbat", CHANNEL_VBAT, CHAN_PATH_SCALING2, AMUX_RSV1,
2664 ADC_DECIMATION_TYPE2, ADC_SCALE_DEFAULT},
2665 {"dcin", CHANNEL_DCIN, CHAN_PATH_SCALING4, AMUX_RSV1,
2666 ADC_DECIMATION_TYPE2, ADC_SCALE_DEFAULT},
2667 {"ichg", CHANNEL_ICHG, CHAN_PATH_SCALING1, AMUX_RSV1,
2668 ADC_DECIMATION_TYPE2, ADC_SCALE_DEFAULT},
2669 {"vph_pwr", CHANNEL_VPH_PWR, CHAN_PATH_SCALING2, AMUX_RSV1,
2670 ADC_DECIMATION_TYPE2, ADC_SCALE_DEFAULT},
2671 {"ibat", CHANNEL_IBAT, CHAN_PATH_SCALING1, AMUX_RSV1,
2672 ADC_DECIMATION_TYPE2, ADC_SCALE_DEFAULT},
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002673 {"batt_therm", CHANNEL_BATT_THERM, CHAN_PATH_SCALING1, AMUX_RSV2,
2674 ADC_DECIMATION_TYPE2, ADC_SCALE_BATT_THERM},
2675 {"batt_id", CHANNEL_BATT_ID, CHAN_PATH_SCALING1, AMUX_RSV1,
2676 ADC_DECIMATION_TYPE2, ADC_SCALE_DEFAULT},
2677 {"usbin", CHANNEL_USBIN, CHAN_PATH_SCALING3, AMUX_RSV1,
2678 ADC_DECIMATION_TYPE2, ADC_SCALE_DEFAULT},
2679 {"pmic_therm", CHANNEL_DIE_TEMP, CHAN_PATH_SCALING1, AMUX_RSV1,
2680 ADC_DECIMATION_TYPE2, ADC_SCALE_PMIC_THERM},
2681 {"625mv", CHANNEL_625MV, CHAN_PATH_SCALING1, AMUX_RSV1,
2682 ADC_DECIMATION_TYPE2, ADC_SCALE_DEFAULT},
2683 {"125v", CHANNEL_125V, CHAN_PATH_SCALING1, AMUX_RSV1,
2684 ADC_DECIMATION_TYPE2, ADC_SCALE_DEFAULT},
2685 {"chg_temp", CHANNEL_CHG_TEMP, CHAN_PATH_SCALING1, AMUX_RSV1,
2686 ADC_DECIMATION_TYPE2, ADC_SCALE_DEFAULT},
Siddartha Mohanadoss77d106e2011-09-20 16:25:59 -07002687 {"pa_therm1", ADC_MPP_1_AMUX8, CHAN_PATH_SCALING1, AMUX_RSV1,
Siddartha Mohanadossb9e4d282011-09-13 17:50:11 -07002688 ADC_DECIMATION_TYPE2, ADC_SCALE_PA_THERM},
2689 {"xo_therm", CHANNEL_MUXOFF, CHAN_PATH_SCALING1, AMUX_RSV0,
2690 ADC_DECIMATION_TYPE2, ADC_SCALE_XOTHERM},
Siddartha Mohanadoss77d106e2011-09-20 16:25:59 -07002691 {"pa_therm0", ADC_MPP_1_AMUX3, CHAN_PATH_SCALING1, AMUX_RSV1,
2692 ADC_DECIMATION_TYPE2, ADC_SCALE_PA_THERM},
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002693};
2694
2695static struct pm8921_adc_properties pm8921_adc_data = {
2696 .adc_vdd_reference = 1800, /* milli-voltage for this adc */
2697 .bitresolution = 15,
2698 .bipolar = 0,
2699};
2700
2701static struct pm8921_adc_platform_data pm8921_adc_pdata = {
2702 .adc_channel = pm8921_adc_channels_data,
Siddartha Mohanadoss77d106e2011-09-20 16:25:59 -07002703 .adc_num_board_channel = ARRAY_SIZE(pm8921_adc_channels_data),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002704 .adc_prop = &pm8921_adc_data,
Siddartha Mohanadoss77d106e2011-09-20 16:25:59 -07002705 .adc_mpp_base = PM8921_MPP_PM_TO_SYS(1),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002706};
Stepan Moskovchenkod056fca2011-01-27 12:12:07 -08002707
Stepan Moskovchenkof441ca22010-12-01 19:31:16 -08002708static void __init msm8960_map_io(void)
2709{
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002710 msm_shared_ram_phys = MSM_SHARED_RAM_PHYS;
Stepan Moskovchenkof441ca22010-12-01 19:31:16 -08002711 msm_map_msm8960_io();
Jeff Ohlstein3a77f9f2011-09-06 14:50:20 -07002712
2713 if (socinfo_init() < 0)
2714 pr_err("socinfo_init() failed!\n");
Stepan Moskovchenkof441ca22010-12-01 19:31:16 -08002715}
2716
Stepan Moskovchenkof4fdfe52011-10-18 17:28:58 -07002717#ifdef CONFIG_ARCH_MSM8930
2718static void __init msm8930_map_io(void)
2719{
2720 msm_shared_ram_phys = MSM_SHARED_RAM_PHYS;
2721 msm_map_msm8930_io();
2722
2723 if (socinfo_init() < 0)
2724 pr_err("socinfo_init() failed!\n");
2725}
2726#endif
2727
Stepan Moskovchenkof441ca22010-12-01 19:31:16 -08002728static void __init msm8960_init_irq(void)
2729{
2730 unsigned int i;
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002731
2732 msm_mpm_irq_extn_init();
Stepan Moskovchenkof441ca22010-12-01 19:31:16 -08002733 gic_init(0, GIC_PPI_START, MSM_QGIC_DIST_BASE,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002734 (void *)MSM_QGIC_CPU_BASE);
Stepan Moskovchenkof441ca22010-12-01 19:31:16 -08002735
2736 /* Edge trigger PPIs except AVS_SVICINT and AVS_SVICINTSWDONE */
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002737 writel_relaxed(0xFFFFD7FF, MSM_QGIC_DIST_BASE + GIC_DIST_CONFIG + 4);
Stepan Moskovchenkof441ca22010-12-01 19:31:16 -08002738
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002739 writel_relaxed(0x0000FFFF, MSM_QGIC_DIST_BASE + GIC_DIST_ENABLE_SET);
2740 mb();
Stepan Moskovchenko50ede4e2010-12-13 18:12:19 -08002741
Stepan Moskovchenkof441ca22010-12-01 19:31:16 -08002742 /* FIXME: Not installing AVS_SVICINT and AVS_SVICINTSWDONE yet
2743 * as they are configured as level, which does not play nice with
2744 * handle_percpu_irq.
2745 */
2746 for (i = GIC_PPI_START; i < GIC_SPI_START; i++) {
2747 if (i != AVS_SVICINT && i != AVS_SVICINTSWDONE)
Thomas Gleixner6845664a2011-03-24 13:25:22 +01002748 irq_set_handler(i, handle_percpu_irq);
Stepan Moskovchenkof441ca22010-12-01 19:31:16 -08002749 }
2750}
2751
Stepan Moskovchenko73b943b2011-10-31 22:43:00 -07002752/* MSM8960 has 5 SDCC controllers */
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002753enum sdcc_controllers {
2754 SDCC1,
2755 SDCC2,
2756 SDCC3,
2757 SDCC4,
2758 SDCC5,
2759 MAX_SDCC_CONTROLLER
2760};
2761
Stepan Moskovchenko73b943b2011-10-31 22:43:00 -07002762/* All SDCC controllers require VDD/VCC voltage */
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002763static struct msm_mmc_reg_data mmc_vdd_reg_data[MAX_SDCC_CONTROLLER] = {
2764 /* SDCC1 : eMMC card connected */
2765 [SDCC1] = {
2766 .name = "sdc_vdd",
2767 .set_voltage_sup = 1,
Subhash Jadavani99ba53a2011-08-01 16:04:18 +05302768 .high_vol_level = 2950000,
2769 .low_vol_level = 2950000,
Subhash Jadavanidd7ef892011-08-18 16:49:57 +05302770 .always_on = 1,
2771 .lpm_sup = 1,
2772 .lpm_uA = 9000,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002773 .hpm_uA = 200000, /* 200mA */
2774 },
2775 /* SDCC3 : External card slot connected */
2776 [SDCC3] = {
2777 .name = "sdc_vdd",
2778 .set_voltage_sup = 1,
Subhash Jadavani99ba53a2011-08-01 16:04:18 +05302779 .high_vol_level = 2950000,
2780 .low_vol_level = 2950000,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002781 .hpm_uA = 600000, /* 600mA */
2782 }
2783};
2784
2785/* Only slots having eMMC card will require VCCQ voltage */
2786static struct msm_mmc_reg_data mmc_vccq_reg_data[1] = {
2787 /* SDCC1 : eMMC card connected */
2788 [SDCC1] = {
2789 .name = "sdc_vccq",
2790 .set_voltage_sup = 1,
2791 .always_on = 1,
Subhash Jadavani99ba53a2011-08-01 16:04:18 +05302792 .high_vol_level = 1800000,
2793 .low_vol_level = 1800000,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002794 .hpm_uA = 200000, /* 200mA */
2795 }
2796};
2797
2798/* All SDCC controllers may require voting for VDD PAD voltage */
2799static struct msm_mmc_reg_data mmc_vddp_reg_data[MAX_SDCC_CONTROLLER] = {
2800 /* SDCC3 : External card slot connected */
2801 [SDCC3] = {
2802 .name = "sdc_vddp",
2803 .set_voltage_sup = 1,
Subhash Jadavani99ba53a2011-08-01 16:04:18 +05302804 .high_vol_level = 2950000,
2805 .low_vol_level = 1850000,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002806 .always_on = 1,
2807 .lpm_sup = 1,
2808 /* Max. Active current required is 16 mA */
2809 .hpm_uA = 16000,
2810 /*
2811 * Sleep current required is ~300 uA. But min. vote can be
2812 * in terms of mA (min. 1 mA). So let's vote for 2 mA
2813 * during sleep.
2814 */
2815 .lpm_uA = 2000,
2816 }
2817};
2818
2819static struct msm_mmc_slot_reg_data mmc_slot_vreg_data[MAX_SDCC_CONTROLLER] = {
2820 /* SDCC1 : eMMC card connected */
2821 [SDCC1] = {
2822 .vdd_data = &mmc_vdd_reg_data[SDCC1],
2823 .vccq_data = &mmc_vccq_reg_data[SDCC1],
2824 },
2825 /* SDCC3 : External card slot connected */
2826 [SDCC3] = {
2827 .vdd_data = &mmc_vdd_reg_data[SDCC3],
2828 .vddp_data = &mmc_vddp_reg_data[SDCC3],
2829 }
2830};
2831
2832/* SDC1 pad data */
2833static struct msm_mmc_pad_drv sdc1_pad_drv_on_cfg[] = {
2834 {TLMM_HDRV_SDC1_CLK, GPIO_CFG_16MA},
Subhash Jadavani87bda5a2011-08-30 17:40:44 +05302835 {TLMM_HDRV_SDC1_CMD, GPIO_CFG_10MA},
2836 {TLMM_HDRV_SDC1_DATA, GPIO_CFG_10MA}
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002837};
2838
2839static struct msm_mmc_pad_drv sdc1_pad_drv_off_cfg[] = {
2840 {TLMM_HDRV_SDC1_CLK, GPIO_CFG_2MA},
2841 {TLMM_HDRV_SDC1_CMD, GPIO_CFG_2MA},
2842 {TLMM_HDRV_SDC1_DATA, GPIO_CFG_2MA}
2843};
2844
2845static struct msm_mmc_pad_pull sdc1_pad_pull_on_cfg[] = {
Subhash Jadavanib7b5b8a2011-09-13 13:00:40 +05302846 {TLMM_PULL_SDC1_CLK, GPIO_CFG_NO_PULL},
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002847 {TLMM_PULL_SDC1_CMD, GPIO_CFG_PULL_UP},
2848 {TLMM_PULL_SDC1_DATA, GPIO_CFG_PULL_UP}
2849};
2850
2851static struct msm_mmc_pad_pull sdc1_pad_pull_off_cfg[] = {
Subhash Jadavanib7b5b8a2011-09-13 13:00:40 +05302852 {TLMM_PULL_SDC1_CLK, GPIO_CFG_NO_PULL},
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002853 {TLMM_PULL_SDC1_CMD, GPIO_CFG_PULL_DOWN},
2854 {TLMM_PULL_SDC1_DATA, GPIO_CFG_PULL_DOWN}
2855};
2856
2857/* SDC3 pad data */
2858static struct msm_mmc_pad_drv sdc3_pad_drv_on_cfg[] = {
2859 {TLMM_HDRV_SDC3_CLK, GPIO_CFG_8MA},
2860 {TLMM_HDRV_SDC3_CMD, GPIO_CFG_8MA},
2861 {TLMM_HDRV_SDC3_DATA, GPIO_CFG_8MA}
2862};
2863
2864static struct msm_mmc_pad_drv sdc3_pad_drv_off_cfg[] = {
2865 {TLMM_HDRV_SDC3_CLK, GPIO_CFG_2MA},
2866 {TLMM_HDRV_SDC3_CMD, GPIO_CFG_2MA},
2867 {TLMM_HDRV_SDC3_DATA, GPIO_CFG_2MA}
2868};
2869
2870static struct msm_mmc_pad_pull sdc3_pad_pull_on_cfg[] = {
Subhash Jadavanib7b5b8a2011-09-13 13:00:40 +05302871 {TLMM_PULL_SDC3_CLK, GPIO_CFG_NO_PULL},
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002872 {TLMM_PULL_SDC3_CMD, GPIO_CFG_PULL_UP},
2873 {TLMM_PULL_SDC3_DATA, GPIO_CFG_PULL_UP}
2874};
2875
2876static struct msm_mmc_pad_pull sdc3_pad_pull_off_cfg[] = {
Subhash Jadavanib7b5b8a2011-09-13 13:00:40 +05302877 {TLMM_PULL_SDC3_CLK, GPIO_CFG_NO_PULL},
Subhash Jadavani46d4f342011-10-12 14:44:45 +05302878 /*
2879 * SDC3 CMD line should be PULLed UP otherwise fluid platform will
2880 * see transitions (1 -> 0 and 0 -> 1) on card detection line,
2881 * which would result in false card detection interrupts.
2882 */
2883 {TLMM_PULL_SDC3_CMD, GPIO_CFG_PULL_UP},
2884 /*
2885 * Keeping DATA lines status to PULL UP will make sure that
2886 * there is no current leak during sleep if external pull up
2887 * is connected to DATA lines.
2888 */
2889 {TLMM_PULL_SDC3_DATA, GPIO_CFG_PULL_UP}
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002890};
2891
2892struct msm_mmc_pad_pull_data mmc_pad_pull_data[MAX_SDCC_CONTROLLER] = {
2893 [SDCC1] = {
2894 .on = sdc1_pad_pull_on_cfg,
2895 .off = sdc1_pad_pull_off_cfg,
2896 .size = ARRAY_SIZE(sdc1_pad_pull_on_cfg)
2897 },
2898 [SDCC3] = {
2899 .on = sdc3_pad_pull_on_cfg,
2900 .off = sdc3_pad_pull_off_cfg,
2901 .size = ARRAY_SIZE(sdc3_pad_pull_on_cfg)
2902 },
2903};
2904
2905struct msm_mmc_pad_drv_data mmc_pad_drv_data[MAX_SDCC_CONTROLLER] = {
2906 [SDCC1] = {
2907 .on = sdc1_pad_drv_on_cfg,
2908 .off = sdc1_pad_drv_off_cfg,
2909 .size = ARRAY_SIZE(sdc1_pad_drv_on_cfg)
2910 },
2911 [SDCC3] = {
2912 .on = sdc3_pad_drv_on_cfg,
2913 .off = sdc3_pad_drv_off_cfg,
2914 .size = ARRAY_SIZE(sdc3_pad_drv_on_cfg)
2915 },
2916};
2917
2918struct msm_mmc_pad_data mmc_pad_data[MAX_SDCC_CONTROLLER] = {
2919 [SDCC1] = {
2920 .pull = &mmc_pad_pull_data[SDCC1],
2921 .drv = &mmc_pad_drv_data[SDCC1]
2922 },
2923 [SDCC3] = {
2924 .pull = &mmc_pad_pull_data[SDCC3],
2925 .drv = &mmc_pad_drv_data[SDCC3]
2926 },
2927};
2928
2929struct msm_mmc_pin_data mmc_slot_pin_data[MAX_SDCC_CONTROLLER] = {
2930 [SDCC1] = {
2931 .pad_data = &mmc_pad_data[SDCC1],
2932 },
2933 [SDCC3] = {
2934 .pad_data = &mmc_pad_data[SDCC3],
2935 },
2936};
2937
2938static unsigned int sdc1_sup_clk_rates[] = {
Subhash Jadavani0e027b72011-08-30 17:40:55 +05302939 400000, 24000000, 48000000
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002940};
2941
2942static unsigned int sdc3_sup_clk_rates[] = {
2943 400000, 24000000, 48000000, 96000000
2944};
2945
2946#ifdef CONFIG_MMC_MSM_SDC1_SUPPORT
2947static struct mmc_platform_data msm8960_sdc1_data = {
2948 .ocr_mask = MMC_VDD_27_28 | MMC_VDD_28_29,
2949#ifdef CONFIG_MMC_MSM_SDC1_8_BIT_SUPPORT
2950 .mmc_bus_width = MMC_CAP_8_BIT_DATA,
2951#else
2952 .mmc_bus_width = MMC_CAP_4_BIT_DATA,
2953#endif
2954 .sup_clk_table = sdc1_sup_clk_rates,
2955 .sup_clk_cnt = ARRAY_SIZE(sdc1_sup_clk_rates),
Subhash Jadavanib7655b62011-09-27 19:12:36 +05302956 .pclk_src_dfab = 1,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002957 .nonremovable = 1,
2958 .sdcc_v4_sup = true,
2959 .vreg_data = &mmc_slot_vreg_data[SDCC1],
Subhash Jadavani0e027b72011-08-30 17:40:55 +05302960 .pin_data = &mmc_slot_pin_data[SDCC1]
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002961};
2962#endif
2963
2964#ifdef CONFIG_MMC_MSM_SDC3_SUPPORT
2965static struct mmc_platform_data msm8960_sdc3_data = {
2966 .ocr_mask = MMC_VDD_27_28 | MMC_VDD_28_29,
2967 .mmc_bus_width = MMC_CAP_4_BIT_DATA,
2968 .sup_clk_table = sdc3_sup_clk_rates,
2969 .sup_clk_cnt = ARRAY_SIZE(sdc3_sup_clk_rates),
Subhash Jadavanib7655b62011-09-27 19:12:36 +05302970 .pclk_src_dfab = 1,
Subhash Jadavanib9ef7472011-09-21 18:37:28 +05302971#ifdef CONFIG_MMC_MSM_SDC3_WP_SUPPORT
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002972 .wpswitch_gpio = PM8921_GPIO_PM_TO_SYS(16),
Subhash Jadavanib9ef7472011-09-21 18:37:28 +05302973#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002974 .sdcc_v4_sup = true,
2975 .vreg_data = &mmc_slot_vreg_data[SDCC3],
2976 .pin_data = &mmc_slot_pin_data[SDCC3],
2977#ifdef CONFIG_MMC_MSM_CARD_HW_DETECTION
2978 .status_gpio = PM8921_GPIO_PM_TO_SYS(26),
2979 .status_irq = PM8921_GPIO_IRQ(PM8921_IRQ_BASE, 26),
2980 .irq_flags = IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING,
2981#endif
2982 .xpc_cap = 1,
2983 .uhs_caps = (MMC_CAP_UHS_SDR12 | MMC_CAP_UHS_SDR25 |
2984 MMC_CAP_UHS_SDR50 | MMC_CAP_UHS_DDR50 |
Subhash Jadavani0e027b72011-08-30 17:40:55 +05302985 MMC_CAP_MAX_CURRENT_600)
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002986};
2987#endif
2988
2989static void __init msm8960_init_mmc(void)
2990{
2991#ifdef CONFIG_MMC_MSM_SDC1_SUPPORT
2992 /* SDC1 : eMMC card connected */
2993 msm_add_sdcc(1, &msm8960_sdc1_data);
2994#endif
2995#ifdef CONFIG_MMC_MSM_SDC3_SUPPORT
2996 /* SDC3: External card slot */
2997 msm_add_sdcc(3, &msm8960_sdc3_data);
2998#endif
2999}
3000
3001static void __init msm8960_init_buses(void)
3002{
3003#ifdef CONFIG_MSM_BUS_SCALING
Gagan Macdc1dc142011-09-16 15:13:35 -06003004 msm_bus_rpm_set_mt_mask();
Gagan Macae154c4b2011-10-05 19:24:43 -06003005 msm_bus_8960_apps_fabric_pdata.rpm_enabled = 1;
3006 msm_bus_8960_sys_fabric_pdata.rpm_enabled = 1;
3007 msm_bus_8960_mm_fabric_pdata.rpm_enabled = 1;
3008 msm_bus_apps_fabric.dev.platform_data =
3009 &msm_bus_8960_apps_fabric_pdata;
3010 msm_bus_sys_fabric.dev.platform_data = &msm_bus_8960_sys_fabric_pdata;
3011 msm_bus_mm_fabric.dev.platform_data = &msm_bus_8960_mm_fabric_pdata;
3012 msm_bus_sys_fpb.dev.platform_data = &msm_bus_8960_sys_fpb_pdata;
3013 msm_bus_cpss_fpb.dev.platform_data = &msm_bus_8960_cpss_fpb_pdata;
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003014#endif
3015}
3016
3017static struct msm_spi_platform_data msm8960_qup_spi_gsbi1_pdata = {
3018 .max_clock_speed = 15060000,
3019};
3020
3021#ifdef CONFIG_USB_MSM_OTG_72K
3022static struct msm_otg_platform_data msm_otg_pdata;
3023#else
3024#define USB_5V_EN 42
3025static void msm_hsusb_vbus_power(bool on)
3026{
3027 int rc;
3028 static bool vbus_is_on;
3029 static struct regulator *mvs_otg_switch;
3030 struct pm_gpio param = {
3031 .direction = PM_GPIO_DIR_OUT,
3032 .output_buffer = PM_GPIO_OUT_BUF_CMOS,
3033 .output_value = 1,
3034 .pull = PM_GPIO_PULL_NO,
3035 .vin_sel = PM_GPIO_VIN_S4,
3036 .out_strength = PM_GPIO_STRENGTH_MED,
3037 .function = PM_GPIO_FUNC_NORMAL,
3038 };
3039
3040 if (vbus_is_on == on)
3041 return;
3042
3043 if (on) {
Stepan Moskovchenko14aa6492011-08-08 15:15:01 -07003044 mvs_otg_switch = regulator_get(&msm8960_device_otg.dev,
3045 "vbus_otg");
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003046 if (IS_ERR(mvs_otg_switch)) {
3047 pr_err("Unable to get mvs_otg_switch\n");
3048 return;
3049 }
3050
3051 rc = gpio_request(PM8921_GPIO_PM_TO_SYS(USB_5V_EN),
3052 "usb_5v_en");
3053 if (rc < 0) {
3054 pr_err("failed to request usb_5v_en gpio\n");
3055 goto put_mvs_otg;
3056 }
3057
3058 if (regulator_enable(mvs_otg_switch)) {
3059 pr_err("unable to enable mvs_otg_switch\n");
3060 goto free_usb_5v_en;
3061 }
3062
3063 rc = pm8xxx_gpio_config(PM8921_GPIO_PM_TO_SYS(USB_5V_EN),
3064 &param);
3065 if (rc < 0) {
3066 pr_err("failed to configure usb_5v_en gpio\n");
3067 goto disable_mvs_otg;
3068 }
3069 vbus_is_on = true;
3070 return;
3071 }
3072disable_mvs_otg:
3073 regulator_disable(mvs_otg_switch);
3074free_usb_5v_en:
3075 gpio_free(PM8921_GPIO_PM_TO_SYS(USB_5V_EN));
3076put_mvs_otg:
3077 regulator_put(mvs_otg_switch);
3078 vbus_is_on = false;
3079}
3080
3081static struct msm_otg_platform_data msm_otg_pdata = {
3082 .mode = USB_OTG,
3083 .otg_control = OTG_PMIC_CONTROL,
3084 .phy_type = SNPS_28NM_INTEGRATED_PHY,
3085 .pclk_src_name = "dfab_usb_hs_clk",
3086 .pmic_id_irq = PM8921_USB_ID_IN_IRQ(PM8921_IRQ_BASE),
3087 .vbus_power = msm_hsusb_vbus_power,
Anji jonnala4e3e6772011-09-15 18:53:42 +05303088 .power_budget = 750,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003089};
3090#endif
3091
Vijayavardhan Vennapusae3316a12011-10-15 06:05:17 +05303092#ifdef CONFIG_USB_EHCI_MSM_HSIC
3093static struct msm_hsic_host_platform_data msm_hsic_pdata = {
3094 .strobe = 150,
3095 .data = 151,
3096};
3097#else
3098static struct msm_hsic_host_platform_data msm_hsic_pdata;
3099#endif
3100
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003101#define PID_MAGIC_ID 0x71432909
3102#define SERIAL_NUM_MAGIC_ID 0x61945374
3103#define SERIAL_NUMBER_LENGTH 127
3104#define DLOAD_USB_BASE_ADD 0x2A03F0C8
3105
3106struct magic_num_struct {
3107 uint32_t pid;
3108 uint32_t serial_num;
3109};
3110
3111struct dload_struct {
3112 uint32_t reserved1;
3113 uint32_t reserved2;
3114 uint32_t reserved3;
3115 uint16_t reserved4;
3116 uint16_t pid;
3117 char serial_number[SERIAL_NUMBER_LENGTH];
3118 uint16_t reserved5;
3119 struct magic_num_struct magic_struct;
3120};
3121
3122static int usb_diag_update_pid_and_serial_num(uint32_t pid, const char *snum)
3123{
3124 struct dload_struct __iomem *dload = 0;
3125
3126 dload = ioremap(DLOAD_USB_BASE_ADD, sizeof(*dload));
3127 if (!dload) {
3128 pr_err("%s: cannot remap I/O memory region: %08x\n",
3129 __func__, DLOAD_USB_BASE_ADD);
3130 return -ENXIO;
3131 }
3132
3133 pr_debug("%s: dload:%p pid:%x serial_num:%s\n",
3134 __func__, dload, pid, snum);
3135 /* update pid */
3136 dload->magic_struct.pid = PID_MAGIC_ID;
3137 dload->pid = pid;
3138
3139 /* update serial number */
3140 dload->magic_struct.serial_num = 0;
3141 if (!snum) {
3142 memset(dload->serial_number, 0, SERIAL_NUMBER_LENGTH);
3143 goto out;
3144 }
3145
3146 dload->magic_struct.serial_num = SERIAL_NUM_MAGIC_ID;
Jin Honge49b1482011-10-03 11:15:50 -07003147 strlcpy(dload->serial_number, snum, SERIAL_NUMBER_LENGTH);
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003148out:
3149 iounmap(dload);
3150 return 0;
3151}
3152
3153static struct android_usb_platform_data android_usb_pdata = {
3154 .update_pid_and_serial_num = usb_diag_update_pid_and_serial_num,
3155};
3156
Stepan Moskovchenko14aa6492011-08-08 15:15:01 -07003157static struct platform_device android_usb_device = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003158 .name = "android_usb",
3159 .id = -1,
3160 .dev = {
3161 .platform_data = &android_usb_pdata,
3162 },
3163};
3164
3165static uint8_t spm_wfi_cmd_sequence[] __initdata = {
3166 0x03, 0x0f,
3167};
3168
3169static uint8_t spm_power_collapse_without_rpm[] __initdata = {
3170 0x00, 0x24, 0x54, 0x10,
3171 0x09, 0x03, 0x01,
3172 0x10, 0x54, 0x30, 0x0C,
3173 0x24, 0x30, 0x0f,
3174};
3175
3176static uint8_t spm_power_collapse_with_rpm[] __initdata = {
3177 0x00, 0x24, 0x54, 0x10,
3178 0x09, 0x07, 0x01, 0x0B,
3179 0x10, 0x54, 0x30, 0x0C,
3180 0x24, 0x30, 0x0f,
3181};
3182
3183static struct msm_spm_seq_entry msm_spm_seq_list[] __initdata = {
3184 [0] = {
3185 .mode = MSM_SPM_MODE_CLOCK_GATING,
3186 .notify_rpm = false,
3187 .cmd = spm_wfi_cmd_sequence,
3188 },
3189 [1] = {
3190 .mode = MSM_SPM_MODE_POWER_COLLAPSE,
3191 .notify_rpm = false,
3192 .cmd = spm_power_collapse_without_rpm,
3193 },
3194 [2] = {
3195 .mode = MSM_SPM_MODE_POWER_COLLAPSE,
3196 .notify_rpm = true,
3197 .cmd = spm_power_collapse_with_rpm,
3198 },
3199};
3200
3201static struct msm_spm_platform_data msm_spm_data[] __initdata = {
3202 [0] = {
3203 .reg_base_addr = MSM_SAW0_BASE,
3204 .reg_init_values[MSM_SPM_REG_SAW2_SECURE] = 0x00,
3205 .reg_init_values[MSM_SPM_REG_SAW2_CFG] = 0x1F,
3206 .reg_init_values[MSM_SPM_REG_SAW2_VCTL] = 0x9C,
3207#if defined(CONFIG_MSM_AVS_HW)
3208 .reg_init_values[MSM_SPM_REG_SAW2_AVS_CTL] = 0x00,
3209 .reg_init_values[MSM_SPM_REG_SAW2_AVS_HYSTERESIS] = 0x00,
3210#endif
3211 .reg_init_values[MSM_SPM_REG_SAW2_SPM_CTL] = 0x01,
3212 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DLY] = 0x02020202,
3213 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_0] = 0x0060009C,
3214 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_1] = 0x0000001C,
3215 .vctl_timeout_us = 50,
3216 .num_modes = ARRAY_SIZE(msm_spm_seq_list),
3217 .modes = msm_spm_seq_list,
3218 },
3219 [1] = {
3220 .reg_base_addr = MSM_SAW1_BASE,
3221 .reg_init_values[MSM_SPM_REG_SAW2_SECURE] = 0x00,
3222 .reg_init_values[MSM_SPM_REG_SAW2_CFG] = 0x1F,
3223 .reg_init_values[MSM_SPM_REG_SAW2_VCTL] = 0x9C,
3224#if defined(CONFIG_MSM_AVS_HW)
3225 .reg_init_values[MSM_SPM_REG_SAW2_AVS_CTL] = 0x00,
3226 .reg_init_values[MSM_SPM_REG_SAW2_AVS_HYSTERESIS] = 0x00,
3227#endif
3228 .reg_init_values[MSM_SPM_REG_SAW2_SPM_CTL] = 0x01,
3229 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DLY] = 0x02020202,
3230 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_0] = 0x0060009C,
3231 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_1] = 0x0000001C,
3232 .vctl_timeout_us = 50,
3233 .num_modes = ARRAY_SIZE(msm_spm_seq_list),
3234 .modes = msm_spm_seq_list,
3235 },
3236};
3237
3238static uint8_t l2_spm_wfi_cmd_sequence[] __initdata = {
3239 0x00, 0x20, 0x03, 0x20,
3240 0x00, 0x0f,
3241};
3242
3243static uint8_t l2_spm_gdhs_cmd_sequence[] __initdata = {
3244 0x00, 0x20, 0x34, 0x64,
3245 0x48, 0x07, 0x48, 0x20,
3246 0x50, 0x64, 0x04, 0x34,
3247 0x50, 0x0f,
3248};
3249static uint8_t l2_spm_power_off_cmd_sequence[] __initdata = {
3250 0x00, 0x10, 0x34, 0x64,
3251 0x48, 0x07, 0x48, 0x10,
3252 0x50, 0x64, 0x04, 0x34,
3253 0x50, 0x0F,
3254};
3255
3256static struct msm_spm_seq_entry msm_spm_l2_seq_list[] __initdata = {
3257 [0] = {
3258 .mode = MSM_SPM_L2_MODE_RETENTION,
3259 .notify_rpm = false,
3260 .cmd = l2_spm_wfi_cmd_sequence,
3261 },
3262 [1] = {
3263 .mode = MSM_SPM_L2_MODE_GDHS,
3264 .notify_rpm = true,
3265 .cmd = l2_spm_gdhs_cmd_sequence,
3266 },
3267 [2] = {
3268 .mode = MSM_SPM_L2_MODE_POWER_COLLAPSE,
3269 .notify_rpm = true,
3270 .cmd = l2_spm_power_off_cmd_sequence,
3271 },
3272};
3273
3274
3275static struct msm_spm_platform_data msm_spm_l2_data[] __initdata = {
3276 [0] = {
3277 .reg_base_addr = MSM_SAW_L2_BASE,
3278 .reg_init_values[MSM_SPM_REG_SAW2_SECURE] = 0x00,
3279 .reg_init_values[MSM_SPM_REG_SAW2_SPM_CTL] = 0x00,
3280 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DLY] = 0x02020202,
3281 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_0] = 0x00A000AE,
3282 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_1] = 0x00A00020,
3283 .modes = msm_spm_l2_seq_list,
3284 .num_modes = ARRAY_SIZE(msm_spm_l2_seq_list),
3285 },
3286};
3287
3288#define CYTTSP_TS_GPIO_IRQ 11
3289#define CYTTSP_TS_SLEEP_GPIO 50
3290#define CYTTSP_TS_RESOUT_N_GPIO 52
3291
3292/*virtual key support */
3293static ssize_t tma340_vkeys_show(struct kobject *kobj,
3294 struct kobj_attribute *attr, char *buf)
3295{
3296 return snprintf(buf, 200,
3297 __stringify(EV_KEY) ":" __stringify(KEY_BACK) ":73:1120:97:97"
3298 ":" __stringify(EV_KEY) ":" __stringify(KEY_MENU) ":230:1120:97:97"
3299 ":" __stringify(EV_KEY) ":" __stringify(KEY_HOME) ":389:1120:97:97"
3300 ":" __stringify(EV_KEY) ":" __stringify(KEY_SEARCH) ":544:1120:97:97"
3301 "\n");
3302}
3303
3304static struct kobj_attribute tma340_vkeys_attr = {
3305 .attr = {
3306 .mode = S_IRUGO,
3307 },
3308 .show = &tma340_vkeys_show,
3309};
3310
3311static struct attribute *tma340_properties_attrs[] = {
3312 &tma340_vkeys_attr.attr,
3313 NULL
3314};
3315
3316static struct attribute_group tma340_properties_attr_group = {
3317 .attrs = tma340_properties_attrs,
3318};
3319
3320
3321static int cyttsp_platform_init(struct i2c_client *client)
3322{
3323 int rc = 0;
3324 static struct kobject *tma340_properties_kobj;
3325
3326 tma340_vkeys_attr.attr.name = "virtualkeys.cyttsp-i2c";
3327 tma340_properties_kobj = kobject_create_and_add("board_properties",
3328 NULL);
3329 if (tma340_properties_kobj)
3330 rc = sysfs_create_group(tma340_properties_kobj,
3331 &tma340_properties_attr_group);
3332 if (!tma340_properties_kobj || rc)
3333 pr_err("%s: failed to create board_properties\n",
3334 __func__);
3335
3336 return 0;
3337}
3338
3339static struct cyttsp_regulator regulator_data[] = {
3340 {
3341 .name = "vdd",
3342 .min_uV = CY_TMA300_VTG_MIN_UV,
3343 .max_uV = CY_TMA300_VTG_MAX_UV,
Anirudh Ghayalf9929b12011-09-07 15:57:36 +05303344 .hpm_load_uA = CY_TMA300_CURR_24HZ_UA,
3345 .lpm_load_uA = CY_TMA300_SLEEP_CURR_UA,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003346 },
3347 /* TODO: Remove after runtime PM is enabled in I2C driver */
3348 {
3349 .name = "vcc_i2c",
3350 .min_uV = CY_I2C_VTG_MIN_UV,
3351 .max_uV = CY_I2C_VTG_MAX_UV,
Anirudh Ghayalf9929b12011-09-07 15:57:36 +05303352 .hpm_load_uA = CY_I2C_CURR_UA,
3353 .lpm_load_uA = CY_I2C_SLEEP_CURR_UA,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003354 },
3355};
3356
3357static struct cyttsp_platform_data cyttsp_pdata = {
3358 .panel_maxx = 634,
3359 .panel_maxy = 1166,
3360 .disp_maxx = 616,
3361 .disp_maxy = 1023,
3362 .disp_minx = 0,
3363 .disp_miny = 16,
3364 .flags = 0x01,
3365 .gen = CY_GEN3, /* or */
3366 .use_st = CY_USE_ST,
3367 .use_mt = CY_USE_MT,
3368 .use_hndshk = CY_SEND_HNDSHK,
3369 .use_trk_id = CY_USE_TRACKING_ID,
Anirudh Ghayale96f66d2011-08-11 14:06:38 +05303370 .use_sleep = CY_USE_DEEP_SLEEP_SEL | CY_USE_LOW_POWER_SEL,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003371 .use_gestures = CY_USE_GESTURES,
3372 .fw_fname = "cyttsp_8960_cdp.hex",
3373 /* activate up to 4 groups
3374 * and set active distance
3375 */
3376 .gest_set = CY_GEST_GRP1 | CY_GEST_GRP2 |
3377 CY_GEST_GRP3 | CY_GEST_GRP4 |
3378 CY_ACT_DIST,
3379 /* change act_intrvl to customize the Active power state
3380 * scanning/processing refresh interval for Operating mode
3381 */
3382 .act_intrvl = CY_ACT_INTRVL_DFLT,
3383 /* change tch_tmout to customize the touch timeout for the
3384 * Active power state for Operating mode
3385 */
3386 .tch_tmout = CY_TCH_TMOUT_DFLT,
3387 /* change lp_intrvl to customize the Low Power power state
3388 * scanning/processing refresh interval for Operating mode
3389 */
3390 .lp_intrvl = CY_LP_INTRVL_DFLT,
3391 .sleep_gpio = CYTTSP_TS_SLEEP_GPIO,
3392 .resout_gpio = CYTTSP_TS_RESOUT_N_GPIO,
3393 .irq_gpio = CYTTSP_TS_GPIO_IRQ,
3394 .regulator_info = regulator_data,
3395 .num_regulators = ARRAY_SIZE(regulator_data),
3396 .init = cyttsp_platform_init,
Mohan Pallaka49c37d62011-08-01 11:52:00 +05303397 .correct_fw_ver = 9,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003398};
3399
3400static struct i2c_board_info cyttsp_info[] __initdata = {
3401 {
3402 I2C_BOARD_INFO(CY_I2C_NAME, 0x24),
3403 .platform_data = &cyttsp_pdata,
3404#ifndef CY_USE_TIMER
3405 .irq = MSM_GPIO_TO_INT(CYTTSP_TS_GPIO_IRQ),
3406#endif /* CY_USE_TIMER */
3407 },
3408};
3409
Mohan Pallaka50837382011-09-07 11:00:57 +05303410/* configuration data */
3411static const u8 mxt_config_data[] = {
3412 /* T6 Object */
Jing Lin2f863172011-10-17 10:56:58 -07003413 0, 0, 0, 0, 0, 0,
Mohan Pallaka50837382011-09-07 11:00:57 +05303414 /* T38 Object */
Jing Lin2f863172011-10-17 10:56:58 -07003415 11, 1, 0, 20, 10, 11, 0, 0, 0, 0,
3416 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3417 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3418 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3419 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3420 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3421 0, 0, 0, 0,
Mohan Pallaka50837382011-09-07 11:00:57 +05303422 /* T7 Object */
Jing Lin2f863172011-10-17 10:56:58 -07003423 100, 16, 50,
Mohan Pallaka50837382011-09-07 11:00:57 +05303424 /* T8 Object */
Jing Lin2f863172011-10-17 10:56:58 -07003425 8, 0, 0, 0, 0, 0, 0, 0, 0, 0,
Mohan Pallaka50837382011-09-07 11:00:57 +05303426 /* T9 Object */
Jing Lin2f863172011-10-17 10:56:58 -07003427 131, 0, 0, 26, 42, 0, 32, 60, 2, 5,
3428 0, 5, 5, 34, 10, 10, 10, 10, 255, 2,
3429 85, 5, 18, 18, 18, 18, 0, 0, 5, 20,
3430 0, 5, 45, 46,
Mohan Pallaka50837382011-09-07 11:00:57 +05303431 /* T15 Object */
Jing Lin2f863172011-10-17 10:56:58 -07003432 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3433 0,
Mohan Pallaka50837382011-09-07 11:00:57 +05303434 /* T22 Object */
Jing Lin2f863172011-10-17 10:56:58 -07003435 0, 0, 0, 0, 0, 0, 0, 0, 30, 0,
3436 0, 0, 255, 255, 255, 255, 0,
Mohan Pallaka50837382011-09-07 11:00:57 +05303437 /* T24 Object */
Jing Lin2f863172011-10-17 10:56:58 -07003438 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3439 0, 0, 0, 0, 0, 0, 0, 0, 0,
Mohan Pallaka50837382011-09-07 11:00:57 +05303440 /* T25 Object */
Jing Lin2f863172011-10-17 10:56:58 -07003441 3, 0, 188, 52, 52, 33, 0, 0, 0, 0,
3442 0, 0, 0, 0,
Mohan Pallaka50837382011-09-07 11:00:57 +05303443 /* T27 Object */
Jing Lin2f863172011-10-17 10:56:58 -07003444 0, 0, 0, 0, 0, 0, 0,
Mohan Pallaka50837382011-09-07 11:00:57 +05303445 /* T28 Object */
Jing Lin2f863172011-10-17 10:56:58 -07003446 0, 0, 0, 8, 8, 60,
Mohan Pallaka50837382011-09-07 11:00:57 +05303447 /* T40 Object */
Jing Lin2f863172011-10-17 10:56:58 -07003448 0, 0, 0, 0, 0,
Mohan Pallaka50837382011-09-07 11:00:57 +05303449 /* T41 Object */
Jing Lin2f863172011-10-17 10:56:58 -07003450 0, 0, 0, 0, 0, 0,
Mohan Pallaka50837382011-09-07 11:00:57 +05303451 /* T43 Object */
Jing Lin2f863172011-10-17 10:56:58 -07003452 0, 0, 0, 0, 0, 0,
Mohan Pallaka50837382011-09-07 11:00:57 +05303453};
3454
3455#define MXT_TS_GPIO_IRQ 11
3456#define MXT_TS_LDO_EN_GPIO 50
3457#define MXT_TS_RESET_GPIO 52
3458
3459static void mxt_init_hw_liquid(void)
3460{
3461 int rc;
3462
3463 rc = gpio_request(MXT_TS_GPIO_IRQ, "mxt_ts_irq_gpio");
3464 if (rc) {
3465 pr_err("%s: unable to request mxt_ts_irq gpio [%d]\n",
3466 __func__, MXT_TS_GPIO_IRQ);
3467 return;
3468 }
3469
3470 rc = gpio_direction_input(MXT_TS_GPIO_IRQ);
3471 if (rc) {
3472 pr_err("%s: unable to set_direction for mxt_ts_irq gpio [%d]\n",
3473 __func__, MXT_TS_GPIO_IRQ);
3474 goto err_irq_gpio_req;
3475 }
3476
3477 rc = gpio_request(MXT_TS_LDO_EN_GPIO, "mxt_ldo_en_gpio");
3478 if (rc) {
3479 pr_err("%s: unable to request mxt_ldo_en gpio [%d]\n",
3480 __func__, MXT_TS_LDO_EN_GPIO);
3481 goto err_irq_gpio_req;
3482 }
3483
3484 rc = gpio_direction_output(MXT_TS_LDO_EN_GPIO, 1);
3485 if (rc) {
3486 pr_err("%s: unable to set_direction for mxt_ldo_en gpio [%d]\n",
3487 __func__, MXT_TS_LDO_EN_GPIO);
3488 goto err_ldo_gpio_req;
3489 }
3490
3491 rc = gpio_request(MXT_TS_RESET_GPIO, "mxt_reset_gpio");
3492 if (rc) {
3493 pr_err("%s: unable to request mxt_reset gpio [%d]\n",
3494 __func__, MXT_TS_RESET_GPIO);
3495 goto err_ldo_gpio_set_dir;
3496 }
3497
3498 rc = gpio_direction_output(MXT_TS_RESET_GPIO, 1);
3499 if (rc) {
3500 pr_err("%s: unable to set_direction for mxt_reset gpio [%d]\n",
3501 __func__, MXT_TS_RESET_GPIO);
3502 goto err_reset_gpio_req;
3503 }
3504
3505 return;
3506
3507err_reset_gpio_req:
3508 gpio_free(MXT_TS_RESET_GPIO);
3509err_ldo_gpio_set_dir:
3510 gpio_set_value(MXT_TS_LDO_EN_GPIO, 0);
3511err_ldo_gpio_req:
3512 gpio_free(MXT_TS_LDO_EN_GPIO);
3513err_irq_gpio_req:
3514 gpio_free(MXT_TS_GPIO_IRQ);
3515}
3516
3517static struct mxt_platform_data mxt_platform_data = {
3518 .config = mxt_config_data,
3519 .config_length = ARRAY_SIZE(mxt_config_data),
Jing Lin2f863172011-10-17 10:56:58 -07003520 .x_size = 1365,
3521 .y_size = 767,
Mohan Pallaka50837382011-09-07 11:00:57 +05303522 .irqflags = IRQF_TRIGGER_FALLING,
Jing Lin2f863172011-10-17 10:56:58 -07003523 .i2c_pull_up = true,
Mohan Pallaka50837382011-09-07 11:00:57 +05303524};
3525
3526static struct i2c_board_info mxt_device_info[] __initdata = {
3527 {
3528 I2C_BOARD_INFO("atmel_mxt_ts", 0x5b),
3529 .platform_data = &mxt_platform_data,
3530 .irq = MSM_GPIO_TO_INT(MXT_TS_GPIO_IRQ),
3531 },
3532};
3533
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003534static void gsbi_qup_i2c_gpio_config(int adap_id, int config_type)
3535{
3536}
3537
3538static struct msm_i2c_platform_data msm8960_i2c_qup_gsbi4_pdata = {
3539 .clk_freq = 100000,
3540 .src_clk_rate = 24000000,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003541 .msm_i2c_config_gpio = gsbi_qup_i2c_gpio_config,
3542};
3543
3544static struct msm_i2c_platform_data msm8960_i2c_qup_gsbi3_pdata = {
3545 .clk_freq = 100000,
3546 .src_clk_rate = 24000000,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003547 .msm_i2c_config_gpio = gsbi_qup_i2c_gpio_config,
3548};
3549
3550static struct msm_i2c_platform_data msm8960_i2c_qup_gsbi10_pdata = {
3551 .clk_freq = 100000,
3552 .src_clk_rate = 24000000,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003553 .msm_i2c_config_gpio = gsbi_qup_i2c_gpio_config,
3554};
3555
3556static struct msm_i2c_platform_data msm8960_i2c_qup_gsbi12_pdata = {
3557 .clk_freq = 100000,
3558 .src_clk_rate = 24000000,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003559 .msm_i2c_config_gpio = gsbi_qup_i2c_gpio_config,
3560};
3561
3562static struct msm_rpm_platform_data msm_rpm_data = {
3563 .reg_base_addrs = {
3564 [MSM_RPM_PAGE_STATUS] = MSM_RPM_BASE,
3565 [MSM_RPM_PAGE_CTRL] = MSM_RPM_BASE + 0x400,
3566 [MSM_RPM_PAGE_REQ] = MSM_RPM_BASE + 0x600,
3567 [MSM_RPM_PAGE_ACK] = MSM_RPM_BASE + 0xa00,
3568 },
3569
3570 .irq_ack = RPM_APCC_CPU0_GP_HIGH_IRQ,
3571 .irq_err = RPM_APCC_CPU0_GP_LOW_IRQ,
3572 .irq_vmpm = RPM_APCC_CPU0_GP_MEDIUM_IRQ,
3573 .msm_apps_ipc_rpm_reg = MSM_APCS_GCC_BASE + 0x008,
3574 .msm_apps_ipc_rpm_val = 4,
3575};
3576
Stepan Moskovchenko93d79ec2011-09-21 16:52:16 -07003577static struct ks8851_pdata spi_eth_pdata = {
3578 .irq_gpio = KS8851_IRQ_GPIO,
3579 .rst_gpio = KS8851_RST_GPIO,
3580};
Praveen Chidambaram043f4ce2011-08-02 09:37:59 -06003581
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003582static struct spi_board_info spi_board_info[] __initdata = {
3583 {
3584 .modalias = "ks8851",
3585 .irq = MSM_GPIO_TO_INT(KS8851_IRQ_GPIO),
3586 .max_speed_hz = 19200000,
3587 .bus_num = 0,
3588 .chip_select = 0,
3589 .mode = SPI_MODE_0,
Stepan Moskovchenko93d79ec2011-09-21 16:52:16 -07003590 .platform_data = &spi_eth_pdata
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003591 },
3592};
3593
3594static struct platform_device msm_device_saw_core0 = {
3595 .name = "saw-regulator",
3596 .id = 0,
3597 .dev = {
3598 .platform_data = &msm_saw_regulator_pdata_s5,
3599 },
3600};
3601
3602static struct platform_device msm_device_saw_core1 = {
3603 .name = "saw-regulator",
3604 .id = 1,
3605 .dev = {
3606 .platform_data = &msm_saw_regulator_pdata_s6,
3607 },
3608};
3609
Siddartha Mohanadossba21fdd2011-08-18 10:05:27 -07003610static struct tsens_platform_data msm_tsens_pdata = {
3611 .slope = 910,
3612 .tsens_factor = 1000,
3613 .hw_type = MSM_8960,
3614 .tsens_num_sensor = 5,
3615};
3616
3617static struct platform_device msm_tsens_device = {
3618 .name = "tsens8960-tm",
3619 .id = -1,
3620 .dev = {
3621 .platform_data = &msm_tsens_pdata,
3622 },
3623};
3624
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003625#ifdef CONFIG_MSM_FAKE_BATTERY
3626static struct platform_device fish_battery_device = {
3627 .name = "fish_battery",
3628};
3629#endif
3630
David Collins26f05562011-06-20 09:56:28 -07003631static struct platform_device msm8960_device_ext_5v_vreg __devinitdata = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003632 .name = GPIO_REGULATOR_DEV_NAME,
3633 .id = PM8921_MPP_PM_TO_SYS(7),
3634 .dev = {
3635 .platform_data = &msm_gpio_regulator_pdata[GPIO_VREG_ID_EXT_5V],
3636 },
3637};
3638
David Collins26f05562011-06-20 09:56:28 -07003639static struct platform_device msm8960_device_ext_l2_vreg __devinitdata = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003640 .name = GPIO_REGULATOR_DEV_NAME,
3641 .id = 91,
3642 .dev = {
3643 .platform_data = &msm_gpio_regulator_pdata[GPIO_VREG_ID_EXT_L2],
3644 },
3645};
3646
David Collinsb10be1d2011-09-02 10:29:31 -07003647static struct platform_device msm8960_device_ext_3p3v_vreg __devinitdata = {
3648 .name = GPIO_REGULATOR_DEV_NAME,
3649 .id = PM8921_GPIO_PM_TO_SYS(17),
3650 .dev = {
3651 .platform_data =
3652 &msm_gpio_regulator_pdata[GPIO_VREG_ID_EXT_3P3V],
3653 },
3654};
3655
David Collins26f05562011-06-20 09:56:28 -07003656static struct platform_device msm8960_device_rpm_regulator __devinitdata = {
3657 .name = "rpm-regulator",
3658 .id = -1,
3659 .dev = {
3660 .platform_data = &msm_rpm_regulator_pdata,
3661 },
3662};
3663
David Collins4c31a872011-08-31 10:07:10 -07003664static struct msm_rpm_log_platform_data msm_rpm_log_pdata = {
3665 .phys_addr_base = 0x0010C000,
3666 .reg_offsets = {
3667 [MSM_RPM_LOG_PAGE_INDICES] = 0x00000080,
3668 [MSM_RPM_LOG_PAGE_BUFFER] = 0x000000A0,
3669 },
3670 .phys_size = SZ_8K,
3671 .log_len = 4096, /* log's buffer length in bytes */
3672 .log_len_mask = (4096 >> 2) - 1, /* length mask in units of u32 */
3673};
3674
3675static struct platform_device msm_rpm_log_device = {
3676 .name = "msm_rpm_log",
3677 .id = -1,
3678 .dev = {
3679 .platform_data = &msm_rpm_log_pdata,
3680 },
3681};
3682
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003683static struct platform_device *common_devices[] __initdata = {
Stepan Moskovchenkodf13d342011-08-03 19:01:25 -07003684 &msm8960_device_dmov,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003685 &msm_device_smd,
3686 &msm8960_device_uart_gsbi5,
Mayank Rana9f51f582011-08-04 18:35:59 +05303687 &msm_device_uart_dm6,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003688 &msm_device_saw_core0,
3689 &msm_device_saw_core1,
3690 &msm8960_device_ext_5v_vreg,
3691 &msm8960_device_ext_l2_vreg,
3692 &msm8960_device_ssbi_pm8921,
3693 &msm8960_device_qup_spi_gsbi1,
3694 &msm8960_device_qup_i2c_gsbi3,
3695 &msm8960_device_qup_i2c_gsbi4,
3696 &msm8960_device_qup_i2c_gsbi10,
3697#ifndef CONFIG_MSM_DSPS
3698 &msm8960_device_qup_i2c_gsbi12,
3699#endif
3700 &msm_slim_ctrl,
3701 &msm_device_wcnss_wlan,
3702#if defined(CONFIG_CRYPTO_DEV_QCRYPTO) || \
3703 defined(CONFIG_CRYPTO_DEV_QCRYPTO_MODULE)
3704 &qcrypto_device,
3705#endif
3706
3707#if defined(CONFIG_CRYPTO_DEV_QCEDEV) || \
3708 defined(CONFIG_CRYPTO_DEV_QCEDEV_MODULE)
3709 &qcedev_device,
3710#endif
3711#ifdef CONFIG_MSM_ROTATOR
3712 &msm_rotator_device,
3713#endif
3714 &msm_device_sps,
3715#ifdef CONFIG_MSM_FAKE_BATTERY
3716 &fish_battery_device,
3717#endif
3718#ifdef CONFIG_ANDROID_PMEM
Laura Abbott2d1760b2011-09-29 21:31:24 -07003719#ifndef CONFIG_MSM_MULTIMEDIA_USE_ION
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003720 &android_pmem_device,
3721 &android_pmem_adsp_device,
Laura Abbott2d1760b2011-09-29 21:31:24 -07003722#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003723 &android_pmem_audio_device,
3724#endif
3725 &msm_fb_device,
3726 &msm_device_vidc,
3727 &msm_device_bam_dmux,
3728 &msm_fm_platform_init,
Mona Hossain9c430e32011-07-27 11:04:47 -07003729
3730#ifdef CONFIG_HW_RANDOM_MSM
3731 &msm_device_rng,
3732#endif
Praveen Chidambaram043f4ce2011-08-02 09:37:59 -06003733 &msm_rpm_device,
Laura Abbottd6183792011-08-19 13:42:24 -07003734#ifdef CONFIG_ION_MSM
3735 &ion_dev,
3736#endif
David Collins4c31a872011-08-31 10:07:10 -07003737 &msm_rpm_log_device,
Pratik Patel7831c082011-06-08 21:44:37 -07003738#ifdef CONFIG_MSM_QDSS
3739 &msm_etb_device,
3740 &msm_tpiu_device,
3741 &msm_funnel_device,
3742 &msm_ptm_device,
3743#endif
Swaminathan Sathappanb77c65e92011-09-30 18:36:09 -07003744 &msm_device_dspcrashd_8960,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003745};
3746
Stepan Moskovchenkod056fca2011-01-27 12:12:07 -08003747static struct platform_device *sim_devices[] __initdata = {
Stepan Moskovchenko14aa6492011-08-08 15:15:01 -07003748 &msm8960_device_otg,
3749 &msm8960_device_gadget_peripheral,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003750 &msm_device_hsusb_host,
Vijayavardhan Vennapusaeb566482011-09-18 07:48:37 +05303751 &msm_device_hsic_host,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003752 &android_usb_device,
3753 &msm_device_vidc,
3754 &mipi_dsi_simulator_panel_device,
3755 &msm_bus_apps_fabric,
3756 &msm_bus_sys_fabric,
3757 &msm_bus_mm_fabric,
3758 &msm_bus_sys_fpb,
3759 &msm_bus_cpss_fpb,
3760 &msm_pcm,
3761 &msm_pcm_routing,
3762 &msm_cpudai0,
3763 &msm_cpudai1,
3764 &msm_cpudai_hdmi_rx,
3765 &msm_cpudai_bt_rx,
3766 &msm_cpudai_bt_tx,
3767 &msm_cpudai_fm_rx,
3768 &msm_cpudai_fm_tx,
Bhalchandra Gajare0e795c42011-08-15 18:10:30 -07003769 &msm_cpudai_auxpcm_rx,
3770 &msm_cpudai_auxpcm_tx,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003771 &msm_cpu_fe,
3772 &msm_stub_codec,
3773 &msm_voice,
3774 &msm_voip,
3775 &msm_lpa_pcm,
3776
3777#if defined(CONFIG_CRYPTO_DEV_QCRYPTO) || \
3778 defined(CONFIG_CRYPTO_DEV_QCRYPTO_MODULE)
3779 &qcrypto_device,
3780#endif
3781
3782#if defined(CONFIG_CRYPTO_DEV_QCEDEV) || \
3783 defined(CONFIG_CRYPTO_DEV_QCEDEV_MODULE)
3784 &qcedev_device,
3785#endif
Stepan Moskovchenkod056fca2011-01-27 12:12:07 -08003786};
3787
3788static struct platform_device *rumi3_devices[] __initdata = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003789 &msm_kgsl_3d0,
3790 &msm_kgsl_2d0,
3791 &msm_kgsl_2d1,
3792 &mipi_dsi_renesas_panel_device,
3793#ifdef CONFIG_MSM_GEMINI
3794 &msm8960_gemini_device,
3795#endif
Stepan Moskovchenkod056fca2011-01-27 12:12:07 -08003796};
3797
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003798static struct platform_device *cdp_devices[] __initdata = {
Stepan Moskovchenko14aa6492011-08-08 15:15:01 -07003799 &msm8960_device_otg,
3800 &msm8960_device_gadget_peripheral,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003801 &msm_device_hsusb_host,
Vijayavardhan Vennapusaeb566482011-09-18 07:48:37 +05303802 &msm_device_hsic_host,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003803 &android_usb_device,
3804 &msm_pcm,
3805 &msm_pcm_routing,
3806 &msm_cpudai0,
3807 &msm_cpudai1,
3808 &msm_cpudai_hdmi_rx,
3809 &msm_cpudai_bt_rx,
3810 &msm_cpudai_bt_tx,
3811 &msm_cpudai_fm_rx,
3812 &msm_cpudai_fm_tx,
Bhalchandra Gajare0e795c42011-08-15 18:10:30 -07003813 &msm_cpudai_auxpcm_rx,
3814 &msm_cpudai_auxpcm_tx,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003815 &msm_cpu_fe,
3816 &msm_stub_codec,
3817 &msm_kgsl_3d0,
3818#ifdef CONFIG_MSM_KGSL_2D
3819 &msm_kgsl_2d0,
3820 &msm_kgsl_2d1,
3821#endif
Chandan Uddaraju83eac3c2011-09-11 18:32:23 -07003822 &mipi_dsi_novatek_panel_device,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003823#ifdef CONFIG_MSM_GEMINI
3824 &msm8960_gemini_device,
3825#endif
3826 &msm_voice,
3827 &msm_voip,
3828 &msm_lpa_pcm,
Laxminath Kasamcee1d602011-08-01 19:26:57 +05303829 &msm_cpudai_afe_01_rx,
3830 &msm_cpudai_afe_01_tx,
3831 &msm_cpudai_afe_02_rx,
3832 &msm_cpudai_afe_02_tx,
3833 &msm_pcm_afe,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003834#ifdef CONFIG_FB_MSM_HDMI_MSM_PANEL
3835 &hdmi_msm_device,
3836#endif
3837 &msm_pcm_hostless,
3838 &msm_bus_apps_fabric,
3839 &msm_bus_sys_fabric,
3840 &msm_bus_mm_fabric,
3841 &msm_bus_sys_fpb,
3842 &msm_bus_cpss_fpb,
Siddartha Mohanadossba21fdd2011-08-18 10:05:27 -07003843 &msm_tsens_device,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003844};
3845
3846static void __init msm8960_i2c_init(void)
3847{
3848 msm8960_device_qup_i2c_gsbi4.dev.platform_data =
3849 &msm8960_i2c_qup_gsbi4_pdata;
3850
3851 msm8960_device_qup_i2c_gsbi3.dev.platform_data =
3852 &msm8960_i2c_qup_gsbi3_pdata;
3853
3854 msm8960_device_qup_i2c_gsbi10.dev.platform_data =
3855 &msm8960_i2c_qup_gsbi10_pdata;
3856
3857 msm8960_device_qup_i2c_gsbi12.dev.platform_data =
3858 &msm8960_i2c_qup_gsbi12_pdata;
3859}
3860
Lucille Sylvester34ec3692011-08-16 16:28:04 -06003861static void __init msm8960_gfx_init(void)
3862{
Jeremy Gebben58b2dce2011-10-13 11:14:19 -06003863 uint32_t soc_platform_version = socinfo_get_version();
Lucille Sylvester34ec3692011-08-16 16:28:04 -06003864 if (SOCINFO_VERSION_MAJOR(soc_platform_version) == 1) {
3865 struct kgsl_device_platform_data *kgsl_3d0_pdata =
3866 msm_kgsl_3d0.dev.platform_data;
3867 kgsl_3d0_pdata->pwr_data.pwrlevel[0].gpu_freq =
3868 320000000;
3869 kgsl_3d0_pdata->pwr_data.pwrlevel[1].gpu_freq =
3870 266667000;
3871 }
3872}
3873
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003874static struct pm8xxx_irq_platform_data pm8xxx_irq_pdata __devinitdata = {
3875 .irq_base = PM8921_IRQ_BASE,
3876 .devirq = MSM_GPIO_TO_INT(104),
3877 .irq_trigger_flag = IRQF_TRIGGER_LOW,
3878};
3879
3880static struct pm8xxx_gpio_platform_data pm8xxx_gpio_pdata __devinitdata = {
3881 .gpio_base = PM8921_GPIO_PM_TO_SYS(1),
3882};
3883
3884static struct pm8xxx_mpp_platform_data pm8xxx_mpp_pdata __devinitdata = {
3885 .mpp_base = PM8921_MPP_PM_TO_SYS(1),
3886};
3887
3888static struct pm8xxx_rtc_platform_data pm8xxx_rtc_pdata __devinitdata = {
3889 .rtc_write_enable = false,
Ashay Jaiswald66c9d52011-10-13 17:41:40 +05303890 .rtc_alarm_powerup = false,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003891};
3892
3893static struct pm8xxx_pwrkey_platform_data pm8xxx_pwrkey_pdata = {
3894 .pull_up = 1,
3895 .kpd_trigger_delay_us = 970,
3896 .wakeup = 1,
3897};
3898
Mohan Pallaka002e9e02011-08-05 11:23:22 +05303899/* Rotate lock key is not available so use F1 */
3900#define KEY_ROTATE_LOCK KEY_F1
3901
3902static const unsigned int keymap_liquid[] = {
3903 KEY(0, 0, KEY_VOLUMEUP),
3904 KEY(0, 1, KEY_VOLUMEDOWN),
3905 KEY(1, 3, KEY_ROTATE_LOCK),
3906 KEY(1, 4, KEY_HOME),
3907};
3908
3909static struct matrix_keymap_data keymap_data_liquid = {
3910 .keymap_size = ARRAY_SIZE(keymap_liquid),
3911 .keymap = keymap_liquid,
3912};
3913
3914static struct pm8xxx_keypad_platform_data keypad_data_liquid = {
3915 .input_name = "keypad_8960_liquid",
3916 .input_phys_device = "keypad_8960/input0",
3917 .num_rows = 2,
3918 .num_cols = 5,
3919 .rows_gpio_start = PM8921_GPIO_PM_TO_SYS(9),
3920 .cols_gpio_start = PM8921_GPIO_PM_TO_SYS(1),
3921 .debounce_ms = 15,
3922 .scan_delay_ms = 32,
3923 .row_hold_ns = 91500,
3924 .wakeup = 1,
3925 .keymap_data = &keymap_data_liquid,
3926};
3927
3928
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003929static const unsigned int keymap[] = {
3930 KEY(0, 0, KEY_VOLUMEUP),
3931 KEY(0, 1, KEY_VOLUMEDOWN),
3932 KEY(0, 2, KEY_CAMERA_SNAPSHOT),
3933 KEY(0, 3, KEY_CAMERA_FOCUS),
3934};
3935
3936static struct matrix_keymap_data keymap_data = {
3937 .keymap_size = ARRAY_SIZE(keymap),
3938 .keymap = keymap,
3939};
3940
3941static struct pm8xxx_keypad_platform_data keypad_data = {
3942 .input_name = "keypad_8960",
3943 .input_phys_device = "keypad_8960/input0",
3944 .num_rows = 1,
3945 .num_cols = 5,
3946 .rows_gpio_start = PM8921_GPIO_PM_TO_SYS(9),
3947 .cols_gpio_start = PM8921_GPIO_PM_TO_SYS(1),
3948 .debounce_ms = 15,
3949 .scan_delay_ms = 32,
3950 .row_hold_ns = 91500,
3951 .wakeup = 1,
3952 .keymap_data = &keymap_data,
3953};
3954
3955static const unsigned int keymap_sim[] = {
3956 KEY(0, 0, KEY_7),
3957 KEY(0, 1, KEY_DOWN),
3958 KEY(0, 2, KEY_UP),
3959 KEY(0, 3, KEY_RIGHT),
3960 KEY(0, 4, KEY_ENTER),
3961 KEY(0, 5, KEY_L),
3962 KEY(0, 6, KEY_BACK),
3963 KEY(0, 7, KEY_M),
3964
3965 KEY(1, 0, KEY_LEFT),
3966 KEY(1, 1, KEY_SEND),
3967 KEY(1, 2, KEY_1),
3968 KEY(1, 3, KEY_4),
3969 KEY(1, 4, KEY_CLEAR),
3970 KEY(1, 5, KEY_MSDOS),
3971 KEY(1, 6, KEY_SPACE),
3972 KEY(1, 7, KEY_COMMA),
3973
3974 KEY(2, 0, KEY_6),
3975 KEY(2, 1, KEY_5),
3976 KEY(2, 2, KEY_8),
3977 KEY(2, 3, KEY_3),
3978 KEY(2, 4, KEY_NUMERIC_STAR),
3979 KEY(2, 5, KEY_UP),
3980 KEY(2, 6, KEY_DOWN),
3981 KEY(2, 7, KEY_LEFTSHIFT),
3982
3983 KEY(3, 0, KEY_9),
3984 KEY(3, 1, KEY_NUMERIC_POUND),
3985 KEY(3, 2, KEY_0),
3986 KEY(3, 3, KEY_2),
3987 KEY(3, 4, KEY_SLEEP),
3988 KEY(3, 5, KEY_F1),
3989 KEY(3, 6, KEY_F2),
3990 KEY(3, 7, KEY_F3),
3991
3992 KEY(4, 0, KEY_BACK),
3993 KEY(4, 1, KEY_HOME),
3994 KEY(4, 2, KEY_MENU),
3995 KEY(4, 3, KEY_VOLUMEUP),
3996 KEY(4, 4, KEY_VOLUMEDOWN),
3997 KEY(4, 5, KEY_F4),
3998 KEY(4, 6, KEY_F5),
3999 KEY(4, 7, KEY_F6),
4000
4001 KEY(5, 0, KEY_R),
4002 KEY(5, 1, KEY_T),
4003 KEY(5, 2, KEY_Y),
4004 KEY(5, 3, KEY_LEFTALT),
4005 KEY(5, 4, KEY_KPENTER),
4006 KEY(5, 5, KEY_Q),
4007 KEY(5, 6, KEY_W),
4008 KEY(5, 7, KEY_E),
4009
4010 KEY(6, 0, KEY_F),
4011 KEY(6, 1, KEY_G),
4012 KEY(6, 2, KEY_H),
4013 KEY(6, 3, KEY_CAPSLOCK),
4014 KEY(6, 4, KEY_PAGEUP),
4015 KEY(6, 5, KEY_A),
4016 KEY(6, 6, KEY_S),
4017 KEY(6, 7, KEY_D),
4018
4019 KEY(7, 0, KEY_V),
4020 KEY(7, 1, KEY_B),
4021 KEY(7, 2, KEY_N),
4022 KEY(7, 3, KEY_MENU),
4023 KEY(7, 4, KEY_PAGEDOWN),
4024 KEY(7, 5, KEY_Z),
4025 KEY(7, 6, KEY_X),
4026 KEY(7, 7, KEY_C),
4027
4028 KEY(8, 0, KEY_P),
4029 KEY(8, 1, KEY_J),
4030 KEY(8, 2, KEY_K),
4031 KEY(8, 3, KEY_INSERT),
4032 KEY(8, 4, KEY_LINEFEED),
4033 KEY(8, 5, KEY_U),
4034 KEY(8, 6, KEY_I),
4035 KEY(8, 7, KEY_O),
4036
4037 KEY(9, 0, KEY_4),
4038 KEY(9, 1, KEY_5),
4039 KEY(9, 2, KEY_6),
4040 KEY(9, 3, KEY_7),
4041 KEY(9, 4, KEY_8),
4042 KEY(9, 5, KEY_1),
4043 KEY(9, 6, KEY_2),
4044 KEY(9, 7, KEY_3),
4045
4046 KEY(10, 0, KEY_F7),
4047 KEY(10, 1, KEY_F8),
4048 KEY(10, 2, KEY_F9),
4049 KEY(10, 3, KEY_F10),
4050 KEY(10, 4, KEY_FN),
4051 KEY(10, 5, KEY_9),
4052 KEY(10, 6, KEY_0),
4053 KEY(10, 7, KEY_DOT),
4054
4055 KEY(11, 0, KEY_LEFTCTRL),
4056 KEY(11, 1, KEY_F11),
4057 KEY(11, 2, KEY_ENTER),
4058 KEY(11, 3, KEY_SEARCH),
4059 KEY(11, 4, KEY_DELETE),
4060 KEY(11, 5, KEY_RIGHT),
4061 KEY(11, 6, KEY_LEFT),
4062 KEY(11, 7, KEY_RIGHTSHIFT),
4063 KEY(0, 0, KEY_VOLUMEUP),
4064 KEY(0, 1, KEY_VOLUMEDOWN),
4065 KEY(0, 2, KEY_CAMERA_SNAPSHOT),
4066 KEY(0, 3, KEY_CAMERA_FOCUS),
4067};
4068
4069static struct matrix_keymap_data keymap_data_sim = {
4070 .keymap_size = ARRAY_SIZE(keymap_sim),
4071 .keymap = keymap_sim,
4072};
4073
4074static struct pm8xxx_keypad_platform_data keypad_data_sim = {
4075 .input_name = "keypad_8960",
4076 .input_phys_device = "keypad_8960/input0",
4077 .num_rows = 12,
4078 .num_cols = 8,
4079 .rows_gpio_start = PM8921_GPIO_PM_TO_SYS(9),
4080 .cols_gpio_start = PM8921_GPIO_PM_TO_SYS(1),
4081 .debounce_ms = 15,
4082 .scan_delay_ms = 32,
4083 .row_hold_ns = 91500,
4084 .wakeup = 1,
4085 .keymap_data = &keymap_data_sim,
4086};
4087
Abhijeet Dharmapurikarad742362011-08-29 19:50:02 -07004088static int pm8921_therm_mitigation[] = {
4089 1100,
4090 700,
4091 600,
4092 325,
4093};
4094
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07004095static struct pm8921_charger_platform_data pm8921_chg_pdata __devinitdata = {
Abhijeet Dharmapurikar34059332011-08-16 19:19:39 -07004096 .safety_time = 180,
Abhijeet Dharmapurikar33fe6fb2011-09-14 16:03:11 -07004097 .update_time = 60000,
Abhijeet Dharmapurikar34059332011-08-16 19:19:39 -07004098 .max_voltage = 4200,
4099 .min_voltage = 3200,
4100 .resume_voltage = 4100,
4101 .term_current = 100,
4102 .cool_temp = 10,
4103 .warm_temp = 40,
4104 .temp_check_period = 1,
Abhijeet Dharmapurikarad742362011-08-29 19:50:02 -07004105 .max_bat_chg_current = 1100,
Abhijeet Dharmapurikar34059332011-08-16 19:19:39 -07004106 .cool_bat_chg_current = 350,
4107 .warm_bat_chg_current = 350,
4108 .cool_bat_voltage = 4100,
4109 .warm_bat_voltage = 4100,
Abhijeet Dharmapurikarad742362011-08-29 19:50:02 -07004110 .thermal_mitigation = pm8921_therm_mitigation,
4111 .thermal_levels = ARRAY_SIZE(pm8921_therm_mitigation),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07004112};
4113
4114static struct pm8xxx_misc_platform_data pm8xxx_misc_pdata = {
4115 .priority = 0,
4116};
4117
4118static struct pm8921_bms_platform_data pm8921_bms_pdata __devinitdata = {
4119 .r_sense = 10,
4120 .i_test = 2500,
4121 .v_failure = 3000,
4122 .calib_delay_ms = 600000,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07004123};
4124
Jay Chokshide4cefb2011-08-04 18:10:44 -07004125#define PM8921_LC_LED_MAX_CURRENT 4 /* I = 4mA */
Jay Chokshi6238d5e2011-10-24 13:47:19 -07004126#define PM8XXX_LED_PWM_PERIOD 1000
4127#define PM8XXX_LED_PWM_DUTY_MS 20
4128/**
4129 * PM8XXX_PWM_CHANNEL_NONE shall be used when LED shall not be
4130 * driven using PWM feature.
4131 */
4132#define PM8XXX_PWM_CHANNEL_NONE -1
Jay Chokshide4cefb2011-08-04 18:10:44 -07004133
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07004134static struct led_info pm8921_led_info[] = {
4135 [0] = {
Jay Chokshi6238d5e2011-10-24 13:47:19 -07004136 .name = "led:battery_charging",
4137 .default_trigger = "battery-charging",
Jay Chokshide4cefb2011-08-04 18:10:44 -07004138 },
4139 [1] = {
Jay Chokshi6238d5e2011-10-24 13:47:19 -07004140 .name = "led:battery_full",
4141 .default_trigger = "battery-full",
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07004142 },
4143};
4144
Jay Chokshi8994e392011-09-14 18:20:39 -07004145static struct led_platform_data pm8921_led_core_pdata = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07004146 .num_leds = ARRAY_SIZE(pm8921_led_info),
4147 .leds = pm8921_led_info,
4148};
4149
Jay Chokshi6238d5e2011-10-24 13:47:19 -07004150static int pm8921_led0_pwm_duty_pcts[56] = {
4151 1, 4, 8, 12, 16, 20, 24, 28, 32, 36,
4152 40, 44, 46, 52, 56, 60, 64, 68, 72, 76,
4153 80, 84, 88, 92, 96, 100, 100, 100, 98, 95,
4154 92, 88, 84, 82, 78, 74, 70, 66, 62, 58,
4155 58, 54, 50, 48, 42, 38, 34, 30, 26, 22,
4156 14, 10, 6, 4, 1
4157};
4158
4159static struct pm8xxx_pwm_duty_cycles pm8921_led0_pwm_duty_cycles = {
4160 .duty_pcts = (int *)&pm8921_led0_pwm_duty_pcts,
4161 .num_duty_pcts = ARRAY_SIZE(pm8921_led0_pwm_duty_pcts),
4162 .duty_ms = PM8XXX_LED_PWM_DUTY_MS,
4163 .start_idx = 0,
4164};
4165
Jay Chokshi8994e392011-09-14 18:20:39 -07004166static struct pm8xxx_led_config pm8921_led_configs[] = {
4167 [0] = {
4168 .id = PM8XXX_ID_LED_0,
Jay Chokshi6238d5e2011-10-24 13:47:19 -07004169 .mode = PM8XXX_LED_MODE_PWM2,
Jay Chokshi8994e392011-09-14 18:20:39 -07004170 .max_current = PM8921_LC_LED_MAX_CURRENT,
Jay Chokshi6238d5e2011-10-24 13:47:19 -07004171 .pwm_channel = 5,
4172 .pwm_period_us = PM8XXX_LED_PWM_PERIOD,
4173 .pwm_duty_cycles = &pm8921_led0_pwm_duty_cycles,
Jay Chokshi8994e392011-09-14 18:20:39 -07004174 },
4175 [1] = {
4176 .id = PM8XXX_ID_LED_1,
Jay Chokshi6238d5e2011-10-24 13:47:19 -07004177 .mode = PM8XXX_LED_MODE_PWM1,
Jay Chokshi8994e392011-09-14 18:20:39 -07004178 .max_current = PM8921_LC_LED_MAX_CURRENT,
Jay Chokshi6238d5e2011-10-24 13:47:19 -07004179 .pwm_channel = 4,
4180 .pwm_period_us = PM8XXX_LED_PWM_PERIOD,
Jay Chokshi8994e392011-09-14 18:20:39 -07004181 },
4182};
4183
4184static struct pm8xxx_led_platform_data pm8xxx_leds_pdata = {
4185 .led_core = &pm8921_led_core_pdata,
4186 .configs = pm8921_led_configs,
4187 .num_configs = ARRAY_SIZE(pm8921_led_configs),
4188};
4189
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07004190static struct pm8921_platform_data pm8921_platform_data __devinitdata = {
4191 .irq_pdata = &pm8xxx_irq_pdata,
4192 .gpio_pdata = &pm8xxx_gpio_pdata,
4193 .mpp_pdata = &pm8xxx_mpp_pdata,
4194 .rtc_pdata = &pm8xxx_rtc_pdata,
4195 .pwrkey_pdata = &pm8xxx_pwrkey_pdata,
4196 .keypad_pdata = &keypad_data,
4197 .misc_pdata = &pm8xxx_misc_pdata,
4198 .regulator_pdatas = msm_pm8921_regulator_pdata,
4199 .charger_pdata = &pm8921_chg_pdata,
4200 .bms_pdata = &pm8921_bms_pdata,
4201 .adc_pdata = &pm8921_adc_pdata,
4202 .leds_pdata = &pm8xxx_leds_pdata,
4203};
4204
4205static struct msm_ssbi_platform_data msm8960_ssbi_pm8921_pdata __devinitdata = {
4206 .controller_type = MSM_SBI_CTRL_PMIC_ARBITER,
4207 .slave = {
4208 .name = "pm8921-core",
4209 .platform_data = &pm8921_platform_data,
4210 },
4211};
4212
Stepan Moskovchenko93d79ec2011-09-21 16:52:16 -07004213#if defined(CONFIG_KS8851) || defined(CONFIG_KS8851_MODULE)
4214static int fpga_init(void)
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07004215{
4216 int ret;
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07004217
4218 ret = gpio_request(FPGA_CS_GPIO, "fpga_cs");
4219 if (ret) {
Stepan Moskovchenko93d79ec2011-09-21 16:52:16 -07004220 pr_err("FPGA CS gpio_request failed: %d\n", ret);
4221 goto fail;
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07004222 }
4223
4224 gpio_direction_output(FPGA_CS_GPIO, 1);
Stepan Moskovchenko93d79ec2011-09-21 16:52:16 -07004225
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07004226 return 0;
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07004227fail:
4228 return ret;
4229}
Stepan Moskovchenko41d168272011-08-09 17:09:42 -07004230#else
Stepan Moskovchenko93d79ec2011-09-21 16:52:16 -07004231static int fpga_init(void)
Stepan Moskovchenko41d168272011-08-09 17:09:42 -07004232{
4233 return 0;
4234}
4235#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07004236
4237static struct msm_cpuidle_state msm_cstates[] __initdata = {
4238 {0, 0, "C0", "WFI",
4239 MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT},
4240
4241 {0, 1, "C1", "STANDALONE_POWER_COLLAPSE",
4242 MSM_PM_SLEEP_MODE_POWER_COLLAPSE_STANDALONE},
4243
4244 {0, 2, "C2", "POWER_COLLAPSE",
4245 MSM_PM_SLEEP_MODE_POWER_COLLAPSE},
4246
4247 {1, 0, "C0", "WFI",
4248 MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT},
4249
4250 {1, 1, "C1", "STANDALONE_POWER_COLLAPSE",
4251 MSM_PM_SLEEP_MODE_POWER_COLLAPSE_STANDALONE},
4252};
4253
4254static struct msm_pm_platform_data msm_pm_data[MSM_PM_SLEEP_MODE_NR * 2] = {
4255 [MSM_PM_MODE(0, MSM_PM_SLEEP_MODE_POWER_COLLAPSE)] = {
4256 .idle_supported = 1,
4257 .suspend_supported = 1,
4258 .idle_enabled = 0,
4259 .suspend_enabled = 0,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07004260 },
4261
4262 [MSM_PM_MODE(0, MSM_PM_SLEEP_MODE_POWER_COLLAPSE_STANDALONE)] = {
4263 .idle_supported = 1,
4264 .suspend_supported = 1,
4265 .idle_enabled = 0,
4266 .suspend_enabled = 0,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07004267 },
4268
4269 [MSM_PM_MODE(0, MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT)] = {
4270 .idle_supported = 1,
4271 .suspend_supported = 1,
4272 .idle_enabled = 1,
4273 .suspend_enabled = 1,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07004274 },
4275
4276 [MSM_PM_MODE(1, MSM_PM_SLEEP_MODE_POWER_COLLAPSE)] = {
4277 .idle_supported = 0,
4278 .suspend_supported = 1,
4279 .idle_enabled = 0,
4280 .suspend_enabled = 0,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07004281 },
4282
4283 [MSM_PM_MODE(1, MSM_PM_SLEEP_MODE_POWER_COLLAPSE_STANDALONE)] = {
4284 .idle_supported = 1,
4285 .suspend_supported = 1,
4286 .idle_enabled = 0,
4287 .suspend_enabled = 0,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07004288 },
4289
4290 [MSM_PM_MODE(1, MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT)] = {
4291 .idle_supported = 1,
4292 .suspend_supported = 0,
4293 .idle_enabled = 1,
4294 .suspend_enabled = 0,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07004295 },
4296};
4297
4298static struct msm_rpmrs_level msm_rpmrs_levels[] __initdata = {
4299 {
4300 MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT,
4301 MSM_RPMRS_LIMITS(ON, ACTIVE, MAX, ACTIVE),
4302 true,
Maheshkumar Sivasubramanianef101a02011-09-19 16:34:30 -06004303 100, 8000, 100000, 1,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07004304 },
4305
4306 {
4307 MSM_PM_SLEEP_MODE_POWER_COLLAPSE_STANDALONE,
4308 MSM_RPMRS_LIMITS(ON, ACTIVE, MAX, ACTIVE),
4309 true,
Maheshkumar Sivasubramanianef101a02011-09-19 16:34:30 -06004310 2000, 6000, 60100000, 3000,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07004311 },
4312
4313 {
4314 MSM_PM_SLEEP_MODE_POWER_COLLAPSE,
4315 MSM_RPMRS_LIMITS(ON, GDHS, MAX, ACTIVE),
4316 false,
Maheshkumar Sivasubramanianef101a02011-09-19 16:34:30 -06004317 4200, 5000, 60350000, 3500,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07004318 },
4319
4320 {
4321 MSM_PM_SLEEP_MODE_POWER_COLLAPSE,
4322 MSM_RPMRS_LIMITS(ON, HSFS_OPEN, MAX, ACTIVE),
4323 false,
Maheshkumar Sivasubramanianef101a02011-09-19 16:34:30 -06004324 6300, 4500, 65350000, 4800,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07004325 },
4326
4327 {
4328 MSM_PM_SLEEP_MODE_POWER_COLLAPSE,
4329 MSM_RPMRS_LIMITS(OFF, GDHS, MAX, ACTIVE),
4330 false,
Maheshkumar Sivasubramanianef101a02011-09-19 16:34:30 -06004331 11700, 2500, 67850000, 5500,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07004332 },
4333
4334 {
4335 MSM_PM_SLEEP_MODE_POWER_COLLAPSE,
4336 MSM_RPMRS_LIMITS(OFF, HSFS_OPEN, MAX, ACTIVE),
4337 false,
Maheshkumar Sivasubramanianef101a02011-09-19 16:34:30 -06004338 13800, 2000, 71850000, 6800,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07004339 },
4340
4341 {
4342 MSM_PM_SLEEP_MODE_POWER_COLLAPSE,
4343 MSM_RPMRS_LIMITS(OFF, HSFS_OPEN, ACTIVE, RET_HIGH),
4344 false,
Maheshkumar Sivasubramanianef101a02011-09-19 16:34:30 -06004345 29700, 500, 75850000, 8800,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07004346 },
4347
4348 {
4349 MSM_PM_SLEEP_MODE_POWER_COLLAPSE,
4350 MSM_RPMRS_LIMITS(OFF, HSFS_OPEN, RET_HIGH, RET_LOW),
4351 false,
Maheshkumar Sivasubramanianef101a02011-09-19 16:34:30 -06004352 29700, 0, 76350000, 9800,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07004353 },
4354};
4355
4356#ifdef CONFIG_I2C
4357#define I2C_SURF 1
4358#define I2C_FFA (1 << 1)
4359#define I2C_RUMI (1 << 2)
4360#define I2C_SIM (1 << 3)
4361#define I2C_FLUID (1 << 4)
Amir Samuelov05f87802011-08-27 18:30:12 +03004362#define I2C_LIQUID (1 << 5)
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07004363
4364struct i2c_registry {
4365 u8 machs;
4366 int bus;
4367 struct i2c_board_info *info;
4368 int len;
4369};
4370
4371#ifdef CONFIG_MSM_CAMERA
4372static struct i2c_board_info msm_camera_boardinfo[] __initdata = {
4373#ifdef CONFIG_IMX074
4374 {
4375 I2C_BOARD_INFO("imx074", 0x1A),
4376 },
4377#endif
4378#ifdef CONFIG_OV2720
4379 {
4380 I2C_BOARD_INFO("ov2720", 0x6C),
4381 },
4382#endif
Kevin Chandfecce22011-07-13 10:52:41 -07004383 {
4384 I2C_BOARD_INFO("qs_mt9p017", 0x6C >> 1),
4385 },
Nishant Pandit474f2252011-07-23 23:17:56 +05304386#ifdef CONFIG_MSM_CAMERA_FLASH_SC628A
4387 {
4388 I2C_BOARD_INFO("sc628a", 0x6E),
4389 },
4390#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07004391};
4392#endif
4393
4394/* Sensors DSPS platform data */
4395#ifdef CONFIG_MSM_DSPS
4396#define DSPS_PIL_GENERIC_NAME "dsps"
4397#endif /* CONFIG_MSM_DSPS */
4398
4399static void __init msm8960_init_dsps(void)
4400{
4401#ifdef CONFIG_MSM_DSPS
4402 struct msm_dsps_platform_data *pdata =
4403 msm_dsps_device.dev.platform_data;
4404 pdata->pil_name = DSPS_PIL_GENERIC_NAME;
4405 pdata->gpios = NULL;
4406 pdata->gpios_num = 0;
4407
4408 platform_device_register(&msm_dsps_device);
4409#endif /* CONFIG_MSM_DSPS */
4410}
4411
Amir Samuelov5137e392011-09-21 17:31:25 +03004412#ifdef CONFIG_ISL9519_CHARGER
4413static struct isl_platform_data isl_data __initdata = {
4414 .valid_n_gpio = 0, /* Not required when notify-by-pmic */
4415 .chg_detection_config = NULL, /* Not required when notify-by-pmic */
4416 .max_system_voltage = 4200,
4417 .min_system_voltage = 3200,
4418 .chgcurrent = 1000, /* 1900, */
4419 .term_current = 400, /* Need fine tuning */
4420 .input_current = 2048,
4421};
4422
4423static struct i2c_board_info isl_charger_i2c_info[] __initdata = {
4424 {
4425 I2C_BOARD_INFO("isl9519q", 0x9),
4426 .irq = 0, /* Not required when notify-by-pmic */
4427 .platform_data = &isl_data,
4428 },
4429};
4430#endif /* CONFIG_ISL9519_CHARGER */
4431
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07004432static struct i2c_registry msm8960_i2c_devices[] __initdata = {
4433#ifdef CONFIG_MSM_CAMERA
4434 {
Amir Samuelov05f87802011-08-27 18:30:12 +03004435 I2C_SURF | I2C_FFA | I2C_FLUID | I2C_LIQUID | I2C_RUMI,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07004436 MSM_8960_GSBI4_QUP_I2C_BUS_ID,
4437 msm_camera_boardinfo,
4438 ARRAY_SIZE(msm_camera_boardinfo),
4439 },
4440#endif
Amir Samuelov5137e392011-09-21 17:31:25 +03004441#ifdef CONFIG_ISL9519_CHARGER
4442 {
4443 I2C_LIQUID,
4444 MSM_8960_GSBI10_QUP_I2C_BUS_ID,
4445 isl_charger_i2c_info,
4446 ARRAY_SIZE(isl_charger_i2c_info),
4447 },
4448#endif /* CONFIG_ISL9519_CHARGER */
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07004449 {
4450 I2C_SURF | I2C_FFA | I2C_FLUID,
4451 MSM_8960_GSBI3_QUP_I2C_BUS_ID,
4452 cyttsp_info,
4453 ARRAY_SIZE(cyttsp_info),
Rohit Vaswanicd2a59b2011-07-19 12:00:48 -07004454 },
Mohan Pallaka50837382011-09-07 11:00:57 +05304455 {
4456 I2C_LIQUID,
4457 MSM_8960_GSBI3_QUP_I2C_BUS_ID,
4458 mxt_device_info,
4459 ARRAY_SIZE(mxt_device_info),
4460 },
4461
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07004462};
4463#endif /* CONFIG_I2C */
4464
4465static void __init register_i2c_devices(void)
4466{
4467#ifdef CONFIG_I2C
4468 u8 mach_mask = 0;
4469 int i;
4470
4471 /* Build the matching 'supported_machs' bitmask */
4472 if (machine_is_msm8960_cdp())
4473 mach_mask = I2C_SURF;
4474 else if (machine_is_msm8960_rumi3())
4475 mach_mask = I2C_RUMI;
4476 else if (machine_is_msm8960_sim())
4477 mach_mask = I2C_SIM;
Amy Maloche2d028032011-07-20 14:08:06 -07004478 else if (machine_is_msm8960_fluid())
4479 mach_mask = I2C_FLUID;
Amir Samuelov05f87802011-08-27 18:30:12 +03004480 else if (machine_is_msm8960_liquid())
4481 mach_mask = I2C_LIQUID;
Amy Maloche1b0663f2011-08-02 16:46:22 -07004482 else if (machine_is_msm8960_mtp())
4483 mach_mask = I2C_FFA;
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07004484 else
4485 pr_err("unmatched machine ID in register_i2c_devices\n");
4486
4487 /* Run the array and install devices as appropriate */
4488 for (i = 0; i < ARRAY_SIZE(msm8960_i2c_devices); ++i) {
4489 if (msm8960_i2c_devices[i].machs & mach_mask)
4490 i2c_register_board_info(msm8960_i2c_devices[i].bus,
4491 msm8960_i2c_devices[i].info,
4492 msm8960_i2c_devices[i].len);
4493 }
4494#endif
4495}
4496
Stepan Moskovchenkod056fca2011-01-27 12:12:07 -08004497static void __init msm8960_sim_init(void)
4498{
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07004499 BUG_ON(msm_rpm_init(&msm_rpm_data));
4500 BUG_ON(msm_rpmrs_levels_init(msm_rpmrs_levels,
4501 ARRAY_SIZE(msm_rpmrs_levels)));
4502 regulator_suppress_info_printing();
David Collins26f05562011-06-20 09:56:28 -07004503 platform_device_register(&msm8960_device_rpm_regulator);
Stephen Boydbb600ae2011-08-02 20:11:40 -07004504 msm_clock_init(&msm8960_clock_init_data);
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07004505 msm8960_device_ssbi_pm8921.dev.platform_data =
4506 &msm8960_ssbi_pm8921_pdata;
4507 pm8921_platform_data.num_regulators = msm_pm8921_regulator_pdata_len;
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07004508
4509 /* Simulator supports a QWERTY keypad */
4510 pm8921_platform_data.keypad_pdata = &keypad_data_sim;
4511
Stepan Moskovchenko14aa6492011-08-08 15:15:01 -07004512 msm8960_device_otg.dev.platform_data = &msm_otg_pdata;
4513 msm8960_device_gadget_peripheral.dev.parent = &msm8960_device_otg.dev;
4514 msm_device_hsusb_host.dev.parent = &msm8960_device_otg.dev;
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07004515 gpiomux_init();
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07004516 msm8960_i2c_init();
4517 msm_spm_init(msm_spm_data, ARRAY_SIZE(msm_spm_data));
4518 msm_spm_l2_init(msm_spm_l2_data);
4519 msm8960_init_buses();
4520 platform_add_devices(common_devices, ARRAY_SIZE(common_devices));
4521 pm8921_gpio_mpp_init();
Stepan Moskovchenkod056fca2011-01-27 12:12:07 -08004522 platform_add_devices(sim_devices, ARRAY_SIZE(sim_devices));
Matt Wagantallec57f062011-08-16 23:54:46 -07004523 acpuclk_init(&acpuclk_8960_soc_data);
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07004524
4525 msm8960_device_qup_spi_gsbi1.dev.platform_data =
4526 &msm8960_qup_spi_gsbi1_pdata;
4527 spi_register_board_info(spi_board_info, ARRAY_SIZE(spi_board_info));
4528
4529 msm8960_init_mmc();
4530 msm_fb_add_devices();
4531 slim_register_board_info(msm_slim_devices,
4532 ARRAY_SIZE(msm_slim_devices));
4533 msm_pm_set_platform_data(msm_pm_data, ARRAY_SIZE(msm_pm_data));
4534 msm_pm_set_rpm_wakeup_irq(RPM_APCC_CPU0_WAKE_UP_IRQ);
4535 msm_cpuidle_set_states(msm_cstates, ARRAY_SIZE(msm_cstates),
4536 msm_pm_data);
Maheshkumar Sivasubramanian8ccc16e2011-10-25 15:59:57 -06004537 BUG_ON(msm_pm_boot_init(MSM_PM_BOOT_CONFIG_TZ, NULL));
Stepan Moskovchenkod056fca2011-01-27 12:12:07 -08004538}
4539
4540static void __init msm8960_rumi3_init(void)
4541{
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07004542 BUG_ON(msm_rpm_init(&msm_rpm_data));
4543 BUG_ON(msm_rpmrs_levels_init(msm_rpmrs_levels,
4544 ARRAY_SIZE(msm_rpmrs_levels)));
4545 regulator_suppress_info_printing();
David Collins26f05562011-06-20 09:56:28 -07004546 platform_device_register(&msm8960_device_rpm_regulator);
Stephen Boydbb600ae2011-08-02 20:11:40 -07004547 msm_clock_init(&msm8960_dummy_clock_init_data);
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07004548 gpiomux_init();
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07004549 msm8960_device_ssbi_pm8921.dev.platform_data =
4550 &msm8960_ssbi_pm8921_pdata;
4551 pm8921_platform_data.num_regulators = msm_pm8921_regulator_pdata_len;
4552 msm8960_device_qup_spi_gsbi1.dev.platform_data =
4553 &msm8960_qup_spi_gsbi1_pdata;
4554 spi_register_board_info(spi_board_info, ARRAY_SIZE(spi_board_info));
4555 msm8960_i2c_init();
4556 msm_spm_init(msm_spm_data, ARRAY_SIZE(msm_spm_data));
4557 msm_spm_l2_init(msm_spm_l2_data);
4558 platform_add_devices(common_devices, ARRAY_SIZE(common_devices));
4559 pm8921_gpio_mpp_init();
Stepan Moskovchenkod056fca2011-01-27 12:12:07 -08004560 platform_add_devices(rumi3_devices, ARRAY_SIZE(rumi3_devices));
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07004561 msm8960_init_mmc();
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07004562 register_i2c_devices();
4563 msm_fb_add_devices();
4564 slim_register_board_info(msm_slim_devices,
4565 ARRAY_SIZE(msm_slim_devices));
4566 msm_pm_set_platform_data(msm_pm_data, ARRAY_SIZE(msm_pm_data));
4567 msm_pm_set_rpm_wakeup_irq(RPM_APCC_CPU0_WAKE_UP_IRQ);
4568 msm_cpuidle_set_states(msm_cstates, ARRAY_SIZE(msm_cstates),
4569 msm_pm_data);
Maheshkumar Sivasubramanian8ccc16e2011-10-25 15:59:57 -06004570 BUG_ON(msm_pm_boot_init(MSM_PM_BOOT_CONFIG_TZ, NULL));
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07004571}
4572
4573static void __init msm8960_cdp_init(void)
4574{
Naveen Ramaraj76483ad2011-09-06 14:25:44 -07004575 if (meminfo_init(SYS_MEMORY, SZ_256M) < 0)
4576 pr_err("meminfo_init() failed!\n");
4577
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07004578 BUG_ON(msm_rpm_init(&msm_rpm_data));
4579 BUG_ON(msm_rpmrs_levels_init(msm_rpmrs_levels,
4580 ARRAY_SIZE(msm_rpmrs_levels)));
Abhijeet Dharmapurikar6d565fd2011-09-15 18:49:56 -07004581
4582 pmic_reset_irq = PM8921_IRQ_BASE + PM8921_RESOUT_IRQ;
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07004583 regulator_suppress_info_printing();
4584 if (msm_xo_init())
4585 pr_err("Failed to initialize XO votes\n");
David Collins26f05562011-06-20 09:56:28 -07004586 platform_device_register(&msm8960_device_rpm_regulator);
Stephen Boydbb600ae2011-08-02 20:11:40 -07004587 msm_clock_init(&msm8960_clock_init_data);
Stepan Moskovchenko14aa6492011-08-08 15:15:01 -07004588 msm8960_device_otg.dev.platform_data = &msm_otg_pdata;
4589 msm8960_device_gadget_peripheral.dev.parent = &msm8960_device_otg.dev;
4590 msm_device_hsusb_host.dev.parent = &msm8960_device_otg.dev;
Vijayavardhan Vennapusae3316a12011-10-15 06:05:17 +05304591 msm_device_hsic_host.dev.platform_data = &msm_hsic_pdata;
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07004592 gpiomux_init();
Stepan Moskovchenko93d79ec2011-09-21 16:52:16 -07004593 if (machine_is_msm8960_cdp())
4594 fpga_init();
Mohan Pallaka002e9e02011-08-05 11:23:22 +05304595 if (machine_is_msm8960_liquid())
4596 pm8921_platform_data.keypad_pdata = &keypad_data_liquid;
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07004597 msm8960_device_qup_spi_gsbi1.dev.platform_data =
4598 &msm8960_qup_spi_gsbi1_pdata;
4599 spi_register_board_info(spi_board_info, ARRAY_SIZE(spi_board_info));
4600 msm8960_device_ssbi_pm8921.dev.platform_data =
4601 &msm8960_ssbi_pm8921_pdata;
4602 pm8921_platform_data.num_regulators = msm_pm8921_regulator_pdata_len;
4603 msm8960_i2c_init();
Lucille Sylvester34ec3692011-08-16 16:28:04 -06004604 msm8960_gfx_init();
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07004605 msm_spm_init(msm_spm_data, ARRAY_SIZE(msm_spm_data));
4606 msm_spm_l2_init(msm_spm_l2_data);
4607 msm8960_init_buses();
4608 platform_add_devices(msm_footswitch_devices,
4609 msm_num_footswitch_devices);
David Collinsb10be1d2011-09-02 10:29:31 -07004610 if (machine_is_msm8960_liquid())
4611 platform_device_register(&msm8960_device_ext_3p3v_vreg);
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07004612 platform_add_devices(common_devices, ARRAY_SIZE(common_devices));
4613 pm8921_gpio_mpp_init();
4614 platform_add_devices(cdp_devices, ARRAY_SIZE(cdp_devices));
4615 msm8960_init_cam();
4616 msm8960_init_mmc();
Matt Wagantallec57f062011-08-16 23:54:46 -07004617 acpuclk_init(&acpuclk_8960_soc_data);
Mohan Pallaka50837382011-09-07 11:00:57 +05304618 if (machine_is_msm8960_liquid())
4619 mxt_init_hw_liquid();
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07004620 register_i2c_devices();
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07004621 msm_fb_add_devices();
4622 slim_register_board_info(msm_slim_devices,
4623 ARRAY_SIZE(msm_slim_devices));
4624 msm8960_init_dsps();
4625 msm_pm_set_platform_data(msm_pm_data, ARRAY_SIZE(msm_pm_data));
4626 msm_pm_set_rpm_wakeup_irq(RPM_APCC_CPU0_WAKE_UP_IRQ);
4627 msm_cpuidle_set_states(msm_cstates, ARRAY_SIZE(msm_cstates),
4628 msm_pm_data);
Larry Bassela7eadea2011-07-14 10:46:00 -07004629 change_memory_power = &msm8960_change_memory_power;
Maheshkumar Sivasubramanian8ccc16e2011-10-25 15:59:57 -06004630 BUG_ON(msm_pm_boot_init(MSM_PM_BOOT_CONFIG_TZ, NULL));
Stepan Moskovchenkod056fca2011-01-27 12:12:07 -08004631}
4632
Stepan Moskovchenkof441ca22010-12-01 19:31:16 -08004633MACHINE_START(MSM8960_SIM, "QCT MSM8960 SIMULATOR")
4634 .map_io = msm8960_map_io,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07004635 .reserve = msm8960_reserve,
Stepan Moskovchenkof441ca22010-12-01 19:31:16 -08004636 .init_irq = msm8960_init_irq,
4637 .timer = &msm_timer,
Stepan Moskovchenkod056fca2011-01-27 12:12:07 -08004638 .init_machine = msm8960_sim_init,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07004639 .init_early = msm8960_allocate_memory_regions,
Larry Basselb830e182011-10-14 10:46:55 -07004640 .init_very_early = msm8960_early_memory,
Stepan Moskovchenkof441ca22010-12-01 19:31:16 -08004641MACHINE_END
Stepan Moskovchenko50ede4e2010-12-13 18:12:19 -08004642
4643MACHINE_START(MSM8960_RUMI3, "QCT MSM8960 RUMI3")
4644 .map_io = msm8960_map_io,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07004645 .reserve = msm8960_reserve,
Stepan Moskovchenko50ede4e2010-12-13 18:12:19 -08004646 .init_irq = msm8960_init_irq,
4647 .timer = &msm_timer,
Stepan Moskovchenkod056fca2011-01-27 12:12:07 -08004648 .init_machine = msm8960_rumi3_init,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07004649 .init_early = msm8960_allocate_memory_regions,
Larry Basselb830e182011-10-14 10:46:55 -07004650 .init_very_early = msm8960_early_memory,
Stepan Moskovchenko50ede4e2010-12-13 18:12:19 -08004651MACHINE_END
4652
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07004653MACHINE_START(MSM8960_CDP, "QCT MSM8960 CDP")
4654 .map_io = msm8960_map_io,
4655 .reserve = msm8960_reserve,
4656 .init_irq = msm8960_init_irq,
4657 .timer = &msm_timer,
4658 .init_machine = msm8960_cdp_init,
4659 .init_early = msm8960_allocate_memory_regions,
Larry Basselb830e182011-10-14 10:46:55 -07004660 .init_very_early = msm8960_early_memory,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07004661MACHINE_END
4662
4663MACHINE_START(MSM8960_MTP, "QCT MSM8960 MTP")
4664 .map_io = msm8960_map_io,
4665 .reserve = msm8960_reserve,
4666 .init_irq = msm8960_init_irq,
4667 .timer = &msm_timer,
4668 .init_machine = msm8960_cdp_init,
4669 .init_early = msm8960_allocate_memory_regions,
Larry Basselb830e182011-10-14 10:46:55 -07004670 .init_very_early = msm8960_early_memory,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07004671MACHINE_END
4672
4673MACHINE_START(MSM8960_FLUID, "QCT MSM8960 FLUID")
4674 .map_io = msm8960_map_io,
4675 .reserve = msm8960_reserve,
4676 .init_irq = msm8960_init_irq,
4677 .timer = &msm_timer,
4678 .init_machine = msm8960_cdp_init,
4679 .init_early = msm8960_allocate_memory_regions,
Larry Basselb830e182011-10-14 10:46:55 -07004680 .init_very_early = msm8960_early_memory,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07004681MACHINE_END
Amir Samuelov0d1f8ae2011-07-28 11:13:58 +03004682
4683MACHINE_START(MSM8960_LIQUID, "QCT MSM8960 LIQUID")
4684 .map_io = msm8960_map_io,
4685 .reserve = msm8960_reserve,
4686 .init_irq = msm8960_init_irq,
4687 .timer = &msm_timer,
4688 .init_machine = msm8960_cdp_init,
4689 .init_early = msm8960_allocate_memory_regions,
Larry Basselb830e182011-10-14 10:46:55 -07004690 .init_very_early = msm8960_early_memory,
Amir Samuelov0d1f8ae2011-07-28 11:13:58 +03004691MACHINE_END
Stepan Moskovchenkof4fdfe52011-10-18 17:28:58 -07004692
4693#ifdef CONFIG_ARCH_MSM8930
4694MACHINE_START(MSM8930_CDP, "QCT MSM8930 CDP")
4695 .map_io = msm8930_map_io,
4696 .reserve = msm8960_reserve,
4697 .init_irq = msm8960_init_irq,
4698 .timer = &msm_timer,
4699 .init_machine = msm8960_cdp_init,
4700 .init_early = msm8960_allocate_memory_regions,
Stepan Moskovchenko0ae2e722011-11-01 13:24:41 -07004701 .init_very_early = msm8960_early_memory,
Stepan Moskovchenkof4fdfe52011-10-18 17:28:58 -07004702MACHINE_END
4703
4704MACHINE_START(MSM8930_MTP, "QCT MSM8930 MTP")
4705 .map_io = msm8930_map_io,
4706 .reserve = msm8960_reserve,
4707 .init_irq = msm8960_init_irq,
4708 .timer = &msm_timer,
4709 .init_machine = msm8960_cdp_init,
4710 .init_early = msm8960_allocate_memory_regions,
Stepan Moskovchenko0ae2e722011-11-01 13:24:41 -07004711 .init_very_early = msm8960_early_memory,
Stepan Moskovchenkof4fdfe52011-10-18 17:28:58 -07004712MACHINE_END
4713
4714MACHINE_START(MSM8930_FLUID, "QCT MSM8930 FLUID")
4715 .map_io = msm8930_map_io,
4716 .reserve = msm8960_reserve,
4717 .init_irq = msm8960_init_irq,
4718 .timer = &msm_timer,
4719 .init_machine = msm8960_cdp_init,
4720 .init_early = msm8960_allocate_memory_regions,
Stepan Moskovchenko0ae2e722011-11-01 13:24:41 -07004721 .init_very_early = msm8960_early_memory,
Stepan Moskovchenkof4fdfe52011-10-18 17:28:58 -07004722MACHINE_END
4723#endif