blob: b74b2852229e6eb354056c15b867bb20dcb1b126 [file] [log] [blame]
Sravan Kumar Ambapuramb22cf4d2012-01-02 21:45:04 +05301/* Copyright (c) 2011-2012, Code Aurora Forum. All rights reserved.
Taniya Dasc98bfbc2011-08-23 09:58:55 +05302 *
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 */
12
13#include <linux/kernel.h>
14#include <linux/init.h>
15#include <linux/gpio_event.h>
Pankaj Kumar6f841742011-10-10 15:52:14 +053016#include <linux/usb/android.h>
Taniya Dasc98bfbc2011-08-23 09:58:55 +053017#include <linux/platform_device.h>
18#include <linux/io.h>
19#include <linux/gpio.h>
20#include <linux/mtd/nand.h>
21#include <linux/mtd/partitions.h>
22#include <linux/i2c.h>
23#include <linux/android_pmem.h>
24#include <linux/bootmem.h>
25#include <linux/mfd/marimba.h>
26#include <linux/power_supply.h>
Trilok Sonib9410792012-04-07 15:37:13 +053027#include <linux/input/rmi_platformdata.h>
28#include <linux/input/rmi_i2c.h>
29#include <linux/i2c/atmel_mxt_ts.h>
Pankaj Kumar3cec0582011-11-18 11:13:29 +053030#include <linux/regulator/consumer.h>
Chintan Pandyaf4ad4002012-02-28 19:49:03 +053031#include <linux/memblock.h>
Mohan Pallaka5afe9852012-01-12 23:12:06 +053032#include <linux/input/ft5x06_ts.h>
Siddartha Mohanadossbc2103f2012-03-20 11:41:48 -070033#include <linux/msm_adc.h>
Taniya Das720c5c32012-05-18 14:08:14 +053034#include <linux/fmem.h>
Taniya Dasc98bfbc2011-08-23 09:58:55 +053035#include <asm/mach/mmc.h>
36#include <asm/mach-types.h>
37#include <asm/mach/arch.h>
Chintan Pandyaf4ad4002012-02-28 19:49:03 +053038#include <asm/hardware/gic.h>
Taniya Dasc98bfbc2011-08-23 09:58:55 +053039#include <mach/board.h>
40#include <mach/msm_iomap.h>
41#include <mach/msm_hsusb.h>
42#include <mach/rpc_hsusb.h>
43#include <mach/rpc_pmapp.h>
44#include <mach/usbdiag.h>
Taniya Dasc98bfbc2011-08-23 09:58:55 +053045#include <mach/msm_memtypes.h>
46#include <mach/msm_serial_hs.h>
Taniya Dasc98bfbc2011-08-23 09:58:55 +053047#include <mach/pmic.h>
48#include <mach/socinfo.h>
49#include <mach/vreg.h>
50#include <mach/rpc_pmapp.h>
51#include <mach/msm_battery.h>
52#include <mach/rpc_server_handset.h>
53#include <mach/socinfo.h>
Pankaj Kumar27c02642011-09-22 15:55:55 +053054#include "board-msm7x27a-regulator.h"
Taniya Dasc98bfbc2011-08-23 09:58:55 +053055#include "devices.h"
56#include "devices-msm7x2xa.h"
Matt Wagantall7cca4642012-02-01 16:43:24 -080057#include "pm.h"
Taniya Dasc98bfbc2011-08-23 09:58:55 +053058#include "timer.h"
Murali Nalajalaa1827842011-11-13 14:12:39 +053059#include "pm-boot.h"
Pankaj Kumar3cec0582011-11-18 11:13:29 +053060#include "board-msm7x27a-regulator.h"
Chintan Pandyacf467fc2011-12-01 17:11:11 +053061#include "board-msm7627a.h"
Taniya Dasc98bfbc2011-08-23 09:58:55 +053062
Trilok Sonib9410792012-04-07 15:37:13 +053063#define PMEM_KERNEL_EBI1_SIZE 0x3A000
Sidipotu Ashok4f1ddc92012-04-11 13:51:34 +053064#define MSM_PMEM_AUDIO_SIZE 0x1F4000
Trilok Sonib9410792012-04-07 15:37:13 +053065#define BAHAMA_SLAVE_ID_FM_REG 0x02
66#define FM_GPIO 83
67#define BT_PCM_BCLK_MODE 0x88
68#define BT_PCM_DIN_MODE 0x89
69#define BT_PCM_DOUT_MODE 0x8A
70#define BT_PCM_SYNC_MODE 0x8B
71#define FM_I2S_SD_MODE 0x8E
72#define FM_I2S_WS_MODE 0x8F
73#define FM_I2S_SCK_MODE 0x90
74#define I2C_PIN_CTL 0x15
75#define I2C_NORMAL 0x40
76
Taniya Dasc98bfbc2011-08-23 09:58:55 +053077static struct platform_device msm_wlan_ar6000_pm_device = {
78 .name = "wlan_ar6000_pm_dev",
79 .id = -1,
80};
81
Taniya Dasc98bfbc2011-08-23 09:58:55 +053082static struct msm_gpio qup_i2c_gpios_io[] = {
83 { GPIO_CFG(60, 0, GPIO_CFG_OUTPUT, GPIO_CFG_NO_PULL, GPIO_CFG_8MA),
84 "qup_scl" },
85 { GPIO_CFG(61, 0, GPIO_CFG_OUTPUT, GPIO_CFG_NO_PULL, GPIO_CFG_8MA),
86 "qup_sda" },
87 { GPIO_CFG(131, 0, GPIO_CFG_OUTPUT, GPIO_CFG_NO_PULL, GPIO_CFG_8MA),
88 "qup_scl" },
89 { GPIO_CFG(132, 0, GPIO_CFG_OUTPUT, GPIO_CFG_NO_PULL, GPIO_CFG_8MA),
90 "qup_sda" },
91};
92
93static struct msm_gpio qup_i2c_gpios_hw[] = {
94 { GPIO_CFG(60, 1, GPIO_CFG_INPUT, GPIO_CFG_NO_PULL, GPIO_CFG_8MA),
95 "qup_scl" },
96 { GPIO_CFG(61, 1, GPIO_CFG_INPUT, GPIO_CFG_NO_PULL, GPIO_CFG_8MA),
97 "qup_sda" },
98 { GPIO_CFG(131, 2, GPIO_CFG_INPUT, GPIO_CFG_NO_PULL, GPIO_CFG_8MA),
99 "qup_scl" },
100 { GPIO_CFG(132, 2, GPIO_CFG_INPUT, GPIO_CFG_NO_PULL, GPIO_CFG_8MA),
101 "qup_sda" },
102};
103
104static void gsbi_qup_i2c_gpio_config(int adap_id, int config_type)
105{
106 int rc;
107
108 if (adap_id < 0 || adap_id > 1)
109 return;
110
111 /* Each adapter gets 2 lines from the table */
112 if (config_type)
113 rc = msm_gpios_request_enable(&qup_i2c_gpios_hw[adap_id*2], 2);
114 else
115 rc = msm_gpios_request_enable(&qup_i2c_gpios_io[adap_id*2], 2);
116 if (rc < 0)
117 pr_err("QUP GPIO request/enable failed: %d\n", rc);
118}
119
120static struct msm_i2c_platform_data msm_gsbi0_qup_i2c_pdata = {
121 .clk_freq = 100000,
122 .msm_i2c_config_gpio = gsbi_qup_i2c_gpio_config,
123};
124
125static struct msm_i2c_platform_data msm_gsbi1_qup_i2c_pdata = {
126 .clk_freq = 100000,
127 .msm_i2c_config_gpio = gsbi_qup_i2c_gpio_config,
128};
129
Trilok Sonib9410792012-04-07 15:37:13 +0530130#ifdef CONFIG_ARCH_MSM7X27A
Sravan Kumar D.V.Nd0b59d62012-04-17 15:08:14 +0530131#define MSM_PMEM_MDP_SIZE 0x2300000
Trilok Sonib9410792012-04-07 15:37:13 +0530132#define MSM_PMEM_ADSP_SIZE 0x1100000
133#endif
134
Taniya Dasc98bfbc2011-08-23 09:58:55 +0530135static struct android_usb_platform_data android_usb_pdata = {
Pankaj Kumar6f841742011-10-10 15:52:14 +0530136 .update_pid_and_serial_num = usb_diag_update_pid_and_serial_num,
Taniya Dasc98bfbc2011-08-23 09:58:55 +0530137};
138
139static struct platform_device android_usb_device = {
140 .name = "android_usb",
141 .id = -1,
142 .dev = {
143 .platform_data = &android_usb_pdata,
144 },
145};
146
Taniya Dasc98bfbc2011-08-23 09:58:55 +0530147#ifdef CONFIG_USB_EHCI_MSM_72K
148static void msm_hsusb_vbus_power(unsigned phy_info, int on)
149{
150 int rc = 0;
151 unsigned gpio;
152
Chintan Pandya40762702011-12-06 13:47:06 +0530153 gpio = QRD_GPIO_HOST_VBUS_EN;
Taniya Dasc98bfbc2011-08-23 09:58:55 +0530154
155 rc = gpio_request(gpio, "i2c_host_vbus_en");
156 if (rc < 0) {
157 pr_err("failed to request %d GPIO\n", gpio);
158 return;
159 }
160 gpio_direction_output(gpio, !!on);
161 gpio_set_value_cansleep(gpio, !!on);
162 gpio_free(gpio);
163}
164
165static struct msm_usb_host_platform_data msm_usb_host_pdata = {
166 .phy_info = (USB_PHY_INTEGRATED | USB_PHY_MODEL_45NM),
167};
168
169static void __init msm7627a_init_host(void)
170{
171 msm_add_host(0, &msm_usb_host_pdata);
172}
173#endif
174
175#ifdef CONFIG_USB_MSM_OTG_72K
176static int hsusb_rpc_connect(int connect)
177{
178 if (connect)
179 return msm_hsusb_rpc_connect();
180 else
181 return msm_hsusb_rpc_close();
182}
183
Pankaj Kumar27c02642011-09-22 15:55:55 +0530184static struct regulator *reg_hsusb;
Taniya Dasc98bfbc2011-08-23 09:58:55 +0530185static int msm_hsusb_ldo_init(int init)
186{
Pankaj Kumar27c02642011-09-22 15:55:55 +0530187 int rc = 0;
Taniya Dasc98bfbc2011-08-23 09:58:55 +0530188
Pankaj Kumar27c02642011-09-22 15:55:55 +0530189 if (init) {
190 reg_hsusb = regulator_get(NULL, "usb");
191 if (IS_ERR(reg_hsusb)) {
192 rc = PTR_ERR(reg_hsusb);
193 pr_err("%s: could not get regulator: %d\n",
194 __func__, rc);
195 goto out;
196 }
197
198 rc = regulator_set_voltage(reg_hsusb, 3300000, 3300000);
199 if (rc) {
200 pr_err("%s: could not set voltage: %d\n",
201 __func__, rc);
202 goto reg_free;
203 }
204
205 return 0;
206 }
207 /* else fall through */
208reg_free:
209 regulator_put(reg_hsusb);
210out:
211 reg_hsusb = NULL;
212 return rc;
Taniya Dasc98bfbc2011-08-23 09:58:55 +0530213}
214
215static int msm_hsusb_ldo_enable(int enable)
216{
217 static int ldo_status;
218
Pankaj Kumar27c02642011-09-22 15:55:55 +0530219 if (IS_ERR_OR_NULL(reg_hsusb))
220 return reg_hsusb ? PTR_ERR(reg_hsusb) : -ENODEV;
Taniya Dasc98bfbc2011-08-23 09:58:55 +0530221
222 if (ldo_status == enable)
223 return 0;
224
225 ldo_status = enable;
226
Pankaj Kumar27c02642011-09-22 15:55:55 +0530227 return enable ?
228 regulator_enable(reg_hsusb) :
229 regulator_disable(reg_hsusb);
Taniya Dasc98bfbc2011-08-23 09:58:55 +0530230}
231
232#ifndef CONFIG_USB_EHCI_MSM_72K
233static int msm_hsusb_pmic_notif_init(void (*callback)(int online), int init)
234{
235 int ret = 0;
236
237 if (init)
238 ret = msm_pm_app_rpc_init(callback);
239 else
240 msm_pm_app_rpc_deinit(callback);
241
242 return ret;
243}
244#endif
245
246static struct msm_otg_platform_data msm_otg_pdata = {
247#ifndef CONFIG_USB_EHCI_MSM_72K
248 .pmic_vbus_notif_init = msm_hsusb_pmic_notif_init,
249#else
250 .vbus_power = msm_hsusb_vbus_power,
251#endif
252 .rpc_connect = hsusb_rpc_connect,
Taniya Dasc98bfbc2011-08-23 09:58:55 +0530253 .pemp_level = PRE_EMPHASIS_WITH_20_PERCENT,
254 .cdr_autoreset = CDR_AUTO_RESET_DISABLE,
255 .drv_ampl = HS_DRV_AMPLITUDE_DEFAULT,
256 .se1_gating = SE1_GATING_DISABLE,
257 .ldo_init = msm_hsusb_ldo_init,
258 .ldo_enable = msm_hsusb_ldo_enable,
259 .chg_init = hsusb_chg_init,
260 .chg_connected = hsusb_chg_connected,
261 .chg_vbus_draw = hsusb_chg_vbus_draw,
262};
263#endif
264
265static struct msm_hsusb_gadget_platform_data msm_gadget_pdata = {
266 .is_phy_status_timer_on = 1,
267};
268
Taniya Dasc98bfbc2011-08-23 09:58:55 +0530269#ifdef CONFIG_SERIAL_MSM_HS
270static struct msm_serial_hs_platform_data msm_uart_dm1_pdata = {
271 .inject_rx_on_wakeup = 1,
272 .rx_to_inject = 0xFD,
273};
274#endif
275static struct msm_pm_platform_data msm7627a_pm_data[MSM_PM_SLEEP_MODE_NR] = {
276 [MSM_PM_SLEEP_MODE_POWER_COLLAPSE] = {
277 .idle_supported = 1,
278 .suspend_supported = 1,
279 .idle_enabled = 1,
280 .suspend_enabled = 1,
281 .latency = 16000,
282 .residency = 20000,
283 },
284 [MSM_PM_SLEEP_MODE_POWER_COLLAPSE_NO_XO_SHUTDOWN] = {
285 .idle_supported = 1,
286 .suspend_supported = 1,
287 .idle_enabled = 1,
288 .suspend_enabled = 1,
289 .latency = 12000,
290 .residency = 20000,
291 },
292 [MSM_PM_SLEEP_MODE_RAMP_DOWN_AND_WAIT_FOR_INTERRUPT] = {
293 .idle_supported = 1,
294 .suspend_supported = 1,
295 .idle_enabled = 0,
296 .suspend_enabled = 1,
297 .latency = 2000,
298 .residency = 0,
299 },
300 [MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT] = {
301 .idle_supported = 1,
302 .suspend_supported = 1,
303 .idle_enabled = 1,
304 .suspend_enabled = 1,
305 .latency = 2,
306 .residency = 0,
307 },
308};
309
Maheshkumar Sivasubramanianc6c55032011-10-25 16:01:32 -0600310static struct msm_pm_boot_platform_data msm_pm_boot_pdata __initdata = {
Sravan Kumar Ambapuramb22cf4d2012-01-02 21:45:04 +0530311 .mode = MSM_PM_BOOT_CONFIG_RESET_VECTOR_PHYS,
312 .p_addr = 0,
Maheshkumar Sivasubramanianc6c55032011-10-25 16:01:32 -0600313};
314
Murali Nalajala4c996be2012-03-12 17:05:41 +0530315/* 8625 PM platform data */
316static struct msm_pm_platform_data msm8625_pm_data[MSM_PM_SLEEP_MODE_NR * 2] = {
317 /* CORE0 entries */
318 [MSM_PM_MODE(0, MSM_PM_SLEEP_MODE_POWER_COLLAPSE)] = {
319 .idle_supported = 1,
320 .suspend_supported = 1,
321 .idle_enabled = 0,
322 .suspend_enabled = 0,
323 .latency = 16000,
324 .residency = 20000,
325 },
326
327 [MSM_PM_MODE(0, MSM_PM_SLEEP_MODE_POWER_COLLAPSE_NO_XO_SHUTDOWN)] = {
328 .idle_supported = 1,
329 .suspend_supported = 1,
330 .idle_enabled = 0,
331 .suspend_enabled = 0,
332 .latency = 12000,
333 .residency = 20000,
334 },
335
336 /* picked latency & redisdency values from 7x30 */
337 [MSM_PM_MODE(0, MSM_PM_SLEEP_MODE_POWER_COLLAPSE_STANDALONE)] = {
338 .idle_supported = 1,
339 .suspend_supported = 1,
340 .idle_enabled = 0,
341 .suspend_enabled = 0,
342 .latency = 500,
343 .residency = 6000,
344 },
345
346 [MSM_PM_MODE(0, MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT)] = {
347 .idle_supported = 1,
348 .suspend_supported = 1,
349 .idle_enabled = 1,
350 .suspend_enabled = 1,
351 .latency = 2,
352 .residency = 10,
353 },
354
355 /* picked latency & redisdency values from 7x30 */
356 [MSM_PM_MODE(1, MSM_PM_SLEEP_MODE_POWER_COLLAPSE_STANDALONE)] = {
357 .idle_supported = 1,
358 .suspend_supported = 1,
359 .idle_enabled = 0,
360 .suspend_enabled = 0,
361 .latency = 500,
362 .residency = 6000,
363 },
364
365 [MSM_PM_MODE(1, MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT)] = {
366 .idle_supported = 1,
367 .suspend_supported = 1,
368 .idle_enabled = 1,
369 .suspend_enabled = 1,
370 .latency = 2,
371 .residency = 10,
372 },
373
374};
375
376static struct msm_pm_boot_platform_data msm_pm_8625_boot_pdata __initdata = {
377 .mode = MSM_PM_BOOT_CONFIG_REMAP_BOOT_ADDR,
378 .v_addr = MSM_CFG_CTL_BASE,
379};
380
Trilok Sonib9410792012-04-07 15:37:13 +0530381static struct android_pmem_platform_data android_pmem_adsp_pdata = {
382 .name = "pmem_adsp",
383 .allocator_type = PMEM_ALLOCATORTYPE_BITMAP,
384 .cached = 1,
385 .memory_type = MEMTYPE_EBI1,
Taniya Das720c5c32012-05-18 14:08:14 +0530386 .request_region = request_fmem_c_region,
387 .release_region = release_fmem_c_region,
388 .reusable = 1,
Trilok Sonib9410792012-04-07 15:37:13 +0530389};
390
391static struct platform_device android_pmem_adsp_device = {
392 .name = "android_pmem",
393 .id = 1,
394 .dev = { .platform_data = &android_pmem_adsp_pdata },
395};
396
397static unsigned pmem_mdp_size = MSM_PMEM_MDP_SIZE;
398static int __init pmem_mdp_size_setup(char *p)
399{
400 pmem_mdp_size = memparse(p, NULL);
401 return 0;
402}
403
404early_param("pmem_mdp_size", pmem_mdp_size_setup);
405
406static unsigned pmem_adsp_size = MSM_PMEM_ADSP_SIZE;
407static int __init pmem_adsp_size_setup(char *p)
408{
409 pmem_adsp_size = memparse(p, NULL);
410 return 0;
411}
412
413early_param("pmem_adsp_size", pmem_adsp_size_setup);
414
415#define SND(desc, num) { .name = #desc, .id = num }
416static struct snd_endpoint snd_endpoints_list[] = {
417 SND(HANDSET, 0),
418 SND(MONO_HEADSET, 2),
419 SND(HEADSET, 3),
420 SND(SPEAKER, 6),
421 SND(TTY_HEADSET, 8),
422 SND(TTY_VCO, 9),
423 SND(TTY_HCO, 10),
424 SND(BT, 12),
425 SND(IN_S_SADC_OUT_HANDSET, 16),
426 SND(IN_S_SADC_OUT_SPEAKER_PHONE, 25),
427 SND(FM_DIGITAL_STEREO_HEADSET, 26),
428 SND(FM_DIGITAL_SPEAKER_PHONE, 27),
429 SND(FM_DIGITAL_BT_A2DP_HEADSET, 28),
430 SND(STEREO_HEADSET_AND_SPEAKER, 31),
431 SND(CURRENT, 0x7FFFFFFE),
432 SND(FM_ANALOG_STEREO_HEADSET, 35),
433 SND(FM_ANALOG_STEREO_HEADSET_CODEC, 36),
434};
435#undef SND
436
437static struct msm_snd_endpoints msm_device_snd_endpoints = {
438 .endpoints = snd_endpoints_list,
439 .num = sizeof(snd_endpoints_list) / sizeof(struct snd_endpoint)
440};
441
442static struct platform_device msm_device_snd = {
443 .name = "msm_snd",
444 .id = -1,
445 .dev = {
446 .platform_data = &msm_device_snd_endpoints
447 },
448};
449
450#define DEC0_FORMAT ((1<<MSM_ADSP_CODEC_MP3)| \
451 (1<<MSM_ADSP_CODEC_AAC)|(1<<MSM_ADSP_CODEC_WMA)| \
452 (1<<MSM_ADSP_CODEC_WMAPRO)|(1<<MSM_ADSP_CODEC_AMRWB)| \
453 (1<<MSM_ADSP_CODEC_AMRNB)|(1<<MSM_ADSP_CODEC_WAV)| \
454 (1<<MSM_ADSP_CODEC_ADPCM)|(1<<MSM_ADSP_CODEC_YADPCM)| \
455 (1<<MSM_ADSP_CODEC_EVRC)|(1<<MSM_ADSP_CODEC_QCELP))
456#define DEC1_FORMAT ((1<<MSM_ADSP_CODEC_MP3)| \
457 (1<<MSM_ADSP_CODEC_AAC)|(1<<MSM_ADSP_CODEC_WMA)| \
458 (1<<MSM_ADSP_CODEC_WMAPRO)|(1<<MSM_ADSP_CODEC_AMRWB)| \
459 (1<<MSM_ADSP_CODEC_AMRNB)|(1<<MSM_ADSP_CODEC_WAV)| \
460 (1<<MSM_ADSP_CODEC_ADPCM)|(1<<MSM_ADSP_CODEC_YADPCM)| \
461 (1<<MSM_ADSP_CODEC_EVRC)|(1<<MSM_ADSP_CODEC_QCELP))
462#define DEC2_FORMAT ((1<<MSM_ADSP_CODEC_MP3)| \
463 (1<<MSM_ADSP_CODEC_AAC)|(1<<MSM_ADSP_CODEC_WMA)| \
464 (1<<MSM_ADSP_CODEC_WMAPRO)|(1<<MSM_ADSP_CODEC_AMRWB)| \
465 (1<<MSM_ADSP_CODEC_AMRNB)|(1<<MSM_ADSP_CODEC_WAV)| \
466 (1<<MSM_ADSP_CODEC_ADPCM)|(1<<MSM_ADSP_CODEC_YADPCM)| \
467 (1<<MSM_ADSP_CODEC_EVRC)|(1<<MSM_ADSP_CODEC_QCELP))
468#define DEC3_FORMAT ((1<<MSM_ADSP_CODEC_MP3)| \
469 (1<<MSM_ADSP_CODEC_AAC)|(1<<MSM_ADSP_CODEC_WMA)| \
470 (1<<MSM_ADSP_CODEC_WMAPRO)|(1<<MSM_ADSP_CODEC_AMRWB)| \
471 (1<<MSM_ADSP_CODEC_AMRNB)|(1<<MSM_ADSP_CODEC_WAV)| \
472 (1<<MSM_ADSP_CODEC_ADPCM)|(1<<MSM_ADSP_CODEC_YADPCM)| \
473 (1<<MSM_ADSP_CODEC_EVRC)|(1<<MSM_ADSP_CODEC_QCELP))
474#define DEC4_FORMAT (1<<MSM_ADSP_CODEC_MIDI)
475
476static unsigned int dec_concurrency_table[] = {
477 /* Audio LP */
478 (DEC0_FORMAT|(1<<MSM_ADSP_MODE_TUNNEL)|(1<<MSM_ADSP_OP_DMA)), 0,
479 0, 0, 0,
480
481 /* Concurrency 1 */
482 (DEC0_FORMAT|(1<<MSM_ADSP_MODE_TUNNEL)|(1<<MSM_ADSP_OP_DM)),
483 (DEC1_FORMAT|(1<<MSM_ADSP_MODE_TUNNEL)|(1<<MSM_ADSP_OP_DM)),
484 (DEC2_FORMAT|(1<<MSM_ADSP_MODE_TUNNEL)|(1<<MSM_ADSP_OP_DM)),
485 (DEC3_FORMAT|(1<<MSM_ADSP_MODE_TUNNEL)|(1<<MSM_ADSP_OP_DM)),
486 (DEC4_FORMAT),
487
488 /* Concurrency 2 */
489 (DEC0_FORMAT|(1<<MSM_ADSP_MODE_TUNNEL)|(1<<MSM_ADSP_OP_DM)),
490 (DEC1_FORMAT|(1<<MSM_ADSP_MODE_TUNNEL)|(1<<MSM_ADSP_OP_DM)),
491 (DEC2_FORMAT|(1<<MSM_ADSP_MODE_TUNNEL)|(1<<MSM_ADSP_OP_DM)),
492 (DEC3_FORMAT|(1<<MSM_ADSP_MODE_TUNNEL)|(1<<MSM_ADSP_OP_DM)),
493 (DEC4_FORMAT),
494
495 /* Concurrency 3 */
496 (DEC0_FORMAT|(1<<MSM_ADSP_MODE_TUNNEL)|(1<<MSM_ADSP_OP_DM)),
497 (DEC1_FORMAT|(1<<MSM_ADSP_MODE_TUNNEL)|(1<<MSM_ADSP_OP_DM)),
498 (DEC2_FORMAT|(1<<MSM_ADSP_MODE_TUNNEL)|(1<<MSM_ADSP_OP_DM)),
499 (DEC3_FORMAT|(1<<MSM_ADSP_MODE_NONTUNNEL)|(1<<MSM_ADSP_OP_DM)),
500 (DEC4_FORMAT),
501
502 /* Concurrency 4 */
503 (DEC0_FORMAT|(1<<MSM_ADSP_MODE_TUNNEL)|(1<<MSM_ADSP_OP_DM)),
504 (DEC1_FORMAT|(1<<MSM_ADSP_MODE_TUNNEL)|(1<<MSM_ADSP_OP_DM)),
505 (DEC2_FORMAT|(1<<MSM_ADSP_MODE_NONTUNNEL)|(1<<MSM_ADSP_OP_DM)),
506 (DEC3_FORMAT|(1<<MSM_ADSP_MODE_NONTUNNEL)|(1<<MSM_ADSP_OP_DM)),
507 (DEC4_FORMAT),
508
509 /* Concurrency 5 */
510 (DEC0_FORMAT|(1<<MSM_ADSP_MODE_TUNNEL)|(1<<MSM_ADSP_OP_DM)),
511 (DEC1_FORMAT|(1<<MSM_ADSP_MODE_NONTUNNEL)|(1<<MSM_ADSP_OP_DM)),
512 (DEC2_FORMAT|(1<<MSM_ADSP_MODE_NONTUNNEL)|(1<<MSM_ADSP_OP_DM)),
513 (DEC3_FORMAT|(1<<MSM_ADSP_MODE_NONTUNNEL)|(1<<MSM_ADSP_OP_DM)),
514 (DEC4_FORMAT),
515
516 /* Concurrency 6 */
Chaithanya Krishna Bacharaju72ab89b2012-05-11 14:24:04 +0530517 (DEC0_FORMAT|(1<<MSM_ADSP_MODE_TUNNEL)|
518 (1<<MSM_ADSP_MODE_NONTUNNEL)|(1<<MSM_ADSP_OP_DM)),
519 0, 0, 0, 0,
Trilok Sonib9410792012-04-07 15:37:13 +0530520
521 /* Concurrency 7 */
522 (DEC0_FORMAT|(1<<MSM_ADSP_MODE_NONTUNNEL)|(1<<MSM_ADSP_OP_DM)),
523 (DEC1_FORMAT|(1<<MSM_ADSP_MODE_NONTUNNEL)|(1<<MSM_ADSP_OP_DM)),
524 (DEC2_FORMAT|(1<<MSM_ADSP_MODE_NONTUNNEL)|(1<<MSM_ADSP_OP_DM)),
525 (DEC3_FORMAT|(1<<MSM_ADSP_MODE_NONTUNNEL)|(1<<MSM_ADSP_OP_DM)),
526 (DEC4_FORMAT),
527};
528
529#define DEC_INFO(name, queueid, decid, nr_codec) { .module_name = name, \
530 .module_queueid = queueid, .module_decid = decid, \
531 .nr_codec_support = nr_codec}
532
533static struct msm_adspdec_info dec_info_list[] = {
534 DEC_INFO("AUDPLAY0TASK", 13, 0, 11), /* AudPlay0BitStreamCtrlQueue */
535 DEC_INFO("AUDPLAY1TASK", 14, 1, 11), /* AudPlay1BitStreamCtrlQueue */
536 DEC_INFO("AUDPLAY2TASK", 15, 2, 11), /* AudPlay2BitStreamCtrlQueue */
537 DEC_INFO("AUDPLAY3TASK", 16, 3, 11), /* AudPlay3BitStreamCtrlQueue */
538 DEC_INFO("AUDPLAY4TASK", 17, 4, 1), /* AudPlay4BitStreamCtrlQueue */
539};
540
541static struct msm_adspdec_database msm_device_adspdec_database = {
542 .num_dec = ARRAY_SIZE(dec_info_list),
543 .num_concurrency_support = (ARRAY_SIZE(dec_concurrency_table) / \
544 ARRAY_SIZE(dec_info_list)),
545 .dec_concurrency_table = dec_concurrency_table,
546 .dec_info_list = dec_info_list,
547};
548
549static struct platform_device msm_device_adspdec = {
550 .name = "msm_adspdec",
551 .id = -1,
552 .dev = {
553 .platform_data = &msm_device_adspdec_database
554 },
555};
556
557static struct android_pmem_platform_data android_pmem_audio_pdata = {
558 .name = "pmem_audio",
559 .allocator_type = PMEM_ALLOCATORTYPE_BITMAP,
560 .cached = 0,
561 .memory_type = MEMTYPE_EBI1,
562};
563
564static struct platform_device android_pmem_audio_device = {
565 .name = "android_pmem",
566 .id = 2,
567 .dev = { .platform_data = &android_pmem_audio_pdata },
568};
569
570static struct android_pmem_platform_data android_pmem_pdata = {
571 .name = "pmem",
572 .allocator_type = PMEM_ALLOCATORTYPE_BITMAP,
573 .cached = 1,
574 .memory_type = MEMTYPE_EBI1,
575};
576static struct platform_device android_pmem_device = {
577 .name = "android_pmem",
578 .id = 0,
579 .dev = { .platform_data = &android_pmem_pdata },
580};
581
Taniya Dasc98bfbc2011-08-23 09:58:55 +0530582static u32 msm_calculate_batt_capacity(u32 current_voltage);
583
584static struct msm_psy_batt_pdata msm_psy_batt_data = {
585 .voltage_min_design = 2800,
586 .voltage_max_design = 4300,
587 .avail_chg_sources = AC_CHG | USB_CHG ,
588 .batt_technology = POWER_SUPPLY_TECHNOLOGY_LION,
589 .calculate_capacity = &msm_calculate_batt_capacity,
590};
591
592static u32 msm_calculate_batt_capacity(u32 current_voltage)
593{
594 u32 low_voltage = msm_psy_batt_data.voltage_min_design;
595 u32 high_voltage = msm_psy_batt_data.voltage_max_design;
596
597 return (current_voltage - low_voltage) * 100
598 / (high_voltage - low_voltage);
599}
600
601static struct platform_device msm_batt_device = {
602 .name = "msm-battery",
603 .id = -1,
604 .dev.platform_data = &msm_psy_batt_data,
605};
606
Siddartha Mohanadossbc2103f2012-03-20 11:41:48 -0700607static char *msm_adc_surf_device_names[] = {
608 "XO_ADC",
609};
610
611static struct msm_adc_platform_data msm_adc_pdata = {
612 .dev_names = msm_adc_surf_device_names,
613 .num_adc = ARRAY_SIZE(msm_adc_surf_device_names),
614 .target_hw = MSM_8x25,
615};
616
617static struct platform_device msm_adc_device = {
618 .name = "msm_adc",
619 .id = -1,
620 .dev = {
621 .platform_data = &msm_adc_pdata,
622 },
623};
624
Taniya Das720c5c32012-05-18 14:08:14 +0530625static struct fmem_platform_data fmem_pdata;
626
627static struct platform_device fmem_device = {
628 .name = "fmem",
629 .id = 1,
630 .dev = { .platform_data = &fmem_pdata },
631};
632
Chintan Pandyaf4ad4002012-02-28 19:49:03 +0530633static struct platform_device *common_devices[] __initdata = {
634 &android_usb_device,
Trilok Sonib9410792012-04-07 15:37:13 +0530635 &android_pmem_device,
636 &android_pmem_adsp_device,
637 &android_pmem_audio_device,
Chintan Pandyaf4ad4002012-02-28 19:49:03 +0530638 &msm_batt_device,
Trilok Sonib9410792012-04-07 15:37:13 +0530639 &msm_device_adspdec,
640 &msm_device_snd,
Chintan Pandyaf4ad4002012-02-28 19:49:03 +0530641 &asoc_msm_pcm,
642 &asoc_msm_dai0,
643 &asoc_msm_dai1,
Siddartha Mohanadossbc2103f2012-03-20 11:41:48 -0700644 &msm_adc_device,
Taniya Das720c5c32012-05-18 14:08:14 +0530645 &fmem_device,
Chintan Pandyaf4ad4002012-02-28 19:49:03 +0530646};
647
648static struct platform_device *qrd7627a_devices[] __initdata = {
Taniya Dasc98bfbc2011-08-23 09:58:55 +0530649 &msm_device_dmov,
650 &msm_device_smd,
651 &msm_device_uart1,
652 &msm_device_uart_dm1,
653 &msm_gsbi0_qup_i2c_device,
654 &msm_gsbi1_qup_i2c_device,
655 &msm_device_otg,
656 &msm_device_gadget_peripheral,
Taniya Dasc98bfbc2011-08-23 09:58:55 +0530657 &msm_kgsl_3d0,
Taniya Dasc98bfbc2011-08-23 09:58:55 +0530658};
659
Chintan Pandyab1bad0e2012-02-06 19:04:51 +0530660static struct platform_device *qrd3_devices[] __initdata = {
661 &msm_device_nand,
662};
663
Chintan Pandyaf4ad4002012-02-28 19:49:03 +0530664static struct platform_device *msm8625_evb_devices[] __initdata = {
665 &msm8625_device_dmov,
666 &msm8625_device_smd,
667 &msm8625_gsbi0_qup_i2c_device,
668 &msm8625_gsbi1_qup_i2c_device,
669 &msm8625_device_uart1,
Ram Mohan Korukonda5ee9fb82012-03-09 12:10:01 +0530670 &msm8625_device_uart_dm1,
Chintan Pandyaf4ad4002012-02-28 19:49:03 +0530671 &msm8625_device_otg,
672 &msm8625_device_gadget_peripheral,
Aparna Mallavarapud95d8fc2012-03-08 12:07:37 +0530673 &msm8625_kgsl_3d0,
Chintan Pandyaf4ad4002012-02-28 19:49:03 +0530674};
675
Trilok Sonib9410792012-04-07 15:37:13 +0530676static unsigned pmem_kernel_ebi1_size = PMEM_KERNEL_EBI1_SIZE;
677static int __init pmem_kernel_ebi1_size_setup(char *p)
678{
679 pmem_kernel_ebi1_size = memparse(p, NULL);
680 return 0;
681}
682early_param("pmem_kernel_ebi1_size", pmem_kernel_ebi1_size_setup);
683
684static unsigned pmem_audio_size = MSM_PMEM_AUDIO_SIZE;
685static int __init pmem_audio_size_setup(char *p)
686{
687 pmem_audio_size = memparse(p, NULL);
688 return 0;
689}
690early_param("pmem_audio_size", pmem_audio_size_setup);
691
692static struct memtype_reserve msm7627a_reserve_table[] __initdata = {
693 [MEMTYPE_SMI] = {
694 },
695 [MEMTYPE_EBI0] = {
696 .flags = MEMTYPE_FLAGS_1M_ALIGN,
697 },
698 [MEMTYPE_EBI1] = {
699 .flags = MEMTYPE_FLAGS_1M_ALIGN,
700 },
701};
702
Taniya Das720c5c32012-05-18 14:08:14 +0530703#ifdef CONFIG_ANDROID_PMEM
704static struct android_pmem_platform_data *pmem_pdata_array[] __initdata = {
705 &android_pmem_adsp_pdata,
706 &android_pmem_audio_pdata,
707 &android_pmem_pdata,
708};
709#endif
710
Trilok Sonib9410792012-04-07 15:37:13 +0530711static void __init size_pmem_devices(void)
712{
713#ifdef CONFIG_ANDROID_PMEM
Taniya Das720c5c32012-05-18 14:08:14 +0530714 unsigned int i;
715 unsigned int reusable_count = 0;
716
Trilok Sonib9410792012-04-07 15:37:13 +0530717 android_pmem_adsp_pdata.size = pmem_adsp_size;
718 android_pmem_pdata.size = pmem_mdp_size;
719 android_pmem_audio_pdata.size = pmem_audio_size;
Taniya Das720c5c32012-05-18 14:08:14 +0530720
721 fmem_pdata.size = 0;
722 fmem_pdata.align = PAGE_SIZE;
723
724 /* Find pmem devices that should use FMEM (reusable) memory.
725 */
726 for (i = 0; i < ARRAY_SIZE(pmem_pdata_array); ++i) {
727 struct android_pmem_platform_data *pdata = pmem_pdata_array[i];
728
729 if (!reusable_count && pdata->reusable)
730 fmem_pdata.size += pdata->size;
731
732 reusable_count += (pdata->reusable) ? 1 : 0;
733
734 if (pdata->reusable && reusable_count > 1) {
735 pr_err("%s: Too many PMEM devices specified as reusable. PMEM device %s was not configured as reusable.\n",
736 __func__, pdata->name);
737 pdata->reusable = 0;
738 }
739 }
740
Trilok Sonib9410792012-04-07 15:37:13 +0530741#endif
742}
743
744static void __init reserve_memory_for(struct android_pmem_platform_data *p)
745{
746 msm7627a_reserve_table[p->memory_type].size += p->size;
747}
748
749static void __init reserve_pmem_memory(void)
750{
751#ifdef CONFIG_ANDROID_PMEM
Taniya Das720c5c32012-05-18 14:08:14 +0530752 unsigned int i;
753 for (i = 0; i < ARRAY_SIZE(pmem_pdata_array); ++i)
754 reserve_memory_for(pmem_pdata_array[i]);
755
Trilok Sonib9410792012-04-07 15:37:13 +0530756 msm7627a_reserve_table[MEMTYPE_EBI1].size += pmem_kernel_ebi1_size;
757#endif
758}
759
760static void __init msm7627a_calculate_reserve_sizes(void)
761{
762 size_pmem_devices();
763 reserve_pmem_memory();
764}
765
766static int msm7627a_paddr_to_memtype(unsigned int paddr)
767{
768 return MEMTYPE_EBI1;
769}
770
771static struct reserve_info msm7627a_reserve_info __initdata = {
772 .memtype_reserve_table = msm7627a_reserve_table,
773 .calculate_reserve_sizes = msm7627a_calculate_reserve_sizes,
774 .paddr_to_memtype = msm7627a_paddr_to_memtype,
775};
776
777static void __init msm7627a_reserve(void)
778{
779 reserve_info = &msm7627a_reserve_info;
780 msm_reserve();
781 memblock_remove(MSM8625_WARM_BOOT_PHYS, SZ_32);
782}
783
784static void __init msm8625_reserve(void)
785{
786 memblock_remove(MSM8625_SECONDARY_PHYS, SZ_8);
787 msm7627a_reserve();
788}
789
790static void msmqrd_adsp_add_pdev(void)
791{
792 int rc = 0;
793 struct rpc_board_dev *rpc_adsp_pdev;
794
795 rpc_adsp_pdev = kzalloc(sizeof(struct rpc_board_dev), GFP_KERNEL);
796 if (rpc_adsp_pdev == NULL) {
797 pr_err("%s: Memory Allocation failure\n", __func__);
798 return;
799 }
800 rpc_adsp_pdev->prog = ADSP_RPC_PROG;
801
802 if (cpu_is_msm8625())
803 rpc_adsp_pdev->pdev = msm8625_device_adsp;
804 else
805 rpc_adsp_pdev->pdev = msm_adsp_device;
806 rc = msm_rpc_add_board_dev(rpc_adsp_pdev, 1);
807 if (rc < 0) {
808 pr_err("%s: return val: %d\n", __func__, rc);
809 kfree(rpc_adsp_pdev);
810 }
811}
812
Chintan Pandyaf4ad4002012-02-28 19:49:03 +0530813static void __init msm7627a_device_i2c_init(void)
Taniya Dasc98bfbc2011-08-23 09:58:55 +0530814{
815 msm_gsbi0_qup_i2c_device.dev.platform_data = &msm_gsbi0_qup_i2c_pdata;
816 msm_gsbi1_qup_i2c_device.dev.platform_data = &msm_gsbi1_qup_i2c_pdata;
817}
818
Chintan Pandyaf4ad4002012-02-28 19:49:03 +0530819static void __init msm8625_device_i2c_init(void)
820{
821 msm8625_gsbi0_qup_i2c_device.dev.platform_data
822 = &msm_gsbi0_qup_i2c_pdata;
823 msm8625_gsbi1_qup_i2c_device.dev.platform_data
824 = &msm_gsbi1_qup_i2c_pdata;
825}
826
Pankaj Kumar3cec0582011-11-18 11:13:29 +0530827static struct platform_device msm_proccomm_regulator_dev = {
828 .name = PROCCOMM_REGULATOR_DEV_NAME,
829 .id = -1,
830 .dev = {
831 .platform_data = &msm7x27a_proccomm_regulator_data
832 }
833};
834
835static void __init msm7627a_init_regulators(void)
836{
837 int rc = platform_device_register(&msm_proccomm_regulator_dev);
838 if (rc)
839 pr_err("%s: could not register regulator device: %d\n",
840 __func__, rc);
841}
842
Santosh Sajjan374d6592012-01-19 23:16:46 +0530843static int __init msm_qrd_init_ar6000pm(void)
844{
845 msm_wlan_ar6000_pm_device.dev.platform_data = &ar600x_wlan_power;
846 return platform_device_register(&msm_wlan_ar6000_pm_device);
847}
848
Taniya Dase380a2d2012-03-09 13:02:41 +0530849static void __init msm_add_footswitch_devices(void)
850{
851 platform_add_devices(msm_footswitch_devices,
852 msm_num_footswitch_devices);
853}
854
Stephen Boyd668d7652012-04-25 11:31:01 -0700855static void __init add_platform_devices(void)
Chintan Pandyab1bad0e2012-02-06 19:04:51 +0530856{
Aparna Mallavarapu5a326242012-05-09 19:49:02 +0530857 if (machine_is_msm8625_evb() || machine_is_msm8625_qrd7()
858 || machine_is_msm8625_evt()) {
Chintan Pandyaf4ad4002012-02-28 19:49:03 +0530859 platform_add_devices(msm8625_evb_devices,
860 ARRAY_SIZE(msm8625_evb_devices));
Aparna Mallavarapubeafcbc2012-03-13 16:57:39 +0530861 platform_add_devices(qrd3_devices,
Taniya Dasbd096542012-03-15 17:43:45 +0530862 ARRAY_SIZE(qrd3_devices));
Aparna Mallavarapubeafcbc2012-03-13 16:57:39 +0530863 } else {
Chintan Pandyaf4ad4002012-02-28 19:49:03 +0530864 platform_add_devices(qrd7627a_devices,
865 ARRAY_SIZE(qrd7627a_devices));
Chintan Pandyaf4ad4002012-02-28 19:49:03 +0530866 }
Taniya Dasbd096542012-03-15 17:43:45 +0530867
Aparna Mallavarapu0b69ca22012-03-26 15:58:35 +0530868 if (machine_is_msm7627a_qrd3() || machine_is_msm7627a_evb())
Taniya Dasbd096542012-03-15 17:43:45 +0530869 platform_add_devices(qrd3_devices,
Aparna Mallavarapu0b69ca22012-03-26 15:58:35 +0530870 ARRAY_SIZE(qrd3_devices));
Taniya Dasbd096542012-03-15 17:43:45 +0530871
Chintan Pandyaf4ad4002012-02-28 19:49:03 +0530872 platform_add_devices(common_devices,
873 ARRAY_SIZE(common_devices));
Chintan Pandyab1bad0e2012-02-06 19:04:51 +0530874}
875
Taniya Dasc98bfbc2011-08-23 09:58:55 +0530876#define UART1DM_RX_GPIO 45
Chintan Pandyaf4ad4002012-02-28 19:49:03 +0530877static void __init qrd7627a_uart1dm_config(void)
878{
879 msm_uart_dm1_pdata.wakeup_irq = gpio_to_irq(UART1DM_RX_GPIO);
880 if (cpu_is_msm8625())
881 msm8625_device_uart_dm1.dev.platform_data =
882 &msm_uart_dm1_pdata;
883 else
884 msm_device_uart_dm1.dev.platform_data = &msm_uart_dm1_pdata;
885}
886
887static void __init qrd7627a_otg_gadget(void)
888{
Chintan Pandyaf4ad4002012-02-28 19:49:03 +0530889 if (cpu_is_msm8625()) {
Murali Nalajala6ff8fb12012-05-02 18:50:50 +0530890 msm_otg_pdata.swfi_latency = msm8625_pm_data
891 [MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT].latency;
Chintan Pandyaf4ad4002012-02-28 19:49:03 +0530892 msm8625_device_otg.dev.platform_data = &msm_otg_pdata;
893 msm8625_device_gadget_peripheral.dev.platform_data =
894 &msm_gadget_pdata;
895
896 } else {
Murali Nalajala6ff8fb12012-05-02 18:50:50 +0530897 msm_otg_pdata.swfi_latency = msm7627a_pm_data
898 [MSM_PM_SLEEP_MODE_RAMP_DOWN_AND_WAIT_FOR_INTERRUPT].latency;
Chintan Pandyaf4ad4002012-02-28 19:49:03 +0530899 msm_device_otg.dev.platform_data = &msm_otg_pdata;
900 msm_device_gadget_peripheral.dev.platform_data =
901 &msm_gadget_pdata;
902 }
903}
904
Taniya Dasbd096542012-03-15 17:43:45 +0530905static void __init msm_pm_init(void)
906{
Taniya Dasbd096542012-03-15 17:43:45 +0530907
Aparna Mallavarapu6d969eb2012-04-03 15:10:25 +0530908 if (!cpu_is_msm8625()) {
Taniya Dasbd096542012-03-15 17:43:45 +0530909 msm_pm_set_platform_data(msm7627a_pm_data,
910 ARRAY_SIZE(msm7627a_pm_data));
911 BUG_ON(msm_pm_boot_init(&msm_pm_boot_pdata));
912 } else {
913 msm_pm_set_platform_data(msm8625_pm_data,
914 ARRAY_SIZE(msm8625_pm_data));
915 BUG_ON(msm_pm_boot_init(&msm_pm_8625_boot_pdata));
916 msm8x25_spm_device_init();
917 }
918}
919
Taniya Dasc868a2e2012-01-03 10:18:47 +0530920static void __init msm_qrd_init(void)
Taniya Dasc98bfbc2011-08-23 09:58:55 +0530921{
922 msm7x2x_misc_init();
Pankaj Kumar3cec0582011-11-18 11:13:29 +0530923 msm7627a_init_regulators();
Trilok Sonib9410792012-04-07 15:37:13 +0530924 msmqrd_adsp_add_pdev();
Taniya Dasc98bfbc2011-08-23 09:58:55 +0530925
Chintan Pandyaf4ad4002012-02-28 19:49:03 +0530926 if (cpu_is_msm8625())
927 msm8625_device_i2c_init();
928 else
929 msm7627a_device_i2c_init();
930
931 /* uart1dm*/
932 qrd7627a_uart1dm_config();
933 /*OTG gadget*/
934 qrd7627a_otg_gadget();
Taniya Dasc868a2e2012-01-03 10:18:47 +0530935
Taniya Dase380a2d2012-03-09 13:02:41 +0530936 msm_add_footswitch_devices();
Chintan Pandyab1bad0e2012-02-06 19:04:51 +0530937 add_platform_devices();
Taniya Dasc868a2e2012-01-03 10:18:47 +0530938
Santosh Sajjan374d6592012-01-19 23:16:46 +0530939 /* Ensure ar6000pm device is registered before MMC/SDC */
940 msm_qrd_init_ar6000pm();
Chintan Pandyacf467fc2011-12-01 17:11:11 +0530941 msm7627a_init_mmc();
942
Taniya Dasc98bfbc2011-08-23 09:58:55 +0530943#ifdef CONFIG_USB_EHCI_MSM_72K
944 msm7627a_init_host();
945#endif
Taniya Dasbd096542012-03-15 17:43:45 +0530946 msm_pm_init();
Murali Nalajalaa1827842011-11-13 14:12:39 +0530947
Murali Nalajala2a0bbda2012-03-28 12:12:54 +0530948 msm_pm_register_irqs();
Taniya Das0a5303a2011-08-23 18:47:48 +0530949 msm_fb_add_devices();
Taniya Dasc98bfbc2011-08-23 09:58:55 +0530950
951#if defined(CONFIG_BT) && defined(CONFIG_MARIMBA_CORE)
Chintan Pandya13490c02011-12-20 13:03:36 +0530952 msm7627a_bt_power_init();
Taniya Dasc98bfbc2011-08-23 09:58:55 +0530953#endif
Taniya Dasda408822011-09-06 12:54:06 +0530954
Chintan Pandya40762702011-12-06 13:47:06 +0530955 msm7627a_camera_init();
Chintan Pandya0d453192012-03-09 13:20:33 +0530956 qrd7627a_add_io_devices();
Aparna Mallavarapud95d8fc2012-03-08 12:07:37 +0530957 msm7x25a_kgsl_3d0_init();
Sudhakara Rao Tentu38ad6e12012-03-30 15:25:18 -0700958 msm8x25_kgsl_3d0_init();
Taniya Dasc98bfbc2011-08-23 09:58:55 +0530959}
960
961static void __init qrd7627a_init_early(void)
962{
963 msm_msm7627a_allocate_memory_regions();
964}
965
966MACHINE_START(MSM7627A_QRD1, "QRD MSM7627a QRD1")
967 .boot_params = PHYS_OFFSET + 0x100,
968 .map_io = msm_common_io_init,
Trilok Sonib9410792012-04-07 15:37:13 +0530969 .reserve = msm7627a_reserve,
Taniya Dasc98bfbc2011-08-23 09:58:55 +0530970 .init_irq = msm_init_irq,
Taniya Dasc868a2e2012-01-03 10:18:47 +0530971 .init_machine = msm_qrd_init,
972 .timer = &msm_timer,
973 .init_early = qrd7627a_init_early,
974 .handle_irq = vic_handle_irq,
975MACHINE_END
Chintan Pandyab1bad0e2012-02-06 19:04:51 +0530976MACHINE_START(MSM7627A_QRD3, "QRD MSM7627a QRD3")
977 .boot_params = PHYS_OFFSET + 0x100,
978 .map_io = msm_common_io_init,
Trilok Sonib9410792012-04-07 15:37:13 +0530979 .reserve = msm7627a_reserve,
Chintan Pandyab1bad0e2012-02-06 19:04:51 +0530980 .init_irq = msm_init_irq,
981 .init_machine = msm_qrd_init,
982 .timer = &msm_timer,
983 .init_early = qrd7627a_init_early,
984 .handle_irq = vic_handle_irq,
985MACHINE_END
Taniya Dasc868a2e2012-01-03 10:18:47 +0530986MACHINE_START(MSM7627A_EVB, "QRD MSM7627a EVB")
987 .boot_params = PHYS_OFFSET + 0x100,
988 .map_io = msm_common_io_init,
Trilok Sonib9410792012-04-07 15:37:13 +0530989 .reserve = msm7627a_reserve,
Taniya Dasc868a2e2012-01-03 10:18:47 +0530990 .init_irq = msm_init_irq,
991 .init_machine = msm_qrd_init,
Taniya Dasc98bfbc2011-08-23 09:58:55 +0530992 .timer = &msm_timer,
993 .init_early = qrd7627a_init_early,
Pankaj Kumarbf8a2a32011-10-21 11:47:21 +0530994 .handle_irq = vic_handle_irq,
Taniya Dasc98bfbc2011-08-23 09:58:55 +0530995MACHINE_END
Chintan Pandyaf4ad4002012-02-28 19:49:03 +0530996MACHINE_START(MSM8625_EVB, "QRD MSM8625 EVB")
997 .boot_params = PHYS_OFFSET + 0x100,
998 .map_io = msm8625_map_io,
Trilok Sonib9410792012-04-07 15:37:13 +0530999 .reserve = msm8625_reserve,
Chintan Pandyaf4ad4002012-02-28 19:49:03 +05301000 .init_irq = msm8625_init_irq,
1001 .init_machine = msm_qrd_init,
1002 .timer = &msm_timer,
1003 .init_early = qrd7627a_init_early,
1004 .handle_irq = gic_handle_irq,
1005MACHINE_END
Taniya Dasbd096542012-03-15 17:43:45 +05301006MACHINE_START(MSM8625_QRD7, "QRD MSM8625 QRD7")
1007 .boot_params = PHYS_OFFSET + 0x100,
1008 .map_io = msm8625_map_io,
Trilok Sonib9410792012-04-07 15:37:13 +05301009 .reserve = msm8625_reserve,
Taniya Dasbd096542012-03-15 17:43:45 +05301010 .init_irq = msm8625_init_irq,
1011 .init_machine = msm_qrd_init,
1012 .timer = &msm_timer,
1013 .init_early = qrd7627a_init_early,
1014 .handle_irq = gic_handle_irq,
1015MACHINE_END
Aparna Mallavarapu5a326242012-05-09 19:49:02 +05301016MACHINE_START(MSM8625_EVT, "QRD MSM8625 EVT")
1017 .boot_params = PHYS_OFFSET + 0x100,
1018 .map_io = msm8625_map_io,
1019 .reserve = msm8625_reserve,
1020 .init_irq = msm8625_init_irq,
1021 .init_machine = msm_qrd_init,
1022 .timer = &msm_timer,
1023 .init_early = qrd7627a_init_early,
1024 .handle_irq = gic_handle_irq,
1025MACHINE_END