blob: 032d8dad853df5f1504e451f2a13a8b6f1e745d6 [file] [log] [blame]
Stepan Moskovchenkoc1074f02011-12-14 17:51:57 -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 *
12 */
13
14#include <linux/init.h>
15#include <linux/ioport.h>
16#include <linux/platform_device.h>
17#include <linux/bootmem.h>
18#include <asm/mach-types.h>
19#include <asm/mach/mmc.h>
20#include <mach/msm_bus_board.h>
21#include <mach/board.h>
22#include <mach/gpio.h>
23#include <mach/gpiomux.h>
24#include "devices.h"
25#include "board-8064.h"
26
27
28static struct pm8xxx_mpp_platform_data
29apq8064_pm8921_mpp_pdata __devinitdata = {
30 .mpp_base = PM8921_MPP_PM_TO_SYS(1),
31};
32
33static struct pm8xxx_gpio_platform_data
34apq8064_pm8921_gpio_pdata __devinitdata = {
35 .gpio_base = PM8921_GPIO_PM_TO_SYS(1),
36};
37
38static struct pm8xxx_irq_platform_data
39apq8064_pm8921_irq_pdata __devinitdata = {
40 .irq_base = PM8921_IRQ_BASE,
41 .devirq = PM8921_USR_IRQ_N,
42 .irq_trigger_flag = IRQF_TRIGGER_HIGH,
43 .dev_id = 0,
44};
45
46static struct pm8921_platform_data
47apq8064_pm8921_platform_data __devinitdata = {
48 .regulator_pdatas = msm8064_pm8921_regulator_pdata,
49 .irq_pdata = &apq8064_pm8921_irq_pdata,
50 .gpio_pdata = &apq8064_pm8921_gpio_pdata,
51 .mpp_pdata = &apq8064_pm8921_mpp_pdata,
52};
53
54static struct pm8xxx_irq_platform_data
55apq8064_pm8821_irq_pdata __devinitdata = {
56 .irq_base = PM8821_IRQ_BASE,
57 .devirq = PM8821_USR_IRQ_N,
58 .irq_trigger_flag = IRQF_TRIGGER_HIGH,
59 .dev_id = 1,
60};
61
62static struct pm8xxx_mpp_platform_data
63apq8064_pm8821_mpp_pdata __devinitdata = {
64 .mpp_base = PM8821_MPP_PM_TO_SYS(1),
65};
66
67static struct pm8821_platform_data
68apq8064_pm8821_platform_data __devinitdata = {
69 .irq_pdata = &apq8064_pm8821_irq_pdata,
70 .mpp_pdata = &apq8064_pm8821_mpp_pdata,
71};
72
73static struct msm_ssbi_platform_data apq8064_ssbi_pm8921_pdata __devinitdata = {
74 .controller_type = MSM_SBI_CTRL_PMIC_ARBITER,
75 .slave = {
76 .name = "pm8921-core",
77 .platform_data = &apq8064_pm8921_platform_data,
78 },
79};
80
81static struct msm_ssbi_platform_data apq8064_ssbi_pm8821_pdata __devinitdata = {
82 .controller_type = MSM_SBI_CTRL_PMIC_ARBITER,
83 .slave = {
84 .name = "pm8821-core",
85 .platform_data = &apq8064_pm8821_platform_data,
86 },
87};
88
89void __init apq8064_init_pmic(void)
90{
91 apq8064_device_ssbi_pmic1.dev.platform_data =
92 &apq8064_ssbi_pm8921_pdata;
93 apq8064_device_ssbi_pmic2.dev.platform_data =
94 &apq8064_ssbi_pm8821_pdata;
95 apq8064_pm8921_platform_data.num_regulators =
96 msm8064_pm8921_regulator_pdata_len;
97
98 if (machine_is_apq8064_rumi3()) {
99 apq8064_pm8921_irq_pdata.devirq = 0;
100 apq8064_pm8821_irq_pdata.devirq = 0;
101 }
102}