blob: b7b2bf5113eb8bf103b0d52aab19435e5fe26077 [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 = {
Krishna Vanka9a265e12012-06-04 23:24:26 +0530585 .voltage_min_design = 3200,
586 .voltage_max_design = 4200,
587 .voltage_fail_safe = 3340,
Taniya Dasc98bfbc2011-08-23 09:58:55 +0530588 .avail_chg_sources = AC_CHG | USB_CHG ,
589 .batt_technology = POWER_SUPPLY_TECHNOLOGY_LION,
590 .calculate_capacity = &msm_calculate_batt_capacity,
591};
592
593static u32 msm_calculate_batt_capacity(u32 current_voltage)
594{
595 u32 low_voltage = msm_psy_batt_data.voltage_min_design;
596 u32 high_voltage = msm_psy_batt_data.voltage_max_design;
597
598 return (current_voltage - low_voltage) * 100
599 / (high_voltage - low_voltage);
600}
601
602static struct platform_device msm_batt_device = {
603 .name = "msm-battery",
604 .id = -1,
605 .dev.platform_data = &msm_psy_batt_data,
606};
607
Siddartha Mohanadossbc2103f2012-03-20 11:41:48 -0700608static char *msm_adc_surf_device_names[] = {
609 "XO_ADC",
610};
611
612static struct msm_adc_platform_data msm_adc_pdata = {
613 .dev_names = msm_adc_surf_device_names,
614 .num_adc = ARRAY_SIZE(msm_adc_surf_device_names),
615 .target_hw = MSM_8x25,
616};
617
618static struct platform_device msm_adc_device = {
619 .name = "msm_adc",
620 .id = -1,
621 .dev = {
622 .platform_data = &msm_adc_pdata,
623 },
624};
625
Taniya Das720c5c32012-05-18 14:08:14 +0530626static struct fmem_platform_data fmem_pdata;
627
628static struct platform_device fmem_device = {
629 .name = "fmem",
630 .id = 1,
631 .dev = { .platform_data = &fmem_pdata },
632};
633
Chintan Pandyaf4ad4002012-02-28 19:49:03 +0530634static struct platform_device *common_devices[] __initdata = {
635 &android_usb_device,
Trilok Sonib9410792012-04-07 15:37:13 +0530636 &android_pmem_device,
637 &android_pmem_adsp_device,
638 &android_pmem_audio_device,
Chintan Pandyaf4ad4002012-02-28 19:49:03 +0530639 &msm_batt_device,
Trilok Sonib9410792012-04-07 15:37:13 +0530640 &msm_device_adspdec,
641 &msm_device_snd,
Chintan Pandyaf4ad4002012-02-28 19:49:03 +0530642 &asoc_msm_pcm,
643 &asoc_msm_dai0,
644 &asoc_msm_dai1,
Siddartha Mohanadossbc2103f2012-03-20 11:41:48 -0700645 &msm_adc_device,
Taniya Das720c5c32012-05-18 14:08:14 +0530646 &fmem_device,
Chintan Pandyaf4ad4002012-02-28 19:49:03 +0530647};
648
649static struct platform_device *qrd7627a_devices[] __initdata = {
Taniya Dasc98bfbc2011-08-23 09:58:55 +0530650 &msm_device_dmov,
651 &msm_device_smd,
652 &msm_device_uart1,
653 &msm_device_uart_dm1,
654 &msm_gsbi0_qup_i2c_device,
655 &msm_gsbi1_qup_i2c_device,
656 &msm_device_otg,
657 &msm_device_gadget_peripheral,
Taniya Dasc98bfbc2011-08-23 09:58:55 +0530658 &msm_kgsl_3d0,
Taniya Dasc98bfbc2011-08-23 09:58:55 +0530659};
660
Chintan Pandyab1bad0e2012-02-06 19:04:51 +0530661static struct platform_device *qrd3_devices[] __initdata = {
662 &msm_device_nand,
663};
664
Chintan Pandyaf4ad4002012-02-28 19:49:03 +0530665static struct platform_device *msm8625_evb_devices[] __initdata = {
666 &msm8625_device_dmov,
667 &msm8625_device_smd,
668 &msm8625_gsbi0_qup_i2c_device,
669 &msm8625_gsbi1_qup_i2c_device,
670 &msm8625_device_uart1,
Ram Mohan Korukonda5ee9fb82012-03-09 12:10:01 +0530671 &msm8625_device_uart_dm1,
Chintan Pandyaf4ad4002012-02-28 19:49:03 +0530672 &msm8625_device_otg,
673 &msm8625_device_gadget_peripheral,
Aparna Mallavarapud95d8fc2012-03-08 12:07:37 +0530674 &msm8625_kgsl_3d0,
Chintan Pandyaf4ad4002012-02-28 19:49:03 +0530675};
676
Trilok Sonib9410792012-04-07 15:37:13 +0530677static unsigned pmem_kernel_ebi1_size = PMEM_KERNEL_EBI1_SIZE;
678static int __init pmem_kernel_ebi1_size_setup(char *p)
679{
680 pmem_kernel_ebi1_size = memparse(p, NULL);
681 return 0;
682}
683early_param("pmem_kernel_ebi1_size", pmem_kernel_ebi1_size_setup);
684
685static unsigned pmem_audio_size = MSM_PMEM_AUDIO_SIZE;
686static int __init pmem_audio_size_setup(char *p)
687{
688 pmem_audio_size = memparse(p, NULL);
689 return 0;
690}
691early_param("pmem_audio_size", pmem_audio_size_setup);
692
693static struct memtype_reserve msm7627a_reserve_table[] __initdata = {
694 [MEMTYPE_SMI] = {
695 },
696 [MEMTYPE_EBI0] = {
697 .flags = MEMTYPE_FLAGS_1M_ALIGN,
698 },
699 [MEMTYPE_EBI1] = {
700 .flags = MEMTYPE_FLAGS_1M_ALIGN,
701 },
702};
703
Taniya Das720c5c32012-05-18 14:08:14 +0530704#ifdef CONFIG_ANDROID_PMEM
705static struct android_pmem_platform_data *pmem_pdata_array[] __initdata = {
706 &android_pmem_adsp_pdata,
707 &android_pmem_audio_pdata,
708 &android_pmem_pdata,
709};
710#endif
711
Trilok Sonib9410792012-04-07 15:37:13 +0530712static void __init size_pmem_devices(void)
713{
714#ifdef CONFIG_ANDROID_PMEM
Taniya Das720c5c32012-05-18 14:08:14 +0530715 unsigned int i;
716 unsigned int reusable_count = 0;
717
Trilok Sonib9410792012-04-07 15:37:13 +0530718 android_pmem_adsp_pdata.size = pmem_adsp_size;
719 android_pmem_pdata.size = pmem_mdp_size;
720 android_pmem_audio_pdata.size = pmem_audio_size;
Taniya Das720c5c32012-05-18 14:08:14 +0530721
722 fmem_pdata.size = 0;
723 fmem_pdata.align = PAGE_SIZE;
724
725 /* Find pmem devices that should use FMEM (reusable) memory.
726 */
727 for (i = 0; i < ARRAY_SIZE(pmem_pdata_array); ++i) {
728 struct android_pmem_platform_data *pdata = pmem_pdata_array[i];
729
730 if (!reusable_count && pdata->reusable)
731 fmem_pdata.size += pdata->size;
732
733 reusable_count += (pdata->reusable) ? 1 : 0;
734
735 if (pdata->reusable && reusable_count > 1) {
736 pr_err("%s: Too many PMEM devices specified as reusable. PMEM device %s was not configured as reusable.\n",
737 __func__, pdata->name);
738 pdata->reusable = 0;
739 }
740 }
741
Trilok Sonib9410792012-04-07 15:37:13 +0530742#endif
743}
744
745static void __init reserve_memory_for(struct android_pmem_platform_data *p)
746{
747 msm7627a_reserve_table[p->memory_type].size += p->size;
748}
749
750static void __init reserve_pmem_memory(void)
751{
752#ifdef CONFIG_ANDROID_PMEM
Taniya Das720c5c32012-05-18 14:08:14 +0530753 unsigned int i;
754 for (i = 0; i < ARRAY_SIZE(pmem_pdata_array); ++i)
755 reserve_memory_for(pmem_pdata_array[i]);
756
Trilok Sonib9410792012-04-07 15:37:13 +0530757 msm7627a_reserve_table[MEMTYPE_EBI1].size += pmem_kernel_ebi1_size;
758#endif
759}
760
761static void __init msm7627a_calculate_reserve_sizes(void)
762{
763 size_pmem_devices();
764 reserve_pmem_memory();
765}
766
767static int msm7627a_paddr_to_memtype(unsigned int paddr)
768{
769 return MEMTYPE_EBI1;
770}
771
772static struct reserve_info msm7627a_reserve_info __initdata = {
773 .memtype_reserve_table = msm7627a_reserve_table,
774 .calculate_reserve_sizes = msm7627a_calculate_reserve_sizes,
775 .paddr_to_memtype = msm7627a_paddr_to_memtype,
776};
777
778static void __init msm7627a_reserve(void)
779{
780 reserve_info = &msm7627a_reserve_info;
781 msm_reserve();
782 memblock_remove(MSM8625_WARM_BOOT_PHYS, SZ_32);
783}
784
785static void __init msm8625_reserve(void)
786{
787 memblock_remove(MSM8625_SECONDARY_PHYS, SZ_8);
788 msm7627a_reserve();
789}
790
791static void msmqrd_adsp_add_pdev(void)
792{
793 int rc = 0;
794 struct rpc_board_dev *rpc_adsp_pdev;
795
796 rpc_adsp_pdev = kzalloc(sizeof(struct rpc_board_dev), GFP_KERNEL);
797 if (rpc_adsp_pdev == NULL) {
798 pr_err("%s: Memory Allocation failure\n", __func__);
799 return;
800 }
801 rpc_adsp_pdev->prog = ADSP_RPC_PROG;
802
803 if (cpu_is_msm8625())
804 rpc_adsp_pdev->pdev = msm8625_device_adsp;
805 else
806 rpc_adsp_pdev->pdev = msm_adsp_device;
807 rc = msm_rpc_add_board_dev(rpc_adsp_pdev, 1);
808 if (rc < 0) {
809 pr_err("%s: return val: %d\n", __func__, rc);
810 kfree(rpc_adsp_pdev);
811 }
812}
813
Chintan Pandyaf4ad4002012-02-28 19:49:03 +0530814static void __init msm7627a_device_i2c_init(void)
Taniya Dasc98bfbc2011-08-23 09:58:55 +0530815{
816 msm_gsbi0_qup_i2c_device.dev.platform_data = &msm_gsbi0_qup_i2c_pdata;
817 msm_gsbi1_qup_i2c_device.dev.platform_data = &msm_gsbi1_qup_i2c_pdata;
818}
819
Chintan Pandyaf4ad4002012-02-28 19:49:03 +0530820static void __init msm8625_device_i2c_init(void)
821{
822 msm8625_gsbi0_qup_i2c_device.dev.platform_data
823 = &msm_gsbi0_qup_i2c_pdata;
824 msm8625_gsbi1_qup_i2c_device.dev.platform_data
825 = &msm_gsbi1_qup_i2c_pdata;
826}
827
Pankaj Kumar3cec0582011-11-18 11:13:29 +0530828static struct platform_device msm_proccomm_regulator_dev = {
829 .name = PROCCOMM_REGULATOR_DEV_NAME,
830 .id = -1,
831 .dev = {
832 .platform_data = &msm7x27a_proccomm_regulator_data
833 }
834};
835
836static void __init msm7627a_init_regulators(void)
837{
838 int rc = platform_device_register(&msm_proccomm_regulator_dev);
839 if (rc)
840 pr_err("%s: could not register regulator device: %d\n",
841 __func__, rc);
842}
843
Santosh Sajjan374d6592012-01-19 23:16:46 +0530844static int __init msm_qrd_init_ar6000pm(void)
845{
846 msm_wlan_ar6000_pm_device.dev.platform_data = &ar600x_wlan_power;
847 return platform_device_register(&msm_wlan_ar6000_pm_device);
848}
849
Taniya Dase380a2d2012-03-09 13:02:41 +0530850static void __init msm_add_footswitch_devices(void)
851{
852 platform_add_devices(msm_footswitch_devices,
853 msm_num_footswitch_devices);
854}
855
Stephen Boyd668d7652012-04-25 11:31:01 -0700856static void __init add_platform_devices(void)
Chintan Pandyab1bad0e2012-02-06 19:04:51 +0530857{
Aparna Mallavarapu5a326242012-05-09 19:49:02 +0530858 if (machine_is_msm8625_evb() || machine_is_msm8625_qrd7()
859 || machine_is_msm8625_evt()) {
Chintan Pandyaf4ad4002012-02-28 19:49:03 +0530860 platform_add_devices(msm8625_evb_devices,
861 ARRAY_SIZE(msm8625_evb_devices));
Aparna Mallavarapubeafcbc2012-03-13 16:57:39 +0530862 platform_add_devices(qrd3_devices,
Taniya Dasbd096542012-03-15 17:43:45 +0530863 ARRAY_SIZE(qrd3_devices));
Aparna Mallavarapubeafcbc2012-03-13 16:57:39 +0530864 } else {
Chintan Pandyaf4ad4002012-02-28 19:49:03 +0530865 platform_add_devices(qrd7627a_devices,
866 ARRAY_SIZE(qrd7627a_devices));
Chintan Pandyaf4ad4002012-02-28 19:49:03 +0530867 }
Taniya Dasbd096542012-03-15 17:43:45 +0530868
Aparna Mallavarapu0b69ca22012-03-26 15:58:35 +0530869 if (machine_is_msm7627a_qrd3() || machine_is_msm7627a_evb())
Taniya Dasbd096542012-03-15 17:43:45 +0530870 platform_add_devices(qrd3_devices,
Aparna Mallavarapu0b69ca22012-03-26 15:58:35 +0530871 ARRAY_SIZE(qrd3_devices));
Taniya Dasbd096542012-03-15 17:43:45 +0530872
Chintan Pandyaf4ad4002012-02-28 19:49:03 +0530873 platform_add_devices(common_devices,
874 ARRAY_SIZE(common_devices));
Chintan Pandyab1bad0e2012-02-06 19:04:51 +0530875}
876
Taniya Dasc98bfbc2011-08-23 09:58:55 +0530877#define UART1DM_RX_GPIO 45
Chintan Pandyaf4ad4002012-02-28 19:49:03 +0530878static void __init qrd7627a_uart1dm_config(void)
879{
880 msm_uart_dm1_pdata.wakeup_irq = gpio_to_irq(UART1DM_RX_GPIO);
881 if (cpu_is_msm8625())
882 msm8625_device_uart_dm1.dev.platform_data =
883 &msm_uart_dm1_pdata;
884 else
885 msm_device_uart_dm1.dev.platform_data = &msm_uart_dm1_pdata;
886}
887
888static void __init qrd7627a_otg_gadget(void)
889{
Chintan Pandyaf4ad4002012-02-28 19:49:03 +0530890 if (cpu_is_msm8625()) {
Murali Nalajala6ff8fb12012-05-02 18:50:50 +0530891 msm_otg_pdata.swfi_latency = msm8625_pm_data
892 [MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT].latency;
Chintan Pandyaf4ad4002012-02-28 19:49:03 +0530893 msm8625_device_otg.dev.platform_data = &msm_otg_pdata;
894 msm8625_device_gadget_peripheral.dev.platform_data =
895 &msm_gadget_pdata;
896
897 } else {
Murali Nalajala6ff8fb12012-05-02 18:50:50 +0530898 msm_otg_pdata.swfi_latency = msm7627a_pm_data
899 [MSM_PM_SLEEP_MODE_RAMP_DOWN_AND_WAIT_FOR_INTERRUPT].latency;
Chintan Pandyaf4ad4002012-02-28 19:49:03 +0530900 msm_device_otg.dev.platform_data = &msm_otg_pdata;
901 msm_device_gadget_peripheral.dev.platform_data =
902 &msm_gadget_pdata;
903 }
904}
905
Taniya Dasbd096542012-03-15 17:43:45 +0530906static void __init msm_pm_init(void)
907{
Taniya Dasbd096542012-03-15 17:43:45 +0530908
Aparna Mallavarapu6d969eb2012-04-03 15:10:25 +0530909 if (!cpu_is_msm8625()) {
Taniya Dasbd096542012-03-15 17:43:45 +0530910 msm_pm_set_platform_data(msm7627a_pm_data,
911 ARRAY_SIZE(msm7627a_pm_data));
912 BUG_ON(msm_pm_boot_init(&msm_pm_boot_pdata));
913 } else {
914 msm_pm_set_platform_data(msm8625_pm_data,
915 ARRAY_SIZE(msm8625_pm_data));
916 BUG_ON(msm_pm_boot_init(&msm_pm_8625_boot_pdata));
917 msm8x25_spm_device_init();
918 }
919}
920
Taniya Dasc868a2e2012-01-03 10:18:47 +0530921static void __init msm_qrd_init(void)
Taniya Dasc98bfbc2011-08-23 09:58:55 +0530922{
923 msm7x2x_misc_init();
Pankaj Kumar3cec0582011-11-18 11:13:29 +0530924 msm7627a_init_regulators();
Trilok Sonib9410792012-04-07 15:37:13 +0530925 msmqrd_adsp_add_pdev();
Taniya Dasc98bfbc2011-08-23 09:58:55 +0530926
Chintan Pandyaf4ad4002012-02-28 19:49:03 +0530927 if (cpu_is_msm8625())
928 msm8625_device_i2c_init();
929 else
930 msm7627a_device_i2c_init();
931
932 /* uart1dm*/
933 qrd7627a_uart1dm_config();
934 /*OTG gadget*/
935 qrd7627a_otg_gadget();
Taniya Dasc868a2e2012-01-03 10:18:47 +0530936
Taniya Dase380a2d2012-03-09 13:02:41 +0530937 msm_add_footswitch_devices();
Chintan Pandyab1bad0e2012-02-06 19:04:51 +0530938 add_platform_devices();
Taniya Dasc868a2e2012-01-03 10:18:47 +0530939
Santosh Sajjan374d6592012-01-19 23:16:46 +0530940 /* Ensure ar6000pm device is registered before MMC/SDC */
941 msm_qrd_init_ar6000pm();
Chintan Pandyacf467fc2011-12-01 17:11:11 +0530942 msm7627a_init_mmc();
943
Taniya Dasc98bfbc2011-08-23 09:58:55 +0530944#ifdef CONFIG_USB_EHCI_MSM_72K
945 msm7627a_init_host();
946#endif
Taniya Dasbd096542012-03-15 17:43:45 +0530947 msm_pm_init();
Murali Nalajalaa1827842011-11-13 14:12:39 +0530948
Murali Nalajala2a0bbda2012-03-28 12:12:54 +0530949 msm_pm_register_irqs();
Taniya Das0a5303a2011-08-23 18:47:48 +0530950 msm_fb_add_devices();
Taniya Dasc98bfbc2011-08-23 09:58:55 +0530951
952#if defined(CONFIG_BT) && defined(CONFIG_MARIMBA_CORE)
Chintan Pandya13490c02011-12-20 13:03:36 +0530953 msm7627a_bt_power_init();
Taniya Dasc98bfbc2011-08-23 09:58:55 +0530954#endif
Taniya Dasda408822011-09-06 12:54:06 +0530955
Chintan Pandya40762702011-12-06 13:47:06 +0530956 msm7627a_camera_init();
Chintan Pandya0d453192012-03-09 13:20:33 +0530957 qrd7627a_add_io_devices();
Aparna Mallavarapud95d8fc2012-03-08 12:07:37 +0530958 msm7x25a_kgsl_3d0_init();
Sudhakara Rao Tentu38ad6e12012-03-30 15:25:18 -0700959 msm8x25_kgsl_3d0_init();
Taniya Dasc98bfbc2011-08-23 09:58:55 +0530960}
961
962static void __init qrd7627a_init_early(void)
963{
964 msm_msm7627a_allocate_memory_regions();
965}
966
967MACHINE_START(MSM7627A_QRD1, "QRD MSM7627a QRD1")
968 .boot_params = PHYS_OFFSET + 0x100,
969 .map_io = msm_common_io_init,
Trilok Sonib9410792012-04-07 15:37:13 +0530970 .reserve = msm7627a_reserve,
Taniya Dasc98bfbc2011-08-23 09:58:55 +0530971 .init_irq = msm_init_irq,
Taniya Dasc868a2e2012-01-03 10:18:47 +0530972 .init_machine = msm_qrd_init,
973 .timer = &msm_timer,
974 .init_early = qrd7627a_init_early,
975 .handle_irq = vic_handle_irq,
976MACHINE_END
Chintan Pandyab1bad0e2012-02-06 19:04:51 +0530977MACHINE_START(MSM7627A_QRD3, "QRD MSM7627a QRD3")
978 .boot_params = PHYS_OFFSET + 0x100,
979 .map_io = msm_common_io_init,
Trilok Sonib9410792012-04-07 15:37:13 +0530980 .reserve = msm7627a_reserve,
Chintan Pandyab1bad0e2012-02-06 19:04:51 +0530981 .init_irq = msm_init_irq,
982 .init_machine = msm_qrd_init,
983 .timer = &msm_timer,
984 .init_early = qrd7627a_init_early,
985 .handle_irq = vic_handle_irq,
986MACHINE_END
Taniya Dasc868a2e2012-01-03 10:18:47 +0530987MACHINE_START(MSM7627A_EVB, "QRD MSM7627a EVB")
988 .boot_params = PHYS_OFFSET + 0x100,
989 .map_io = msm_common_io_init,
Trilok Sonib9410792012-04-07 15:37:13 +0530990 .reserve = msm7627a_reserve,
Taniya Dasc868a2e2012-01-03 10:18:47 +0530991 .init_irq = msm_init_irq,
992 .init_machine = msm_qrd_init,
Taniya Dasc98bfbc2011-08-23 09:58:55 +0530993 .timer = &msm_timer,
994 .init_early = qrd7627a_init_early,
Pankaj Kumarbf8a2a32011-10-21 11:47:21 +0530995 .handle_irq = vic_handle_irq,
Taniya Dasc98bfbc2011-08-23 09:58:55 +0530996MACHINE_END
Chintan Pandyaf4ad4002012-02-28 19:49:03 +0530997MACHINE_START(MSM8625_EVB, "QRD MSM8625 EVB")
998 .boot_params = PHYS_OFFSET + 0x100,
999 .map_io = msm8625_map_io,
Trilok Sonib9410792012-04-07 15:37:13 +05301000 .reserve = msm8625_reserve,
Chintan Pandyaf4ad4002012-02-28 19:49:03 +05301001 .init_irq = msm8625_init_irq,
1002 .init_machine = msm_qrd_init,
1003 .timer = &msm_timer,
1004 .init_early = qrd7627a_init_early,
1005 .handle_irq = gic_handle_irq,
1006MACHINE_END
Taniya Dasbd096542012-03-15 17:43:45 +05301007MACHINE_START(MSM8625_QRD7, "QRD MSM8625 QRD7")
1008 .boot_params = PHYS_OFFSET + 0x100,
1009 .map_io = msm8625_map_io,
Trilok Sonib9410792012-04-07 15:37:13 +05301010 .reserve = msm8625_reserve,
Taniya Dasbd096542012-03-15 17:43:45 +05301011 .init_irq = msm8625_init_irq,
1012 .init_machine = msm_qrd_init,
1013 .timer = &msm_timer,
1014 .init_early = qrd7627a_init_early,
1015 .handle_irq = gic_handle_irq,
1016MACHINE_END
Aparna Mallavarapu5a326242012-05-09 19:49:02 +05301017MACHINE_START(MSM8625_EVT, "QRD MSM8625 EVT")
1018 .boot_params = PHYS_OFFSET + 0x100,
1019 .map_io = msm8625_map_io,
1020 .reserve = msm8625_reserve,
1021 .init_irq = msm8625_init_irq,
1022 .init_machine = msm_qrd_init,
1023 .timer = &msm_timer,
1024 .init_early = qrd7627a_init_early,
1025 .handle_irq = gic_handle_irq,
1026MACHINE_END