blob: 3412539568cf26d6b289d7cd0581d63259c28899 [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
Amir Samuelovf9b0c3c2011-11-03 18:55:53 +0200157#define PM8XXX_GPIO_OUTPUT_VIN(_gpio, _val, _vin) \
158 PM8XXX_GPIO_INIT(_gpio, PM_GPIO_DIR_OUT, PM_GPIO_OUT_BUF_CMOS, _val, \
159 PM_GPIO_PULL_NO, _vin, \
160 PM_GPIO_STRENGTH_HIGH, \
161 PM_GPIO_FUNC_NORMAL, 0, 0)
162
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700163/* Initial PM8921 GPIO configurations */
164static struct pm8xxx_gpio_init pm8921_gpios[] __initdata = {
165 PM8XXX_GPIO_DISABLE(6), /* Disable unused */
166 PM8XXX_GPIO_DISABLE(7), /* Disable NFC */
167 PM8XXX_GPIO_INPUT(16, PM_GPIO_PULL_UP_30), /* SD_CARD_WP */
Amir Samuelov0c7270f2011-09-07 03:13:47 +0300168 /* External regulator shared by display and touchscreen on LiQUID */
169 PM8XXX_GPIO_OUTPUT(17, 0), /* DISP 3.3 V Boost */
Amir Samuelovf9b0c3c2011-11-03 18:55:53 +0200170 PM8XXX_GPIO_OUTPUT_VIN(21, 1, PM_GPIO_VIN_VPH), /* Backlight Enable */
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700171 PM8XXX_GPIO_DISABLE(22), /* Disable NFC */
Nagamalleswararao Ganjieac5dfa2011-07-23 17:31:16 -0700172 PM8XXX_GPIO_OUTPUT_FUNC(24, 0, PM_GPIO_FUNC_2), /* Bl: Off, PWM mode */
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700173 PM8XXX_GPIO_INPUT(26, PM_GPIO_PULL_UP_30), /* SD_CARD_DET_N */
Nagamalleswararao Ganjica0adc02011-09-22 20:35:53 -0700174 PM8XXX_GPIO_OUTPUT(43, PM_GPIO_PULL_UP_30), /* DISP_RESET_N */
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700175};
176
177/* Initial PM8921 MPP configurations */
178static struct pm8xxx_mpp_init pm8921_mpps[] __initdata = {
179 /* External 5V regulator enable; shared by HDMI and USB_OTG switches. */
180 PM8XXX_MPP_INIT(7, D_INPUT, PM8921_MPP_DIG_LEVEL_VPH, DIN_TO_INT),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700181 PM8XXX_MPP_INIT(PM8921_AMUX_MPP_8, A_INPUT, PM8XXX_MPP_AIN_AMUX_CH8,
182 DOUT_CTRL_LOW),
183};
184
185static void __init pm8921_gpio_mpp_init(void)
186{
187 int i, rc;
188
189 for (i = 0; i < ARRAY_SIZE(pm8921_gpios); i++) {
190 rc = pm8xxx_gpio_config(pm8921_gpios[i].gpio,
191 &pm8921_gpios[i].config);
192 if (rc) {
193 pr_err("%s: pm8xxx_gpio_config: rc=%d\n", __func__, rc);
194 break;
195 }
196 }
197
198 for (i = 0; i < ARRAY_SIZE(pm8921_mpps); i++) {
199 rc = pm8xxx_mpp_config(pm8921_mpps[i].mpp,
200 &pm8921_mpps[i].config);
201 if (rc) {
202 pr_err("%s: pm8xxx_mpp_config: rc=%d\n", __func__, rc);
203 break;
204 }
205 }
206}
207
208#define FPGA_CS_GPIO 14
209#define KS8851_RST_GPIO 89
210#define KS8851_IRQ_GPIO 90
211
Rohit Vaswanicd2a59b2011-07-19 12:00:48 -0700212#if defined(CONFIG_GPIO_SX150X) || defined(CONFIG_GPIO_SX150X_MODULE)
213enum {
Abhijeet Dharmapurikar0fda5602011-08-17 18:00:55 -0700214 GPIO_EXPANDER_IRQ_BASE = (PM8921_IRQ_BASE + PM8921_NR_IRQS),
Rohit Vaswanicd2a59b2011-07-19 12:00:48 -0700215 GPIO_EXPANDER_GPIO_BASE = (PM8921_MPP_BASE + PM8921_NR_MPPS),
216 /* CAM Expander */
217 GPIO_CAM_EXPANDER_BASE = GPIO_EXPANDER_GPIO_BASE,
218 GPIO_CAM_GP_STROBE_READY = GPIO_CAM_EXPANDER_BASE,
219 GPIO_CAM_GP_AFBUSY,
220 GPIO_CAM_GP_STROBE_CE,
221 GPIO_CAM_GP_CAM1MP_XCLR,
222 GPIO_CAM_GP_CAMIF_RESET_N,
223 GPIO_CAM_GP_XMT_FLASH_INT,
224 GPIO_CAM_GP_LED_EN1,
225 GPIO_CAM_GP_LED_EN2,
226
227};
228#endif
229
Harini Jayaraman608d0462011-08-09 19:10:03 -0600230/* The SPI configurations apply to GSBI 1*/
231static struct gpiomux_setting spi_active = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700232 .func = GPIOMUX_FUNC_1,
Stepan Moskovchenkoa69f9052011-10-26 17:47:18 -0700233 .drv = GPIOMUX_DRV_12MA,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700234 .pull = GPIOMUX_PULL_NONE,
235};
236
Harini Jayaraman608d0462011-08-09 19:10:03 -0600237static struct gpiomux_setting spi_suspended_config = {
238 .func = GPIOMUX_FUNC_GPIO,
239 .drv = GPIOMUX_DRV_2MA,
240 .pull = GPIOMUX_PULL_DOWN,
241};
242
Mohan Pallakafd9a8f12011-09-23 11:50:38 +0530243static struct gpiomux_setting gsbi3_suspended_cfg = {
244 .func = GPIOMUX_FUNC_1,
245 .drv = GPIOMUX_DRV_2MA,
246 .pull = GPIOMUX_PULL_KEEPER,
247};
248
249static struct gpiomux_setting gsbi3_active_cfg = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700250 .func = GPIOMUX_FUNC_1,
251 .drv = GPIOMUX_DRV_8MA,
252 .pull = GPIOMUX_PULL_NONE,
253};
254
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700255static struct gpiomux_setting gsbi5 = {
256 .func = GPIOMUX_FUNC_1,
257 .drv = GPIOMUX_DRV_8MA,
258 .pull = GPIOMUX_PULL_NONE,
259};
260
261static struct gpiomux_setting gsbi10 = {
262 .func = GPIOMUX_FUNC_2,
263 .drv = GPIOMUX_DRV_8MA,
264 .pull = GPIOMUX_PULL_NONE,
265};
266
267static struct gpiomux_setting gsbi12 = {
268 .func = GPIOMUX_FUNC_1,
269 .drv = GPIOMUX_DRV_8MA,
270 .pull = GPIOMUX_PULL_NONE,
271};
272
273static struct gpiomux_setting cdc_mclk = {
274 .func = GPIOMUX_FUNC_1,
275 .drv = GPIOMUX_DRV_8MA,
276 .pull = GPIOMUX_PULL_NONE,
277};
278
Bhalchandra Gajare0e795c42011-08-15 18:10:30 -0700279static struct gpiomux_setting audio_auxpcm[] = {
280 /* Suspended state */
281 {
282 .func = GPIOMUX_FUNC_GPIO,
283 .drv = GPIOMUX_DRV_2MA,
284 .pull = GPIOMUX_PULL_NONE,
285 },
286 /* Active state */
287 {
288 .func = GPIOMUX_FUNC_1,
289 .drv = GPIOMUX_DRV_2MA,
290 .pull = GPIOMUX_PULL_NONE,
291 },
292};
293
Stepan Moskovchenko93d79ec2011-09-21 16:52:16 -0700294#if defined(CONFIG_KS8851) || defined(CONFIG_KS8851_MODULE)
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700295static struct gpiomux_setting gpio_eth_config = {
296 .pull = GPIOMUX_PULL_NONE,
297 .drv = GPIOMUX_DRV_8MA,
298 .func = GPIOMUX_FUNC_GPIO,
299};
Stepan Moskovchenko41d168272011-08-09 17:09:42 -0700300#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700301
302static struct gpiomux_setting slimbus = {
303 .func = GPIOMUX_FUNC_1,
304 .drv = GPIOMUX_DRV_8MA,
305 .pull = GPIOMUX_PULL_KEEPER,
306};
307
308struct msm_gpiomux_config msm8960_gpiomux_configs[NR_GPIO_IRQS] = {
Stepan Moskovchenko93d79ec2011-09-21 16:52:16 -0700309#if defined(CONFIG_KS8851) || defined(CONFIG_KS8851_MODULE)
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700310 {
311 .gpio = KS8851_IRQ_GPIO,
312 .settings = {
313 [GPIOMUX_SUSPENDED] = &gpio_eth_config,
314 }
315 },
316 {
317 .gpio = KS8851_RST_GPIO,
318 .settings = {
319 [GPIOMUX_SUSPENDED] = &gpio_eth_config,
320 }
321 },
322 {
323 .gpio = FPGA_CS_GPIO,
324 .settings = {
325 [GPIOMUX_SUSPENDED] = &gpio_eth_config,
326 }
327 },
Stepan Moskovchenko41d168272011-08-09 17:09:42 -0700328#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700329};
330
331static struct msm_gpiomux_config msm8960_gsbi_configs[] __initdata = {
332 {
333 .gpio = 6, /* GSBI1 QUP SPI_DATA_MOSI */
334 .settings = {
Harini Jayaraman608d0462011-08-09 19:10:03 -0600335 [GPIOMUX_SUSPENDED] = &spi_suspended_config,
336 [GPIOMUX_ACTIVE] = &spi_active,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700337 },
338 },
339 {
340 .gpio = 7, /* GSBI1 QUP SPI_DATA_MISO */
341 .settings = {
Harini Jayaraman608d0462011-08-09 19:10:03 -0600342 [GPIOMUX_SUSPENDED] = &spi_suspended_config,
343 [GPIOMUX_ACTIVE] = &spi_active,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700344 },
345 },
346 {
347 .gpio = 8, /* GSBI1 QUP SPI_CS_N */
348 .settings = {
Harini Jayaraman608d0462011-08-09 19:10:03 -0600349 [GPIOMUX_SUSPENDED] = &spi_suspended_config,
350 [GPIOMUX_ACTIVE] = &spi_active,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700351 },
352 },
353 {
354 .gpio = 9, /* GSBI1 QUP SPI_CLK */
355 .settings = {
Harini Jayaraman608d0462011-08-09 19:10:03 -0600356 [GPIOMUX_SUSPENDED] = &spi_suspended_config,
357 [GPIOMUX_ACTIVE] = &spi_active,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700358 },
359 },
360 {
361 .gpio = 16, /* GSBI3 I2C QUP SDA */
362 .settings = {
Mohan Pallakafd9a8f12011-09-23 11:50:38 +0530363 [GPIOMUX_SUSPENDED] = &gsbi3_suspended_cfg,
364 [GPIOMUX_ACTIVE] = &gsbi3_active_cfg,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700365 },
366 },
367 {
368 .gpio = 17, /* GSBI3 I2C QUP SCL */
369 .settings = {
Mohan Pallakafd9a8f12011-09-23 11:50:38 +0530370 [GPIOMUX_SUSPENDED] = &gsbi3_suspended_cfg,
371 [GPIOMUX_ACTIVE] = &gsbi3_active_cfg,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700372 },
373 },
374 {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700375 .gpio = 22, /* GSBI5 UART2 */
376 .settings = {
377 [GPIOMUX_SUSPENDED] = &gsbi5,
378 },
379 },
380 {
381 .gpio = 23, /* GSBI5 UART2 */
382 .settings = {
383 [GPIOMUX_SUSPENDED] = &gsbi5,
384 },
385 },
386 {
387 .gpio = 24, /* GSBI5 UART2 */
388 .settings = {
389 [GPIOMUX_SUSPENDED] = &gsbi5,
390 },
391 },
392 {
393 .gpio = 25, /* GSBI5 UART2 */
394 .settings = {
395 [GPIOMUX_SUSPENDED] = &gsbi5,
396 },
397 },
398 {
399 .gpio = 44, /* GSBI12 I2C QUP SDA */
400 .settings = {
401 [GPIOMUX_SUSPENDED] = &gsbi12,
402 },
403 },
404 {
405 .gpio = 45, /* GSBI12 I2C QUP SCL */
406 .settings = {
407 [GPIOMUX_SUSPENDED] = &gsbi12,
408 },
409 },
410 {
411 .gpio = 73, /* GSBI10 I2C QUP SDA */
412 .settings = {
413 [GPIOMUX_SUSPENDED] = &gsbi10,
414 },
415 },
416 {
417 .gpio = 74, /* GSBI10 I2C QUP SCL */
418 .settings = {
419 [GPIOMUX_SUSPENDED] = &gsbi10,
420 },
421 },
422};
423
424static struct msm_gpiomux_config msm8960_slimbus_config[] __initdata = {
425 {
426 .gpio = 60, /* slimbus data */
427 .settings = {
428 [GPIOMUX_SUSPENDED] = &slimbus,
429 },
430 },
431 {
432 .gpio = 61, /* slimbus clk */
433 .settings = {
434 [GPIOMUX_SUSPENDED] = &slimbus,
435 },
436 },
437};
438
439static struct msm_gpiomux_config msm8960_audio_codec_configs[] __initdata = {
440 {
441 .gpio = 59,
442 .settings = {
443 [GPIOMUX_SUSPENDED] = &cdc_mclk,
444 },
445 },
446};
Bhalchandra Gajare0e795c42011-08-15 18:10:30 -0700447
448static struct msm_gpiomux_config msm8960_audio_auxpcm_configs[] __initdata = {
449 {
450 .gpio = 63,
451 .settings = {
452 [GPIOMUX_SUSPENDED] = &audio_auxpcm[0],
453 [GPIOMUX_ACTIVE] = &audio_auxpcm[1],
454 },
455 },
456 {
457 .gpio = 64,
458 .settings = {
459 [GPIOMUX_SUSPENDED] = &audio_auxpcm[0],
460 [GPIOMUX_ACTIVE] = &audio_auxpcm[1],
461 },
462 },
463 {
464 .gpio = 65,
465 .settings = {
466 [GPIOMUX_SUSPENDED] = &audio_auxpcm[0],
467 [GPIOMUX_ACTIVE] = &audio_auxpcm[1],
468 },
469 },
470 {
471 .gpio = 66,
472 .settings = {
473 [GPIOMUX_SUSPENDED] = &audio_auxpcm[0],
474 [GPIOMUX_ACTIVE] = &audio_auxpcm[1],
475 },
476 },
477};
478
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700479static struct gpiomux_setting wcnss_5wire_suspend_cfg = {
480 .func = GPIOMUX_FUNC_GPIO,
481 .drv = GPIOMUX_DRV_2MA,
Ankur Nandwaniad0d9ac2011-09-26 11:49:25 -0700482 .pull = GPIOMUX_PULL_UP,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700483};
484
485static struct gpiomux_setting wcnss_5wire_active_cfg = {
486 .func = GPIOMUX_FUNC_1,
487 .drv = GPIOMUX_DRV_6MA,
488 .pull = GPIOMUX_PULL_DOWN,
489};
490
491static struct msm_gpiomux_config wcnss_5wire_interface[] = {
492 {
493 .gpio = 84,
494 .settings = {
495 [GPIOMUX_ACTIVE] = &wcnss_5wire_active_cfg,
496 [GPIOMUX_SUSPENDED] = &wcnss_5wire_suspend_cfg,
497 },
498 },
499 {
500 .gpio = 85,
501 .settings = {
502 [GPIOMUX_ACTIVE] = &wcnss_5wire_active_cfg,
503 [GPIOMUX_SUSPENDED] = &wcnss_5wire_suspend_cfg,
504 },
505 },
506 {
507 .gpio = 86,
508 .settings = {
509 [GPIOMUX_ACTIVE] = &wcnss_5wire_active_cfg,
510 [GPIOMUX_SUSPENDED] = &wcnss_5wire_suspend_cfg,
511 },
512 },
513 {
514 .gpio = 87,
515 .settings = {
516 [GPIOMUX_ACTIVE] = &wcnss_5wire_active_cfg,
517 [GPIOMUX_SUSPENDED] = &wcnss_5wire_suspend_cfg,
518 },
519 },
520 {
521 .gpio = 88,
522 .settings = {
523 [GPIOMUX_ACTIVE] = &wcnss_5wire_active_cfg,
524 [GPIOMUX_SUSPENDED] = &wcnss_5wire_suspend_cfg,
525 },
526 },
527};
Nishant Pandit24153d82011-08-27 16:05:13 +0530528static struct gpiomux_setting cam_settings[] = {
Nishant Pandit474f2252011-07-23 23:17:56 +0530529 {
530 .func = GPIOMUX_FUNC_GPIO, /*suspend*/
531 .drv = GPIOMUX_DRV_2MA,
532 .pull = GPIOMUX_PULL_DOWN,
533 },
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700534
Nishant Pandit474f2252011-07-23 23:17:56 +0530535 {
536 .func = GPIOMUX_FUNC_1, /*active 1*/
537 .drv = GPIOMUX_DRV_2MA,
538 .pull = GPIOMUX_PULL_NONE,
539 },
540
541 {
542 .func = GPIOMUX_FUNC_GPIO, /*active 2*/
543 .drv = GPIOMUX_DRV_2MA,
544 .pull = GPIOMUX_PULL_NONE,
545 },
546
547 {
548 .func = GPIOMUX_FUNC_1, /*active 3*/
549 .drv = GPIOMUX_DRV_8MA,
Kevin Chan4c58d292011-09-13 11:03:25 -0700550 .pull = GPIOMUX_PULL_NONE,
Nishant Pandit474f2252011-07-23 23:17:56 +0530551 },
Nishant Pandit24153d82011-08-27 16:05:13 +0530552
553 {
554 .func = GPIOMUX_FUNC_5, /*active 4*/
555 .drv = GPIOMUX_DRV_8MA,
556 .pull = GPIOMUX_PULL_UP,
557 },
558
559 {
560 .func = GPIOMUX_FUNC_6, /*active 5*/
561 .drv = GPIOMUX_DRV_8MA,
562 .pull = GPIOMUX_PULL_UP,
563 },
564
565 {
566 .func = GPIOMUX_FUNC_2, /*active 6*/
567 .drv = GPIOMUX_DRV_2MA,
568 .pull = GPIOMUX_PULL_UP,
569 },
570
571 {
572 .func = GPIOMUX_FUNC_3, /*active 7*/
573 .drv = GPIOMUX_DRV_8MA,
574 .pull = GPIOMUX_PULL_UP,
575 },
576
Kevin Chan4c58d292011-09-13 11:03:25 -0700577 {
578 .func = GPIOMUX_FUNC_GPIO, /*i2c suspend*/
579 .drv = GPIOMUX_DRV_2MA,
580 .pull = GPIOMUX_PULL_KEEPER,
581 },
582
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700583};
584
Nishant Pandit24153d82011-08-27 16:05:13 +0530585static struct msm_gpiomux_config msm8960_cam_common_configs[] = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700586 {
587 .gpio = 2,
588 .settings = {
Nishant Pandit474f2252011-07-23 23:17:56 +0530589 [GPIOMUX_ACTIVE] = &cam_settings[2],
590 [GPIOMUX_SUSPENDED] = &cam_settings[0],
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700591 },
592 },
593 {
594 .gpio = 3,
595 .settings = {
Nishant Pandit474f2252011-07-23 23:17:56 +0530596 [GPIOMUX_ACTIVE] = &cam_settings[1],
597 [GPIOMUX_SUSPENDED] = &cam_settings[0],
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700598 },
599 },
600 {
601 .gpio = 4,
602 .settings = {
Nishant Pandit474f2252011-07-23 23:17:56 +0530603 [GPIOMUX_ACTIVE] = &cam_settings[1],
604 [GPIOMUX_SUSPENDED] = &cam_settings[0],
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700605 },
606 },
607 {
608 .gpio = 5,
609 .settings = {
Nishant Pandit474f2252011-07-23 23:17:56 +0530610 [GPIOMUX_ACTIVE] = &cam_settings[1],
611 [GPIOMUX_SUSPENDED] = &cam_settings[0],
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700612 },
613 },
614 {
Nishant Pandit24153d82011-08-27 16:05:13 +0530615 .gpio = 76,
616 .settings = {
617 [GPIOMUX_ACTIVE] = &cam_settings[2],
618 [GPIOMUX_SUSPENDED] = &cam_settings[0],
619 },
620 },
621 {
622 .gpio = 107,
623 .settings = {
624 [GPIOMUX_ACTIVE] = &cam_settings[2],
625 [GPIOMUX_SUSPENDED] = &cam_settings[0],
626 },
627 },
628};
629
630static struct msm_gpiomux_config msm8960_cam_2d_configs[] = {
631 {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700632 .gpio = 18,
633 .settings = {
Nishant Pandit474f2252011-07-23 23:17:56 +0530634 [GPIOMUX_ACTIVE] = &cam_settings[3],
Kevin Chan4c58d292011-09-13 11:03:25 -0700635 [GPIOMUX_SUSPENDED] = &cam_settings[8],
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700636 },
637 },
638 {
639 .gpio = 19,
640 .settings = {
Nishant Pandit474f2252011-07-23 23:17:56 +0530641 [GPIOMUX_ACTIVE] = &cam_settings[3],
Kevin Chan4c58d292011-09-13 11:03:25 -0700642 [GPIOMUX_SUSPENDED] = &cam_settings[8],
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700643 },
644 },
645 {
646 .gpio = 20,
647 .settings = {
Nishant Pandit474f2252011-07-23 23:17:56 +0530648 [GPIOMUX_ACTIVE] = &cam_settings[3],
Kevin Chan4c58d292011-09-13 11:03:25 -0700649 [GPIOMUX_SUSPENDED] = &cam_settings[8],
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700650 },
651 },
652 {
653 .gpio = 21,
654 .settings = {
Nishant Pandit474f2252011-07-23 23:17:56 +0530655 [GPIOMUX_ACTIVE] = &cam_settings[3],
Kevin Chan4c58d292011-09-13 11:03:25 -0700656 [GPIOMUX_SUSPENDED] = &cam_settings[8],
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700657 },
658 },
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700659};
660
661static struct gpiomux_setting cyts_resout_sus_cfg = {
662 .func = GPIOMUX_FUNC_GPIO,
663 .drv = GPIOMUX_DRV_6MA,
664 .pull = GPIOMUX_PULL_UP,
665};
666
667static struct gpiomux_setting cyts_resout_act_cfg = {
668 .func = GPIOMUX_FUNC_GPIO,
669 .drv = GPIOMUX_DRV_6MA,
670 .pull = GPIOMUX_PULL_UP,
671};
672
673static struct gpiomux_setting cyts_sleep_sus_cfg = {
674 .func = GPIOMUX_FUNC_GPIO,
675 .drv = GPIOMUX_DRV_6MA,
676 .pull = GPIOMUX_PULL_DOWN,
677};
678
679static struct gpiomux_setting cyts_sleep_act_cfg = {
680 .func = GPIOMUX_FUNC_GPIO,
681 .drv = GPIOMUX_DRV_6MA,
682 .pull = GPIOMUX_PULL_DOWN,
683};
684
685static struct gpiomux_setting cyts_int_act_cfg = {
686 .func = GPIOMUX_FUNC_GPIO,
687 .drv = GPIOMUX_DRV_8MA,
688 .pull = GPIOMUX_PULL_UP,
689};
690
691static struct gpiomux_setting cyts_int_sus_cfg = {
692 .func = GPIOMUX_FUNC_GPIO,
693 .drv = GPIOMUX_DRV_2MA,
Mohan Pallakacbc5d162011-09-13 15:23:21 +0530694 .pull = GPIOMUX_PULL_DOWN,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700695};
696
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700697static struct msm_gpiomux_config msm8960_cyts_configs[] __initdata = {
698 { /* TS INTERRUPT */
699 .gpio = 11,
700 .settings = {
701 [GPIOMUX_ACTIVE] = &cyts_int_act_cfg,
702 [GPIOMUX_SUSPENDED] = &cyts_int_sus_cfg,
703 },
704 },
705 { /* TS SLEEP */
706 .gpio = 50,
707 .settings = {
708 [GPIOMUX_ACTIVE] = &cyts_sleep_act_cfg,
709 [GPIOMUX_SUSPENDED] = &cyts_sleep_sus_cfg,
710 },
711 },
712 { /* TS RESOUT */
713 .gpio = 52,
714 .settings = {
715 [GPIOMUX_ACTIVE] = &cyts_resout_act_cfg,
716 [GPIOMUX_SUSPENDED] = &cyts_resout_sus_cfg,
717 },
718 },
719};
720
Vijayavardhan Vennapusae3316a12011-10-15 06:05:17 +0530721#ifdef CONFIG_USB_EHCI_MSM_HSIC
722static struct gpiomux_setting hsic_act_cfg = {
723 .func = GPIOMUX_FUNC_1,
724 .drv = GPIOMUX_DRV_12MA,
725 .pull = GPIOMUX_PULL_NONE,
726};
727
728static struct gpiomux_setting hsic_sus_cfg = {
729 .func = GPIOMUX_FUNC_GPIO,
730 .drv = GPIOMUX_DRV_2MA,
731 .pull = GPIOMUX_PULL_DOWN,
732};
733
Vijayavardhan Vennapusa2b592824f2011-11-02 19:51:32 +0530734static struct gpiomux_setting hsic_hub_act_cfg = {
735 .func = GPIOMUX_FUNC_GPIO,
736 .drv = GPIOMUX_DRV_2MA,
737 .pull = GPIOMUX_PULL_NONE,
738};
739
Vijayavardhan Vennapusae3316a12011-10-15 06:05:17 +0530740static struct msm_gpiomux_config msm8960_hsic_configs[] = {
741 {
742 .gpio = 150, /*HSIC_STROBE */
743 .settings = {
744 [GPIOMUX_ACTIVE] = &hsic_act_cfg,
745 [GPIOMUX_SUSPENDED] = &hsic_sus_cfg,
746 },
747 },
748 {
749 .gpio = 151, /* HSIC_DATA */
750 .settings = {
751 [GPIOMUX_ACTIVE] = &hsic_act_cfg,
752 [GPIOMUX_SUSPENDED] = &hsic_sus_cfg,
753 },
754 },
Vijayavardhan Vennapusa2b592824f2011-11-02 19:51:32 +0530755 {
756 .gpio = 91, /* HSIC_HUB_RESET */
757 .settings = {
758 [GPIOMUX_ACTIVE] = &hsic_hub_act_cfg,
759 [GPIOMUX_SUSPENDED] = &hsic_sus_cfg,
760 },
761 },
Vijayavardhan Vennapusae3316a12011-10-15 06:05:17 +0530762};
763#endif
764
Rohit Vaswanicd2a59b2011-07-19 12:00:48 -0700765#if defined(CONFIG_GPIO_SX150X) || defined(CONFIG_GPIO_SX150X_MODULE)
766enum {
767 SX150X_CAM,
768};
769
Nishant Pandit474f2252011-07-23 23:17:56 +0530770static struct sx150x_platform_data sx150x_data[] = {
Rohit Vaswanicd2a59b2011-07-19 12:00:48 -0700771 [SX150X_CAM] = {
772 .gpio_base = GPIO_CAM_EXPANDER_BASE,
773 .oscio_is_gpo = false,
774 .io_pullup_ena = 0x0,
Nishant Pandit474f2252011-07-23 23:17:56 +0530775 .io_pulldn_ena = 0xc0,
Rohit Vaswanicd2a59b2011-07-19 12:00:48 -0700776 .io_open_drain_ena = 0x0,
777 .irq_summary = -1,
778 },
779};
Nishant Pandit474f2252011-07-23 23:17:56 +0530780
781#endif
782
783#ifdef CONFIG_I2C
784
785#define MSM_8960_GSBI4_QUP_I2C_BUS_ID 4
786#define MSM_8960_GSBI3_QUP_I2C_BUS_ID 3
Amir Samuelov5137e392011-09-21 17:31:25 +0300787#define MSM_8960_GSBI10_QUP_I2C_BUS_ID 10
Nishant Pandit474f2252011-07-23 23:17:56 +0530788
789#if defined(CONFIG_GPIO_SX150X) || defined(CONFIG_GPIO_SX150X_MODULE)
790
791static struct i2c_board_info cam_expander_i2c_info[] = {
792 {
793 I2C_BOARD_INFO("sx1508q", 0x22),
794 .platform_data = &sx150x_data[SX150X_CAM]
795 },
796};
797
798static struct msm_cam_expander_info cam_expander_info[] = {
799 {
800 cam_expander_i2c_info,
801 MSM_8960_GSBI4_QUP_I2C_BUS_ID,
802 },
803};
804#endif
Rohit Vaswanicd2a59b2011-07-19 12:00:48 -0700805#endif
806
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700807#define MSM_PMEM_KERNEL_EBI1_SIZE 0x110C000
808#define MSM_PMEM_ADSP_SIZE 0x3800000
Ben Romberger09e462d2011-08-09 15:24:37 -0700809#define MSM_PMEM_AUDIO_SIZE 0x28B000
Ravishangar Kalyanamf4ef7282011-10-10 17:39:48 -0700810#ifdef CONFIG_FB_MSM_HDMI_AS_PRIMARY
811#define MSM_PMEM_SIZE 0x4000000 /* 64 Mbytes */
812#else
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700813#define MSM_PMEM_SIZE 0x1800000 /* 24 Mbytes */
Ravishangar Kalyanamf4ef7282011-10-10 17:39:48 -0700814#endif
Laura Abbott2d1760b2011-09-29 21:31:24 -0700815
816
817#ifdef CONFIG_MSM_MULTIMEDIA_USE_ION
818#define MSM_ION_EBI_SIZE MSM_PMEM_SIZE
819#define MSM_ION_ADSP_SIZE MSM_PMEM_ADSP_SIZE
820#define MSM_ION_HEAP_NUM 4
821#else
822#define MSM_ION_HEAP_NUM 2
823#endif
Laura Abbottd6183792011-08-19 13:42:24 -0700824
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700825#ifdef CONFIG_KERNEL_PMEM_EBI_REGION
826static unsigned pmem_kernel_ebi1_size = MSM_PMEM_KERNEL_EBI1_SIZE;
827static int __init pmem_kernel_ebi1_size_setup(char *p)
828{
829 pmem_kernel_ebi1_size = memparse(p, NULL);
830 return 0;
831}
832early_param("pmem_kernel_ebi1_size", pmem_kernel_ebi1_size_setup);
833#endif
834
835#ifdef CONFIG_ANDROID_PMEM
836static unsigned pmem_size = MSM_PMEM_SIZE;
837static int __init pmem_size_setup(char *p)
838{
839 pmem_size = memparse(p, NULL);
840 return 0;
841}
842early_param("pmem_size", pmem_size_setup);
843
844static unsigned pmem_adsp_size = MSM_PMEM_ADSP_SIZE;
845
846static int __init pmem_adsp_size_setup(char *p)
847{
848 pmem_adsp_size = memparse(p, NULL);
849 return 0;
850}
851early_param("pmem_adsp_size", pmem_adsp_size_setup);
852
853static unsigned pmem_audio_size = MSM_PMEM_AUDIO_SIZE;
854
855static int __init pmem_audio_size_setup(char *p)
856{
857 pmem_audio_size = memparse(p, NULL);
858 return 0;
859}
860early_param("pmem_audio_size", pmem_audio_size_setup);
861#endif
862
863#ifdef CONFIG_ANDROID_PMEM
Laura Abbott2d1760b2011-09-29 21:31:24 -0700864#ifndef CONFIG_MSM_MULTIMEDIA_USE_ION
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700865static struct android_pmem_platform_data android_pmem_pdata = {
866 .name = "pmem",
867 .allocator_type = PMEM_ALLOCATORTYPE_ALLORNOTHING,
868 .cached = 1,
869 .memory_type = MEMTYPE_EBI1,
870};
871
872static struct platform_device android_pmem_device = {
873 .name = "android_pmem",
874 .id = 0,
875 .dev = {.platform_data = &android_pmem_pdata},
876};
877
878static struct android_pmem_platform_data android_pmem_adsp_pdata = {
879 .name = "pmem_adsp",
880 .allocator_type = PMEM_ALLOCATORTYPE_BITMAP,
881 .cached = 0,
882 .memory_type = MEMTYPE_EBI1,
883};
884static struct platform_device android_pmem_adsp_device = {
885 .name = "android_pmem",
886 .id = 2,
887 .dev = { .platform_data = &android_pmem_adsp_pdata },
888};
Laura Abbott2d1760b2011-09-29 21:31:24 -0700889#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700890
891static struct android_pmem_platform_data android_pmem_audio_pdata = {
892 .name = "pmem_audio",
893 .allocator_type = PMEM_ALLOCATORTYPE_BITMAP,
894 .cached = 0,
895 .memory_type = MEMTYPE_EBI1,
896};
897
898static struct platform_device android_pmem_audio_device = {
899 .name = "android_pmem",
900 .id = 4,
901 .dev = { .platform_data = &android_pmem_audio_pdata },
902};
903#endif
904
Swaminathan Sathappanb77c65e92011-09-30 18:36:09 -0700905#define DSP_RAM_BASE_8960 0x8da00000
906#define DSP_RAM_SIZE_8960 0x1800000
907static int dspcrashd_pdata_8960 = 0xDEADDEAD;
908
909static struct resource resources_dspcrashd_8960[] = {
910 {
911 .name = "msm_dspcrashd",
912 .start = DSP_RAM_BASE_8960,
913 .end = DSP_RAM_BASE_8960 + DSP_RAM_SIZE_8960,
914 .flags = IORESOURCE_DMA,
915 },
916};
917
918struct platform_device msm_device_dspcrashd_8960 = {
919 .name = "msm_dspcrashd",
920 .num_resources = ARRAY_SIZE(resources_dspcrashd_8960),
921 .resource = resources_dspcrashd_8960,
922 .dev = { .platform_data = &dspcrashd_pdata_8960 },
923};
924
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700925static struct memtype_reserve msm8960_reserve_table[] __initdata = {
926 [MEMTYPE_SMI] = {
927 },
928 [MEMTYPE_EBI0] = {
929 .flags = MEMTYPE_FLAGS_1M_ALIGN,
930 },
931 [MEMTYPE_EBI1] = {
932 .flags = MEMTYPE_FLAGS_1M_ALIGN,
933 },
934};
935
936static void __init size_pmem_devices(void)
937{
938#ifdef CONFIG_ANDROID_PMEM
Laura Abbott2d1760b2011-09-29 21:31:24 -0700939#ifndef CONFIG_MSM_MULTIMEDIA_USE_ION
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700940 android_pmem_adsp_pdata.size = pmem_adsp_size;
941 android_pmem_pdata.size = pmem_size;
Laura Abbott2d1760b2011-09-29 21:31:24 -0700942#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700943 android_pmem_audio_pdata.size = MSM_PMEM_AUDIO_SIZE;
944#endif
945}
946
947static void __init reserve_memory_for(struct android_pmem_platform_data *p)
948{
949 msm8960_reserve_table[p->memory_type].size += p->size;
950}
951
952static void __init reserve_pmem_memory(void)
953{
954#ifdef CONFIG_ANDROID_PMEM
Laura Abbott2d1760b2011-09-29 21:31:24 -0700955#ifndef CONFIG_MSM_MULTIMEDIA_USE_ION
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700956 reserve_memory_for(&android_pmem_adsp_pdata);
957 reserve_memory_for(&android_pmem_pdata);
Laura Abbott2d1760b2011-09-29 21:31:24 -0700958#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700959 reserve_memory_for(&android_pmem_audio_pdata);
960 msm8960_reserve_table[MEMTYPE_EBI1].size += pmem_kernel_ebi1_size;
961#endif
962}
963
Larry Basselb4126da2011-07-18 14:31:33 -0700964static int msm8960_paddr_to_memtype(unsigned int paddr)
965{
966 return MEMTYPE_EBI1;
967}
968
Laura Abbottd6183792011-08-19 13:42:24 -0700969#ifdef CONFIG_ION_MSM
970struct ion_platform_data ion_pdata = {
Laura Abbott2d1760b2011-09-29 21:31:24 -0700971 .nr = MSM_ION_HEAP_NUM,
Laura Abbottd6183792011-08-19 13:42:24 -0700972 .heaps = {
973 {
974 .id = ION_HEAP_SYSTEM_ID,
975 .type = ION_HEAP_TYPE_SYSTEM,
976 .name = ION_KMALLOC_HEAP_NAME,
977 },
978 {
979 .id = ION_HEAP_SYSTEM_CONTIG_ID,
980 .type = ION_HEAP_TYPE_SYSTEM_CONTIG,
981 .name = ION_VMALLOC_HEAP_NAME,
982 },
Laura Abbott2d1760b2011-09-29 21:31:24 -0700983#ifdef CONFIG_MSM_MULTIMEDIA_USE_ION
Laura Abbottd6183792011-08-19 13:42:24 -0700984 {
985 .id = ION_HEAP_EBI_ID,
986 .type = ION_HEAP_TYPE_CARVEOUT,
987 .name = ION_EBI1_HEAP_NAME,
988 .size = MSM_ION_EBI_SIZE,
989 .memory_type = ION_EBI_TYPE,
990 },
Laura Abbott2d1760b2011-09-29 21:31:24 -0700991 {
992 .id = ION_HEAP_ADSP_ID,
993 .type = ION_HEAP_TYPE_CARVEOUT,
994 .name = ION_ADSP_HEAP_NAME,
995 .size = MSM_ION_ADSP_SIZE,
996 .memory_type = ION_EBI_TYPE,
997 },
998#endif
Laura Abbottd6183792011-08-19 13:42:24 -0700999 }
1000};
1001
1002struct platform_device ion_dev = {
1003 .name = "ion-msm",
1004 .id = 1,
1005 .dev = { .platform_data = &ion_pdata },
1006};
1007#endif
1008
1009static void reserve_ion_memory(void)
1010{
Laura Abbott2d1760b2011-09-29 21:31:24 -07001011#if defined(CONFIG_ION_MSM) && defined(CONFIG_MSM_MULTIMEDIA_USE_ION)
Laura Abbottd6183792011-08-19 13:42:24 -07001012 msm8960_reserve_table[MEMTYPE_EBI1].size += MSM_ION_EBI_SIZE;
Laura Abbott2d1760b2011-09-29 21:31:24 -07001013 msm8960_reserve_table[MEMTYPE_EBI1].size += MSM_ION_ADSP_SIZE;
Laura Abbottd6183792011-08-19 13:42:24 -07001014#endif
1015}
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001016static void __init msm8960_calculate_reserve_sizes(void)
1017{
1018 size_pmem_devices();
1019 reserve_pmem_memory();
Laura Abbottd6183792011-08-19 13:42:24 -07001020 reserve_ion_memory();
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001021}
1022
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001023static struct reserve_info msm8960_reserve_info __initdata = {
1024 .memtype_reserve_table = msm8960_reserve_table,
1025 .calculate_reserve_sizes = msm8960_calculate_reserve_sizes,
1026 .paddr_to_memtype = msm8960_paddr_to_memtype,
1027};
1028
Larry Basselb4126da2011-07-18 14:31:33 -07001029static int msm8960_memory_bank_size(void)
1030{
1031 return 1<<29;
1032}
1033
1034static void __init locate_unstable_memory(void)
1035{
1036 struct membank *mb = &meminfo.bank[meminfo.nr_banks - 1];
1037 unsigned long bank_size;
1038 unsigned long low, high;
1039
1040 bank_size = msm8960_memory_bank_size();
1041 low = meminfo.bank[0].start;
1042 high = mb->start + mb->size;
1043 low &= ~(bank_size - 1);
1044
1045 if (high - low <= bank_size)
1046 return;
1047 msm8960_reserve_info.low_unstable_address = low + bank_size;
1048 msm8960_reserve_info.max_unstable_size = high - low - bank_size;
1049 msm8960_reserve_info.bank_size = bank_size;
1050 pr_info("low unstable address %lx max size %lx bank size %lx\n",
1051 msm8960_reserve_info.low_unstable_address,
1052 msm8960_reserve_info.max_unstable_size,
1053 msm8960_reserve_info.bank_size);
1054}
1055
Larry Basselb830e182011-10-14 10:46:55 -07001056static void __init place_movable_zone(void)
1057{
1058 movable_reserved_start = msm8960_reserve_info.low_unstable_address;
1059 movable_reserved_size = msm8960_reserve_info.max_unstable_size;
1060 pr_info("movable zone start %lx size %lx\n",
1061 movable_reserved_start, movable_reserved_size);
1062}
1063
1064static void __init msm8960_early_memory(void)
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001065{
1066 reserve_info = &msm8960_reserve_info;
Larry Basselb4126da2011-07-18 14:31:33 -07001067 locate_unstable_memory();
Larry Basselb830e182011-10-14 10:46:55 -07001068 place_movable_zone();
1069}
1070
1071static void __init msm8960_reserve(void)
1072{
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001073 msm_reserve();
1074}
1075
Larry Bassela4414b12011-08-04 11:11:02 -07001076static int msm8960_change_memory_power(u64 start, u64 size,
1077 int change_type)
Larry Bassela7eadea2011-07-14 10:46:00 -07001078{
Naveen Ramarajb03bb1b2011-09-12 14:34:31 -07001079 return soc_change_memory_power(start, size, change_type);
Larry Bassela7eadea2011-07-14 10:46:00 -07001080}
1081
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001082#ifdef CONFIG_MSM_CAMERA
1083
Nishant Pandit24153d82011-08-27 16:05:13 +05301084static uint16_t msm_cam_gpio_2d_tbl[] = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001085 5, /*CAMIF_MCLK*/
1086 20, /*CAMIF_I2C_DATA*/
1087 21, /*CAMIF_I2C_CLK*/
1088};
1089
Nishant Pandit24153d82011-08-27 16:05:13 +05301090static struct msm_camera_gpio_conf gpio_conf = {
1091 .cam_gpiomux_conf_tbl = msm8960_cam_2d_configs,
1092 .cam_gpiomux_conf_tbl_size = ARRAY_SIZE(msm8960_cam_2d_configs),
1093 .cam_gpio_tbl = msm_cam_gpio_2d_tbl,
1094 .cam_gpio_tbl_size = ARRAY_SIZE(msm_cam_gpio_2d_tbl),
1095};
1096
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001097#define VFE_CAMIF_TIMER1_GPIO 2
1098#define VFE_CAMIF_TIMER2_GPIO 3
1099#define VFE_CAMIF_TIMER3_GPIO_INT 4
1100struct msm_camera_sensor_strobe_flash_data strobe_flash_xenon = {
1101 .flash_trigger = VFE_CAMIF_TIMER2_GPIO,
1102 .flash_charge = VFE_CAMIF_TIMER1_GPIO,
1103 .flash_charge_done = VFE_CAMIF_TIMER3_GPIO_INT,
1104 .flash_recharge_duration = 50000,
1105 .irq = MSM_GPIO_TO_INT(VFE_CAMIF_TIMER3_GPIO_INT),
1106};
1107
Nishant Pandit474f2252011-07-23 23:17:56 +05301108#ifdef CONFIG_MSM_CAMERA_FLASH
1109static struct msm_camera_sensor_flash_src msm_flash_src = {
1110 .flash_sr_type = MSM_CAMERA_FLASH_SRC_EXT,
1111 ._fsrc.ext_driver_src.led_en = GPIO_CAM_GP_LED_EN1,
1112 ._fsrc.ext_driver_src.led_flash_en = GPIO_CAM_GP_LED_EN2,
1113#if defined(CONFIG_I2C) && (defined(CONFIG_GPIO_SX150X) || \
1114 defined(CONFIG_GPIO_SX150X_MODULE))
1115 ._fsrc.ext_driver_src.expander_info = cam_expander_info,
1116#endif
1117};
1118#endif
1119
Shuzhen Wang65c3b1d2011-09-20 12:53:08 -07001120static struct msm_bus_vectors cam_init_vectors[] = {
1121 {
1122 .src = MSM_BUS_MASTER_VFE,
1123 .dst = MSM_BUS_SLAVE_EBI_CH0,
1124 .ab = 0,
1125 .ib = 0,
1126 },
1127 {
1128 .src = MSM_BUS_MASTER_VPE,
1129 .dst = MSM_BUS_SLAVE_EBI_CH0,
1130 .ab = 0,
1131 .ib = 0,
1132 },
1133 {
1134 .src = MSM_BUS_MASTER_JPEG_ENC,
1135 .dst = MSM_BUS_SLAVE_EBI_CH0,
1136 .ab = 0,
1137 .ib = 0,
1138 },
1139};
1140
1141static struct msm_bus_vectors cam_preview_vectors[] = {
1142 {
1143 .src = MSM_BUS_MASTER_VFE,
1144 .dst = MSM_BUS_SLAVE_EBI_CH0,
1145 .ab = 27648000,
1146 .ib = 110592000,
1147 },
1148 {
1149 .src = MSM_BUS_MASTER_VPE,
1150 .dst = MSM_BUS_SLAVE_EBI_CH0,
1151 .ab = 0,
1152 .ib = 0,
1153 },
1154 {
1155 .src = MSM_BUS_MASTER_JPEG_ENC,
1156 .dst = MSM_BUS_SLAVE_EBI_CH0,
1157 .ab = 0,
1158 .ib = 0,
1159 },
1160};
1161
1162static struct msm_bus_vectors cam_video_vectors[] = {
1163 {
1164 .src = MSM_BUS_MASTER_VFE,
1165 .dst = MSM_BUS_SLAVE_EBI_CH0,
1166 .ab = 140451840,
1167 .ib = 561807360,
1168 },
1169 {
1170 .src = MSM_BUS_MASTER_VPE,
1171 .dst = MSM_BUS_SLAVE_EBI_CH0,
1172 .ab = 206807040,
1173 .ib = 488816640,
1174 },
1175 {
1176 .src = MSM_BUS_MASTER_JPEG_ENC,
1177 .dst = MSM_BUS_SLAVE_EBI_CH0,
1178 .ab = 0,
1179 .ib = 0,
1180 },
1181};
1182
1183static struct msm_bus_vectors cam_snapshot_vectors[] = {
1184 {
1185 .src = MSM_BUS_MASTER_VFE,
1186 .dst = MSM_BUS_SLAVE_EBI_CH0,
1187 .ab = 274423680,
1188 .ib = 1097694720,
1189 },
1190 {
1191 .src = MSM_BUS_MASTER_VPE,
1192 .dst = MSM_BUS_SLAVE_EBI_CH0,
1193 .ab = 0,
1194 .ib = 0,
1195 },
1196 {
1197 .src = MSM_BUS_MASTER_JPEG_ENC,
1198 .dst = MSM_BUS_SLAVE_EBI_CH0,
1199 .ab = 540000000,
1200 .ib = 1350000000,
1201 },
1202};
1203
1204static struct msm_bus_vectors cam_zsl_vectors[] = {
1205 {
1206 .src = MSM_BUS_MASTER_VFE,
1207 .dst = MSM_BUS_SLAVE_EBI_CH0,
1208 .ab = 302071680,
1209 .ib = 1208286720,
1210 },
1211 {
1212 .src = MSM_BUS_MASTER_VPE,
1213 .dst = MSM_BUS_SLAVE_EBI_CH0,
1214 .ab = 0,
1215 .ib = 0,
1216 },
1217 {
1218 .src = MSM_BUS_MASTER_JPEG_ENC,
1219 .dst = MSM_BUS_SLAVE_EBI_CH0,
1220 .ab = 540000000,
1221 .ib = 1350000000,
1222 },
1223};
1224
1225static struct msm_bus_paths cam_bus_client_config[] = {
1226 {
1227 ARRAY_SIZE(cam_init_vectors),
1228 cam_init_vectors,
1229 },
1230 {
1231 ARRAY_SIZE(cam_preview_vectors),
1232 cam_preview_vectors,
1233 },
1234 {
1235 ARRAY_SIZE(cam_video_vectors),
1236 cam_video_vectors,
1237 },
1238 {
1239 ARRAY_SIZE(cam_snapshot_vectors),
1240 cam_snapshot_vectors,
1241 },
1242 {
1243 ARRAY_SIZE(cam_zsl_vectors),
1244 cam_zsl_vectors,
1245 },
1246};
1247
1248static struct msm_bus_scale_pdata cam_bus_client_pdata = {
1249 cam_bus_client_config,
1250 ARRAY_SIZE(cam_bus_client_config),
1251 .name = "msm_camera",
1252};
Shuzhen Wang65c3b1d2011-09-20 12:53:08 -07001253
Nishant Pandit24153d82011-08-27 16:05:13 +05301254struct msm_camera_device_platform_data msm_camera_csi_device_data[] = {
1255 {
1256 .ioclk.mclk_clk_rate = 24000000,
1257 .ioclk.vfe_clk_rate = 228570000,
1258 .csid_core = 0,
Shuzhen Wang65c3b1d2011-09-20 12:53:08 -07001259 .cam_bus_scale_table = &cam_bus_client_pdata,
Nishant Pandit24153d82011-08-27 16:05:13 +05301260 },
1261 {
1262 .ioclk.mclk_clk_rate = 24000000,
1263 .ioclk.vfe_clk_rate = 228570000,
1264 .csid_core = 1,
Shuzhen Wang65c3b1d2011-09-20 12:53:08 -07001265 .cam_bus_scale_table = &cam_bus_client_pdata,
Nishant Pandit24153d82011-08-27 16:05:13 +05301266 },
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001267};
1268
Sreesudhan Ramakrish Ramkumarb54fd242011-09-12 17:11:19 -07001269#ifdef CONFIG_IMX074_ACT
1270static struct i2c_board_info imx074_actuator_i2c_info = {
1271 I2C_BOARD_INFO("imx074_act", 0x11),
1272};
1273
1274static struct msm_actuator_info imx074_actuator_info = {
1275 .board_info = &imx074_actuator_i2c_info,
1276 .bus_id = MSM_8960_GSBI4_QUP_I2C_BUS_ID,
1277 .vcm_pwd = 0,
1278 .vcm_enable = 1,
1279};
1280#endif
1281
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001282#ifdef CONFIG_IMX074
1283static struct msm_camera_sensor_flash_data flash_imx074 = {
1284 .flash_type = MSM_CAMERA_FLASH_LED,
Nishant Pandit474f2252011-07-23 23:17:56 +05301285#ifdef CONFIG_MSM_CAMERA_FLASH
1286 .flash_src = &msm_flash_src
1287#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001288};
1289
Nishant Pandit24153d82011-08-27 16:05:13 +05301290static struct msm_camera_sensor_platform_info sensor_board_info_imx074 = {
1291 .mount_angle = 90,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001292 .sensor_reset = 107,
1293 .sensor_pwd = 85,
1294 .vcm_pwd = 0,
1295 .vcm_enable = 1,
Nishant Pandit24153d82011-08-27 16:05:13 +05301296};
1297
1298static struct msm_camera_sensor_info msm_camera_sensor_imx074_data = {
1299 .sensor_name = "imx074",
1300 .pdata = &msm_camera_csi_device_data[0],
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001301 .flash_data = &flash_imx074,
1302 .strobe_flash_data = &strobe_flash_xenon,
Nishant Pandit24153d82011-08-27 16:05:13 +05301303 .sensor_platform_info = &sensor_board_info_imx074,
1304 .gpio_conf = &gpio_conf,
1305 .csi_if = 1,
1306 .camera_type = BACK_CAMERA_2D,
Sreesudhan Ramakrish Ramkumarb54fd242011-09-12 17:11:19 -07001307#ifdef CONFIG_IMX074_ACT
1308 .actuator_info = &imx074_actuator_info
1309#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001310};
1311
1312struct platform_device msm8960_camera_sensor_imx074 = {
1313 .name = "msm_camera_imx074",
1314 .dev = {
1315 .platform_data = &msm_camera_sensor_imx074_data,
1316 },
1317};
1318#endif
1319#ifdef CONFIG_OV2720
1320static struct msm_camera_sensor_flash_data flash_ov2720 = {
Kevin Chan1a990332011-07-26 20:31:23 -07001321 .flash_type = MSM_CAMERA_FLASH_NONE,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001322};
1323
Nishant Pandit24153d82011-08-27 16:05:13 +05301324static struct msm_camera_sensor_platform_info sensor_board_info_ov2720 = {
1325 .mount_angle = 0,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001326 .sensor_reset = 76,
1327 .sensor_pwd = 85,
1328 .vcm_pwd = 0,
1329 .vcm_enable = 1,
Nishant Pandit24153d82011-08-27 16:05:13 +05301330};
1331
1332static struct msm_camera_sensor_info msm_camera_sensor_ov2720_data = {
1333 .sensor_name = "ov2720",
1334 .pdata = &msm_camera_csi_device_data[1],
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001335 .flash_data = &flash_ov2720,
Nishant Pandit24153d82011-08-27 16:05:13 +05301336 .sensor_platform_info = &sensor_board_info_ov2720,
1337 .gpio_conf = &gpio_conf,
1338 .csi_if = 1,
1339 .camera_type = FRONT_CAMERA_2D,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001340};
1341
1342struct platform_device msm8960_camera_sensor_ov2720 = {
1343 .name = "msm_camera_ov2720",
1344 .dev = {
1345 .platform_data = &msm_camera_sensor_ov2720_data,
1346 },
1347};
1348#endif
Kevin Chandfecce22011-07-13 10:52:41 -07001349
1350static struct msm_camera_sensor_flash_data flash_qs_mt9p017 = {
1351 .flash_type = MSM_CAMERA_FLASH_LED,
1352};
1353
Nishant Pandit24153d82011-08-27 16:05:13 +05301354static struct msm_camera_sensor_platform_info sensor_board_info_qs_mt9p017 = {
1355 .mount_angle = 270,
Kevin Chandfecce22011-07-13 10:52:41 -07001356 .sensor_reset = 107,
1357 .sensor_pwd = 85,
1358 .vcm_pwd = 0,
1359 .vcm_enable = 1,
Nishant Pandit24153d82011-08-27 16:05:13 +05301360};
1361
1362static struct msm_camera_sensor_info msm_camera_sensor_qs_mt9p017_data = {
1363 .sensor_name = "qs_mt9p017",
1364 .pdata = &msm_camera_csi_device_data[0],
Kevin Chandfecce22011-07-13 10:52:41 -07001365 .flash_data = &flash_qs_mt9p017,
Nishant Pandit24153d82011-08-27 16:05:13 +05301366 .sensor_platform_info = &sensor_board_info_qs_mt9p017,
1367 .gpio_conf = &gpio_conf,
1368 .csi_if = 1,
1369 .camera_type = BACK_CAMERA_3D,
Kevin Chandfecce22011-07-13 10:52:41 -07001370};
1371
1372struct platform_device msm8960_camera_sensor_qs_mt9p017 = {
1373 .name = "msm_camera_qs_mt9p017",
1374 .dev = {
1375 .platform_data = &msm_camera_sensor_qs_mt9p017_data,
1376 },
1377};
1378
Kevin Chan8b0d2322011-09-10 21:06:31 -07001379static struct msm8960_privacy_light_cfg privacy_light_info = {
1380 .mpp = PM8921_MPP_PM_TO_SYS(12),
1381};
1382
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001383static void __init msm8960_init_cam(void)
1384{
1385 int i;
1386 struct platform_device *cam_dev[] = {
1387 &msm8960_camera_sensor_imx074,
1388 &msm8960_camera_sensor_ov2720,
Kevin Chandfecce22011-07-13 10:52:41 -07001389 &msm8960_camera_sensor_qs_mt9p017,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001390 };
1391
Kevin Chan8b0d2322011-09-10 21:06:31 -07001392 if (machine_is_msm8960_liquid()) {
1393 struct msm_camera_sensor_info *s_info;
1394 s_info = msm8960_camera_sensor_imx074.dev.platform_data;
1395 s_info->sensor_platform_info->mount_angle = 180;
1396 s_info = msm8960_camera_sensor_ov2720.dev.platform_data;
1397 s_info->sensor_platform_info->privacy_light = 1;
1398 s_info->sensor_platform_info->privacy_light_info =
1399 &privacy_light_info;
1400 }
1401
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001402 for (i = 0; i < ARRAY_SIZE(cam_dev); i++) {
1403 struct msm_camera_sensor_info *s_info;
1404 s_info = cam_dev[i]->dev.platform_data;
1405 msm_get_cam_resources(s_info);
1406 platform_device_register(cam_dev[i]);
1407 }
1408}
1409#endif
1410
1411#ifdef CONFIG_FB_MSM_TRIPLE_BUFFER
kuogee hsieh3830eb92011-09-12 15:25:57 -07001412#define MSM_FB_PRIM_BUF_SIZE (1376 * 768 * 4 * 3) /* 4 bpp x 3 pages */
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001413#else
kuogee hsieh3830eb92011-09-12 15:25:57 -07001414#define MSM_FB_PRIM_BUF_SIZE (1376 * 768 * 4 * 2) /* 4 bpp x 2 pages */
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001415#endif
1416
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001417
1418#ifdef CONFIG_FB_MSM_HDMI_MSM_PANEL
kuogee hsieh3830eb92011-09-12 15:25:57 -07001419#define MSM_FB_EXT_BUF_SIZE (1920 * 1088 * 2 * 1) /* 2 bpp x 1 page */
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001420#elif defined(CONFIG_FB_MSM_TVOUT)
kuogee hsieh3830eb92011-09-12 15:25:57 -07001421#define MSM_FB_EXT_BUF_SIZE (720 * 576 * 2 * 2) /* 2 bpp x 2 pages */
1422#else
1423#define MSM_FB_EXT_BUF_SIZE 0
1424#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001425
kuogee hsieh3830eb92011-09-12 15:25:57 -07001426#ifdef CONFIG_FB_MSM_OVERLAY_WRITEBACK
1427/* width x height x 3 bpp x 2 frame buffer */
1428#define MSM_FB_WRITEBACK_SIZE (1376 * 768 * 3 * 2)
1429#define MSM_FB_WRITEBACK_OFFSET \
1430 (MSM_FB_PRIM_BUF_SIZE + MSM_FB_EXT_BUF_SIZE)
1431#else
1432#define MSM_FB_WRITEBACK_SIZE 0
1433#define MSM_FB_WRITEBACK_OFFSET 0
1434#endif
1435
Ravishangar Kalyanamf4ef7282011-10-10 17:39:48 -07001436#ifdef CONFIG_FB_MSM_HDMI_AS_PRIMARY
1437/* 4 bpp x 2 page HDMI case */
1438#define MSM_FB_SIZE roundup((1920 * 1088 * 4 * 2), 4096)
1439#else
kuogee hsieh3830eb92011-09-12 15:25:57 -07001440/* Note: must be multiple of 4096 */
1441#define MSM_FB_SIZE roundup(MSM_FB_PRIM_BUF_SIZE + MSM_FB_EXT_BUF_SIZE + \
1442 MSM_FB_WRITEBACK_SIZE, 4096)
Ravishangar Kalyanamf4ef7282011-10-10 17:39:48 -07001443#endif
kuogee hsieh3830eb92011-09-12 15:25:57 -07001444
1445static int writeback_offset(void)
1446{
1447 return MSM_FB_WRITEBACK_OFFSET;
1448}
1449
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001450
1451#define MDP_VSYNC_GPIO 0
1452
Ravishangar Kalyanamf8e21952011-07-28 16:47:44 -07001453#define PANEL_NAME_MAX_LEN 30
1454#define MIPI_CMD_NOVATEK_QHD_PANEL_NAME "mipi_cmd_novatek_qhd"
1455#define MIPI_VIDEO_NOVATEK_QHD_PANEL_NAME "mipi_video_novatek_qhd"
1456#define MIPI_VIDEO_TOSHIBA_WSVGA_PANEL_NAME "mipi_video_toshiba_wsvga"
1457#define MIPI_VIDEO_CHIMEI_WXGA_PANEL_NAME "mipi_video_chimei_wxga"
1458#define MIPI_VIDEO_SIMULATOR_VGA_PANEL_NAME "mipi_video_simulator_vga"
1459#define MIPI_CMD_RENESAS_FWVGA_PANEL_NAME "mipi_cmd_renesas_fwvga"
1460#define HDMI_PANEL_NAME "hdmi_msm"
1461#define TVOUT_PANEL_NAME "tvout_msm"
Amir Samuelov0c7270f2011-09-07 03:13:47 +03001462
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001463static struct resource msm_fb_resources[] = {
1464 {
1465 .flags = IORESOURCE_DMA,
1466 }
1467};
1468
Amir Samuelov0c7270f2011-09-07 03:13:47 +03001469static int msm_fb_detect_panel(const char *name)
1470{
1471 if (machine_is_msm8960_liquid()) {
Ravishangar Kalyanamf8e21952011-07-28 16:47:44 -07001472 if (!strncmp(name, MIPI_VIDEO_CHIMEI_WXGA_PANEL_NAME,
1473 strnlen(MIPI_VIDEO_CHIMEI_WXGA_PANEL_NAME,
1474 PANEL_NAME_MAX_LEN)))
Amir Samuelov0c7270f2011-09-07 03:13:47 +03001475 return 0;
1476 } else {
Ravishangar Kalyanamf8e21952011-07-28 16:47:44 -07001477 if (!strncmp(name, MIPI_VIDEO_TOSHIBA_WSVGA_PANEL_NAME,
1478 strnlen(MIPI_VIDEO_TOSHIBA_WSVGA_PANEL_NAME,
1479 PANEL_NAME_MAX_LEN)))
Amir Samuelov0c7270f2011-09-07 03:13:47 +03001480 return 0;
Ravishangar Kalyanamf8e21952011-07-28 16:47:44 -07001481
1482#ifndef CONFIG_FB_MSM_MIPI_PANEL_DETECT
1483 if (!strncmp(name, MIPI_VIDEO_NOVATEK_QHD_PANEL_NAME,
1484 strnlen(MIPI_VIDEO_NOVATEK_QHD_PANEL_NAME,
1485 PANEL_NAME_MAX_LEN)))
1486 return 0;
1487
1488 if (!strncmp(name, MIPI_CMD_NOVATEK_QHD_PANEL_NAME,
1489 strnlen(MIPI_CMD_NOVATEK_QHD_PANEL_NAME,
1490 PANEL_NAME_MAX_LEN)))
1491 return 0;
1492
1493 if (!strncmp(name, MIPI_VIDEO_SIMULATOR_VGA_PANEL_NAME,
1494 strnlen(MIPI_VIDEO_SIMULATOR_VGA_PANEL_NAME,
1495 PANEL_NAME_MAX_LEN)))
1496 return 0;
1497
1498 if (!strncmp(name, MIPI_CMD_RENESAS_FWVGA_PANEL_NAME,
1499 strnlen(MIPI_CMD_RENESAS_FWVGA_PANEL_NAME,
1500 PANEL_NAME_MAX_LEN)))
1501 return 0;
1502#endif
Amir Samuelov0c7270f2011-09-07 03:13:47 +03001503 }
1504
Ravishangar Kalyanamf8e21952011-07-28 16:47:44 -07001505 if (!strncmp(name, HDMI_PANEL_NAME,
1506 strnlen(HDMI_PANEL_NAME,
1507 PANEL_NAME_MAX_LEN)))
1508 return 0;
Amir Samuelov0c7270f2011-09-07 03:13:47 +03001509
Ravishangar Kalyanamf8e21952011-07-28 16:47:44 -07001510 if (!strncmp(name, TVOUT_PANEL_NAME,
1511 strnlen(TVOUT_PANEL_NAME,
1512 PANEL_NAME_MAX_LEN)))
1513 return 0;
1514
1515 pr_warning("%s: not supported '%s'", __func__, name);
Amir Samuelov0c7270f2011-09-07 03:13:47 +03001516 return -ENODEV;
1517}
1518
1519static struct msm_fb_platform_data msm_fb_pdata = {
1520 .detect_client = msm_fb_detect_panel,
1521};
Amir Samuelov0c7270f2011-09-07 03:13:47 +03001522
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001523static struct platform_device msm_fb_device = {
1524 .name = "msm_fb",
1525 .id = 0,
1526 .num_resources = ARRAY_SIZE(msm_fb_resources),
1527 .resource = msm_fb_resources,
Amir Samuelov0c7270f2011-09-07 03:13:47 +03001528 .dev.platform_data = &msm_fb_pdata,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001529};
1530
1531static bool dsi_power_on;
1532
Amir Samuelov0c7270f2011-09-07 03:13:47 +03001533/**
1534 * LiQUID panel on/off
1535 *
1536 * @param on
1537 *
1538 * @return int
1539 */
1540static int mipi_dsi_liquid_panel_power(int on)
1541{
1542 static struct regulator *reg_l2, *reg_ext_3p3v;
1543 static int gpio21, gpio24, gpio43;
1544 int rc;
1545
1546 pr_info("%s: on=%d\n", __func__, on);
1547
1548 gpio21 = PM8921_GPIO_PM_TO_SYS(21); /* disp power enable_n */
1549 gpio43 = PM8921_GPIO_PM_TO_SYS(43); /* Displays Enable (rst_n)*/
1550 gpio24 = PM8921_GPIO_PM_TO_SYS(24); /* Backlight PWM */
1551
1552 if (!dsi_power_on) {
1553
1554 reg_l2 = regulator_get(&msm_mipi_dsi1_device.dev,
1555 "dsi_vdda");
1556 if (IS_ERR(reg_l2)) {
1557 pr_err("could not get 8921_l2, rc = %ld\n",
1558 PTR_ERR(reg_l2));
1559 return -ENODEV;
1560 }
1561
1562 rc = regulator_set_voltage(reg_l2, 1200000, 1200000);
1563 if (rc) {
1564 pr_err("set_voltage l2 failed, rc=%d\n", rc);
1565 return -EINVAL;
1566 }
1567
1568 reg_ext_3p3v = regulator_get(&msm_mipi_dsi1_device.dev,
1569 "vdd_lvds_3p3v");
1570 if (IS_ERR(reg_ext_3p3v)) {
1571 pr_err("could not get reg_ext_3p3v, rc = %ld\n",
1572 PTR_ERR(reg_ext_3p3v));
1573 return -ENODEV;
1574 }
1575
1576 rc = gpio_request(gpio21, "disp_pwr_en_n");
1577 if (rc) {
1578 pr_err("request gpio 21 failed, rc=%d\n", rc);
1579 return -ENODEV;
1580 }
1581
1582 rc = gpio_request(gpio43, "disp_rst_n");
1583 if (rc) {
1584 pr_err("request gpio 43 failed, rc=%d\n", rc);
1585 return -ENODEV;
1586 }
1587
1588 rc = gpio_request(gpio24, "disp_backlight_pwm");
1589 if (rc) {
1590 pr_err("request gpio 24 failed, rc=%d\n", rc);
1591 return -ENODEV;
1592 }
1593
1594 dsi_power_on = true;
1595 }
1596
1597 if (on) {
1598 rc = regulator_set_optimum_mode(reg_l2, 100000);
1599 if (rc < 0) {
1600 pr_err("set_optimum_mode l2 failed, rc=%d\n", rc);
1601 return -EINVAL;
1602 }
1603 rc = regulator_enable(reg_l2);
1604 if (rc) {
1605 pr_err("enable l2 failed, rc=%d\n", rc);
1606 return -ENODEV;
1607 }
1608
1609 rc = regulator_enable(reg_ext_3p3v);
1610 if (rc) {
1611 pr_err("enable reg_ext_3p3v failed, rc=%d\n", rc);
1612 return -ENODEV;
1613 }
1614
1615 /* set reset pin before power enable */
1616 gpio_set_value_cansleep(gpio43, 0); /* disp disable (resx=0) */
1617
1618 gpio_set_value_cansleep(gpio21, 0); /* disp power enable_n */
1619 msleep(20);
1620 gpio_set_value_cansleep(gpio43, 1); /* disp enable */
1621 msleep(20);
1622 gpio_set_value_cansleep(gpio43, 0); /* disp enable */
1623 msleep(20);
1624 gpio_set_value_cansleep(gpio43, 1); /* disp enable */
1625 msleep(20);
1626 } else {
1627 gpio_set_value_cansleep(gpio43, 0);
1628 gpio_set_value_cansleep(gpio21, 1);
1629
1630 rc = regulator_disable(reg_l2);
1631 if (rc) {
1632 pr_err("disable reg_l2 failed, rc=%d\n", rc);
1633 return -ENODEV;
1634 }
1635 rc = regulator_disable(reg_ext_3p3v);
1636 if (rc) {
1637 pr_err("disable reg_ext_3p3v failed, rc=%d\n", rc);
1638 return -ENODEV;
1639 }
1640 rc = regulator_set_optimum_mode(reg_l2, 100);
1641 if (rc < 0) {
1642 pr_err("set_optimum_mode l2 failed, rc=%d\n", rc);
1643 return -EINVAL;
1644 }
1645 }
1646
1647 return 0;
1648}
1649
1650static int mipi_dsi_cdp_panel_power(int on)
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001651{
1652 static struct regulator *reg_l8, *reg_l23, *reg_l2;
Nagamalleswararao Ganjieac5dfa2011-07-23 17:31:16 -07001653 static int gpio43;
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001654 int rc;
1655
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001656 pr_info("%s: state : %d\n", __func__, on);
1657
1658 if (!dsi_power_on) {
1659
1660 reg_l8 = regulator_get(&msm_mipi_dsi1_device.dev,
1661 "dsi_vdc");
1662 if (IS_ERR(reg_l8)) {
1663 pr_err("could not get 8921_l8, rc = %ld\n",
1664 PTR_ERR(reg_l8));
1665 return -ENODEV;
1666 }
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001667 reg_l23 = regulator_get(&msm_mipi_dsi1_device.dev,
1668 "dsi_vddio");
1669 if (IS_ERR(reg_l23)) {
1670 pr_err("could not get 8921_l23, rc = %ld\n",
1671 PTR_ERR(reg_l23));
1672 return -ENODEV;
1673 }
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001674 reg_l2 = regulator_get(&msm_mipi_dsi1_device.dev,
1675 "dsi_vdda");
1676 if (IS_ERR(reg_l2)) {
1677 pr_err("could not get 8921_l2, rc = %ld\n",
1678 PTR_ERR(reg_l2));
1679 return -ENODEV;
1680 }
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001681 rc = regulator_set_voltage(reg_l8, 2800000, 3000000);
1682 if (rc) {
1683 pr_err("set_voltage l8 failed, rc=%d\n", rc);
1684 return -EINVAL;
1685 }
1686 rc = regulator_set_voltage(reg_l23, 1800000, 1800000);
1687 if (rc) {
1688 pr_err("set_voltage l23 failed, rc=%d\n", rc);
1689 return -EINVAL;
1690 }
1691 rc = regulator_set_voltage(reg_l2, 1200000, 1200000);
1692 if (rc) {
1693 pr_err("set_voltage l2 failed, rc=%d\n", rc);
1694 return -EINVAL;
1695 }
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001696 gpio43 = PM8921_GPIO_PM_TO_SYS(43);
1697 rc = gpio_request(gpio43, "disp_rst_n");
1698 if (rc) {
1699 pr_err("request gpio 43 failed, rc=%d\n", rc);
1700 return -ENODEV;
1701 }
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001702 dsi_power_on = true;
1703 }
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001704 if (on) {
1705 rc = regulator_set_optimum_mode(reg_l8, 100000);
1706 if (rc < 0) {
1707 pr_err("set_optimum_mode l8 failed, rc=%d\n", rc);
1708 return -EINVAL;
1709 }
1710 rc = regulator_set_optimum_mode(reg_l23, 100000);
1711 if (rc < 0) {
1712 pr_err("set_optimum_mode l23 failed, rc=%d\n", rc);
1713 return -EINVAL;
1714 }
1715 rc = regulator_set_optimum_mode(reg_l2, 100000);
1716 if (rc < 0) {
1717 pr_err("set_optimum_mode l2 failed, rc=%d\n", rc);
1718 return -EINVAL;
1719 }
1720 rc = regulator_enable(reg_l8);
1721 if (rc) {
1722 pr_err("enable l8 failed, rc=%d\n", rc);
1723 return -ENODEV;
1724 }
1725 rc = regulator_enable(reg_l23);
1726 if (rc) {
1727 pr_err("enable l8 failed, rc=%d\n", rc);
1728 return -ENODEV;
1729 }
1730 rc = regulator_enable(reg_l2);
1731 if (rc) {
1732 pr_err("enable l2 failed, rc=%d\n", rc);
1733 return -ENODEV;
1734 }
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001735 gpio_set_value_cansleep(gpio43, 1);
1736 } else {
Nagamalleswararao Ganjica0adc02011-09-22 20:35:53 -07001737 rc = regulator_disable(reg_l2);
1738 if (rc) {
1739 pr_err("disable reg_l2 failed, rc=%d\n", rc);
1740 return -ENODEV;
1741 }
1742 rc = regulator_disable(reg_l8);
1743 if (rc) {
1744 pr_err("disable reg_l8 failed, rc=%d\n", rc);
1745 return -ENODEV;
1746 }
1747 rc = regulator_disable(reg_l23);
1748 if (rc) {
1749 pr_err("disable reg_l23 failed, rc=%d\n", rc);
1750 return -ENODEV;
1751 }
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001752 rc = regulator_set_optimum_mode(reg_l8, 100);
1753 if (rc < 0) {
1754 pr_err("set_optimum_mode l8 failed, rc=%d\n", rc);
1755 return -EINVAL;
1756 }
1757 rc = regulator_set_optimum_mode(reg_l23, 100);
1758 if (rc < 0) {
1759 pr_err("set_optimum_mode l23 failed, rc=%d\n", rc);
1760 return -EINVAL;
1761 }
1762 rc = regulator_set_optimum_mode(reg_l2, 100);
1763 if (rc < 0) {
1764 pr_err("set_optimum_mode l2 failed, rc=%d\n", rc);
1765 return -EINVAL;
1766 }
1767 gpio_set_value_cansleep(gpio43, 0);
1768 }
1769 return 0;
1770}
1771
Amir Samuelov0c7270f2011-09-07 03:13:47 +03001772static int mipi_dsi_panel_power(int on)
1773{
1774 int ret;
1775
1776 pr_info("%s: on=%d\n", __func__, on);
1777
1778 if (machine_is_msm8960_liquid())
1779 ret = mipi_dsi_liquid_panel_power(on);
1780 else
1781 ret = mipi_dsi_cdp_panel_power(on);
1782
1783 return ret;
1784}
1785
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001786static struct mipi_dsi_platform_data mipi_dsi_pdata = {
1787 .vsync_gpio = MDP_VSYNC_GPIO,
1788 .dsi_power_save = mipi_dsi_panel_power,
1789};
1790
1791#ifdef CONFIG_MSM_BUS_SCALING
1792
1793static struct msm_bus_vectors mdp_init_vectors[] = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001794 {
1795 .src = MSM_BUS_MASTER_MDP_PORT0,
1796 .dst = MSM_BUS_SLAVE_EBI_CH0,
1797 .ab = 0,
1798 .ib = 0,
1799 },
Ravishangar Kalyanam882930f2011-07-08 17:51:52 -07001800};
1801
Ravishangar Kalyanamf4ef7282011-10-10 17:39:48 -07001802#ifdef CONFIG_FB_MSM_HDMI_AS_PRIMARY
1803static struct msm_bus_vectors hdmi_as_primary_vectors[] = {
1804 /* If HDMI is used as primary */
1805 {
1806 .src = MSM_BUS_MASTER_MDP_PORT0,
1807 .dst = MSM_BUS_SLAVE_EBI_CH0,
1808 .ab = 2000000000,
1809 .ib = 2000000000,
1810 },
1811};
1812static struct msm_bus_paths mdp_bus_scale_usecases[] = {
1813 {
1814 ARRAY_SIZE(mdp_init_vectors),
1815 mdp_init_vectors,
1816 },
1817 {
1818 ARRAY_SIZE(hdmi_as_primary_vectors),
1819 hdmi_as_primary_vectors,
1820 },
1821 {
1822 ARRAY_SIZE(hdmi_as_primary_vectors),
1823 hdmi_as_primary_vectors,
1824 },
1825 {
1826 ARRAY_SIZE(hdmi_as_primary_vectors),
1827 hdmi_as_primary_vectors,
1828 },
1829 {
1830 ARRAY_SIZE(hdmi_as_primary_vectors),
1831 hdmi_as_primary_vectors,
1832 },
1833 {
1834 ARRAY_SIZE(hdmi_as_primary_vectors),
1835 hdmi_as_primary_vectors,
1836 },
1837};
1838#else
Ravishangar Kalyanam882930f2011-07-08 17:51:52 -07001839static struct msm_bus_vectors mdp_ui_vectors[] = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001840 {
1841 .src = MSM_BUS_MASTER_MDP_PORT0,
1842 .dst = MSM_BUS_SLAVE_EBI_CH0,
Ravishangar Kalyanam882930f2011-07-08 17:51:52 -07001843 .ab = 216000000 * 2,
1844 .ib = 270000000 * 2,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001845 },
1846};
1847
1848static struct msm_bus_vectors mdp_vga_vectors[] = {
1849 /* VGA and less video */
1850 {
1851 .src = MSM_BUS_MASTER_MDP_PORT0,
1852 .dst = MSM_BUS_SLAVE_EBI_CH0,
Ravishangar Kalyanam882930f2011-07-08 17:51:52 -07001853 .ab = 216000000 * 2,
1854 .ib = 270000000 * 2,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001855 },
1856};
1857
1858static struct msm_bus_vectors mdp_720p_vectors[] = {
1859 /* 720p and less video */
1860 {
1861 .src = MSM_BUS_MASTER_MDP_PORT0,
1862 .dst = MSM_BUS_SLAVE_EBI_CH0,
Ravishangar Kalyanam882930f2011-07-08 17:51:52 -07001863 .ab = 230400000 * 2,
1864 .ib = 288000000 * 2,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001865 },
1866};
1867
1868static struct msm_bus_vectors mdp_1080p_vectors[] = {
1869 /* 1080p and less video */
1870 {
1871 .src = MSM_BUS_MASTER_MDP_PORT0,
1872 .dst = MSM_BUS_SLAVE_EBI_CH0,
Ravishangar Kalyanam882930f2011-07-08 17:51:52 -07001873 .ab = 334080000 * 2,
1874 .ib = 417600000 * 2,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001875 },
1876};
1877
1878static struct msm_bus_paths mdp_bus_scale_usecases[] = {
1879 {
1880 ARRAY_SIZE(mdp_init_vectors),
1881 mdp_init_vectors,
1882 },
1883 {
Ravishangar Kalyanam882930f2011-07-08 17:51:52 -07001884 ARRAY_SIZE(mdp_ui_vectors),
1885 mdp_ui_vectors,
1886 },
1887 {
1888 ARRAY_SIZE(mdp_ui_vectors),
1889 mdp_ui_vectors,
1890 },
1891 {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001892 ARRAY_SIZE(mdp_vga_vectors),
1893 mdp_vga_vectors,
1894 },
1895 {
1896 ARRAY_SIZE(mdp_720p_vectors),
1897 mdp_720p_vectors,
1898 },
1899 {
1900 ARRAY_SIZE(mdp_1080p_vectors),
1901 mdp_1080p_vectors,
1902 },
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001903};
Ravishangar Kalyanamf4ef7282011-10-10 17:39:48 -07001904#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001905
1906static struct msm_bus_scale_pdata mdp_bus_scale_pdata = {
1907 mdp_bus_scale_usecases,
1908 ARRAY_SIZE(mdp_bus_scale_usecases),
1909 .name = "mdp",
1910};
1911
1912#endif
1913
Ravishangar Kalyanamf4ef7282011-10-10 17:39:48 -07001914#ifdef CONFIG_FB_MSM_HDMI_AS_PRIMARY
1915int mdp_core_clk_rate_table[] = {
1916 200000000,
1917 200000000,
1918 200000000,
1919 200000000,
1920};
1921#else
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001922int mdp_core_clk_rate_table[] = {
1923 85330000,
1924 85330000,
Nagamalleswararao Ganjiad31c982011-08-15 23:24:17 -07001925 160000000,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001926 200000000,
1927};
Ravishangar Kalyanamf4ef7282011-10-10 17:39:48 -07001928#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001929
1930static struct msm_panel_common_pdata mdp_pdata = {
1931 .gpio = MDP_VSYNC_GPIO,
Ravishangar Kalyanamf4ef7282011-10-10 17:39:48 -07001932#ifdef CONFIG_FB_MSM_HDMI_AS_PRIMARY
1933 .mdp_core_clk_rate = 200000000,
1934#else
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001935 .mdp_core_clk_rate = 85330000,
Ravishangar Kalyanamf4ef7282011-10-10 17:39:48 -07001936#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001937 .mdp_core_clk_table = mdp_core_clk_rate_table,
1938 .num_mdp_clk = ARRAY_SIZE(mdp_core_clk_rate_table),
1939#ifdef CONFIG_MSM_BUS_SCALING
1940 .mdp_bus_scale_table = &mdp_bus_scale_pdata,
1941#endif
1942 .mdp_rev = MDP_REV_42,
kuogee hsieh3830eb92011-09-12 15:25:57 -07001943 .writeback_offset = writeback_offset,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001944};
1945
1946static struct platform_device mipi_dsi_renesas_panel_device = {
1947 .name = "mipi_renesas",
1948 .id = 0,
1949};
1950
1951static struct platform_device mipi_dsi_simulator_panel_device = {
1952 .name = "mipi_simulator",
1953 .id = 0,
1954};
1955
Nagamalleswararao Ganjieac5dfa2011-07-23 17:31:16 -07001956#define LPM_CHANNEL0 0
1957static int toshiba_gpio[] = {LPM_CHANNEL0};
1958
1959static struct mipi_dsi_panel_platform_data toshiba_pdata = {
1960 .gpio = toshiba_gpio,
1961};
1962
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001963static struct platform_device mipi_dsi_toshiba_panel_device = {
1964 .name = "mipi_toshiba",
1965 .id = 0,
Nagamalleswararao Ganjieac5dfa2011-07-23 17:31:16 -07001966 .dev = {
1967 .platform_data = &toshiba_pdata,
1968 }
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001969};
1970
Amir Samuelov0c7270f2011-09-07 03:13:47 +03001971static int dsi2lvds_gpio[2] = {
1972 0,/* Backlight PWM-ID=0 for PMIC-GPIO#24 */
1973 0x1F08 /* DSI2LVDS Bridge GPIO Output, mask=0x1f, out=0x08 */
1974 };
1975
1976static struct msm_panel_common_pdata mipi_dsi2lvds_pdata = {
1977 .gpio_num = dsi2lvds_gpio,
1978};
1979
Chandan Uddaraju83eac3c2011-09-11 18:32:23 -07001980static struct mipi_dsi_phy_ctrl dsi_novatek_cmd_mode_phy_db = {
1981
1982/* DSI_BIT_CLK at 500MHz, 2 lane, RGB888 */
1983 {0x0F, 0x0a, 0x04, 0x00, 0x20}, /* regulator */
1984 /* timing */
1985 {0xab, 0x8a, 0x18, 0x00, 0x92, 0x97, 0x1b, 0x8c,
1986 0x0c, 0x03, 0x04, 0xa0},
1987 {0x5f, 0x00, 0x00, 0x10}, /* phy ctrl */
1988 {0xff, 0x00, 0x06, 0x00}, /* strength */
1989 /* pll control */
1990 {0x40, 0xf9, 0x30, 0xda, 0x00, 0x40, 0x03, 0x62,
1991 0x40, 0x07, 0x03,
1992 0x00, 0x1a, 0x00, 0x00, 0x02, 0x00, 0x20, 0x00, 0x01},
1993};
1994
1995static struct mipi_dsi_panel_platform_data novatek_pdata = {
1996 .phy_ctrl_settings = &dsi_novatek_cmd_mode_phy_db,
1997};
1998
1999static struct platform_device mipi_dsi_novatek_panel_device = {
2000 .name = "mipi_novatek",
2001 .id = 0,
2002 .dev = {
2003 .platform_data = &novatek_pdata,
2004 }
2005};
2006
Amir Samuelov0c7270f2011-09-07 03:13:47 +03002007static struct platform_device mipi_dsi2lvds_bridge_device = {
2008 .name = "mipi_tc358764",
2009 .id = 0,
2010 .dev.platform_data = &mipi_dsi2lvds_pdata,
2011};
2012
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002013#ifdef CONFIG_FB_MSM_HDMI_MSM_PANEL
2014static struct resource hdmi_msm_resources[] = {
2015 {
2016 .name = "hdmi_msm_qfprom_addr",
2017 .start = 0x00700000,
2018 .end = 0x007060FF,
2019 .flags = IORESOURCE_MEM,
2020 },
2021 {
2022 .name = "hdmi_msm_hdmi_addr",
2023 .start = 0x04A00000,
2024 .end = 0x04A00FFF,
2025 .flags = IORESOURCE_MEM,
2026 },
2027 {
2028 .name = "hdmi_msm_irq",
2029 .start = HDMI_IRQ,
2030 .end = HDMI_IRQ,
2031 .flags = IORESOURCE_IRQ,
2032 },
2033};
2034
2035static int hdmi_enable_5v(int on);
2036static int hdmi_core_power(int on, int show);
2037static int hdmi_cec_power(int on);
2038
2039static struct msm_hdmi_platform_data hdmi_msm_data = {
2040 .irq = HDMI_IRQ,
2041 .enable_5v = hdmi_enable_5v,
2042 .core_power = hdmi_core_power,
2043 .cec_power = hdmi_cec_power,
2044};
2045
2046static struct platform_device hdmi_msm_device = {
2047 .name = "hdmi_msm",
2048 .id = 0,
2049 .num_resources = ARRAY_SIZE(hdmi_msm_resources),
2050 .resource = hdmi_msm_resources,
2051 .dev.platform_data = &hdmi_msm_data,
2052};
2053#endif /* CONFIG_FB_MSM_HDMI_MSM_PANEL */
2054
Ravishangar Kalyanam882930f2011-07-08 17:51:52 -07002055#ifdef CONFIG_MSM_BUS_SCALING
2056static struct msm_bus_vectors dtv_bus_init_vectors[] = {
2057 {
2058 .src = MSM_BUS_MASTER_MDP_PORT0,
2059 .dst = MSM_BUS_SLAVE_EBI_CH0,
2060 .ab = 0,
2061 .ib = 0,
2062 },
2063};
Ravishangar Kalyanamf4ef7282011-10-10 17:39:48 -07002064
2065#ifdef CONFIG_FB_MSM_HDMI_AS_PRIMARY
2066static struct msm_bus_vectors dtv_bus_def_vectors[] = {
2067 {
2068 .src = MSM_BUS_MASTER_MDP_PORT0,
2069 .dst = MSM_BUS_SLAVE_EBI_CH0,
2070 .ab = 2000000000,
2071 .ib = 2000000000,
2072 },
2073};
2074#else
Ravishangar Kalyanam882930f2011-07-08 17:51:52 -07002075static struct msm_bus_vectors dtv_bus_def_vectors[] = {
2076 {
2077 .src = MSM_BUS_MASTER_MDP_PORT0,
2078 .dst = MSM_BUS_SLAVE_EBI_CH0,
2079 .ab = 566092800 * 2,
2080 .ib = 707616000 * 2,
2081 },
2082};
Ravishangar Kalyanamf4ef7282011-10-10 17:39:48 -07002083#endif
2084
Ravishangar Kalyanam882930f2011-07-08 17:51:52 -07002085static struct msm_bus_paths dtv_bus_scale_usecases[] = {
2086 {
2087 ARRAY_SIZE(dtv_bus_init_vectors),
2088 dtv_bus_init_vectors,
2089 },
2090 {
2091 ARRAY_SIZE(dtv_bus_def_vectors),
2092 dtv_bus_def_vectors,
2093 },
2094};
2095static struct msm_bus_scale_pdata dtv_bus_scale_pdata = {
2096 dtv_bus_scale_usecases,
2097 ARRAY_SIZE(dtv_bus_scale_usecases),
2098 .name = "dtv",
2099};
2100
2101static struct lcdc_platform_data dtv_pdata = {
2102 .bus_scale_table = &dtv_bus_scale_pdata,
2103};
2104#endif
2105
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002106static void __init msm_fb_add_devices(void)
2107{
Amir Samuelov0c7270f2011-09-07 03:13:47 +03002108 struct platform_device *ptr = NULL;
2109
2110 if (machine_is_msm8960_liquid())
2111 ptr = &mipi_dsi2lvds_bridge_device;
2112 else
2113 ptr = &mipi_dsi_toshiba_panel_device;
2114 platform_add_devices(&ptr, 1);
2115
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002116 if (machine_is_msm8x60_rumi3()) {
2117 msm_fb_register_device("mdp", NULL);
2118 mipi_dsi_pdata.target_type = 1;
2119 } else
2120 msm_fb_register_device("mdp", &mdp_pdata);
2121 msm_fb_register_device("mipi_dsi", &mipi_dsi_pdata);
Ravishangar Kalyanam882930f2011-07-08 17:51:52 -07002122#ifdef CONFIG_MSM_BUS_SCALING
2123 msm_fb_register_device("dtv", &dtv_pdata);
2124#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002125}
2126
Ravishangar Kalyanamba99e512011-07-20 12:57:19 -07002127static struct gpiomux_setting mdp_vsync_suspend_cfg = {
2128 .func = GPIOMUX_FUNC_GPIO,
2129 .drv = GPIOMUX_DRV_2MA,
2130 .pull = GPIOMUX_PULL_DOWN,
2131};
2132
2133static struct gpiomux_setting mdp_vsync_active_cfg = {
2134 .func = GPIOMUX_FUNC_1,
2135 .drv = GPIOMUX_DRV_2MA,
2136 .pull = GPIOMUX_PULL_DOWN,
2137};
2138
2139static struct msm_gpiomux_config msm8960_mdp_vsync_configs[] __initdata = {
2140 {
2141 .gpio = MDP_VSYNC_GPIO,
2142 .settings = {
2143 [GPIOMUX_ACTIVE] = &mdp_vsync_active_cfg,
2144 [GPIOMUX_SUSPENDED] = &mdp_vsync_suspend_cfg,
2145 },
2146 }
2147};
2148
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002149#ifdef CONFIG_FB_MSM_HDMI_MSM_PANEL
2150static struct gpiomux_setting hdmi_suspend_cfg = {
2151 .func = GPIOMUX_FUNC_GPIO,
2152 .drv = GPIOMUX_DRV_2MA,
2153 .pull = GPIOMUX_PULL_DOWN,
2154};
2155
2156static struct gpiomux_setting hdmi_active_1_cfg = {
2157 .func = GPIOMUX_FUNC_1,
2158 .drv = GPIOMUX_DRV_2MA,
2159 .pull = GPIOMUX_PULL_UP,
2160};
2161
2162static struct gpiomux_setting hdmi_active_2_cfg = {
2163 .func = GPIOMUX_FUNC_1,
2164 .drv = GPIOMUX_DRV_2MA,
2165 .pull = GPIOMUX_PULL_DOWN,
2166};
2167
2168static struct msm_gpiomux_config msm8960_hdmi_configs[] __initdata = {
2169 {
2170 .gpio = 99,
2171 .settings = {
2172 [GPIOMUX_ACTIVE] = &hdmi_active_1_cfg,
2173 [GPIOMUX_SUSPENDED] = &hdmi_suspend_cfg,
2174 },
2175 },
2176 {
2177 .gpio = 100,
2178 .settings = {
2179 [GPIOMUX_ACTIVE] = &hdmi_active_1_cfg,
2180 [GPIOMUX_SUSPENDED] = &hdmi_suspend_cfg,
2181 },
2182 },
2183 {
2184 .gpio = 101,
2185 .settings = {
2186 [GPIOMUX_ACTIVE] = &hdmi_active_1_cfg,
2187 [GPIOMUX_SUSPENDED] = &hdmi_suspend_cfg,
2188 },
2189 },
2190 {
2191 .gpio = 102,
2192 .settings = {
2193 [GPIOMUX_ACTIVE] = &hdmi_active_2_cfg,
2194 [GPIOMUX_SUSPENDED] = &hdmi_suspend_cfg,
2195 },
2196 },
2197};
2198
2199static int hdmi_enable_5v(int on)
2200{
2201 /* TBD: PM8921 regulator instead of 8901 */
2202 static struct regulator *reg_8921_hdmi_mvs; /* HDMI_5V */
2203 static int prev_on;
2204 int rc;
2205
2206 if (on == prev_on)
2207 return 0;
2208
2209 if (!reg_8921_hdmi_mvs)
2210 reg_8921_hdmi_mvs = regulator_get(&hdmi_msm_device.dev,
2211 "hdmi_mvs");
2212
2213 if (on) {
2214 rc = regulator_enable(reg_8921_hdmi_mvs);
2215 if (rc) {
2216 pr_err("'%s' regulator enable failed, rc=%d\n",
2217 "8921_hdmi_mvs", rc);
2218 return rc;
2219 }
2220 pr_debug("%s(on): success\n", __func__);
2221 } else {
2222 rc = regulator_disable(reg_8921_hdmi_mvs);
2223 if (rc)
2224 pr_warning("'%s' regulator disable failed, rc=%d\n",
2225 "8921_hdmi_mvs", rc);
2226 pr_debug("%s(off): success\n", __func__);
2227 }
2228
2229 prev_on = on;
2230
2231 return 0;
2232}
2233
2234static int hdmi_core_power(int on, int show)
2235{
2236 static struct regulator *reg_8921_l23, *reg_8921_s4;
2237 static int prev_on;
2238 int rc;
2239
2240 if (on == prev_on)
2241 return 0;
2242
2243 /* TBD: PM8921 regulator instead of 8901 */
Nagamalleswararao Ganjica0adc02011-09-22 20:35:53 -07002244 if (!reg_8921_l23) {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002245 reg_8921_l23 = regulator_get(&hdmi_msm_device.dev, "hdmi_avdd");
Nagamalleswararao Ganjica0adc02011-09-22 20:35:53 -07002246 if (IS_ERR(reg_8921_l23)) {
2247 pr_err("could not get reg_8921_l23, rc = %ld\n",
2248 PTR_ERR(reg_8921_l23));
2249 return -ENODEV;
2250 }
2251 rc = regulator_set_voltage(reg_8921_l23, 1800000, 1800000);
2252 if (rc) {
2253 pr_err("set_voltage failed for 8921_l23, rc=%d\n", rc);
2254 return -EINVAL;
2255 }
2256 }
2257 if (!reg_8921_s4) {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002258 reg_8921_s4 = regulator_get(&hdmi_msm_device.dev, "hdmi_vcc");
Nagamalleswararao Ganjica0adc02011-09-22 20:35:53 -07002259 if (IS_ERR(reg_8921_s4)) {
2260 pr_err("could not get reg_8921_s4, rc = %ld\n",
2261 PTR_ERR(reg_8921_s4));
2262 return -ENODEV;
2263 }
2264 rc = regulator_set_voltage(reg_8921_s4, 1800000, 1800000);
2265 if (rc) {
2266 pr_err("set_voltage failed for 8921_s4, rc=%d\n", rc);
2267 return -EINVAL;
2268 }
2269 }
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002270
2271 if (on) {
2272 rc = regulator_set_optimum_mode(reg_8921_l23, 100000);
2273 if (rc < 0) {
2274 pr_err("set_optimum_mode l23 failed, rc=%d\n", rc);
2275 return -EINVAL;
2276 }
Nagamalleswararao Ganjica0adc02011-09-22 20:35:53 -07002277 rc = regulator_enable(reg_8921_l23);
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002278 if (rc) {
2279 pr_err("'%s' regulator enable failed, rc=%d\n",
2280 "hdmi_avdd", rc);
2281 return rc;
2282 }
Nagamalleswararao Ganjica0adc02011-09-22 20:35:53 -07002283 rc = regulator_enable(reg_8921_s4);
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002284 if (rc) {
2285 pr_err("'%s' regulator enable failed, rc=%d\n",
2286 "hdmi_vcc", rc);
2287 return rc;
2288 }
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002289 rc = gpio_request(100, "HDMI_DDC_CLK");
2290 if (rc) {
2291 pr_err("'%s'(%d) gpio_request failed, rc=%d\n",
2292 "HDMI_DDC_CLK", 100, rc);
2293 goto error1;
2294 }
2295 rc = gpio_request(101, "HDMI_DDC_DATA");
2296 if (rc) {
2297 pr_err("'%s'(%d) gpio_request failed, rc=%d\n",
2298 "HDMI_DDC_DATA", 101, rc);
2299 goto error2;
2300 }
2301 rc = gpio_request(102, "HDMI_HPD");
2302 if (rc) {
2303 pr_err("'%s'(%d) gpio_request failed, rc=%d\n",
2304 "HDMI_HPD", 102, rc);
2305 goto error3;
2306 }
2307 pr_debug("%s(on): success\n", __func__);
2308 } else {
2309 gpio_free(100);
2310 gpio_free(101);
2311 gpio_free(102);
2312
Nagamalleswararao Ganjica0adc02011-09-22 20:35:53 -07002313 rc = regulator_disable(reg_8921_l23);
2314 if (rc) {
2315 pr_err("disable reg_8921_l23 failed, rc=%d\n", rc);
2316 return -ENODEV;
2317 }
2318 rc = regulator_disable(reg_8921_s4);
2319 if (rc) {
2320 pr_err("disable reg_8921_s4 failed, rc=%d\n", rc);
2321 return -ENODEV;
2322 }
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002323 rc = regulator_set_optimum_mode(reg_8921_l23, 100);
2324 if (rc < 0) {
2325 pr_err("set_optimum_mode l23 failed, rc=%d\n", rc);
2326 return -EINVAL;
2327 }
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002328 pr_debug("%s(off): success\n", __func__);
2329 }
2330
2331 prev_on = on;
2332
2333 return 0;
2334
2335error3:
2336 gpio_free(101);
2337error2:
2338 gpio_free(100);
2339error1:
2340 regulator_disable(reg_8921_l23);
Nagamalleswararao Ganjica0adc02011-09-22 20:35:53 -07002341 regulator_disable(reg_8921_s4);
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002342 return rc;
2343}
2344
2345static int hdmi_cec_power(int on)
2346{
2347 static int prev_on;
2348 int rc;
2349
2350 if (on == prev_on)
2351 return 0;
2352
2353 if (on) {
2354 rc = gpio_request(99, "HDMI_CEC_VAR");
2355 if (rc) {
2356 pr_err("'%s'(%d) gpio_request failed, rc=%d\n",
2357 "HDMI_CEC_VAR", 99, rc);
2358 goto error;
2359 }
2360 pr_debug("%s(on): success\n", __func__);
2361 } else {
2362 gpio_free(99);
2363 pr_debug("%s(off): success\n", __func__);
2364 }
2365
2366 prev_on = on;
2367
2368 return 0;
2369error:
2370 return rc;
2371}
2372#endif /* CONFIG_FB_MSM_HDMI_MSM_PANEL */
2373
2374static void __init msm8960_allocate_memory_regions(void)
2375{
2376 void *addr;
2377 unsigned long size;
2378
2379 size = MSM_FB_SIZE;
2380 addr = alloc_bootmem_align(size, 0x1000);
2381 msm_fb_resources[0].start = __pa(addr);
2382 msm_fb_resources[0].end = msm_fb_resources[0].start + size - 1;
2383 pr_info("allocating %lu bytes at %p (%lx physical) for fb\n",
2384 size, addr, __pa(addr));
2385
2386}
2387#ifdef CONFIG_WCD9310_CODEC
2388
2389#define TABLA_INTERRUPT_BASE (NR_MSM_IRQS + NR_GPIO_IRQS + NR_PM8921_IRQS)
2390
Patrick Lai3043fba2011-08-01 14:15:57 -07002391/* Micbias setting is based on 8660 CDP/MTP/FLUID requirement
2392 * 4 micbiases are used to power various analog and digital
2393 * microphones operating at 1800 mV. Technically, all micbiases
2394 * can source from single cfilter since all microphones operate
2395 * at the same voltage level. The arrangement below is to make
2396 * sure all cfilters are exercised. LDO_H regulator ouput level
2397 * does not need to be as high as 2.85V. It is choosen for
2398 * microphone sensitivity purpose.
2399 */
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002400static struct tabla_pdata tabla_platform_data = {
2401 .slimbus_slave_device = {
2402 .name = "tabla-slave",
2403 .e_addr = {0, 0, 0x10, 0, 0x17, 2},
2404 },
2405 .irq = MSM_GPIO_TO_INT(62),
2406 .irq_base = TABLA_INTERRUPT_BASE,
2407 .num_irqs = NR_TABLA_IRQS,
2408 .reset_gpio = PM8921_GPIO_PM_TO_SYS(34),
Patrick Lai3043fba2011-08-01 14:15:57 -07002409 .micbias = {
2410 .ldoh_v = TABLA_LDOH_2P85_V,
2411 .cfilt1_mv = 1800,
2412 .cfilt2_mv = 1800,
2413 .cfilt3_mv = 1800,
2414 .bias1_cfilt_sel = TABLA_CFILT1_SEL,
2415 .bias2_cfilt_sel = TABLA_CFILT2_SEL,
2416 .bias3_cfilt_sel = TABLA_CFILT3_SEL,
2417 .bias4_cfilt_sel = TABLA_CFILT3_SEL,
2418 }
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002419};
2420
2421static struct slim_device msm_slim_tabla = {
2422 .name = "tabla-slim",
2423 .e_addr = {0, 1, 0x10, 0, 0x17, 2},
2424 .dev = {
2425 .platform_data = &tabla_platform_data,
2426 },
2427};
Santosh Mardi60e19d92011-10-28 01:15:14 +05302428
2429static struct tabla_pdata tabla20_platform_data = {
2430 .slimbus_slave_device = {
2431 .name = "tabla-slave",
2432 .e_addr = {0, 0, 0x60, 0, 0x17, 2},
2433 },
2434 .irq = MSM_GPIO_TO_INT(62),
2435 .irq_base = TABLA_INTERRUPT_BASE,
2436 .num_irqs = NR_TABLA_IRQS,
2437 .reset_gpio = PM8921_GPIO_PM_TO_SYS(34),
2438 .micbias = {
2439 .ldoh_v = TABLA_LDOH_2P85_V,
2440 .cfilt1_mv = 1800,
2441 .cfilt2_mv = 1800,
2442 .cfilt3_mv = 1800,
2443 .bias1_cfilt_sel = TABLA_CFILT1_SEL,
2444 .bias2_cfilt_sel = TABLA_CFILT2_SEL,
2445 .bias3_cfilt_sel = TABLA_CFILT3_SEL,
2446 .bias4_cfilt_sel = TABLA_CFILT3_SEL,
2447 }
2448};
2449
2450static struct slim_device msm_slim_tabla20 = {
2451 .name = "tabla2x-slim",
2452 .e_addr = {0, 1, 0x60, 0, 0x17, 2},
2453 .dev = {
2454 .platform_data = &tabla20_platform_data,
2455 },
2456};
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002457#endif
2458
2459static struct slim_boardinfo msm_slim_devices[] = {
2460#ifdef CONFIG_WCD9310_CODEC
2461 {
2462 .bus_num = 1,
2463 .slim_slave = &msm_slim_tabla,
2464 },
Santosh Mardi60e19d92011-10-28 01:15:14 +05302465 {
2466 .bus_num = 1,
2467 .slim_slave = &msm_slim_tabla20,
2468 },
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002469#endif
2470 /* add more slimbus slaves as needed */
2471};
2472
Yunsen Wang5c1a7392011-07-09 19:10:16 -07002473#define MSM_WCNSS_PHYS 0x03000000
2474#define MSM_WCNSS_SIZE 0x280000
2475
2476static struct resource resources_wcnss_wlan[] = {
2477 {
2478 .start = RIVA_APPS_WLAN_RX_DATA_AVAIL_IRQ,
2479 .end = RIVA_APPS_WLAN_RX_DATA_AVAIL_IRQ,
2480 .name = "wcnss_wlanrx_irq",
2481 .flags = IORESOURCE_IRQ,
2482 },
2483 {
2484 .start = RIVA_APPS_WLAN_DATA_XFER_DONE_IRQ,
2485 .end = RIVA_APPS_WLAN_DATA_XFER_DONE_IRQ,
2486 .name = "wcnss_wlantx_irq",
2487 .flags = IORESOURCE_IRQ,
2488 },
2489 {
2490 .start = MSM_WCNSS_PHYS,
2491 .end = MSM_WCNSS_PHYS + MSM_WCNSS_SIZE - 1,
2492 .name = "wcnss_mmio",
2493 .flags = IORESOURCE_MEM,
2494 },
Ankur Nandwaniad0d9ac2011-09-26 11:49:25 -07002495 {
2496 .start = 84,
2497 .end = 88,
2498 .name = "wcnss_gpios_5wire",
2499 .flags = IORESOURCE_IO,
2500 },
Yunsen Wang5c1a7392011-07-09 19:10:16 -07002501};
2502
Ankur Nandwanib0039b02011-08-09 14:00:45 -07002503static struct qcom_wcnss_opts qcom_wcnss_pdata = {
2504 .has_48mhz_xo = 1,
2505};
2506
Yunsen Wang5c1a7392011-07-09 19:10:16 -07002507static struct platform_device msm_device_wcnss_wlan = {
2508 .name = "wcnss_wlan",
2509 .id = 0,
2510 .num_resources = ARRAY_SIZE(resources_wcnss_wlan),
2511 .resource = resources_wcnss_wlan,
Ankur Nandwanib0039b02011-08-09 14:00:45 -07002512 .dev = {.platform_data = &qcom_wcnss_pdata},
Yunsen Wang5c1a7392011-07-09 19:10:16 -07002513};
2514
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002515#if defined(CONFIG_CRYPTO_DEV_QCRYPTO) || \
2516 defined(CONFIG_CRYPTO_DEV_QCRYPTO_MODULE) || \
2517 defined(CONFIG_CRYPTO_DEV_QCEDEV) || \
2518 defined(CONFIG_CRYPTO_DEV_QCEDEV_MODULE)
2519
2520#define QCE_SIZE 0x10000
2521#define QCE_0_BASE 0x18500000
2522
2523#define QCE_HW_KEY_SUPPORT 0
2524#define QCE_SHA_HMAC_SUPPORT 1
2525#define QCE_SHARE_CE_RESOURCE 1
2526#define QCE_CE_SHARED 0
2527
2528static struct resource qcrypto_resources[] = {
2529 [0] = {
2530 .start = QCE_0_BASE,
2531 .end = QCE_0_BASE + QCE_SIZE - 1,
2532 .flags = IORESOURCE_MEM,
2533 },
2534 [1] = {
2535 .name = "crypto_channels",
2536 .start = DMOV_CE_IN_CHAN,
2537 .end = DMOV_CE_OUT_CHAN,
2538 .flags = IORESOURCE_DMA,
2539 },
2540 [2] = {
2541 .name = "crypto_crci_in",
2542 .start = DMOV_CE_IN_CRCI,
2543 .end = DMOV_CE_IN_CRCI,
2544 .flags = IORESOURCE_DMA,
2545 },
2546 [3] = {
2547 .name = "crypto_crci_out",
2548 .start = DMOV_CE_OUT_CRCI,
2549 .end = DMOV_CE_OUT_CRCI,
2550 .flags = IORESOURCE_DMA,
2551 },
2552};
2553
2554static struct resource qcedev_resources[] = {
2555 [0] = {
2556 .start = QCE_0_BASE,
2557 .end = QCE_0_BASE + QCE_SIZE - 1,
2558 .flags = IORESOURCE_MEM,
2559 },
2560 [1] = {
2561 .name = "crypto_channels",
2562 .start = DMOV_CE_IN_CHAN,
2563 .end = DMOV_CE_OUT_CHAN,
2564 .flags = IORESOURCE_DMA,
2565 },
2566 [2] = {
2567 .name = "crypto_crci_in",
2568 .start = DMOV_CE_IN_CRCI,
2569 .end = DMOV_CE_IN_CRCI,
2570 .flags = IORESOURCE_DMA,
2571 },
2572 [3] = {
2573 .name = "crypto_crci_out",
2574 .start = DMOV_CE_OUT_CRCI,
2575 .end = DMOV_CE_OUT_CRCI,
2576 .flags = IORESOURCE_DMA,
2577 },
2578};
2579
2580#endif
2581
2582#if defined(CONFIG_CRYPTO_DEV_QCRYPTO) || \
2583 defined(CONFIG_CRYPTO_DEV_QCRYPTO_MODULE)
2584
2585static struct msm_ce_hw_support qcrypto_ce_hw_suppport = {
2586 .ce_shared = QCE_CE_SHARED,
2587 .shared_ce_resource = QCE_SHARE_CE_RESOURCE,
2588 .hw_key_support = QCE_HW_KEY_SUPPORT,
2589 .sha_hmac = QCE_SHA_HMAC_SUPPORT,
2590};
2591
2592static struct platform_device qcrypto_device = {
2593 .name = "qcrypto",
2594 .id = 0,
2595 .num_resources = ARRAY_SIZE(qcrypto_resources),
2596 .resource = qcrypto_resources,
2597 .dev = {
2598 .coherent_dma_mask = DMA_BIT_MASK(32),
2599 .platform_data = &qcrypto_ce_hw_suppport,
2600 },
2601};
2602#endif
2603
2604#if defined(CONFIG_CRYPTO_DEV_QCEDEV) || \
2605 defined(CONFIG_CRYPTO_DEV_QCEDEV_MODULE)
2606
2607static struct msm_ce_hw_support qcedev_ce_hw_suppport = {
2608 .ce_shared = QCE_CE_SHARED,
2609 .shared_ce_resource = QCE_SHARE_CE_RESOURCE,
2610 .hw_key_support = QCE_HW_KEY_SUPPORT,
2611 .sha_hmac = QCE_SHA_HMAC_SUPPORT,
2612};
2613
2614static struct platform_device qcedev_device = {
2615 .name = "qce",
2616 .id = 0,
2617 .num_resources = ARRAY_SIZE(qcedev_resources),
2618 .resource = qcedev_resources,
2619 .dev = {
2620 .coherent_dma_mask = DMA_BIT_MASK(32),
2621 .platform_data = &qcedev_ce_hw_suppport,
2622 },
2623};
2624#endif
2625
2626
2627static int __init gpiomux_init(void)
2628{
2629 int rc;
2630
2631 rc = msm_gpiomux_init(NR_GPIO_IRQS);
2632 if (rc) {
2633 pr_err(KERN_ERR "msm_gpiomux_init failed %d\n", rc);
2634 return rc;
2635 }
2636
Nishant Pandit24153d82011-08-27 16:05:13 +05302637 msm_gpiomux_install(msm8960_cam_common_configs,
2638 ARRAY_SIZE(msm8960_cam_common_configs));
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002639
2640 msm_gpiomux_install(msm8960_gpiomux_configs,
Stepan Moskovchenkod2a45a82011-08-09 17:02:57 -07002641 ARRAY_SIZE(msm8960_gpiomux_configs));
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002642
2643 msm_gpiomux_install(msm8960_gsbi_configs,
2644 ARRAY_SIZE(msm8960_gsbi_configs));
2645
2646 msm_gpiomux_install(msm8960_cyts_configs,
2647 ARRAY_SIZE(msm8960_cyts_configs));
2648
2649 msm_gpiomux_install(msm8960_slimbus_config,
2650 ARRAY_SIZE(msm8960_slimbus_config));
2651
2652 msm_gpiomux_install(msm8960_audio_codec_configs,
2653 ARRAY_SIZE(msm8960_audio_codec_configs));
2654
Bhalchandra Gajare0e795c42011-08-15 18:10:30 -07002655 msm_gpiomux_install(msm8960_audio_auxpcm_configs,
2656 ARRAY_SIZE(msm8960_audio_auxpcm_configs));
2657
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002658#ifdef CONFIG_FB_MSM_HDMI_MSM_PANEL
2659 msm_gpiomux_install(msm8960_hdmi_configs,
2660 ARRAY_SIZE(msm8960_hdmi_configs));
2661#endif
2662
Ravishangar Kalyanamba99e512011-07-20 12:57:19 -07002663 msm_gpiomux_install(msm8960_mdp_vsync_configs,
2664 ARRAY_SIZE(msm8960_mdp_vsync_configs));
2665
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002666 msm_gpiomux_install(wcnss_5wire_interface,
2667 ARRAY_SIZE(wcnss_5wire_interface));
2668
2669 return 0;
2670}
2671
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002672#define MSM_SHARED_RAM_PHYS 0x80000000
2673
2674static struct pm8921_adc_amux pm8921_adc_channels_data[] = {
2675 {"vcoin", CHANNEL_VCOIN, CHAN_PATH_SCALING2, AMUX_RSV1,
2676 ADC_DECIMATION_TYPE2, ADC_SCALE_DEFAULT},
2677 {"vbat", CHANNEL_VBAT, CHAN_PATH_SCALING2, AMUX_RSV1,
2678 ADC_DECIMATION_TYPE2, ADC_SCALE_DEFAULT},
2679 {"dcin", CHANNEL_DCIN, CHAN_PATH_SCALING4, AMUX_RSV1,
2680 ADC_DECIMATION_TYPE2, ADC_SCALE_DEFAULT},
2681 {"ichg", CHANNEL_ICHG, CHAN_PATH_SCALING1, AMUX_RSV1,
2682 ADC_DECIMATION_TYPE2, ADC_SCALE_DEFAULT},
2683 {"vph_pwr", CHANNEL_VPH_PWR, CHAN_PATH_SCALING2, AMUX_RSV1,
2684 ADC_DECIMATION_TYPE2, ADC_SCALE_DEFAULT},
2685 {"ibat", CHANNEL_IBAT, CHAN_PATH_SCALING1, AMUX_RSV1,
2686 ADC_DECIMATION_TYPE2, ADC_SCALE_DEFAULT},
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002687 {"batt_therm", CHANNEL_BATT_THERM, CHAN_PATH_SCALING1, AMUX_RSV2,
2688 ADC_DECIMATION_TYPE2, ADC_SCALE_BATT_THERM},
2689 {"batt_id", CHANNEL_BATT_ID, CHAN_PATH_SCALING1, AMUX_RSV1,
2690 ADC_DECIMATION_TYPE2, ADC_SCALE_DEFAULT},
2691 {"usbin", CHANNEL_USBIN, CHAN_PATH_SCALING3, AMUX_RSV1,
2692 ADC_DECIMATION_TYPE2, ADC_SCALE_DEFAULT},
2693 {"pmic_therm", CHANNEL_DIE_TEMP, CHAN_PATH_SCALING1, AMUX_RSV1,
2694 ADC_DECIMATION_TYPE2, ADC_SCALE_PMIC_THERM},
2695 {"625mv", CHANNEL_625MV, CHAN_PATH_SCALING1, AMUX_RSV1,
2696 ADC_DECIMATION_TYPE2, ADC_SCALE_DEFAULT},
2697 {"125v", CHANNEL_125V, CHAN_PATH_SCALING1, AMUX_RSV1,
2698 ADC_DECIMATION_TYPE2, ADC_SCALE_DEFAULT},
2699 {"chg_temp", CHANNEL_CHG_TEMP, CHAN_PATH_SCALING1, AMUX_RSV1,
2700 ADC_DECIMATION_TYPE2, ADC_SCALE_DEFAULT},
Siddartha Mohanadoss77d106e2011-09-20 16:25:59 -07002701 {"pa_therm1", ADC_MPP_1_AMUX8, CHAN_PATH_SCALING1, AMUX_RSV1,
Siddartha Mohanadossb9e4d282011-09-13 17:50:11 -07002702 ADC_DECIMATION_TYPE2, ADC_SCALE_PA_THERM},
2703 {"xo_therm", CHANNEL_MUXOFF, CHAN_PATH_SCALING1, AMUX_RSV0,
2704 ADC_DECIMATION_TYPE2, ADC_SCALE_XOTHERM},
Siddartha Mohanadoss77d106e2011-09-20 16:25:59 -07002705 {"pa_therm0", ADC_MPP_1_AMUX3, CHAN_PATH_SCALING1, AMUX_RSV1,
2706 ADC_DECIMATION_TYPE2, ADC_SCALE_PA_THERM},
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002707};
2708
2709static struct pm8921_adc_properties pm8921_adc_data = {
2710 .adc_vdd_reference = 1800, /* milli-voltage for this adc */
2711 .bitresolution = 15,
2712 .bipolar = 0,
2713};
2714
2715static struct pm8921_adc_platform_data pm8921_adc_pdata = {
2716 .adc_channel = pm8921_adc_channels_data,
Siddartha Mohanadoss77d106e2011-09-20 16:25:59 -07002717 .adc_num_board_channel = ARRAY_SIZE(pm8921_adc_channels_data),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002718 .adc_prop = &pm8921_adc_data,
Siddartha Mohanadoss77d106e2011-09-20 16:25:59 -07002719 .adc_mpp_base = PM8921_MPP_PM_TO_SYS(1),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002720};
Stepan Moskovchenkod056fca2011-01-27 12:12:07 -08002721
Stepan Moskovchenkof441ca22010-12-01 19:31:16 -08002722static void __init msm8960_map_io(void)
2723{
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002724 msm_shared_ram_phys = MSM_SHARED_RAM_PHYS;
Stepan Moskovchenkof441ca22010-12-01 19:31:16 -08002725 msm_map_msm8960_io();
Jeff Ohlstein3a77f9f2011-09-06 14:50:20 -07002726
2727 if (socinfo_init() < 0)
2728 pr_err("socinfo_init() failed!\n");
Stepan Moskovchenkof441ca22010-12-01 19:31:16 -08002729}
2730
Stepan Moskovchenkof4fdfe52011-10-18 17:28:58 -07002731#ifdef CONFIG_ARCH_MSM8930
2732static void __init msm8930_map_io(void)
2733{
2734 msm_shared_ram_phys = MSM_SHARED_RAM_PHYS;
2735 msm_map_msm8930_io();
2736
2737 if (socinfo_init() < 0)
2738 pr_err("socinfo_init() failed!\n");
2739}
2740#endif
2741
Stepan Moskovchenkof441ca22010-12-01 19:31:16 -08002742static void __init msm8960_init_irq(void)
2743{
2744 unsigned int i;
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002745
2746 msm_mpm_irq_extn_init();
Stepan Moskovchenkof441ca22010-12-01 19:31:16 -08002747 gic_init(0, GIC_PPI_START, MSM_QGIC_DIST_BASE,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002748 (void *)MSM_QGIC_CPU_BASE);
Stepan Moskovchenkof441ca22010-12-01 19:31:16 -08002749
2750 /* Edge trigger PPIs except AVS_SVICINT and AVS_SVICINTSWDONE */
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002751 writel_relaxed(0xFFFFD7FF, MSM_QGIC_DIST_BASE + GIC_DIST_CONFIG + 4);
Stepan Moskovchenkof441ca22010-12-01 19:31:16 -08002752
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002753 writel_relaxed(0x0000FFFF, MSM_QGIC_DIST_BASE + GIC_DIST_ENABLE_SET);
2754 mb();
Stepan Moskovchenko50ede4e2010-12-13 18:12:19 -08002755
Stepan Moskovchenkof441ca22010-12-01 19:31:16 -08002756 /* FIXME: Not installing AVS_SVICINT and AVS_SVICINTSWDONE yet
2757 * as they are configured as level, which does not play nice with
2758 * handle_percpu_irq.
2759 */
2760 for (i = GIC_PPI_START; i < GIC_SPI_START; i++) {
2761 if (i != AVS_SVICINT && i != AVS_SVICINTSWDONE)
Thomas Gleixner6845664a2011-03-24 13:25:22 +01002762 irq_set_handler(i, handle_percpu_irq);
Stepan Moskovchenkof441ca22010-12-01 19:31:16 -08002763 }
2764}
2765
Stepan Moskovchenko73b943b2011-10-31 22:43:00 -07002766/* MSM8960 has 5 SDCC controllers */
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002767enum sdcc_controllers {
2768 SDCC1,
2769 SDCC2,
2770 SDCC3,
2771 SDCC4,
2772 SDCC5,
2773 MAX_SDCC_CONTROLLER
2774};
2775
Stepan Moskovchenko73b943b2011-10-31 22:43:00 -07002776/* All SDCC controllers require VDD/VCC voltage */
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002777static struct msm_mmc_reg_data mmc_vdd_reg_data[MAX_SDCC_CONTROLLER] = {
2778 /* SDCC1 : eMMC card connected */
2779 [SDCC1] = {
2780 .name = "sdc_vdd",
2781 .set_voltage_sup = 1,
Subhash Jadavani99ba53a2011-08-01 16:04:18 +05302782 .high_vol_level = 2950000,
2783 .low_vol_level = 2950000,
Subhash Jadavanidd7ef892011-08-18 16:49:57 +05302784 .always_on = 1,
2785 .lpm_sup = 1,
2786 .lpm_uA = 9000,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002787 .hpm_uA = 200000, /* 200mA */
2788 },
2789 /* SDCC3 : External card slot connected */
2790 [SDCC3] = {
2791 .name = "sdc_vdd",
2792 .set_voltage_sup = 1,
Subhash Jadavani99ba53a2011-08-01 16:04:18 +05302793 .high_vol_level = 2950000,
2794 .low_vol_level = 2950000,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002795 .hpm_uA = 600000, /* 600mA */
2796 }
2797};
2798
2799/* Only slots having eMMC card will require VCCQ voltage */
2800static struct msm_mmc_reg_data mmc_vccq_reg_data[1] = {
2801 /* SDCC1 : eMMC card connected */
2802 [SDCC1] = {
2803 .name = "sdc_vccq",
2804 .set_voltage_sup = 1,
2805 .always_on = 1,
Subhash Jadavani99ba53a2011-08-01 16:04:18 +05302806 .high_vol_level = 1800000,
2807 .low_vol_level = 1800000,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002808 .hpm_uA = 200000, /* 200mA */
2809 }
2810};
2811
2812/* All SDCC controllers may require voting for VDD PAD voltage */
2813static struct msm_mmc_reg_data mmc_vddp_reg_data[MAX_SDCC_CONTROLLER] = {
2814 /* SDCC3 : External card slot connected */
2815 [SDCC3] = {
2816 .name = "sdc_vddp",
2817 .set_voltage_sup = 1,
Subhash Jadavani99ba53a2011-08-01 16:04:18 +05302818 .high_vol_level = 2950000,
2819 .low_vol_level = 1850000,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002820 .always_on = 1,
2821 .lpm_sup = 1,
2822 /* Max. Active current required is 16 mA */
2823 .hpm_uA = 16000,
2824 /*
2825 * Sleep current required is ~300 uA. But min. vote can be
2826 * in terms of mA (min. 1 mA). So let's vote for 2 mA
2827 * during sleep.
2828 */
2829 .lpm_uA = 2000,
2830 }
2831};
2832
2833static struct msm_mmc_slot_reg_data mmc_slot_vreg_data[MAX_SDCC_CONTROLLER] = {
2834 /* SDCC1 : eMMC card connected */
2835 [SDCC1] = {
2836 .vdd_data = &mmc_vdd_reg_data[SDCC1],
2837 .vccq_data = &mmc_vccq_reg_data[SDCC1],
2838 },
2839 /* SDCC3 : External card slot connected */
2840 [SDCC3] = {
2841 .vdd_data = &mmc_vdd_reg_data[SDCC3],
2842 .vddp_data = &mmc_vddp_reg_data[SDCC3],
2843 }
2844};
2845
2846/* SDC1 pad data */
2847static struct msm_mmc_pad_drv sdc1_pad_drv_on_cfg[] = {
2848 {TLMM_HDRV_SDC1_CLK, GPIO_CFG_16MA},
Subhash Jadavani87bda5a2011-08-30 17:40:44 +05302849 {TLMM_HDRV_SDC1_CMD, GPIO_CFG_10MA},
2850 {TLMM_HDRV_SDC1_DATA, GPIO_CFG_10MA}
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002851};
2852
2853static struct msm_mmc_pad_drv sdc1_pad_drv_off_cfg[] = {
2854 {TLMM_HDRV_SDC1_CLK, GPIO_CFG_2MA},
2855 {TLMM_HDRV_SDC1_CMD, GPIO_CFG_2MA},
2856 {TLMM_HDRV_SDC1_DATA, GPIO_CFG_2MA}
2857};
2858
2859static struct msm_mmc_pad_pull sdc1_pad_pull_on_cfg[] = {
Subhash Jadavanib7b5b8a2011-09-13 13:00:40 +05302860 {TLMM_PULL_SDC1_CLK, GPIO_CFG_NO_PULL},
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002861 {TLMM_PULL_SDC1_CMD, GPIO_CFG_PULL_UP},
2862 {TLMM_PULL_SDC1_DATA, GPIO_CFG_PULL_UP}
2863};
2864
2865static struct msm_mmc_pad_pull sdc1_pad_pull_off_cfg[] = {
Subhash Jadavanib7b5b8a2011-09-13 13:00:40 +05302866 {TLMM_PULL_SDC1_CLK, GPIO_CFG_NO_PULL},
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002867 {TLMM_PULL_SDC1_CMD, GPIO_CFG_PULL_DOWN},
2868 {TLMM_PULL_SDC1_DATA, GPIO_CFG_PULL_DOWN}
2869};
2870
2871/* SDC3 pad data */
2872static struct msm_mmc_pad_drv sdc3_pad_drv_on_cfg[] = {
2873 {TLMM_HDRV_SDC3_CLK, GPIO_CFG_8MA},
2874 {TLMM_HDRV_SDC3_CMD, GPIO_CFG_8MA},
2875 {TLMM_HDRV_SDC3_DATA, GPIO_CFG_8MA}
2876};
2877
2878static struct msm_mmc_pad_drv sdc3_pad_drv_off_cfg[] = {
2879 {TLMM_HDRV_SDC3_CLK, GPIO_CFG_2MA},
2880 {TLMM_HDRV_SDC3_CMD, GPIO_CFG_2MA},
2881 {TLMM_HDRV_SDC3_DATA, GPIO_CFG_2MA}
2882};
2883
2884static struct msm_mmc_pad_pull sdc3_pad_pull_on_cfg[] = {
Subhash Jadavanib7b5b8a2011-09-13 13:00:40 +05302885 {TLMM_PULL_SDC3_CLK, GPIO_CFG_NO_PULL},
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002886 {TLMM_PULL_SDC3_CMD, GPIO_CFG_PULL_UP},
2887 {TLMM_PULL_SDC3_DATA, GPIO_CFG_PULL_UP}
2888};
2889
2890static struct msm_mmc_pad_pull sdc3_pad_pull_off_cfg[] = {
Subhash Jadavanib7b5b8a2011-09-13 13:00:40 +05302891 {TLMM_PULL_SDC3_CLK, GPIO_CFG_NO_PULL},
Subhash Jadavani46d4f342011-10-12 14:44:45 +05302892 /*
2893 * SDC3 CMD line should be PULLed UP otherwise fluid platform will
2894 * see transitions (1 -> 0 and 0 -> 1) on card detection line,
2895 * which would result in false card detection interrupts.
2896 */
2897 {TLMM_PULL_SDC3_CMD, GPIO_CFG_PULL_UP},
2898 /*
2899 * Keeping DATA lines status to PULL UP will make sure that
2900 * there is no current leak during sleep if external pull up
2901 * is connected to DATA lines.
2902 */
2903 {TLMM_PULL_SDC3_DATA, GPIO_CFG_PULL_UP}
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002904};
2905
2906struct msm_mmc_pad_pull_data mmc_pad_pull_data[MAX_SDCC_CONTROLLER] = {
2907 [SDCC1] = {
2908 .on = sdc1_pad_pull_on_cfg,
2909 .off = sdc1_pad_pull_off_cfg,
2910 .size = ARRAY_SIZE(sdc1_pad_pull_on_cfg)
2911 },
2912 [SDCC3] = {
2913 .on = sdc3_pad_pull_on_cfg,
2914 .off = sdc3_pad_pull_off_cfg,
2915 .size = ARRAY_SIZE(sdc3_pad_pull_on_cfg)
2916 },
2917};
2918
2919struct msm_mmc_pad_drv_data mmc_pad_drv_data[MAX_SDCC_CONTROLLER] = {
2920 [SDCC1] = {
2921 .on = sdc1_pad_drv_on_cfg,
2922 .off = sdc1_pad_drv_off_cfg,
2923 .size = ARRAY_SIZE(sdc1_pad_drv_on_cfg)
2924 },
2925 [SDCC3] = {
2926 .on = sdc3_pad_drv_on_cfg,
2927 .off = sdc3_pad_drv_off_cfg,
2928 .size = ARRAY_SIZE(sdc3_pad_drv_on_cfg)
2929 },
2930};
2931
2932struct msm_mmc_pad_data mmc_pad_data[MAX_SDCC_CONTROLLER] = {
2933 [SDCC1] = {
2934 .pull = &mmc_pad_pull_data[SDCC1],
2935 .drv = &mmc_pad_drv_data[SDCC1]
2936 },
2937 [SDCC3] = {
2938 .pull = &mmc_pad_pull_data[SDCC3],
2939 .drv = &mmc_pad_drv_data[SDCC3]
2940 },
2941};
2942
2943struct msm_mmc_pin_data mmc_slot_pin_data[MAX_SDCC_CONTROLLER] = {
2944 [SDCC1] = {
2945 .pad_data = &mmc_pad_data[SDCC1],
2946 },
2947 [SDCC3] = {
2948 .pad_data = &mmc_pad_data[SDCC3],
2949 },
2950};
2951
2952static unsigned int sdc1_sup_clk_rates[] = {
Subhash Jadavani0e027b72011-08-30 17:40:55 +05302953 400000, 24000000, 48000000
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002954};
2955
2956static unsigned int sdc3_sup_clk_rates[] = {
2957 400000, 24000000, 48000000, 96000000
2958};
2959
2960#ifdef CONFIG_MMC_MSM_SDC1_SUPPORT
2961static struct mmc_platform_data msm8960_sdc1_data = {
2962 .ocr_mask = MMC_VDD_27_28 | MMC_VDD_28_29,
2963#ifdef CONFIG_MMC_MSM_SDC1_8_BIT_SUPPORT
2964 .mmc_bus_width = MMC_CAP_8_BIT_DATA,
2965#else
2966 .mmc_bus_width = MMC_CAP_4_BIT_DATA,
2967#endif
2968 .sup_clk_table = sdc1_sup_clk_rates,
2969 .sup_clk_cnt = ARRAY_SIZE(sdc1_sup_clk_rates),
Subhash Jadavanib7655b62011-09-27 19:12:36 +05302970 .pclk_src_dfab = 1,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002971 .nonremovable = 1,
2972 .sdcc_v4_sup = true,
2973 .vreg_data = &mmc_slot_vreg_data[SDCC1],
Subhash Jadavani0e027b72011-08-30 17:40:55 +05302974 .pin_data = &mmc_slot_pin_data[SDCC1]
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002975};
2976#endif
2977
2978#ifdef CONFIG_MMC_MSM_SDC3_SUPPORT
2979static struct mmc_platform_data msm8960_sdc3_data = {
2980 .ocr_mask = MMC_VDD_27_28 | MMC_VDD_28_29,
2981 .mmc_bus_width = MMC_CAP_4_BIT_DATA,
2982 .sup_clk_table = sdc3_sup_clk_rates,
2983 .sup_clk_cnt = ARRAY_SIZE(sdc3_sup_clk_rates),
Subhash Jadavanib7655b62011-09-27 19:12:36 +05302984 .pclk_src_dfab = 1,
Subhash Jadavanib9ef7472011-09-21 18:37:28 +05302985#ifdef CONFIG_MMC_MSM_SDC3_WP_SUPPORT
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002986 .wpswitch_gpio = PM8921_GPIO_PM_TO_SYS(16),
Subhash Jadavanib9ef7472011-09-21 18:37:28 +05302987#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002988 .sdcc_v4_sup = true,
2989 .vreg_data = &mmc_slot_vreg_data[SDCC3],
2990 .pin_data = &mmc_slot_pin_data[SDCC3],
2991#ifdef CONFIG_MMC_MSM_CARD_HW_DETECTION
2992 .status_gpio = PM8921_GPIO_PM_TO_SYS(26),
2993 .status_irq = PM8921_GPIO_IRQ(PM8921_IRQ_BASE, 26),
2994 .irq_flags = IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING,
2995#endif
2996 .xpc_cap = 1,
2997 .uhs_caps = (MMC_CAP_UHS_SDR12 | MMC_CAP_UHS_SDR25 |
2998 MMC_CAP_UHS_SDR50 | MMC_CAP_UHS_DDR50 |
Subhash Jadavani0e027b72011-08-30 17:40:55 +05302999 MMC_CAP_MAX_CURRENT_600)
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003000};
3001#endif
3002
3003static void __init msm8960_init_mmc(void)
3004{
3005#ifdef CONFIG_MMC_MSM_SDC1_SUPPORT
3006 /* SDC1 : eMMC card connected */
3007 msm_add_sdcc(1, &msm8960_sdc1_data);
3008#endif
3009#ifdef CONFIG_MMC_MSM_SDC3_SUPPORT
3010 /* SDC3: External card slot */
3011 msm_add_sdcc(3, &msm8960_sdc3_data);
3012#endif
3013}
3014
3015static void __init msm8960_init_buses(void)
3016{
3017#ifdef CONFIG_MSM_BUS_SCALING
Gagan Macdc1dc142011-09-16 15:13:35 -06003018 msm_bus_rpm_set_mt_mask();
Gagan Macae154c4b2011-10-05 19:24:43 -06003019 msm_bus_8960_apps_fabric_pdata.rpm_enabled = 1;
3020 msm_bus_8960_sys_fabric_pdata.rpm_enabled = 1;
3021 msm_bus_8960_mm_fabric_pdata.rpm_enabled = 1;
3022 msm_bus_apps_fabric.dev.platform_data =
3023 &msm_bus_8960_apps_fabric_pdata;
3024 msm_bus_sys_fabric.dev.platform_data = &msm_bus_8960_sys_fabric_pdata;
3025 msm_bus_mm_fabric.dev.platform_data = &msm_bus_8960_mm_fabric_pdata;
3026 msm_bus_sys_fpb.dev.platform_data = &msm_bus_8960_sys_fpb_pdata;
3027 msm_bus_cpss_fpb.dev.platform_data = &msm_bus_8960_cpss_fpb_pdata;
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003028#endif
3029}
3030
3031static struct msm_spi_platform_data msm8960_qup_spi_gsbi1_pdata = {
3032 .max_clock_speed = 15060000,
3033};
3034
3035#ifdef CONFIG_USB_MSM_OTG_72K
3036static struct msm_otg_platform_data msm_otg_pdata;
3037#else
3038#define USB_5V_EN 42
3039static void msm_hsusb_vbus_power(bool on)
3040{
3041 int rc;
3042 static bool vbus_is_on;
3043 static struct regulator *mvs_otg_switch;
3044 struct pm_gpio param = {
3045 .direction = PM_GPIO_DIR_OUT,
3046 .output_buffer = PM_GPIO_OUT_BUF_CMOS,
3047 .output_value = 1,
3048 .pull = PM_GPIO_PULL_NO,
3049 .vin_sel = PM_GPIO_VIN_S4,
3050 .out_strength = PM_GPIO_STRENGTH_MED,
3051 .function = PM_GPIO_FUNC_NORMAL,
3052 };
3053
3054 if (vbus_is_on == on)
3055 return;
3056
3057 if (on) {
Stepan Moskovchenko14aa6492011-08-08 15:15:01 -07003058 mvs_otg_switch = regulator_get(&msm8960_device_otg.dev,
3059 "vbus_otg");
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003060 if (IS_ERR(mvs_otg_switch)) {
3061 pr_err("Unable to get mvs_otg_switch\n");
3062 return;
3063 }
3064
3065 rc = gpio_request(PM8921_GPIO_PM_TO_SYS(USB_5V_EN),
3066 "usb_5v_en");
3067 if (rc < 0) {
3068 pr_err("failed to request usb_5v_en gpio\n");
3069 goto put_mvs_otg;
3070 }
3071
3072 if (regulator_enable(mvs_otg_switch)) {
3073 pr_err("unable to enable mvs_otg_switch\n");
3074 goto free_usb_5v_en;
3075 }
3076
3077 rc = pm8xxx_gpio_config(PM8921_GPIO_PM_TO_SYS(USB_5V_EN),
3078 &param);
3079 if (rc < 0) {
3080 pr_err("failed to configure usb_5v_en gpio\n");
3081 goto disable_mvs_otg;
3082 }
3083 vbus_is_on = true;
3084 return;
3085 }
3086disable_mvs_otg:
3087 regulator_disable(mvs_otg_switch);
3088free_usb_5v_en:
3089 gpio_free(PM8921_GPIO_PM_TO_SYS(USB_5V_EN));
3090put_mvs_otg:
3091 regulator_put(mvs_otg_switch);
3092 vbus_is_on = false;
3093}
3094
3095static struct msm_otg_platform_data msm_otg_pdata = {
3096 .mode = USB_OTG,
3097 .otg_control = OTG_PMIC_CONTROL,
3098 .phy_type = SNPS_28NM_INTEGRATED_PHY,
3099 .pclk_src_name = "dfab_usb_hs_clk",
3100 .pmic_id_irq = PM8921_USB_ID_IN_IRQ(PM8921_IRQ_BASE),
3101 .vbus_power = msm_hsusb_vbus_power,
Anji jonnala4e3e6772011-09-15 18:53:42 +05303102 .power_budget = 750,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003103};
3104#endif
3105
Vijayavardhan Vennapusae3316a12011-10-15 06:05:17 +05303106#ifdef CONFIG_USB_EHCI_MSM_HSIC
Vijayavardhan Vennapusa2b592824f2011-11-02 19:51:32 +05303107#define HSIC_HUB_RESET_GPIO 91
Vijayavardhan Vennapusae3316a12011-10-15 06:05:17 +05303108static struct msm_hsic_host_platform_data msm_hsic_pdata = {
3109 .strobe = 150,
3110 .data = 151,
3111};
3112#else
3113static struct msm_hsic_host_platform_data msm_hsic_pdata;
3114#endif
3115
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003116#define PID_MAGIC_ID 0x71432909
3117#define SERIAL_NUM_MAGIC_ID 0x61945374
3118#define SERIAL_NUMBER_LENGTH 127
3119#define DLOAD_USB_BASE_ADD 0x2A03F0C8
3120
3121struct magic_num_struct {
3122 uint32_t pid;
3123 uint32_t serial_num;
3124};
3125
3126struct dload_struct {
3127 uint32_t reserved1;
3128 uint32_t reserved2;
3129 uint32_t reserved3;
3130 uint16_t reserved4;
3131 uint16_t pid;
3132 char serial_number[SERIAL_NUMBER_LENGTH];
3133 uint16_t reserved5;
3134 struct magic_num_struct magic_struct;
3135};
3136
3137static int usb_diag_update_pid_and_serial_num(uint32_t pid, const char *snum)
3138{
3139 struct dload_struct __iomem *dload = 0;
3140
3141 dload = ioremap(DLOAD_USB_BASE_ADD, sizeof(*dload));
3142 if (!dload) {
3143 pr_err("%s: cannot remap I/O memory region: %08x\n",
3144 __func__, DLOAD_USB_BASE_ADD);
3145 return -ENXIO;
3146 }
3147
3148 pr_debug("%s: dload:%p pid:%x serial_num:%s\n",
3149 __func__, dload, pid, snum);
3150 /* update pid */
3151 dload->magic_struct.pid = PID_MAGIC_ID;
3152 dload->pid = pid;
3153
3154 /* update serial number */
3155 dload->magic_struct.serial_num = 0;
3156 if (!snum) {
3157 memset(dload->serial_number, 0, SERIAL_NUMBER_LENGTH);
3158 goto out;
3159 }
3160
3161 dload->magic_struct.serial_num = SERIAL_NUM_MAGIC_ID;
Jin Honge49b1482011-10-03 11:15:50 -07003162 strlcpy(dload->serial_number, snum, SERIAL_NUMBER_LENGTH);
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003163out:
3164 iounmap(dload);
3165 return 0;
3166}
3167
3168static struct android_usb_platform_data android_usb_pdata = {
3169 .update_pid_and_serial_num = usb_diag_update_pid_and_serial_num,
3170};
3171
Stepan Moskovchenko14aa6492011-08-08 15:15:01 -07003172static struct platform_device android_usb_device = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003173 .name = "android_usb",
3174 .id = -1,
3175 .dev = {
3176 .platform_data = &android_usb_pdata,
3177 },
3178};
3179
3180static uint8_t spm_wfi_cmd_sequence[] __initdata = {
3181 0x03, 0x0f,
3182};
3183
3184static uint8_t spm_power_collapse_without_rpm[] __initdata = {
3185 0x00, 0x24, 0x54, 0x10,
3186 0x09, 0x03, 0x01,
3187 0x10, 0x54, 0x30, 0x0C,
3188 0x24, 0x30, 0x0f,
3189};
3190
3191static uint8_t spm_power_collapse_with_rpm[] __initdata = {
3192 0x00, 0x24, 0x54, 0x10,
3193 0x09, 0x07, 0x01, 0x0B,
3194 0x10, 0x54, 0x30, 0x0C,
3195 0x24, 0x30, 0x0f,
3196};
3197
3198static struct msm_spm_seq_entry msm_spm_seq_list[] __initdata = {
3199 [0] = {
3200 .mode = MSM_SPM_MODE_CLOCK_GATING,
3201 .notify_rpm = false,
3202 .cmd = spm_wfi_cmd_sequence,
3203 },
3204 [1] = {
3205 .mode = MSM_SPM_MODE_POWER_COLLAPSE,
3206 .notify_rpm = false,
3207 .cmd = spm_power_collapse_without_rpm,
3208 },
3209 [2] = {
3210 .mode = MSM_SPM_MODE_POWER_COLLAPSE,
3211 .notify_rpm = true,
3212 .cmd = spm_power_collapse_with_rpm,
3213 },
3214};
3215
3216static struct msm_spm_platform_data msm_spm_data[] __initdata = {
3217 [0] = {
3218 .reg_base_addr = MSM_SAW0_BASE,
3219 .reg_init_values[MSM_SPM_REG_SAW2_SECURE] = 0x00,
3220 .reg_init_values[MSM_SPM_REG_SAW2_CFG] = 0x1F,
3221 .reg_init_values[MSM_SPM_REG_SAW2_VCTL] = 0x9C,
3222#if defined(CONFIG_MSM_AVS_HW)
3223 .reg_init_values[MSM_SPM_REG_SAW2_AVS_CTL] = 0x00,
3224 .reg_init_values[MSM_SPM_REG_SAW2_AVS_HYSTERESIS] = 0x00,
3225#endif
3226 .reg_init_values[MSM_SPM_REG_SAW2_SPM_CTL] = 0x01,
3227 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DLY] = 0x02020202,
3228 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_0] = 0x0060009C,
3229 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_1] = 0x0000001C,
3230 .vctl_timeout_us = 50,
3231 .num_modes = ARRAY_SIZE(msm_spm_seq_list),
3232 .modes = msm_spm_seq_list,
3233 },
3234 [1] = {
3235 .reg_base_addr = MSM_SAW1_BASE,
3236 .reg_init_values[MSM_SPM_REG_SAW2_SECURE] = 0x00,
3237 .reg_init_values[MSM_SPM_REG_SAW2_CFG] = 0x1F,
3238 .reg_init_values[MSM_SPM_REG_SAW2_VCTL] = 0x9C,
3239#if defined(CONFIG_MSM_AVS_HW)
3240 .reg_init_values[MSM_SPM_REG_SAW2_AVS_CTL] = 0x00,
3241 .reg_init_values[MSM_SPM_REG_SAW2_AVS_HYSTERESIS] = 0x00,
3242#endif
3243 .reg_init_values[MSM_SPM_REG_SAW2_SPM_CTL] = 0x01,
3244 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DLY] = 0x02020202,
3245 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_0] = 0x0060009C,
3246 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_1] = 0x0000001C,
3247 .vctl_timeout_us = 50,
3248 .num_modes = ARRAY_SIZE(msm_spm_seq_list),
3249 .modes = msm_spm_seq_list,
3250 },
3251};
3252
3253static uint8_t l2_spm_wfi_cmd_sequence[] __initdata = {
3254 0x00, 0x20, 0x03, 0x20,
3255 0x00, 0x0f,
3256};
3257
3258static uint8_t l2_spm_gdhs_cmd_sequence[] __initdata = {
3259 0x00, 0x20, 0x34, 0x64,
3260 0x48, 0x07, 0x48, 0x20,
3261 0x50, 0x64, 0x04, 0x34,
3262 0x50, 0x0f,
3263};
3264static uint8_t l2_spm_power_off_cmd_sequence[] __initdata = {
3265 0x00, 0x10, 0x34, 0x64,
3266 0x48, 0x07, 0x48, 0x10,
3267 0x50, 0x64, 0x04, 0x34,
3268 0x50, 0x0F,
3269};
3270
3271static struct msm_spm_seq_entry msm_spm_l2_seq_list[] __initdata = {
3272 [0] = {
3273 .mode = MSM_SPM_L2_MODE_RETENTION,
3274 .notify_rpm = false,
3275 .cmd = l2_spm_wfi_cmd_sequence,
3276 },
3277 [1] = {
3278 .mode = MSM_SPM_L2_MODE_GDHS,
3279 .notify_rpm = true,
3280 .cmd = l2_spm_gdhs_cmd_sequence,
3281 },
3282 [2] = {
3283 .mode = MSM_SPM_L2_MODE_POWER_COLLAPSE,
3284 .notify_rpm = true,
3285 .cmd = l2_spm_power_off_cmd_sequence,
3286 },
3287};
3288
3289
3290static struct msm_spm_platform_data msm_spm_l2_data[] __initdata = {
3291 [0] = {
3292 .reg_base_addr = MSM_SAW_L2_BASE,
3293 .reg_init_values[MSM_SPM_REG_SAW2_SECURE] = 0x00,
3294 .reg_init_values[MSM_SPM_REG_SAW2_SPM_CTL] = 0x00,
3295 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DLY] = 0x02020202,
3296 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_0] = 0x00A000AE,
3297 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_1] = 0x00A00020,
3298 .modes = msm_spm_l2_seq_list,
3299 .num_modes = ARRAY_SIZE(msm_spm_l2_seq_list),
3300 },
3301};
3302
3303#define CYTTSP_TS_GPIO_IRQ 11
3304#define CYTTSP_TS_SLEEP_GPIO 50
3305#define CYTTSP_TS_RESOUT_N_GPIO 52
3306
3307/*virtual key support */
3308static ssize_t tma340_vkeys_show(struct kobject *kobj,
3309 struct kobj_attribute *attr, char *buf)
3310{
3311 return snprintf(buf, 200,
3312 __stringify(EV_KEY) ":" __stringify(KEY_BACK) ":73:1120:97:97"
3313 ":" __stringify(EV_KEY) ":" __stringify(KEY_MENU) ":230:1120:97:97"
3314 ":" __stringify(EV_KEY) ":" __stringify(KEY_HOME) ":389:1120:97:97"
3315 ":" __stringify(EV_KEY) ":" __stringify(KEY_SEARCH) ":544:1120:97:97"
3316 "\n");
3317}
3318
3319static struct kobj_attribute tma340_vkeys_attr = {
3320 .attr = {
3321 .mode = S_IRUGO,
3322 },
3323 .show = &tma340_vkeys_show,
3324};
3325
3326static struct attribute *tma340_properties_attrs[] = {
3327 &tma340_vkeys_attr.attr,
3328 NULL
3329};
3330
3331static struct attribute_group tma340_properties_attr_group = {
3332 .attrs = tma340_properties_attrs,
3333};
3334
3335
3336static int cyttsp_platform_init(struct i2c_client *client)
3337{
3338 int rc = 0;
3339 static struct kobject *tma340_properties_kobj;
3340
3341 tma340_vkeys_attr.attr.name = "virtualkeys.cyttsp-i2c";
3342 tma340_properties_kobj = kobject_create_and_add("board_properties",
3343 NULL);
3344 if (tma340_properties_kobj)
3345 rc = sysfs_create_group(tma340_properties_kobj,
3346 &tma340_properties_attr_group);
3347 if (!tma340_properties_kobj || rc)
3348 pr_err("%s: failed to create board_properties\n",
3349 __func__);
3350
3351 return 0;
3352}
3353
3354static struct cyttsp_regulator regulator_data[] = {
3355 {
3356 .name = "vdd",
3357 .min_uV = CY_TMA300_VTG_MIN_UV,
3358 .max_uV = CY_TMA300_VTG_MAX_UV,
Anirudh Ghayalf9929b12011-09-07 15:57:36 +05303359 .hpm_load_uA = CY_TMA300_CURR_24HZ_UA,
3360 .lpm_load_uA = CY_TMA300_SLEEP_CURR_UA,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003361 },
3362 /* TODO: Remove after runtime PM is enabled in I2C driver */
3363 {
3364 .name = "vcc_i2c",
3365 .min_uV = CY_I2C_VTG_MIN_UV,
3366 .max_uV = CY_I2C_VTG_MAX_UV,
Anirudh Ghayalf9929b12011-09-07 15:57:36 +05303367 .hpm_load_uA = CY_I2C_CURR_UA,
3368 .lpm_load_uA = CY_I2C_SLEEP_CURR_UA,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003369 },
3370};
3371
3372static struct cyttsp_platform_data cyttsp_pdata = {
3373 .panel_maxx = 634,
3374 .panel_maxy = 1166,
3375 .disp_maxx = 616,
3376 .disp_maxy = 1023,
3377 .disp_minx = 0,
3378 .disp_miny = 16,
3379 .flags = 0x01,
3380 .gen = CY_GEN3, /* or */
3381 .use_st = CY_USE_ST,
3382 .use_mt = CY_USE_MT,
3383 .use_hndshk = CY_SEND_HNDSHK,
3384 .use_trk_id = CY_USE_TRACKING_ID,
Anirudh Ghayale96f66d2011-08-11 14:06:38 +05303385 .use_sleep = CY_USE_DEEP_SLEEP_SEL | CY_USE_LOW_POWER_SEL,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003386 .use_gestures = CY_USE_GESTURES,
3387 .fw_fname = "cyttsp_8960_cdp.hex",
3388 /* activate up to 4 groups
3389 * and set active distance
3390 */
3391 .gest_set = CY_GEST_GRP1 | CY_GEST_GRP2 |
3392 CY_GEST_GRP3 | CY_GEST_GRP4 |
3393 CY_ACT_DIST,
3394 /* change act_intrvl to customize the Active power state
3395 * scanning/processing refresh interval for Operating mode
3396 */
3397 .act_intrvl = CY_ACT_INTRVL_DFLT,
3398 /* change tch_tmout to customize the touch timeout for the
3399 * Active power state for Operating mode
3400 */
3401 .tch_tmout = CY_TCH_TMOUT_DFLT,
3402 /* change lp_intrvl to customize the Low Power power state
3403 * scanning/processing refresh interval for Operating mode
3404 */
3405 .lp_intrvl = CY_LP_INTRVL_DFLT,
3406 .sleep_gpio = CYTTSP_TS_SLEEP_GPIO,
3407 .resout_gpio = CYTTSP_TS_RESOUT_N_GPIO,
3408 .irq_gpio = CYTTSP_TS_GPIO_IRQ,
3409 .regulator_info = regulator_data,
3410 .num_regulators = ARRAY_SIZE(regulator_data),
3411 .init = cyttsp_platform_init,
Mohan Pallaka49c37d62011-08-01 11:52:00 +05303412 .correct_fw_ver = 9,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003413};
3414
3415static struct i2c_board_info cyttsp_info[] __initdata = {
3416 {
3417 I2C_BOARD_INFO(CY_I2C_NAME, 0x24),
3418 .platform_data = &cyttsp_pdata,
3419#ifndef CY_USE_TIMER
3420 .irq = MSM_GPIO_TO_INT(CYTTSP_TS_GPIO_IRQ),
3421#endif /* CY_USE_TIMER */
3422 },
3423};
3424
Mohan Pallaka50837382011-09-07 11:00:57 +05303425/* configuration data */
3426static const u8 mxt_config_data[] = {
3427 /* T6 Object */
Jing Lin2f863172011-10-17 10:56:58 -07003428 0, 0, 0, 0, 0, 0,
Mohan Pallaka50837382011-09-07 11:00:57 +05303429 /* T38 Object */
Jing Lin2f863172011-10-17 10:56:58 -07003430 11, 1, 0, 20, 10, 11, 0, 0, 0, 0,
3431 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3432 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3433 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3434 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3435 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3436 0, 0, 0, 0,
Mohan Pallaka50837382011-09-07 11:00:57 +05303437 /* T7 Object */
Jing Lin2f863172011-10-17 10:56:58 -07003438 100, 16, 50,
Mohan Pallaka50837382011-09-07 11:00:57 +05303439 /* T8 Object */
Jing Lin2f863172011-10-17 10:56:58 -07003440 8, 0, 0, 0, 0, 0, 0, 0, 0, 0,
Mohan Pallaka50837382011-09-07 11:00:57 +05303441 /* T9 Object */
Jing Lin2f863172011-10-17 10:56:58 -07003442 131, 0, 0, 26, 42, 0, 32, 60, 2, 5,
3443 0, 5, 5, 34, 10, 10, 10, 10, 255, 2,
3444 85, 5, 18, 18, 18, 18, 0, 0, 5, 20,
3445 0, 5, 45, 46,
Mohan Pallaka50837382011-09-07 11:00:57 +05303446 /* T15 Object */
Jing Lin2f863172011-10-17 10:56:58 -07003447 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3448 0,
Mohan Pallaka50837382011-09-07 11:00:57 +05303449 /* T22 Object */
Jing Lin2f863172011-10-17 10:56:58 -07003450 0, 0, 0, 0, 0, 0, 0, 0, 30, 0,
3451 0, 0, 255, 255, 255, 255, 0,
Mohan Pallaka50837382011-09-07 11:00:57 +05303452 /* T24 Object */
Jing Lin2f863172011-10-17 10:56:58 -07003453 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3454 0, 0, 0, 0, 0, 0, 0, 0, 0,
Mohan Pallaka50837382011-09-07 11:00:57 +05303455 /* T25 Object */
Jing Lin2f863172011-10-17 10:56:58 -07003456 3, 0, 188, 52, 52, 33, 0, 0, 0, 0,
3457 0, 0, 0, 0,
Mohan Pallaka50837382011-09-07 11:00:57 +05303458 /* T27 Object */
Jing Lin2f863172011-10-17 10:56:58 -07003459 0, 0, 0, 0, 0, 0, 0,
Mohan Pallaka50837382011-09-07 11:00:57 +05303460 /* T28 Object */
Jing Lin2f863172011-10-17 10:56:58 -07003461 0, 0, 0, 8, 8, 60,
Mohan Pallaka50837382011-09-07 11:00:57 +05303462 /* T40 Object */
Jing Lin2f863172011-10-17 10:56:58 -07003463 0, 0, 0, 0, 0,
Mohan Pallaka50837382011-09-07 11:00:57 +05303464 /* T41 Object */
Jing Lin2f863172011-10-17 10:56:58 -07003465 0, 0, 0, 0, 0, 0,
Mohan Pallaka50837382011-09-07 11:00:57 +05303466 /* T43 Object */
Jing Lin2f863172011-10-17 10:56:58 -07003467 0, 0, 0, 0, 0, 0,
Mohan Pallaka50837382011-09-07 11:00:57 +05303468};
3469
3470#define MXT_TS_GPIO_IRQ 11
3471#define MXT_TS_LDO_EN_GPIO 50
3472#define MXT_TS_RESET_GPIO 52
3473
3474static void mxt_init_hw_liquid(void)
3475{
3476 int rc;
3477
3478 rc = gpio_request(MXT_TS_GPIO_IRQ, "mxt_ts_irq_gpio");
3479 if (rc) {
3480 pr_err("%s: unable to request mxt_ts_irq gpio [%d]\n",
3481 __func__, MXT_TS_GPIO_IRQ);
3482 return;
3483 }
3484
3485 rc = gpio_direction_input(MXT_TS_GPIO_IRQ);
3486 if (rc) {
3487 pr_err("%s: unable to set_direction for mxt_ts_irq gpio [%d]\n",
3488 __func__, MXT_TS_GPIO_IRQ);
3489 goto err_irq_gpio_req;
3490 }
3491
3492 rc = gpio_request(MXT_TS_LDO_EN_GPIO, "mxt_ldo_en_gpio");
3493 if (rc) {
3494 pr_err("%s: unable to request mxt_ldo_en gpio [%d]\n",
3495 __func__, MXT_TS_LDO_EN_GPIO);
3496 goto err_irq_gpio_req;
3497 }
3498
3499 rc = gpio_direction_output(MXT_TS_LDO_EN_GPIO, 1);
3500 if (rc) {
3501 pr_err("%s: unable to set_direction for mxt_ldo_en gpio [%d]\n",
3502 __func__, MXT_TS_LDO_EN_GPIO);
3503 goto err_ldo_gpio_req;
3504 }
3505
3506 rc = gpio_request(MXT_TS_RESET_GPIO, "mxt_reset_gpio");
3507 if (rc) {
3508 pr_err("%s: unable to request mxt_reset gpio [%d]\n",
3509 __func__, MXT_TS_RESET_GPIO);
3510 goto err_ldo_gpio_set_dir;
3511 }
3512
3513 rc = gpio_direction_output(MXT_TS_RESET_GPIO, 1);
3514 if (rc) {
3515 pr_err("%s: unable to set_direction for mxt_reset gpio [%d]\n",
3516 __func__, MXT_TS_RESET_GPIO);
3517 goto err_reset_gpio_req;
3518 }
3519
3520 return;
3521
3522err_reset_gpio_req:
3523 gpio_free(MXT_TS_RESET_GPIO);
3524err_ldo_gpio_set_dir:
3525 gpio_set_value(MXT_TS_LDO_EN_GPIO, 0);
3526err_ldo_gpio_req:
3527 gpio_free(MXT_TS_LDO_EN_GPIO);
3528err_irq_gpio_req:
3529 gpio_free(MXT_TS_GPIO_IRQ);
3530}
3531
3532static struct mxt_platform_data mxt_platform_data = {
3533 .config = mxt_config_data,
3534 .config_length = ARRAY_SIZE(mxt_config_data),
Jing Lin2f863172011-10-17 10:56:58 -07003535 .x_size = 1365,
3536 .y_size = 767,
Mohan Pallaka50837382011-09-07 11:00:57 +05303537 .irqflags = IRQF_TRIGGER_FALLING,
Jing Lin2f863172011-10-17 10:56:58 -07003538 .i2c_pull_up = true,
Mohan Pallaka50837382011-09-07 11:00:57 +05303539};
3540
3541static struct i2c_board_info mxt_device_info[] __initdata = {
3542 {
3543 I2C_BOARD_INFO("atmel_mxt_ts", 0x5b),
3544 .platform_data = &mxt_platform_data,
3545 .irq = MSM_GPIO_TO_INT(MXT_TS_GPIO_IRQ),
3546 },
3547};
3548
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003549static void gsbi_qup_i2c_gpio_config(int adap_id, int config_type)
3550{
3551}
3552
3553static struct msm_i2c_platform_data msm8960_i2c_qup_gsbi4_pdata = {
3554 .clk_freq = 100000,
3555 .src_clk_rate = 24000000,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003556 .msm_i2c_config_gpio = gsbi_qup_i2c_gpio_config,
3557};
3558
3559static struct msm_i2c_platform_data msm8960_i2c_qup_gsbi3_pdata = {
3560 .clk_freq = 100000,
3561 .src_clk_rate = 24000000,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003562 .msm_i2c_config_gpio = gsbi_qup_i2c_gpio_config,
3563};
3564
3565static struct msm_i2c_platform_data msm8960_i2c_qup_gsbi10_pdata = {
3566 .clk_freq = 100000,
3567 .src_clk_rate = 24000000,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003568 .msm_i2c_config_gpio = gsbi_qup_i2c_gpio_config,
3569};
3570
3571static struct msm_i2c_platform_data msm8960_i2c_qup_gsbi12_pdata = {
3572 .clk_freq = 100000,
3573 .src_clk_rate = 24000000,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003574 .msm_i2c_config_gpio = gsbi_qup_i2c_gpio_config,
3575};
3576
3577static struct msm_rpm_platform_data msm_rpm_data = {
3578 .reg_base_addrs = {
3579 [MSM_RPM_PAGE_STATUS] = MSM_RPM_BASE,
3580 [MSM_RPM_PAGE_CTRL] = MSM_RPM_BASE + 0x400,
3581 [MSM_RPM_PAGE_REQ] = MSM_RPM_BASE + 0x600,
3582 [MSM_RPM_PAGE_ACK] = MSM_RPM_BASE + 0xa00,
3583 },
3584
3585 .irq_ack = RPM_APCC_CPU0_GP_HIGH_IRQ,
3586 .irq_err = RPM_APCC_CPU0_GP_LOW_IRQ,
3587 .irq_vmpm = RPM_APCC_CPU0_GP_MEDIUM_IRQ,
3588 .msm_apps_ipc_rpm_reg = MSM_APCS_GCC_BASE + 0x008,
3589 .msm_apps_ipc_rpm_val = 4,
3590};
3591
Stepan Moskovchenko93d79ec2011-09-21 16:52:16 -07003592static struct ks8851_pdata spi_eth_pdata = {
3593 .irq_gpio = KS8851_IRQ_GPIO,
3594 .rst_gpio = KS8851_RST_GPIO,
3595};
Praveen Chidambaram043f4ce2011-08-02 09:37:59 -06003596
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003597static struct spi_board_info spi_board_info[] __initdata = {
3598 {
3599 .modalias = "ks8851",
3600 .irq = MSM_GPIO_TO_INT(KS8851_IRQ_GPIO),
3601 .max_speed_hz = 19200000,
3602 .bus_num = 0,
3603 .chip_select = 0,
3604 .mode = SPI_MODE_0,
Stepan Moskovchenko93d79ec2011-09-21 16:52:16 -07003605 .platform_data = &spi_eth_pdata
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003606 },
3607};
3608
3609static struct platform_device msm_device_saw_core0 = {
3610 .name = "saw-regulator",
3611 .id = 0,
3612 .dev = {
3613 .platform_data = &msm_saw_regulator_pdata_s5,
3614 },
3615};
3616
3617static struct platform_device msm_device_saw_core1 = {
3618 .name = "saw-regulator",
3619 .id = 1,
3620 .dev = {
3621 .platform_data = &msm_saw_regulator_pdata_s6,
3622 },
3623};
3624
Siddartha Mohanadossba21fdd2011-08-18 10:05:27 -07003625static struct tsens_platform_data msm_tsens_pdata = {
3626 .slope = 910,
3627 .tsens_factor = 1000,
3628 .hw_type = MSM_8960,
3629 .tsens_num_sensor = 5,
3630};
3631
3632static struct platform_device msm_tsens_device = {
3633 .name = "tsens8960-tm",
3634 .id = -1,
3635 .dev = {
3636 .platform_data = &msm_tsens_pdata,
3637 },
3638};
3639
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003640#ifdef CONFIG_MSM_FAKE_BATTERY
3641static struct platform_device fish_battery_device = {
3642 .name = "fish_battery",
3643};
3644#endif
3645
David Collins26f05562011-06-20 09:56:28 -07003646static struct platform_device msm8960_device_ext_5v_vreg __devinitdata = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003647 .name = GPIO_REGULATOR_DEV_NAME,
3648 .id = PM8921_MPP_PM_TO_SYS(7),
3649 .dev = {
3650 .platform_data = &msm_gpio_regulator_pdata[GPIO_VREG_ID_EXT_5V],
3651 },
3652};
3653
David Collins26f05562011-06-20 09:56:28 -07003654static struct platform_device msm8960_device_ext_l2_vreg __devinitdata = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003655 .name = GPIO_REGULATOR_DEV_NAME,
3656 .id = 91,
3657 .dev = {
3658 .platform_data = &msm_gpio_regulator_pdata[GPIO_VREG_ID_EXT_L2],
3659 },
3660};
3661
David Collinsb10be1d2011-09-02 10:29:31 -07003662static struct platform_device msm8960_device_ext_3p3v_vreg __devinitdata = {
3663 .name = GPIO_REGULATOR_DEV_NAME,
3664 .id = PM8921_GPIO_PM_TO_SYS(17),
3665 .dev = {
3666 .platform_data =
3667 &msm_gpio_regulator_pdata[GPIO_VREG_ID_EXT_3P3V],
3668 },
3669};
3670
David Collins26f05562011-06-20 09:56:28 -07003671static struct platform_device msm8960_device_rpm_regulator __devinitdata = {
3672 .name = "rpm-regulator",
3673 .id = -1,
3674 .dev = {
3675 .platform_data = &msm_rpm_regulator_pdata,
3676 },
3677};
3678
David Collins4c31a872011-08-31 10:07:10 -07003679static struct msm_rpm_log_platform_data msm_rpm_log_pdata = {
3680 .phys_addr_base = 0x0010C000,
3681 .reg_offsets = {
3682 [MSM_RPM_LOG_PAGE_INDICES] = 0x00000080,
3683 [MSM_RPM_LOG_PAGE_BUFFER] = 0x000000A0,
3684 },
3685 .phys_size = SZ_8K,
3686 .log_len = 4096, /* log's buffer length in bytes */
3687 .log_len_mask = (4096 >> 2) - 1, /* length mask in units of u32 */
3688};
3689
3690static struct platform_device msm_rpm_log_device = {
3691 .name = "msm_rpm_log",
3692 .id = -1,
3693 .dev = {
3694 .platform_data = &msm_rpm_log_pdata,
3695 },
3696};
3697
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003698static struct platform_device *common_devices[] __initdata = {
Stepan Moskovchenkodf13d342011-08-03 19:01:25 -07003699 &msm8960_device_dmov,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003700 &msm_device_smd,
3701 &msm8960_device_uart_gsbi5,
Mayank Rana9f51f582011-08-04 18:35:59 +05303702 &msm_device_uart_dm6,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003703 &msm_device_saw_core0,
3704 &msm_device_saw_core1,
3705 &msm8960_device_ext_5v_vreg,
3706 &msm8960_device_ext_l2_vreg,
3707 &msm8960_device_ssbi_pm8921,
3708 &msm8960_device_qup_spi_gsbi1,
3709 &msm8960_device_qup_i2c_gsbi3,
3710 &msm8960_device_qup_i2c_gsbi4,
3711 &msm8960_device_qup_i2c_gsbi10,
3712#ifndef CONFIG_MSM_DSPS
3713 &msm8960_device_qup_i2c_gsbi12,
3714#endif
3715 &msm_slim_ctrl,
3716 &msm_device_wcnss_wlan,
3717#if defined(CONFIG_CRYPTO_DEV_QCRYPTO) || \
3718 defined(CONFIG_CRYPTO_DEV_QCRYPTO_MODULE)
3719 &qcrypto_device,
3720#endif
3721
3722#if defined(CONFIG_CRYPTO_DEV_QCEDEV) || \
3723 defined(CONFIG_CRYPTO_DEV_QCEDEV_MODULE)
3724 &qcedev_device,
3725#endif
3726#ifdef CONFIG_MSM_ROTATOR
3727 &msm_rotator_device,
3728#endif
3729 &msm_device_sps,
3730#ifdef CONFIG_MSM_FAKE_BATTERY
3731 &fish_battery_device,
3732#endif
3733#ifdef CONFIG_ANDROID_PMEM
Laura Abbott2d1760b2011-09-29 21:31:24 -07003734#ifndef CONFIG_MSM_MULTIMEDIA_USE_ION
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003735 &android_pmem_device,
3736 &android_pmem_adsp_device,
Laura Abbott2d1760b2011-09-29 21:31:24 -07003737#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003738 &android_pmem_audio_device,
3739#endif
3740 &msm_fb_device,
3741 &msm_device_vidc,
3742 &msm_device_bam_dmux,
3743 &msm_fm_platform_init,
Mona Hossain9c430e32011-07-27 11:04:47 -07003744
3745#ifdef CONFIG_HW_RANDOM_MSM
3746 &msm_device_rng,
3747#endif
Praveen Chidambaram043f4ce2011-08-02 09:37:59 -06003748 &msm_rpm_device,
Laura Abbottd6183792011-08-19 13:42:24 -07003749#ifdef CONFIG_ION_MSM
3750 &ion_dev,
3751#endif
David Collins4c31a872011-08-31 10:07:10 -07003752 &msm_rpm_log_device,
Pratik Patel7831c082011-06-08 21:44:37 -07003753#ifdef CONFIG_MSM_QDSS
3754 &msm_etb_device,
3755 &msm_tpiu_device,
3756 &msm_funnel_device,
3757 &msm_ptm_device,
3758#endif
Swaminathan Sathappanb77c65e92011-09-30 18:36:09 -07003759 &msm_device_dspcrashd_8960,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003760};
3761
Stepan Moskovchenkod056fca2011-01-27 12:12:07 -08003762static struct platform_device *sim_devices[] __initdata = {
Stepan Moskovchenko14aa6492011-08-08 15:15:01 -07003763 &msm8960_device_otg,
3764 &msm8960_device_gadget_peripheral,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003765 &msm_device_hsusb_host,
Vijayavardhan Vennapusaeb566482011-09-18 07:48:37 +05303766 &msm_device_hsic_host,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003767 &android_usb_device,
3768 &msm_device_vidc,
3769 &mipi_dsi_simulator_panel_device,
3770 &msm_bus_apps_fabric,
3771 &msm_bus_sys_fabric,
3772 &msm_bus_mm_fabric,
3773 &msm_bus_sys_fpb,
3774 &msm_bus_cpss_fpb,
3775 &msm_pcm,
3776 &msm_pcm_routing,
3777 &msm_cpudai0,
3778 &msm_cpudai1,
3779 &msm_cpudai_hdmi_rx,
3780 &msm_cpudai_bt_rx,
3781 &msm_cpudai_bt_tx,
3782 &msm_cpudai_fm_rx,
3783 &msm_cpudai_fm_tx,
Bhalchandra Gajare0e795c42011-08-15 18:10:30 -07003784 &msm_cpudai_auxpcm_rx,
3785 &msm_cpudai_auxpcm_tx,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003786 &msm_cpu_fe,
3787 &msm_stub_codec,
3788 &msm_voice,
3789 &msm_voip,
3790 &msm_lpa_pcm,
3791
3792#if defined(CONFIG_CRYPTO_DEV_QCRYPTO) || \
3793 defined(CONFIG_CRYPTO_DEV_QCRYPTO_MODULE)
3794 &qcrypto_device,
3795#endif
3796
3797#if defined(CONFIG_CRYPTO_DEV_QCEDEV) || \
3798 defined(CONFIG_CRYPTO_DEV_QCEDEV_MODULE)
3799 &qcedev_device,
3800#endif
Stepan Moskovchenkod056fca2011-01-27 12:12:07 -08003801};
3802
3803static struct platform_device *rumi3_devices[] __initdata = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003804 &msm_kgsl_3d0,
3805 &msm_kgsl_2d0,
3806 &msm_kgsl_2d1,
3807 &mipi_dsi_renesas_panel_device,
3808#ifdef CONFIG_MSM_GEMINI
3809 &msm8960_gemini_device,
3810#endif
Stepan Moskovchenkod056fca2011-01-27 12:12:07 -08003811};
3812
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003813static struct platform_device *cdp_devices[] __initdata = {
Stepan Moskovchenko14aa6492011-08-08 15:15:01 -07003814 &msm8960_device_otg,
3815 &msm8960_device_gadget_peripheral,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003816 &msm_device_hsusb_host,
3817 &android_usb_device,
3818 &msm_pcm,
3819 &msm_pcm_routing,
3820 &msm_cpudai0,
3821 &msm_cpudai1,
3822 &msm_cpudai_hdmi_rx,
3823 &msm_cpudai_bt_rx,
3824 &msm_cpudai_bt_tx,
3825 &msm_cpudai_fm_rx,
3826 &msm_cpudai_fm_tx,
Bhalchandra Gajare0e795c42011-08-15 18:10:30 -07003827 &msm_cpudai_auxpcm_rx,
3828 &msm_cpudai_auxpcm_tx,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003829 &msm_cpu_fe,
3830 &msm_stub_codec,
3831 &msm_kgsl_3d0,
3832#ifdef CONFIG_MSM_KGSL_2D
3833 &msm_kgsl_2d0,
3834 &msm_kgsl_2d1,
3835#endif
Chandan Uddaraju83eac3c2011-09-11 18:32:23 -07003836 &mipi_dsi_novatek_panel_device,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003837#ifdef CONFIG_MSM_GEMINI
3838 &msm8960_gemini_device,
3839#endif
3840 &msm_voice,
3841 &msm_voip,
3842 &msm_lpa_pcm,
Laxminath Kasamcee1d602011-08-01 19:26:57 +05303843 &msm_cpudai_afe_01_rx,
3844 &msm_cpudai_afe_01_tx,
3845 &msm_cpudai_afe_02_rx,
3846 &msm_cpudai_afe_02_tx,
3847 &msm_pcm_afe,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003848#ifdef CONFIG_FB_MSM_HDMI_MSM_PANEL
3849 &hdmi_msm_device,
3850#endif
3851 &msm_pcm_hostless,
3852 &msm_bus_apps_fabric,
3853 &msm_bus_sys_fabric,
3854 &msm_bus_mm_fabric,
3855 &msm_bus_sys_fpb,
3856 &msm_bus_cpss_fpb,
Siddartha Mohanadossba21fdd2011-08-18 10:05:27 -07003857 &msm_tsens_device,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003858};
3859
3860static void __init msm8960_i2c_init(void)
3861{
3862 msm8960_device_qup_i2c_gsbi4.dev.platform_data =
3863 &msm8960_i2c_qup_gsbi4_pdata;
3864
3865 msm8960_device_qup_i2c_gsbi3.dev.platform_data =
3866 &msm8960_i2c_qup_gsbi3_pdata;
3867
3868 msm8960_device_qup_i2c_gsbi10.dev.platform_data =
3869 &msm8960_i2c_qup_gsbi10_pdata;
3870
3871 msm8960_device_qup_i2c_gsbi12.dev.platform_data =
3872 &msm8960_i2c_qup_gsbi12_pdata;
3873}
3874
Lucille Sylvester34ec3692011-08-16 16:28:04 -06003875static void __init msm8960_gfx_init(void)
3876{
Jeremy Gebben58b2dce2011-10-13 11:14:19 -06003877 uint32_t soc_platform_version = socinfo_get_version();
Lucille Sylvester34ec3692011-08-16 16:28:04 -06003878 if (SOCINFO_VERSION_MAJOR(soc_platform_version) == 1) {
3879 struct kgsl_device_platform_data *kgsl_3d0_pdata =
3880 msm_kgsl_3d0.dev.platform_data;
3881 kgsl_3d0_pdata->pwr_data.pwrlevel[0].gpu_freq =
3882 320000000;
3883 kgsl_3d0_pdata->pwr_data.pwrlevel[1].gpu_freq =
3884 266667000;
3885 }
3886}
3887
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003888static struct pm8xxx_irq_platform_data pm8xxx_irq_pdata __devinitdata = {
3889 .irq_base = PM8921_IRQ_BASE,
3890 .devirq = MSM_GPIO_TO_INT(104),
3891 .irq_trigger_flag = IRQF_TRIGGER_LOW,
3892};
3893
3894static struct pm8xxx_gpio_platform_data pm8xxx_gpio_pdata __devinitdata = {
3895 .gpio_base = PM8921_GPIO_PM_TO_SYS(1),
3896};
3897
3898static struct pm8xxx_mpp_platform_data pm8xxx_mpp_pdata __devinitdata = {
3899 .mpp_base = PM8921_MPP_PM_TO_SYS(1),
3900};
3901
3902static struct pm8xxx_rtc_platform_data pm8xxx_rtc_pdata __devinitdata = {
3903 .rtc_write_enable = false,
Ashay Jaiswald66c9d52011-10-13 17:41:40 +05303904 .rtc_alarm_powerup = false,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003905};
3906
3907static struct pm8xxx_pwrkey_platform_data pm8xxx_pwrkey_pdata = {
3908 .pull_up = 1,
3909 .kpd_trigger_delay_us = 970,
3910 .wakeup = 1,
3911};
3912
Mohan Pallaka002e9e02011-08-05 11:23:22 +05303913/* Rotate lock key is not available so use F1 */
3914#define KEY_ROTATE_LOCK KEY_F1
3915
3916static const unsigned int keymap_liquid[] = {
3917 KEY(0, 0, KEY_VOLUMEUP),
3918 KEY(0, 1, KEY_VOLUMEDOWN),
3919 KEY(1, 3, KEY_ROTATE_LOCK),
3920 KEY(1, 4, KEY_HOME),
3921};
3922
3923static struct matrix_keymap_data keymap_data_liquid = {
3924 .keymap_size = ARRAY_SIZE(keymap_liquid),
3925 .keymap = keymap_liquid,
3926};
3927
3928static struct pm8xxx_keypad_platform_data keypad_data_liquid = {
3929 .input_name = "keypad_8960_liquid",
3930 .input_phys_device = "keypad_8960/input0",
3931 .num_rows = 2,
3932 .num_cols = 5,
3933 .rows_gpio_start = PM8921_GPIO_PM_TO_SYS(9),
3934 .cols_gpio_start = PM8921_GPIO_PM_TO_SYS(1),
3935 .debounce_ms = 15,
3936 .scan_delay_ms = 32,
3937 .row_hold_ns = 91500,
3938 .wakeup = 1,
3939 .keymap_data = &keymap_data_liquid,
3940};
3941
3942
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003943static const unsigned int keymap[] = {
3944 KEY(0, 0, KEY_VOLUMEUP),
3945 KEY(0, 1, KEY_VOLUMEDOWN),
3946 KEY(0, 2, KEY_CAMERA_SNAPSHOT),
3947 KEY(0, 3, KEY_CAMERA_FOCUS),
3948};
3949
3950static struct matrix_keymap_data keymap_data = {
3951 .keymap_size = ARRAY_SIZE(keymap),
3952 .keymap = keymap,
3953};
3954
3955static struct pm8xxx_keypad_platform_data keypad_data = {
3956 .input_name = "keypad_8960",
3957 .input_phys_device = "keypad_8960/input0",
3958 .num_rows = 1,
3959 .num_cols = 5,
3960 .rows_gpio_start = PM8921_GPIO_PM_TO_SYS(9),
3961 .cols_gpio_start = PM8921_GPIO_PM_TO_SYS(1),
3962 .debounce_ms = 15,
3963 .scan_delay_ms = 32,
3964 .row_hold_ns = 91500,
3965 .wakeup = 1,
3966 .keymap_data = &keymap_data,
3967};
3968
3969static const unsigned int keymap_sim[] = {
3970 KEY(0, 0, KEY_7),
3971 KEY(0, 1, KEY_DOWN),
3972 KEY(0, 2, KEY_UP),
3973 KEY(0, 3, KEY_RIGHT),
3974 KEY(0, 4, KEY_ENTER),
3975 KEY(0, 5, KEY_L),
3976 KEY(0, 6, KEY_BACK),
3977 KEY(0, 7, KEY_M),
3978
3979 KEY(1, 0, KEY_LEFT),
3980 KEY(1, 1, KEY_SEND),
3981 KEY(1, 2, KEY_1),
3982 KEY(1, 3, KEY_4),
3983 KEY(1, 4, KEY_CLEAR),
3984 KEY(1, 5, KEY_MSDOS),
3985 KEY(1, 6, KEY_SPACE),
3986 KEY(1, 7, KEY_COMMA),
3987
3988 KEY(2, 0, KEY_6),
3989 KEY(2, 1, KEY_5),
3990 KEY(2, 2, KEY_8),
3991 KEY(2, 3, KEY_3),
3992 KEY(2, 4, KEY_NUMERIC_STAR),
3993 KEY(2, 5, KEY_UP),
3994 KEY(2, 6, KEY_DOWN),
3995 KEY(2, 7, KEY_LEFTSHIFT),
3996
3997 KEY(3, 0, KEY_9),
3998 KEY(3, 1, KEY_NUMERIC_POUND),
3999 KEY(3, 2, KEY_0),
4000 KEY(3, 3, KEY_2),
4001 KEY(3, 4, KEY_SLEEP),
4002 KEY(3, 5, KEY_F1),
4003 KEY(3, 6, KEY_F2),
4004 KEY(3, 7, KEY_F3),
4005
4006 KEY(4, 0, KEY_BACK),
4007 KEY(4, 1, KEY_HOME),
4008 KEY(4, 2, KEY_MENU),
4009 KEY(4, 3, KEY_VOLUMEUP),
4010 KEY(4, 4, KEY_VOLUMEDOWN),
4011 KEY(4, 5, KEY_F4),
4012 KEY(4, 6, KEY_F5),
4013 KEY(4, 7, KEY_F6),
4014
4015 KEY(5, 0, KEY_R),
4016 KEY(5, 1, KEY_T),
4017 KEY(5, 2, KEY_Y),
4018 KEY(5, 3, KEY_LEFTALT),
4019 KEY(5, 4, KEY_KPENTER),
4020 KEY(5, 5, KEY_Q),
4021 KEY(5, 6, KEY_W),
4022 KEY(5, 7, KEY_E),
4023
4024 KEY(6, 0, KEY_F),
4025 KEY(6, 1, KEY_G),
4026 KEY(6, 2, KEY_H),
4027 KEY(6, 3, KEY_CAPSLOCK),
4028 KEY(6, 4, KEY_PAGEUP),
4029 KEY(6, 5, KEY_A),
4030 KEY(6, 6, KEY_S),
4031 KEY(6, 7, KEY_D),
4032
4033 KEY(7, 0, KEY_V),
4034 KEY(7, 1, KEY_B),
4035 KEY(7, 2, KEY_N),
4036 KEY(7, 3, KEY_MENU),
4037 KEY(7, 4, KEY_PAGEDOWN),
4038 KEY(7, 5, KEY_Z),
4039 KEY(7, 6, KEY_X),
4040 KEY(7, 7, KEY_C),
4041
4042 KEY(8, 0, KEY_P),
4043 KEY(8, 1, KEY_J),
4044 KEY(8, 2, KEY_K),
4045 KEY(8, 3, KEY_INSERT),
4046 KEY(8, 4, KEY_LINEFEED),
4047 KEY(8, 5, KEY_U),
4048 KEY(8, 6, KEY_I),
4049 KEY(8, 7, KEY_O),
4050
4051 KEY(9, 0, KEY_4),
4052 KEY(9, 1, KEY_5),
4053 KEY(9, 2, KEY_6),
4054 KEY(9, 3, KEY_7),
4055 KEY(9, 4, KEY_8),
4056 KEY(9, 5, KEY_1),
4057 KEY(9, 6, KEY_2),
4058 KEY(9, 7, KEY_3),
4059
4060 KEY(10, 0, KEY_F7),
4061 KEY(10, 1, KEY_F8),
4062 KEY(10, 2, KEY_F9),
4063 KEY(10, 3, KEY_F10),
4064 KEY(10, 4, KEY_FN),
4065 KEY(10, 5, KEY_9),
4066 KEY(10, 6, KEY_0),
4067 KEY(10, 7, KEY_DOT),
4068
4069 KEY(11, 0, KEY_LEFTCTRL),
4070 KEY(11, 1, KEY_F11),
4071 KEY(11, 2, KEY_ENTER),
4072 KEY(11, 3, KEY_SEARCH),
4073 KEY(11, 4, KEY_DELETE),
4074 KEY(11, 5, KEY_RIGHT),
4075 KEY(11, 6, KEY_LEFT),
4076 KEY(11, 7, KEY_RIGHTSHIFT),
4077 KEY(0, 0, KEY_VOLUMEUP),
4078 KEY(0, 1, KEY_VOLUMEDOWN),
4079 KEY(0, 2, KEY_CAMERA_SNAPSHOT),
4080 KEY(0, 3, KEY_CAMERA_FOCUS),
4081};
4082
4083static struct matrix_keymap_data keymap_data_sim = {
4084 .keymap_size = ARRAY_SIZE(keymap_sim),
4085 .keymap = keymap_sim,
4086};
4087
4088static struct pm8xxx_keypad_platform_data keypad_data_sim = {
4089 .input_name = "keypad_8960",
4090 .input_phys_device = "keypad_8960/input0",
4091 .num_rows = 12,
4092 .num_cols = 8,
4093 .rows_gpio_start = PM8921_GPIO_PM_TO_SYS(9),
4094 .cols_gpio_start = PM8921_GPIO_PM_TO_SYS(1),
4095 .debounce_ms = 15,
4096 .scan_delay_ms = 32,
4097 .row_hold_ns = 91500,
4098 .wakeup = 1,
4099 .keymap_data = &keymap_data_sim,
4100};
4101
Abhijeet Dharmapurikarad742362011-08-29 19:50:02 -07004102static int pm8921_therm_mitigation[] = {
4103 1100,
4104 700,
4105 600,
4106 325,
4107};
4108
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07004109static struct pm8921_charger_platform_data pm8921_chg_pdata __devinitdata = {
Abhijeet Dharmapurikar34059332011-08-16 19:19:39 -07004110 .safety_time = 180,
Abhijeet Dharmapurikar33fe6fb2011-09-14 16:03:11 -07004111 .update_time = 60000,
Abhijeet Dharmapurikar34059332011-08-16 19:19:39 -07004112 .max_voltage = 4200,
4113 .min_voltage = 3200,
4114 .resume_voltage = 4100,
4115 .term_current = 100,
4116 .cool_temp = 10,
4117 .warm_temp = 40,
4118 .temp_check_period = 1,
Abhijeet Dharmapurikarad742362011-08-29 19:50:02 -07004119 .max_bat_chg_current = 1100,
Abhijeet Dharmapurikar34059332011-08-16 19:19:39 -07004120 .cool_bat_chg_current = 350,
4121 .warm_bat_chg_current = 350,
4122 .cool_bat_voltage = 4100,
4123 .warm_bat_voltage = 4100,
Abhijeet Dharmapurikarad742362011-08-29 19:50:02 -07004124 .thermal_mitigation = pm8921_therm_mitigation,
4125 .thermal_levels = ARRAY_SIZE(pm8921_therm_mitigation),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07004126};
4127
4128static struct pm8xxx_misc_platform_data pm8xxx_misc_pdata = {
4129 .priority = 0,
4130};
4131
4132static struct pm8921_bms_platform_data pm8921_bms_pdata __devinitdata = {
4133 .r_sense = 10,
4134 .i_test = 2500,
4135 .v_failure = 3000,
4136 .calib_delay_ms = 600000,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07004137};
4138
Jay Chokshide4cefb2011-08-04 18:10:44 -07004139#define PM8921_LC_LED_MAX_CURRENT 4 /* I = 4mA */
Jay Chokshi6238d5e2011-10-24 13:47:19 -07004140#define PM8XXX_LED_PWM_PERIOD 1000
4141#define PM8XXX_LED_PWM_DUTY_MS 20
4142/**
4143 * PM8XXX_PWM_CHANNEL_NONE shall be used when LED shall not be
4144 * driven using PWM feature.
4145 */
4146#define PM8XXX_PWM_CHANNEL_NONE -1
Jay Chokshide4cefb2011-08-04 18:10:44 -07004147
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07004148static struct led_info pm8921_led_info[] = {
4149 [0] = {
Jay Chokshi6238d5e2011-10-24 13:47:19 -07004150 .name = "led:battery_charging",
4151 .default_trigger = "battery-charging",
Jay Chokshide4cefb2011-08-04 18:10:44 -07004152 },
4153 [1] = {
Jay Chokshi6238d5e2011-10-24 13:47:19 -07004154 .name = "led:battery_full",
4155 .default_trigger = "battery-full",
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07004156 },
4157};
4158
Jay Chokshi8994e392011-09-14 18:20:39 -07004159static struct led_platform_data pm8921_led_core_pdata = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07004160 .num_leds = ARRAY_SIZE(pm8921_led_info),
4161 .leds = pm8921_led_info,
4162};
4163
Jay Chokshi6238d5e2011-10-24 13:47:19 -07004164static int pm8921_led0_pwm_duty_pcts[56] = {
4165 1, 4, 8, 12, 16, 20, 24, 28, 32, 36,
4166 40, 44, 46, 52, 56, 60, 64, 68, 72, 76,
4167 80, 84, 88, 92, 96, 100, 100, 100, 98, 95,
4168 92, 88, 84, 82, 78, 74, 70, 66, 62, 58,
4169 58, 54, 50, 48, 42, 38, 34, 30, 26, 22,
4170 14, 10, 6, 4, 1
4171};
4172
4173static struct pm8xxx_pwm_duty_cycles pm8921_led0_pwm_duty_cycles = {
4174 .duty_pcts = (int *)&pm8921_led0_pwm_duty_pcts,
4175 .num_duty_pcts = ARRAY_SIZE(pm8921_led0_pwm_duty_pcts),
4176 .duty_ms = PM8XXX_LED_PWM_DUTY_MS,
4177 .start_idx = 0,
4178};
4179
Jay Chokshi8994e392011-09-14 18:20:39 -07004180static struct pm8xxx_led_config pm8921_led_configs[] = {
4181 [0] = {
4182 .id = PM8XXX_ID_LED_0,
Jay Chokshi6238d5e2011-10-24 13:47:19 -07004183 .mode = PM8XXX_LED_MODE_PWM2,
Jay Chokshi8994e392011-09-14 18:20:39 -07004184 .max_current = PM8921_LC_LED_MAX_CURRENT,
Jay Chokshi6238d5e2011-10-24 13:47:19 -07004185 .pwm_channel = 5,
4186 .pwm_period_us = PM8XXX_LED_PWM_PERIOD,
4187 .pwm_duty_cycles = &pm8921_led0_pwm_duty_cycles,
Jay Chokshi8994e392011-09-14 18:20:39 -07004188 },
4189 [1] = {
4190 .id = PM8XXX_ID_LED_1,
Jay Chokshi6238d5e2011-10-24 13:47:19 -07004191 .mode = PM8XXX_LED_MODE_PWM1,
Jay Chokshi8994e392011-09-14 18:20:39 -07004192 .max_current = PM8921_LC_LED_MAX_CURRENT,
Jay Chokshi6238d5e2011-10-24 13:47:19 -07004193 .pwm_channel = 4,
4194 .pwm_period_us = PM8XXX_LED_PWM_PERIOD,
Jay Chokshi8994e392011-09-14 18:20:39 -07004195 },
4196};
4197
4198static struct pm8xxx_led_platform_data pm8xxx_leds_pdata = {
4199 .led_core = &pm8921_led_core_pdata,
4200 .configs = pm8921_led_configs,
4201 .num_configs = ARRAY_SIZE(pm8921_led_configs),
4202};
4203
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07004204static struct pm8921_platform_data pm8921_platform_data __devinitdata = {
4205 .irq_pdata = &pm8xxx_irq_pdata,
4206 .gpio_pdata = &pm8xxx_gpio_pdata,
4207 .mpp_pdata = &pm8xxx_mpp_pdata,
4208 .rtc_pdata = &pm8xxx_rtc_pdata,
4209 .pwrkey_pdata = &pm8xxx_pwrkey_pdata,
4210 .keypad_pdata = &keypad_data,
4211 .misc_pdata = &pm8xxx_misc_pdata,
4212 .regulator_pdatas = msm_pm8921_regulator_pdata,
4213 .charger_pdata = &pm8921_chg_pdata,
4214 .bms_pdata = &pm8921_bms_pdata,
4215 .adc_pdata = &pm8921_adc_pdata,
4216 .leds_pdata = &pm8xxx_leds_pdata,
4217};
4218
4219static struct msm_ssbi_platform_data msm8960_ssbi_pm8921_pdata __devinitdata = {
4220 .controller_type = MSM_SBI_CTRL_PMIC_ARBITER,
4221 .slave = {
4222 .name = "pm8921-core",
4223 .platform_data = &pm8921_platform_data,
4224 },
4225};
4226
Stepan Moskovchenko93d79ec2011-09-21 16:52:16 -07004227#if defined(CONFIG_KS8851) || defined(CONFIG_KS8851_MODULE)
4228static int fpga_init(void)
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07004229{
4230 int ret;
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07004231
4232 ret = gpio_request(FPGA_CS_GPIO, "fpga_cs");
4233 if (ret) {
Stepan Moskovchenko93d79ec2011-09-21 16:52:16 -07004234 pr_err("FPGA CS gpio_request failed: %d\n", ret);
4235 goto fail;
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07004236 }
4237
4238 gpio_direction_output(FPGA_CS_GPIO, 1);
Stepan Moskovchenko93d79ec2011-09-21 16:52:16 -07004239
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07004240 return 0;
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07004241fail:
4242 return ret;
4243}
Stepan Moskovchenko41d168272011-08-09 17:09:42 -07004244#else
Stepan Moskovchenko93d79ec2011-09-21 16:52:16 -07004245static int fpga_init(void)
Stepan Moskovchenko41d168272011-08-09 17:09:42 -07004246{
4247 return 0;
4248}
4249#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07004250
4251static struct msm_cpuidle_state msm_cstates[] __initdata = {
4252 {0, 0, "C0", "WFI",
4253 MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT},
4254
4255 {0, 1, "C1", "STANDALONE_POWER_COLLAPSE",
4256 MSM_PM_SLEEP_MODE_POWER_COLLAPSE_STANDALONE},
4257
4258 {0, 2, "C2", "POWER_COLLAPSE",
4259 MSM_PM_SLEEP_MODE_POWER_COLLAPSE},
4260
4261 {1, 0, "C0", "WFI",
4262 MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT},
4263
4264 {1, 1, "C1", "STANDALONE_POWER_COLLAPSE",
4265 MSM_PM_SLEEP_MODE_POWER_COLLAPSE_STANDALONE},
4266};
4267
4268static struct msm_pm_platform_data msm_pm_data[MSM_PM_SLEEP_MODE_NR * 2] = {
4269 [MSM_PM_MODE(0, MSM_PM_SLEEP_MODE_POWER_COLLAPSE)] = {
4270 .idle_supported = 1,
4271 .suspend_supported = 1,
4272 .idle_enabled = 0,
4273 .suspend_enabled = 0,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07004274 },
4275
4276 [MSM_PM_MODE(0, MSM_PM_SLEEP_MODE_POWER_COLLAPSE_STANDALONE)] = {
4277 .idle_supported = 1,
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(0, MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT)] = {
4284 .idle_supported = 1,
4285 .suspend_supported = 1,
4286 .idle_enabled = 1,
4287 .suspend_enabled = 1,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07004288 },
4289
4290 [MSM_PM_MODE(1, MSM_PM_SLEEP_MODE_POWER_COLLAPSE)] = {
4291 .idle_supported = 0,
4292 .suspend_supported = 1,
4293 .idle_enabled = 0,
4294 .suspend_enabled = 0,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07004295 },
4296
4297 [MSM_PM_MODE(1, MSM_PM_SLEEP_MODE_POWER_COLLAPSE_STANDALONE)] = {
4298 .idle_supported = 1,
4299 .suspend_supported = 1,
4300 .idle_enabled = 0,
4301 .suspend_enabled = 0,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07004302 },
4303
4304 [MSM_PM_MODE(1, MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT)] = {
4305 .idle_supported = 1,
4306 .suspend_supported = 0,
4307 .idle_enabled = 1,
4308 .suspend_enabled = 0,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07004309 },
4310};
4311
4312static struct msm_rpmrs_level msm_rpmrs_levels[] __initdata = {
4313 {
4314 MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT,
4315 MSM_RPMRS_LIMITS(ON, ACTIVE, MAX, ACTIVE),
4316 true,
Maheshkumar Sivasubramanianef101a02011-09-19 16:34:30 -06004317 100, 8000, 100000, 1,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07004318 },
4319
4320 {
4321 MSM_PM_SLEEP_MODE_POWER_COLLAPSE_STANDALONE,
4322 MSM_RPMRS_LIMITS(ON, ACTIVE, MAX, ACTIVE),
4323 true,
Maheshkumar Sivasubramanianef101a02011-09-19 16:34:30 -06004324 2000, 6000, 60100000, 3000,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07004325 },
4326
4327 {
4328 MSM_PM_SLEEP_MODE_POWER_COLLAPSE,
4329 MSM_RPMRS_LIMITS(ON, GDHS, MAX, ACTIVE),
4330 false,
Maheshkumar Sivasubramanianef101a02011-09-19 16:34:30 -06004331 4200, 5000, 60350000, 3500,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07004332 },
4333
4334 {
4335 MSM_PM_SLEEP_MODE_POWER_COLLAPSE,
4336 MSM_RPMRS_LIMITS(ON, HSFS_OPEN, MAX, ACTIVE),
4337 false,
Maheshkumar Sivasubramanianef101a02011-09-19 16:34:30 -06004338 6300, 4500, 65350000, 4800,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07004339 },
4340
4341 {
4342 MSM_PM_SLEEP_MODE_POWER_COLLAPSE,
4343 MSM_RPMRS_LIMITS(OFF, GDHS, MAX, ACTIVE),
4344 false,
Maheshkumar Sivasubramanianef101a02011-09-19 16:34:30 -06004345 11700, 2500, 67850000, 5500,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07004346 },
4347
4348 {
4349 MSM_PM_SLEEP_MODE_POWER_COLLAPSE,
4350 MSM_RPMRS_LIMITS(OFF, HSFS_OPEN, MAX, ACTIVE),
4351 false,
Maheshkumar Sivasubramanianef101a02011-09-19 16:34:30 -06004352 13800, 2000, 71850000, 6800,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07004353 },
4354
4355 {
4356 MSM_PM_SLEEP_MODE_POWER_COLLAPSE,
4357 MSM_RPMRS_LIMITS(OFF, HSFS_OPEN, ACTIVE, RET_HIGH),
4358 false,
Maheshkumar Sivasubramanianef101a02011-09-19 16:34:30 -06004359 29700, 500, 75850000, 8800,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07004360 },
4361
4362 {
4363 MSM_PM_SLEEP_MODE_POWER_COLLAPSE,
4364 MSM_RPMRS_LIMITS(OFF, HSFS_OPEN, RET_HIGH, RET_LOW),
4365 false,
Maheshkumar Sivasubramanianef101a02011-09-19 16:34:30 -06004366 29700, 0, 76350000, 9800,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07004367 },
4368};
4369
4370#ifdef CONFIG_I2C
4371#define I2C_SURF 1
4372#define I2C_FFA (1 << 1)
4373#define I2C_RUMI (1 << 2)
4374#define I2C_SIM (1 << 3)
4375#define I2C_FLUID (1 << 4)
Amir Samuelov05f87802011-08-27 18:30:12 +03004376#define I2C_LIQUID (1 << 5)
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07004377
4378struct i2c_registry {
4379 u8 machs;
4380 int bus;
4381 struct i2c_board_info *info;
4382 int len;
4383};
4384
4385#ifdef CONFIG_MSM_CAMERA
4386static struct i2c_board_info msm_camera_boardinfo[] __initdata = {
4387#ifdef CONFIG_IMX074
4388 {
4389 I2C_BOARD_INFO("imx074", 0x1A),
4390 },
4391#endif
4392#ifdef CONFIG_OV2720
4393 {
4394 I2C_BOARD_INFO("ov2720", 0x6C),
4395 },
4396#endif
Kevin Chandfecce22011-07-13 10:52:41 -07004397 {
4398 I2C_BOARD_INFO("qs_mt9p017", 0x6C >> 1),
4399 },
Nishant Pandit474f2252011-07-23 23:17:56 +05304400#ifdef CONFIG_MSM_CAMERA_FLASH_SC628A
4401 {
4402 I2C_BOARD_INFO("sc628a", 0x6E),
4403 },
4404#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07004405};
4406#endif
4407
4408/* Sensors DSPS platform data */
4409#ifdef CONFIG_MSM_DSPS
4410#define DSPS_PIL_GENERIC_NAME "dsps"
4411#endif /* CONFIG_MSM_DSPS */
4412
4413static void __init msm8960_init_dsps(void)
4414{
4415#ifdef CONFIG_MSM_DSPS
4416 struct msm_dsps_platform_data *pdata =
4417 msm_dsps_device.dev.platform_data;
4418 pdata->pil_name = DSPS_PIL_GENERIC_NAME;
4419 pdata->gpios = NULL;
4420 pdata->gpios_num = 0;
4421
4422 platform_device_register(&msm_dsps_device);
4423#endif /* CONFIG_MSM_DSPS */
4424}
4425
Vamsi Krishna98f54fb2011-11-02 14:55:41 -07004426static void __init msm8960_init_hsic(void)
4427{
4428#ifdef CONFIG_USB_EHCI_MSM_HSIC
4429 uint32_t version = socinfo_get_version();
4430
4431 pr_info("%s: version:%d mtp:%d\n", __func__,
4432 SOCINFO_VERSION_MAJOR(version),
4433 machine_is_msm8960_mtp());
4434
4435 if ((SOCINFO_VERSION_MAJOR(version) == 1) ||
4436 machine_is_msm8960_mtp() ||
4437 machine_is_msm8960_fluid())
4438 return;
4439
4440 msm_gpiomux_install(msm8960_hsic_configs,
4441 ARRAY_SIZE(msm8960_hsic_configs));
4442
4443 platform_device_register(&msm_device_hsic_host);
4444#endif
4445}
4446
4447
Amir Samuelov5137e392011-09-21 17:31:25 +03004448#ifdef CONFIG_ISL9519_CHARGER
4449static struct isl_platform_data isl_data __initdata = {
4450 .valid_n_gpio = 0, /* Not required when notify-by-pmic */
4451 .chg_detection_config = NULL, /* Not required when notify-by-pmic */
4452 .max_system_voltage = 4200,
4453 .min_system_voltage = 3200,
4454 .chgcurrent = 1000, /* 1900, */
4455 .term_current = 400, /* Need fine tuning */
4456 .input_current = 2048,
4457};
4458
4459static struct i2c_board_info isl_charger_i2c_info[] __initdata = {
4460 {
4461 I2C_BOARD_INFO("isl9519q", 0x9),
4462 .irq = 0, /* Not required when notify-by-pmic */
4463 .platform_data = &isl_data,
4464 },
4465};
4466#endif /* CONFIG_ISL9519_CHARGER */
4467
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07004468static struct i2c_registry msm8960_i2c_devices[] __initdata = {
4469#ifdef CONFIG_MSM_CAMERA
4470 {
Amir Samuelov05f87802011-08-27 18:30:12 +03004471 I2C_SURF | I2C_FFA | I2C_FLUID | I2C_LIQUID | I2C_RUMI,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07004472 MSM_8960_GSBI4_QUP_I2C_BUS_ID,
4473 msm_camera_boardinfo,
4474 ARRAY_SIZE(msm_camera_boardinfo),
4475 },
4476#endif
Amir Samuelov5137e392011-09-21 17:31:25 +03004477#ifdef CONFIG_ISL9519_CHARGER
4478 {
4479 I2C_LIQUID,
4480 MSM_8960_GSBI10_QUP_I2C_BUS_ID,
4481 isl_charger_i2c_info,
4482 ARRAY_SIZE(isl_charger_i2c_info),
4483 },
4484#endif /* CONFIG_ISL9519_CHARGER */
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07004485 {
4486 I2C_SURF | I2C_FFA | I2C_FLUID,
4487 MSM_8960_GSBI3_QUP_I2C_BUS_ID,
4488 cyttsp_info,
4489 ARRAY_SIZE(cyttsp_info),
Rohit Vaswanicd2a59b2011-07-19 12:00:48 -07004490 },
Mohan Pallaka50837382011-09-07 11:00:57 +05304491 {
4492 I2C_LIQUID,
4493 MSM_8960_GSBI3_QUP_I2C_BUS_ID,
4494 mxt_device_info,
4495 ARRAY_SIZE(mxt_device_info),
4496 },
4497
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07004498};
4499#endif /* CONFIG_I2C */
4500
4501static void __init register_i2c_devices(void)
4502{
4503#ifdef CONFIG_I2C
4504 u8 mach_mask = 0;
4505 int i;
4506
4507 /* Build the matching 'supported_machs' bitmask */
4508 if (machine_is_msm8960_cdp())
4509 mach_mask = I2C_SURF;
4510 else if (machine_is_msm8960_rumi3())
4511 mach_mask = I2C_RUMI;
4512 else if (machine_is_msm8960_sim())
4513 mach_mask = I2C_SIM;
Amy Maloche2d028032011-07-20 14:08:06 -07004514 else if (machine_is_msm8960_fluid())
4515 mach_mask = I2C_FLUID;
Amir Samuelov05f87802011-08-27 18:30:12 +03004516 else if (machine_is_msm8960_liquid())
4517 mach_mask = I2C_LIQUID;
Amy Maloche1b0663f2011-08-02 16:46:22 -07004518 else if (machine_is_msm8960_mtp())
4519 mach_mask = I2C_FFA;
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07004520 else
4521 pr_err("unmatched machine ID in register_i2c_devices\n");
4522
4523 /* Run the array and install devices as appropriate */
4524 for (i = 0; i < ARRAY_SIZE(msm8960_i2c_devices); ++i) {
4525 if (msm8960_i2c_devices[i].machs & mach_mask)
4526 i2c_register_board_info(msm8960_i2c_devices[i].bus,
4527 msm8960_i2c_devices[i].info,
4528 msm8960_i2c_devices[i].len);
4529 }
4530#endif
4531}
4532
Stepan Moskovchenkod056fca2011-01-27 12:12:07 -08004533static void __init msm8960_sim_init(void)
4534{
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07004535 BUG_ON(msm_rpm_init(&msm_rpm_data));
4536 BUG_ON(msm_rpmrs_levels_init(msm_rpmrs_levels,
4537 ARRAY_SIZE(msm_rpmrs_levels)));
4538 regulator_suppress_info_printing();
David Collins26f05562011-06-20 09:56:28 -07004539 platform_device_register(&msm8960_device_rpm_regulator);
Stephen Boydbb600ae2011-08-02 20:11:40 -07004540 msm_clock_init(&msm8960_clock_init_data);
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07004541 msm8960_device_ssbi_pm8921.dev.platform_data =
4542 &msm8960_ssbi_pm8921_pdata;
4543 pm8921_platform_data.num_regulators = msm_pm8921_regulator_pdata_len;
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07004544
4545 /* Simulator supports a QWERTY keypad */
4546 pm8921_platform_data.keypad_pdata = &keypad_data_sim;
4547
Stepan Moskovchenko14aa6492011-08-08 15:15:01 -07004548 msm8960_device_otg.dev.platform_data = &msm_otg_pdata;
4549 msm8960_device_gadget_peripheral.dev.parent = &msm8960_device_otg.dev;
4550 msm_device_hsusb_host.dev.parent = &msm8960_device_otg.dev;
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07004551 gpiomux_init();
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07004552 msm8960_i2c_init();
4553 msm_spm_init(msm_spm_data, ARRAY_SIZE(msm_spm_data));
4554 msm_spm_l2_init(msm_spm_l2_data);
4555 msm8960_init_buses();
4556 platform_add_devices(common_devices, ARRAY_SIZE(common_devices));
4557 pm8921_gpio_mpp_init();
Stepan Moskovchenkod056fca2011-01-27 12:12:07 -08004558 platform_add_devices(sim_devices, ARRAY_SIZE(sim_devices));
Matt Wagantallec57f062011-08-16 23:54:46 -07004559 acpuclk_init(&acpuclk_8960_soc_data);
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07004560
4561 msm8960_device_qup_spi_gsbi1.dev.platform_data =
4562 &msm8960_qup_spi_gsbi1_pdata;
4563 spi_register_board_info(spi_board_info, ARRAY_SIZE(spi_board_info));
4564
4565 msm8960_init_mmc();
4566 msm_fb_add_devices();
4567 slim_register_board_info(msm_slim_devices,
4568 ARRAY_SIZE(msm_slim_devices));
4569 msm_pm_set_platform_data(msm_pm_data, ARRAY_SIZE(msm_pm_data));
4570 msm_pm_set_rpm_wakeup_irq(RPM_APCC_CPU0_WAKE_UP_IRQ);
4571 msm_cpuidle_set_states(msm_cstates, ARRAY_SIZE(msm_cstates),
4572 msm_pm_data);
Maheshkumar Sivasubramanian8ccc16e2011-10-25 15:59:57 -06004573 BUG_ON(msm_pm_boot_init(MSM_PM_BOOT_CONFIG_TZ, NULL));
Stepan Moskovchenkod056fca2011-01-27 12:12:07 -08004574}
4575
4576static void __init msm8960_rumi3_init(void)
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)));
4581 regulator_suppress_info_printing();
David Collins26f05562011-06-20 09:56:28 -07004582 platform_device_register(&msm8960_device_rpm_regulator);
Stephen Boydbb600ae2011-08-02 20:11:40 -07004583 msm_clock_init(&msm8960_dummy_clock_init_data);
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07004584 gpiomux_init();
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07004585 msm8960_device_ssbi_pm8921.dev.platform_data =
4586 &msm8960_ssbi_pm8921_pdata;
4587 pm8921_platform_data.num_regulators = msm_pm8921_regulator_pdata_len;
4588 msm8960_device_qup_spi_gsbi1.dev.platform_data =
4589 &msm8960_qup_spi_gsbi1_pdata;
4590 spi_register_board_info(spi_board_info, ARRAY_SIZE(spi_board_info));
4591 msm8960_i2c_init();
4592 msm_spm_init(msm_spm_data, ARRAY_SIZE(msm_spm_data));
4593 msm_spm_l2_init(msm_spm_l2_data);
4594 platform_add_devices(common_devices, ARRAY_SIZE(common_devices));
4595 pm8921_gpio_mpp_init();
Stepan Moskovchenkod056fca2011-01-27 12:12:07 -08004596 platform_add_devices(rumi3_devices, ARRAY_SIZE(rumi3_devices));
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07004597 msm8960_init_mmc();
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07004598 register_i2c_devices();
4599 msm_fb_add_devices();
4600 slim_register_board_info(msm_slim_devices,
4601 ARRAY_SIZE(msm_slim_devices));
4602 msm_pm_set_platform_data(msm_pm_data, ARRAY_SIZE(msm_pm_data));
4603 msm_pm_set_rpm_wakeup_irq(RPM_APCC_CPU0_WAKE_UP_IRQ);
4604 msm_cpuidle_set_states(msm_cstates, ARRAY_SIZE(msm_cstates),
4605 msm_pm_data);
Maheshkumar Sivasubramanian8ccc16e2011-10-25 15:59:57 -06004606 BUG_ON(msm_pm_boot_init(MSM_PM_BOOT_CONFIG_TZ, NULL));
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07004607}
4608
4609static void __init msm8960_cdp_init(void)
4610{
Naveen Ramaraj76483ad2011-09-06 14:25:44 -07004611 if (meminfo_init(SYS_MEMORY, SZ_256M) < 0)
4612 pr_err("meminfo_init() failed!\n");
4613
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07004614 BUG_ON(msm_rpm_init(&msm_rpm_data));
4615 BUG_ON(msm_rpmrs_levels_init(msm_rpmrs_levels,
4616 ARRAY_SIZE(msm_rpmrs_levels)));
Abhijeet Dharmapurikar6d565fd2011-09-15 18:49:56 -07004617
4618 pmic_reset_irq = PM8921_IRQ_BASE + PM8921_RESOUT_IRQ;
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07004619 regulator_suppress_info_printing();
4620 if (msm_xo_init())
4621 pr_err("Failed to initialize XO votes\n");
David Collins26f05562011-06-20 09:56:28 -07004622 platform_device_register(&msm8960_device_rpm_regulator);
Stephen Boydbb600ae2011-08-02 20:11:40 -07004623 msm_clock_init(&msm8960_clock_init_data);
Stepan Moskovchenko14aa6492011-08-08 15:15:01 -07004624 msm8960_device_otg.dev.platform_data = &msm_otg_pdata;
4625 msm8960_device_gadget_peripheral.dev.parent = &msm8960_device_otg.dev;
4626 msm_device_hsusb_host.dev.parent = &msm8960_device_otg.dev;
Vijayavardhan Vennapusa2b592824f2011-11-02 19:51:32 +05304627#ifdef CONFIG_USB_EHCI_MSM_HSIC
4628 if (machine_is_msm8960_liquid()) {
4629 if (SOCINFO_VERSION_MAJOR(socinfo_get_version()) >= 2)
4630 msm_hsic_pdata.hub_reset = HSIC_HUB_RESET_GPIO;
4631 }
4632#endif
Vijayavardhan Vennapusae3316a12011-10-15 06:05:17 +05304633 msm_device_hsic_host.dev.platform_data = &msm_hsic_pdata;
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07004634 gpiomux_init();
Stepan Moskovchenko93d79ec2011-09-21 16:52:16 -07004635 if (machine_is_msm8960_cdp())
4636 fpga_init();
Mohan Pallaka002e9e02011-08-05 11:23:22 +05304637 if (machine_is_msm8960_liquid())
4638 pm8921_platform_data.keypad_pdata = &keypad_data_liquid;
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07004639 msm8960_device_qup_spi_gsbi1.dev.platform_data =
4640 &msm8960_qup_spi_gsbi1_pdata;
4641 spi_register_board_info(spi_board_info, ARRAY_SIZE(spi_board_info));
4642 msm8960_device_ssbi_pm8921.dev.platform_data =
4643 &msm8960_ssbi_pm8921_pdata;
4644 pm8921_platform_data.num_regulators = msm_pm8921_regulator_pdata_len;
4645 msm8960_i2c_init();
Lucille Sylvester34ec3692011-08-16 16:28:04 -06004646 msm8960_gfx_init();
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07004647 msm_spm_init(msm_spm_data, ARRAY_SIZE(msm_spm_data));
4648 msm_spm_l2_init(msm_spm_l2_data);
4649 msm8960_init_buses();
4650 platform_add_devices(msm_footswitch_devices,
4651 msm_num_footswitch_devices);
David Collinsb10be1d2011-09-02 10:29:31 -07004652 if (machine_is_msm8960_liquid())
4653 platform_device_register(&msm8960_device_ext_3p3v_vreg);
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07004654 platform_add_devices(common_devices, ARRAY_SIZE(common_devices));
4655 pm8921_gpio_mpp_init();
4656 platform_add_devices(cdp_devices, ARRAY_SIZE(cdp_devices));
Vamsi Krishna98f54fb2011-11-02 14:55:41 -07004657 msm8960_init_hsic();
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07004658 msm8960_init_cam();
4659 msm8960_init_mmc();
Matt Wagantallec57f062011-08-16 23:54:46 -07004660 acpuclk_init(&acpuclk_8960_soc_data);
Mohan Pallaka50837382011-09-07 11:00:57 +05304661 if (machine_is_msm8960_liquid())
4662 mxt_init_hw_liquid();
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07004663 register_i2c_devices();
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07004664 msm_fb_add_devices();
4665 slim_register_board_info(msm_slim_devices,
4666 ARRAY_SIZE(msm_slim_devices));
4667 msm8960_init_dsps();
4668 msm_pm_set_platform_data(msm_pm_data, ARRAY_SIZE(msm_pm_data));
4669 msm_pm_set_rpm_wakeup_irq(RPM_APCC_CPU0_WAKE_UP_IRQ);
4670 msm_cpuidle_set_states(msm_cstates, ARRAY_SIZE(msm_cstates),
4671 msm_pm_data);
Larry Bassela7eadea2011-07-14 10:46:00 -07004672 change_memory_power = &msm8960_change_memory_power;
Maheshkumar Sivasubramanian8ccc16e2011-10-25 15:59:57 -06004673 BUG_ON(msm_pm_boot_init(MSM_PM_BOOT_CONFIG_TZ, NULL));
Stepan Moskovchenkod056fca2011-01-27 12:12:07 -08004674}
4675
Stepan Moskovchenkof441ca22010-12-01 19:31:16 -08004676MACHINE_START(MSM8960_SIM, "QCT MSM8960 SIMULATOR")
4677 .map_io = msm8960_map_io,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07004678 .reserve = msm8960_reserve,
Stepan Moskovchenkof441ca22010-12-01 19:31:16 -08004679 .init_irq = msm8960_init_irq,
4680 .timer = &msm_timer,
Stepan Moskovchenkod056fca2011-01-27 12:12:07 -08004681 .init_machine = msm8960_sim_init,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07004682 .init_early = msm8960_allocate_memory_regions,
Larry Basselb830e182011-10-14 10:46:55 -07004683 .init_very_early = msm8960_early_memory,
Stepan Moskovchenkof441ca22010-12-01 19:31:16 -08004684MACHINE_END
Stepan Moskovchenko50ede4e2010-12-13 18:12:19 -08004685
4686MACHINE_START(MSM8960_RUMI3, "QCT MSM8960 RUMI3")
4687 .map_io = msm8960_map_io,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07004688 .reserve = msm8960_reserve,
Stepan Moskovchenko50ede4e2010-12-13 18:12:19 -08004689 .init_irq = msm8960_init_irq,
4690 .timer = &msm_timer,
Stepan Moskovchenkod056fca2011-01-27 12:12:07 -08004691 .init_machine = msm8960_rumi3_init,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07004692 .init_early = msm8960_allocate_memory_regions,
Larry Basselb830e182011-10-14 10:46:55 -07004693 .init_very_early = msm8960_early_memory,
Stepan Moskovchenko50ede4e2010-12-13 18:12:19 -08004694MACHINE_END
4695
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07004696MACHINE_START(MSM8960_CDP, "QCT MSM8960 CDP")
4697 .map_io = msm8960_map_io,
4698 .reserve = msm8960_reserve,
4699 .init_irq = msm8960_init_irq,
4700 .timer = &msm_timer,
4701 .init_machine = msm8960_cdp_init,
4702 .init_early = msm8960_allocate_memory_regions,
Larry Basselb830e182011-10-14 10:46:55 -07004703 .init_very_early = msm8960_early_memory,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07004704MACHINE_END
4705
4706MACHINE_START(MSM8960_MTP, "QCT MSM8960 MTP")
4707 .map_io = msm8960_map_io,
4708 .reserve = msm8960_reserve,
4709 .init_irq = msm8960_init_irq,
4710 .timer = &msm_timer,
4711 .init_machine = msm8960_cdp_init,
4712 .init_early = msm8960_allocate_memory_regions,
Larry Basselb830e182011-10-14 10:46:55 -07004713 .init_very_early = msm8960_early_memory,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07004714MACHINE_END
4715
4716MACHINE_START(MSM8960_FLUID, "QCT MSM8960 FLUID")
4717 .map_io = msm8960_map_io,
4718 .reserve = msm8960_reserve,
4719 .init_irq = msm8960_init_irq,
4720 .timer = &msm_timer,
4721 .init_machine = msm8960_cdp_init,
4722 .init_early = msm8960_allocate_memory_regions,
Larry Basselb830e182011-10-14 10:46:55 -07004723 .init_very_early = msm8960_early_memory,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07004724MACHINE_END
Amir Samuelov0d1f8ae2011-07-28 11:13:58 +03004725
4726MACHINE_START(MSM8960_LIQUID, "QCT MSM8960 LIQUID")
4727 .map_io = msm8960_map_io,
4728 .reserve = msm8960_reserve,
4729 .init_irq = msm8960_init_irq,
4730 .timer = &msm_timer,
4731 .init_machine = msm8960_cdp_init,
4732 .init_early = msm8960_allocate_memory_regions,
Larry Basselb830e182011-10-14 10:46:55 -07004733 .init_very_early = msm8960_early_memory,
Amir Samuelov0d1f8ae2011-07-28 11:13:58 +03004734MACHINE_END
Stepan Moskovchenkof4fdfe52011-10-18 17:28:58 -07004735
4736#ifdef CONFIG_ARCH_MSM8930
4737MACHINE_START(MSM8930_CDP, "QCT MSM8930 CDP")
4738 .map_io = msm8930_map_io,
4739 .reserve = msm8960_reserve,
4740 .init_irq = msm8960_init_irq,
4741 .timer = &msm_timer,
4742 .init_machine = msm8960_cdp_init,
4743 .init_early = msm8960_allocate_memory_regions,
Stepan Moskovchenko0ae2e722011-11-01 13:24:41 -07004744 .init_very_early = msm8960_early_memory,
Stepan Moskovchenkof4fdfe52011-10-18 17:28:58 -07004745MACHINE_END
4746
4747MACHINE_START(MSM8930_MTP, "QCT MSM8930 MTP")
4748 .map_io = msm8930_map_io,
4749 .reserve = msm8960_reserve,
4750 .init_irq = msm8960_init_irq,
4751 .timer = &msm_timer,
4752 .init_machine = msm8960_cdp_init,
4753 .init_early = msm8960_allocate_memory_regions,
Stepan Moskovchenko0ae2e722011-11-01 13:24:41 -07004754 .init_very_early = msm8960_early_memory,
Stepan Moskovchenkof4fdfe52011-10-18 17:28:58 -07004755MACHINE_END
4756
4757MACHINE_START(MSM8930_FLUID, "QCT MSM8930 FLUID")
4758 .map_io = msm8930_map_io,
4759 .reserve = msm8960_reserve,
4760 .init_irq = msm8960_init_irq,
4761 .timer = &msm_timer,
4762 .init_machine = msm8960_cdp_init,
4763 .init_early = msm8960_allocate_memory_regions,
Stepan Moskovchenko0ae2e722011-11-01 13:24:41 -07004764 .init_very_early = msm8960_early_memory,
Stepan Moskovchenkof4fdfe52011-10-18 17:28:58 -07004765MACHINE_END
4766#endif