blob: 51e605598c8e408bb13bd2accf2e49ec4864fbd5 [file] [log] [blame]
Shashank Mittal402d0972010-09-29 10:09:52 -07001/*
Subbaraman Narayanamurthyaea23b72011-04-12 13:07:41 -07002 * * Copyright (c) 2010-2011, Code Aurora Forum. All rights reserved.
Shashank Mittal402d0972010-09-29 10:09:52 -07003 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are
6 * met:
7 * * Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * * Redistributions in binary form must reproduce the above
10 * copyright notice, this list of conditions and the following
11 * disclaimer in the documentation and/or other materials provided
12 * with the distribution.
13 * * Neither the name of Code Aurora Forum, Inc. nor the names of its
14 * contributors may be used to endorse or promote products derived
15 * from this software without specific prior written permission.
16 *
17 * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
18 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
19 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
20 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
21 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
22 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
23 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
24 * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
25 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
26 * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
27 * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 */
29#ifndef __PLATFORM_MSM8X60_PMIC_H
30#define __PLATFORM_MSM8X60_PMIC_H
31
32/* PMIC 8901 LDO Module defines */
33#define PM8901_LDO_BASE (0x2F)
34
35#define PM8901_LDO_L0 (PM8901_LDO_BASE + 0x00)
36#define PM8901_LDO_L0_TEST_BANK (PM8901_LDO_BASE + 0x01)
37#define PM8901_LDO_L1 (PM8901_LDO_BASE + 0x02)
38#define PM8901_LDO_L1_TEST_BANK (PM8901_LDO_BASE + 0x03)
39#define PM8901_LDO_L2 (PM8901_LDO_BASE + 0x04)
40#define PM8901_LDO_L2_TEST_BANK (PM8901_LDO_BASE + 0x05)
41#define PM8901_LDO_L3 (PM8901_LDO_BASE + 0x06)
42#define PM8901_LDO_L3_TEST_BANK (PM8901_LDO_BASE + 0x07)
43#define PM8901_LDO_L4 (PM8901_LDO_BASE + 0x08)
44#define PM8901_LDO_L4_TEST_BANK (PM8901_LDO_BASE + 0x09)
45#define PM8901_LDO_L5 (PM8901_LDO_BASE + 0x0A)
46#define PM8901_LDO_L5_TEST_BANK (PM8901_LDO_BASE + 0x0B)
47#define PM8901_LDO_L6 (PM8901_LDO_BASE + 0x0C)
48#define PM8901_LDO_L6_TEST_BANK (PM8901_LDO_BASE + 0x0D)
49#define PM8901_LDO_L7 (PM8901_LDO_BASE + 0x0E)
50#define PM8901_LDO_L7_TEST_BANK (PM8901_LDO_BASE + 0x0F)
Subbaraman Narayanamurthy83019a42011-02-15 20:08:02 -080051#define PM8901_PMR_7 (0xAD)
Shashank Mittal402d0972010-09-29 10:09:52 -070052
53#define PM8901_LDO_TEST_BANK(n) ((n)<<4)
54
55#define PM8901_LDO_CTL_ENABLE__S (7)
56#define PM8901_LDO_CTL_PULL_DOWN__S (6)
57#define PM8901_LDO_CTL_MODE__S (5)
58/* LDO CTL */
59#define LDO_CTL_ENABLE_MASK (0x80)
60#define LDO_CTL_PULL_DOWN_MASK (0x40)
61#define LDO_CTL_NORMAL_POWER_MODE_MASK (0x20)
62#define LDO_CTL_VOLTAGE_SET_MASK (0x1F)
63
64/* LDO TEST BANK 2 */
65#define LDO_TEST_RANGE_SELECT_MASK (0x01)
66
67/* LDO TEST BANK 4 */
68#define LDO_TEST_OUTPUT_RANGE_MASK (0x01)
69
70/* LDO TEST BANK 5 */
71#define LDO_TEST_XO_EN_ALL_MASK (0x1F)
72
73/* PMIC 8058 defines */
Subbaraman Narayanamurthy8f1ffa52011-06-03 12:33:01 -070074#define PM8058_LPG_CTL_BASE (0x13C)
75#define PM8058_LPG_CTL(n) (PM8058_LPG_CTL_BASE + (n))
76#define PM8058_LPG_BANK_SEL (0x143)
77#define PM8058_LPG_BANK_ENABLE (0x144)
78
Shashank Mittal402d0972010-09-29 10:09:52 -070079#define GPIO24_GPIO_CNTRL (0x167)
80#define GPIO25_GPIO_CNTRL (0x168)
81
Subbaraman Narayanamurthy78aa8fe2011-02-17 18:03:15 -080082#define IRQ_BLOCK_SEL_USR_ADDR 0x1C0
83#define IRQ_STATUS_RT_USR_ADDR 0x1C3
84
Subbaraman Narayanamurthyf7940e72011-05-17 18:14:47 -070085/* PMIC 8058 LDO module defines */
86#define PM8058_LDO_CTRL_L0 (0x009)
87#define PM8058_LDO_TEST_L0 (0x065)
88#define PM8058_LDO_CTRL_L1 (0x00A)
89#define PM8058_LDO_TEST_L1 (0x066)
90#define PM8058_LDO_CTRL_L2 (0x00B)
91#define PM8058_LDO_TEST_L2 (0x067)
92#define PM8058_LDO_CTRL_L3 (0x00C)
93#define PM8058_LDO_TEST_L3 (0x068)
94#define PM8058_LDO_CTRL_L4 (0x00D)
95#define PM8058_LDO_TEST_L4 (0x069)
96#define PM8058_LDO_CTRL_L5 (0x00E)
97#define PM8058_LDO_TEST_L5 (0x06A)
98#define PM8058_LDO_CTRL_L6 (0x00F)
99#define PM8058_LDO_TEST_L6 (0x06B)
100#define PM8058_LDO_CTRL_L7 (0x010)
101#define PM8058_LDO_TEST_L7 (0x06C)
102#define PM8058_LDO_CTRL_L8 (0x011)
103#define PM8058_LDO_TEST_L8 (0x06D)
104#define PM8058_LDO_CTRL_L9 (0x012)
105#define PM8058_LDO_TEST_L9 (0x06E)
106#define PM8058_LDO_CTRL_L10 (0x013)
107#define PM8058_LDO_TEST_L10 (0x06F)
108#define PM8058_LDO_CTRL_L11 (0x014)
109#define PM8058_LDO_TEST_L11 (0x070)
110#define PM8058_LDO_CTRL_L12 (0x015)
111#define PM8058_LDO_TEST_L12 (0x071)
112#define PM8058_LDO_CTRL_L13 (0x016)
113#define PM8058_LDO_TEST_L13 (0x072)
114#define PM8058_LDO_CTRL_L14 (0x017)
115#define PM8058_LDO_TEST_L14 (0x073)
116
117#define PM8058_LDO_CTRL_L15 (0x089)
118#define PM8058_LDO_TEST_L15 (0x0E5)
119#define PM8058_LDO_CTRL_L16 (0x08A)
120#define PM8058_LDO_TEST_L16 (0x0E6)
121#define PM8058_LDO_CTRL_L17 (0x08B)
122#define PM8058_LDO_TEST_L17 (0x0E7)
123
124#define PM8058_LDO_CTRL_L18 (0x11D)
125#define PM8058_LDO_TEST_L18 (0x125)
126#define PM8058_LDO_CTRL_L19 (0x11E)
127#define PM8058_LDO_TEST_L19 (0x126)
128#define PM8058_LDO_CTRL_L20 (0x11F)
129#define PM8058_LDO_TEST_L20 (0x127)
130#define PM8058_LDO_CTRL_L21 (0x120)
131#define PM8058_LDO_TEST_L21 (0x128)
132#define PM8058_LDO_CTRL_L22 (0x121)
133#define PM8058_LDO_TEST_L22 (0x129)
134#define PM8058_LDO_CTRL_L23 (0x122)
135#define PM8058_LDO_TEST_L23 (0x12A)
136#define PM8058_LDO_CTRL_L24 (0x123)
137#define PM8058_LDO_TEST_L24 (0x12B)
138#define PM8058_LDO_CTRL_L25 (0x124)
139#define PM8058_LDO_TEST_L25 (0x12C)
140
Ajay Dudanib01e5062011-12-03 23:23:42 -0800141typedef enum {
142 PM_KYPD_PWRON_IRQ_ID = 51,
Subbaraman Narayanamurthyaea23b72011-04-12 13:07:41 -0700143
Ajay Dudanib01e5062011-12-03 23:23:42 -0800144 /* Block 24 Interrupts */
145 PM_GPIO01_CHGED_ST_IRQ_ID = 192,
146 PM_GPIO02_CHGED_ST_IRQ_ID = 193,
147 PM_GPIO03_CHGED_ST_IRQ_ID = 194,
148 PM_GPIO04_CHGED_ST_IRQ_ID = 195,
149 PM_GPIO05_CHGED_ST_IRQ_ID = 196,
150 PM_GPIO06_CHGED_ST_IRQ_ID = 197,
151 PM_GPIO07_CHGED_ST_IRQ_ID = 198,
152 PM_GPIO08_CHGED_ST_IRQ_ID = 199,
Subbaraman Narayanamurthy78aa8fe2011-02-17 18:03:15 -0800153
Ajay Dudanib01e5062011-12-03 23:23:42 -0800154 /* Block 25 Interrupts */
155 PM_GPIO09_CHGED_ST_IRQ_ID = 200,
156 PM_GPIO10_CHGED_ST_IRQ_ID = 201,
157 PM_GPIO11_CHGED_ST_IRQ_ID = 202,
158 PM_GPIO12_CHGED_ST_IRQ_ID = 203,
159 PM_GPIO13_CHGED_ST_IRQ_ID = 204,
160 PM_GPIO14_CHGED_ST_IRQ_ID = 205,
161 PM_GPIO15_CHGED_ST_IRQ_ID = 206,
162 PM_GPIO16_CHGED_ST_IRQ_ID = 207,
Subbaraman Narayanamurthy78aa8fe2011-02-17 18:03:15 -0800163
Ajay Dudanib01e5062011-12-03 23:23:42 -0800164 /* Block 26 Interrupts */
165 PM_GPIO17_CHGED_ST_IRQ_ID = 208,
166 PM_GPIO18_CHGED_ST_IRQ_ID = 209,
167 PM_GPIO19_CHGED_ST_IRQ_ID = 210,
168 PM_GPIO20_CHGED_ST_IRQ_ID = 211,
169 PM_GPIO21_CHGED_ST_IRQ_ID = 212,
170 PM_GPIO22_CHGED_ST_IRQ_ID = 213,
171 PM_GPIO23_CHGED_ST_IRQ_ID = 214,
172 PM_GPIO24_CHGED_ST_IRQ_ID = 215,
Subbaraman Narayanamurthy78aa8fe2011-02-17 18:03:15 -0800173
Ajay Dudanib01e5062011-12-03 23:23:42 -0800174 /* Block 27 Interrupts */
175 PM_GPIO25_CHGED_ST_IRQ_ID = 216,
176 PM_GPIO26_CHGED_ST_IRQ_ID = 217,
177 PM_GPIO27_CHGED_ST_IRQ_ID = 218,
178 PM_GPIO28_CHGED_ST_IRQ_ID = 219,
179 PM_GPIO29_CHGED_ST_IRQ_ID = 220,
180 PM_GPIO30_CHGED_ST_IRQ_ID = 221,
181 PM_GPIO31_CHGED_ST_IRQ_ID = 222,
182 PM_GPIO32_CHGED_ST_IRQ_ID = 223,
Subbaraman Narayanamurthy78aa8fe2011-02-17 18:03:15 -0800183
Ajay Dudanib01e5062011-12-03 23:23:42 -0800184 /* Block 28 Interrupts */
185 PM_GPIO33_CHGED_ST_IRQ_ID = 224,
186 PM_GPIO34_CHGED_ST_IRQ_ID = 225,
187 PM_GPIO35_CHGED_ST_IRQ_ID = 226,
188 PM_GPIO36_CHGED_ST_IRQ_ID = 227,
189 PM_GPIO37_CHGED_ST_IRQ_ID = 228,
190 PM_GPIO38_CHGED_ST_IRQ_ID = 229,
191 PM_GPIO39_CHGED_ST_IRQ_ID = 230,
192 PM_GPIO40_CHGED_ST_IRQ_ID = 231,
193} pm_irq_id_type;
Subbaraman Narayanamurthy78aa8fe2011-02-17 18:03:15 -0800194
Shashank Mittal402d0972010-09-29 10:09:52 -0700195#endif