blob: 21820793c0225c9165c1ebe88fd3e51ff7a655ee [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
Ashay Jaiswal0b023dc2012-01-25 10:18:36 +053046static struct pm8xxx_rtc_platform_data
47apq8064_pm8921_rtc_pdata = {
48 .rtc_write_enable = false,
49 .rtc_alarm_powerup = false,
50};
51
Stepan Moskovchenkoc1074f02011-12-14 17:51:57 -080052static struct pm8921_platform_data
53apq8064_pm8921_platform_data __devinitdata = {
54 .regulator_pdatas = msm8064_pm8921_regulator_pdata,
55 .irq_pdata = &apq8064_pm8921_irq_pdata,
56 .gpio_pdata = &apq8064_pm8921_gpio_pdata,
57 .mpp_pdata = &apq8064_pm8921_mpp_pdata,
Ashay Jaiswal0b023dc2012-01-25 10:18:36 +053058 .rtc_pdata = &apq8064_pm8921_rtc_pdata,
Stepan Moskovchenkoc1074f02011-12-14 17:51:57 -080059};
60
61static struct pm8xxx_irq_platform_data
62apq8064_pm8821_irq_pdata __devinitdata = {
63 .irq_base = PM8821_IRQ_BASE,
64 .devirq = PM8821_USR_IRQ_N,
65 .irq_trigger_flag = IRQF_TRIGGER_HIGH,
66 .dev_id = 1,
67};
68
69static struct pm8xxx_mpp_platform_data
70apq8064_pm8821_mpp_pdata __devinitdata = {
71 .mpp_base = PM8821_MPP_PM_TO_SYS(1),
72};
73
74static struct pm8821_platform_data
75apq8064_pm8821_platform_data __devinitdata = {
76 .irq_pdata = &apq8064_pm8821_irq_pdata,
77 .mpp_pdata = &apq8064_pm8821_mpp_pdata,
78};
79
80static struct msm_ssbi_platform_data apq8064_ssbi_pm8921_pdata __devinitdata = {
81 .controller_type = MSM_SBI_CTRL_PMIC_ARBITER,
82 .slave = {
83 .name = "pm8921-core",
84 .platform_data = &apq8064_pm8921_platform_data,
85 },
86};
87
88static struct msm_ssbi_platform_data apq8064_ssbi_pm8821_pdata __devinitdata = {
89 .controller_type = MSM_SBI_CTRL_PMIC_ARBITER,
90 .slave = {
91 .name = "pm8821-core",
92 .platform_data = &apq8064_pm8821_platform_data,
93 },
94};
95
96void __init apq8064_init_pmic(void)
97{
98 apq8064_device_ssbi_pmic1.dev.platform_data =
99 &apq8064_ssbi_pm8921_pdata;
100 apq8064_device_ssbi_pmic2.dev.platform_data =
101 &apq8064_ssbi_pm8821_pdata;
102 apq8064_pm8921_platform_data.num_regulators =
103 msm8064_pm8921_regulator_pdata_len;
104
105 if (machine_is_apq8064_rumi3()) {
106 apq8064_pm8921_irq_pdata.devirq = 0;
107 apq8064_pm8821_irq_pdata.devirq = 0;
108 }
109}