blob: b71ecd3293043253183b306872859a7b04fea475 [file] [log] [blame]
Jay Chokshiea67c622011-07-29 17:12:26 -07001/*
Vikram Mulukutlabc2e9572011-11-04 03:41:38 -07002 * Copyright (c) 2011-2012, Code Aurora Forum. All rights reserved.
Jay Chokshiea67c622011-07-29 17:12:26 -07003 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 and
6 * only version 2 as published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 */
13
David Collins75016742011-12-02 15:04:25 -080014#include <linux/regulator/pm8xxx-regulator.h>
Jay Chokshiea67c622011-07-29 17:12:26 -070015
Stepan Moskovchenko5a83dba2011-12-05 17:30:17 -080016#include "board-8064.h"
Jay Chokshiea67c622011-07-29 17:12:26 -070017
18#define VREG_CONSUMERS(_id) \
19 static struct regulator_consumer_supply vreg_consumers_##_id[]
20
21/*
22 * Consumer specific regulator names:
23 * regulator name consumer dev_name
24 */
25VREG_CONSUMERS(L1) = {
26 REGULATOR_SUPPLY("8921_l1", NULL),
27};
28VREG_CONSUMERS(L2) = {
29 REGULATOR_SUPPLY("8921_l2", NULL),
Jeyaprakash Soundrapandianf0d4d012012-01-16 15:12:20 -080030 REGULATOR_SUPPLY("mipi_csi_vdd", "4-001a"),
31 REGULATOR_SUPPLY("mipi_csi_vdd", "4-006c"),
Jay Chokshiea67c622011-07-29 17:12:26 -070032};
33VREG_CONSUMERS(L3) = {
34 REGULATOR_SUPPLY("8921_l3", NULL),
Hemant Kumar6ddad592011-08-03 19:31:56 -070035 REGULATOR_SUPPLY("HSUSB_3p3", "msm_otg"),
Manu Gautamdccbca42011-11-08 15:13:38 +053036 REGULATOR_SUPPLY("HSUSB_3p3", "msm_ehci_host.0"),
37 REGULATOR_SUPPLY("HSUSB_3p3", "msm_ehci_host.1"),
Jay Chokshiea67c622011-07-29 17:12:26 -070038};
39VREG_CONSUMERS(L4) = {
40 REGULATOR_SUPPLY("8921_l4", NULL),
Hemant Kumar6ddad592011-08-03 19:31:56 -070041 REGULATOR_SUPPLY("HSUSB_1p8", "msm_otg"),
Manu Gautamdccbca42011-11-08 15:13:38 +053042 REGULATOR_SUPPLY("HSUSB_1p8", "msm_ehci_host.0"),
43 REGULATOR_SUPPLY("HSUSB_1p8", "msm_ehci_host.1"),
Subramanian Srinivasan04d2c832012-01-17 11:26:36 -080044 REGULATOR_SUPPLY("iris_vddxo", "wcnss_wlan.0"),
Jay Chokshiea67c622011-07-29 17:12:26 -070045};
46VREG_CONSUMERS(L5) = {
47 REGULATOR_SUPPLY("8921_l5", NULL),
Sahitya Tummalab4d883f2011-08-23 10:44:51 +053048 REGULATOR_SUPPLY("sdc_vdd", "msm_sdcc.1"),
Jay Chokshiea67c622011-07-29 17:12:26 -070049};
50VREG_CONSUMERS(L6) = {
51 REGULATOR_SUPPLY("8921_l6", NULL),
Sahitya Tummalab4d883f2011-08-23 10:44:51 +053052 REGULATOR_SUPPLY("sdc_vdd", "msm_sdcc.3"),
Jay Chokshiea67c622011-07-29 17:12:26 -070053};
54VREG_CONSUMERS(L7) = {
55 REGULATOR_SUPPLY("8921_l7", NULL),
Sahitya Tummalab4d883f2011-08-23 10:44:51 +053056 REGULATOR_SUPPLY("sdc_vddp", "msm_sdcc.3"),
Jay Chokshiea67c622011-07-29 17:12:26 -070057};
58VREG_CONSUMERS(L8) = {
59 REGULATOR_SUPPLY("8921_l8", NULL),
Jeyaprakash Soundrapandianf0d4d012012-01-16 15:12:20 -080060 REGULATOR_SUPPLY("cam_vana", "4-001a"),
61 REGULATOR_SUPPLY("cam_vana", "4-006c"),
Jay Chokshiea67c622011-07-29 17:12:26 -070062};
63VREG_CONSUMERS(L9) = {
64 REGULATOR_SUPPLY("8921_l9", NULL),
Anirudh Ghayal2917a5a2012-02-05 19:51:07 -080065 REGULATOR_SUPPLY("vdd", "3-0024"),
Jay Chokshiea67c622011-07-29 17:12:26 -070066};
67VREG_CONSUMERS(L10) = {
68 REGULATOR_SUPPLY("8921_l10", NULL),
Subramanian Srinivasan04d2c832012-01-17 11:26:36 -080069 REGULATOR_SUPPLY("iris_vddpa", "wcnss_wlan.0"),
Jay Chokshiea67c622011-07-29 17:12:26 -070070};
71VREG_CONSUMERS(L11) = {
72 REGULATOR_SUPPLY("8921_l11", NULL),
73};
74VREG_CONSUMERS(L12) = {
Jeyaprakash Soundrapandianf0d4d012012-01-16 15:12:20 -080075 REGULATOR_SUPPLY("cam_vdig", "4-001a"),
76 REGULATOR_SUPPLY("cam_vdig", "4-006c"),
Jay Chokshiea67c622011-07-29 17:12:26 -070077 REGULATOR_SUPPLY("8921_l12", NULL),
78};
79VREG_CONSUMERS(L14) = {
80 REGULATOR_SUPPLY("8921_l14", NULL),
81};
82VREG_CONSUMERS(L15) = {
83 REGULATOR_SUPPLY("8921_l15", NULL),
84};
85VREG_CONSUMERS(L16) = {
86 REGULATOR_SUPPLY("8921_l16", NULL),
Jeyaprakash Soundrapandianf0d4d012012-01-16 15:12:20 -080087 REGULATOR_SUPPLY("cam_vaf", "4-001a"),
88 REGULATOR_SUPPLY("cam_vaf", "4-006c"),
Jay Chokshiea67c622011-07-29 17:12:26 -070089};
90VREG_CONSUMERS(L17) = {
91 REGULATOR_SUPPLY("8921_l17", NULL),
92};
93VREG_CONSUMERS(L18) = {
94 REGULATOR_SUPPLY("8921_l18", NULL),
95};
96VREG_CONSUMERS(L22) = {
97 REGULATOR_SUPPLY("8921_l22", NULL),
98};
99VREG_CONSUMERS(L23) = {
100 REGULATOR_SUPPLY("8921_l23", NULL),
Swaminathan Sathappan2316e082012-02-03 14:07:17 -0800101 REGULATOR_SUPPLY("pll_vdd", "pil_qdsp6v4.1"),
102 REGULATOR_SUPPLY("pll_vdd", "pil_qdsp6v4.2"),
103
Jay Chokshiea67c622011-07-29 17:12:26 -0700104};
105VREG_CONSUMERS(L24) = {
106 REGULATOR_SUPPLY("8921_l24", NULL),
Subramanian Srinivasan04d2c832012-01-17 11:26:36 -0800107 REGULATOR_SUPPLY("riva_vddmx", "wcnss_wlan.0"),
Jay Chokshiea67c622011-07-29 17:12:26 -0700108};
109VREG_CONSUMERS(L25) = {
110 REGULATOR_SUPPLY("8921_l25", NULL),
Swaminathan Sathappan2f51a752011-12-05 12:51:19 -0800111 REGULATOR_SUPPLY("VDDD_CDC_D", "tabla-slim"),
112 REGULATOR_SUPPLY("CDC_VDDA_A_1P2V", "tabla-slim"),
Swaminathan Sathappan2316e082012-02-03 14:07:17 -0800113 REGULATOR_SUPPLY("VDDD_CDC_D", "tabla2x-slim"),
114 REGULATOR_SUPPLY("CDC_VDDA_A_1P2V", "tabla2x-slim"),
Jay Chokshiea67c622011-07-29 17:12:26 -0700115};
116VREG_CONSUMERS(L26) = {
117 REGULATOR_SUPPLY("8921_l26", NULL),
Matt Wagantallb94b9a52012-02-02 21:59:54 -0800118 REGULATOR_SUPPLY("core_vdd", "pil_qdsp6v4.0"),
Jay Chokshiea67c622011-07-29 17:12:26 -0700119};
120VREG_CONSUMERS(L27) = {
121 REGULATOR_SUPPLY("8921_l27", NULL),
Swaminathan Sathappan2316e082012-02-03 14:07:17 -0800122 REGULATOR_SUPPLY("core_vdd", "pil_qdsp6v4.2"),
Jay Chokshiea67c622011-07-29 17:12:26 -0700123};
124VREG_CONSUMERS(L28) = {
125 REGULATOR_SUPPLY("8921_l28", NULL),
Swaminathan Sathappan2316e082012-02-03 14:07:17 -0800126 REGULATOR_SUPPLY("core_vdd", "pil_qdsp6v4.1"),
Jay Chokshiea67c622011-07-29 17:12:26 -0700127};
128VREG_CONSUMERS(S1) = {
129 REGULATOR_SUPPLY("8921_s1", NULL),
130};
131VREG_CONSUMERS(S2) = {
132 REGULATOR_SUPPLY("8921_s2", NULL),
Subramanian Srinivasan04d2c832012-01-17 11:26:36 -0800133 REGULATOR_SUPPLY("iris_vddrfa", "wcnss_wlan.0"),
Jay Chokshiea67c622011-07-29 17:12:26 -0700134};
135VREG_CONSUMERS(S3) = {
136 REGULATOR_SUPPLY("8921_s3", NULL),
Hemant Kumar6ddad592011-08-03 19:31:56 -0700137 REGULATOR_SUPPLY("HSUSB_VDDCX", "msm_otg"),
Manu Gautamdccbca42011-11-08 15:13:38 +0530138 REGULATOR_SUPPLY("HSUSB_VDDCX", "msm_ehci_host.0"),
139 REGULATOR_SUPPLY("HSUSB_VDDCX", "msm_ehci_host.1"),
Hemant Kumara945b472012-01-25 15:08:06 -0800140 REGULATOR_SUPPLY("HSIC_VDDCX", "msm_hsic_host"),
Subramanian Srinivasan04d2c832012-01-17 11:26:36 -0800141 REGULATOR_SUPPLY("riva_vddcx", "wcnss_wlan.0"),
Jay Chokshiea67c622011-07-29 17:12:26 -0700142};
143VREG_CONSUMERS(S4) = {
144 REGULATOR_SUPPLY("8921_s4", NULL),
Sahitya Tummalab4d883f2011-08-23 10:44:51 +0530145 REGULATOR_SUPPLY("sdc_vccq", "msm_sdcc.1"),
Swaminathan Sathappan2f51a752011-12-05 12:51:19 -0800146 REGULATOR_SUPPLY("VDDIO_CDC", "tabla-slim"),
147 REGULATOR_SUPPLY("CDC_VDD_CP", "tabla-slim"),
148 REGULATOR_SUPPLY("CDC_VDDA_TX", "tabla-slim"),
149 REGULATOR_SUPPLY("CDC_VDDA_RX", "tabla-slim"),
Swaminathan Sathappan2316e082012-02-03 14:07:17 -0800150 REGULATOR_SUPPLY("VDDIO_CDC", "tabla2x-slim"),
151 REGULATOR_SUPPLY("CDC_VDD_CP", "tabla2x-slim"),
152 REGULATOR_SUPPLY("CDC_VDDA_TX", "tabla2x-slim"),
153 REGULATOR_SUPPLY("CDC_VDDA_RX", "tabla2x-slim"),
Subramanian Srinivasan04d2c832012-01-17 11:26:36 -0800154 REGULATOR_SUPPLY("riva_vddpx", "wcnss_wlan.0"),
Jing Lin21ed4de2012-02-05 15:53:28 -0800155 REGULATOR_SUPPLY("vcc_i2c", "3-005b"),
Anirudh Ghayal2917a5a2012-02-05 19:51:07 -0800156 REGULATOR_SUPPLY("vcc_i2c", "3-0024"),
Jay Chokshiea67c622011-07-29 17:12:26 -0700157};
158VREG_CONSUMERS(S5) = {
159 REGULATOR_SUPPLY("8921_s5", NULL),
Vikram Mulukutlabc2e9572011-11-04 03:41:38 -0700160 REGULATOR_SUPPLY("krait0", NULL),
Jay Chokshiea67c622011-07-29 17:12:26 -0700161};
162VREG_CONSUMERS(S6) = {
163 REGULATOR_SUPPLY("8921_s6", NULL),
Vikram Mulukutlabc2e9572011-11-04 03:41:38 -0700164 REGULATOR_SUPPLY("krait1", NULL),
Jay Chokshiea67c622011-07-29 17:12:26 -0700165};
166VREG_CONSUMERS(S7) = {
167 REGULATOR_SUPPLY("8921_s7", NULL),
168};
169VREG_CONSUMERS(LVS1) = {
170 REGULATOR_SUPPLY("8921_lvs1", NULL),
Subramanian Srinivasan04d2c832012-01-17 11:26:36 -0800171 REGULATOR_SUPPLY("iris_vddio", "wcnss_wlan.0"),
Jay Chokshiea67c622011-07-29 17:12:26 -0700172};
173VREG_CONSUMERS(LVS2) = {
174 REGULATOR_SUPPLY("8921_lvs2", NULL),
Subramanian Srinivasan04d2c832012-01-17 11:26:36 -0800175 REGULATOR_SUPPLY("iris_vdddig", "wcnss_wlan.0"),
Jay Chokshiea67c622011-07-29 17:12:26 -0700176};
177VREG_CONSUMERS(LVS3) = {
178 REGULATOR_SUPPLY("8921_lvs3", NULL),
179};
180VREG_CONSUMERS(LVS4) = {
181 REGULATOR_SUPPLY("8921_lvs4", NULL),
182};
183VREG_CONSUMERS(LVS5) = {
184 REGULATOR_SUPPLY("8921_lvs5", NULL),
Jeyaprakash Soundrapandianf0d4d012012-01-16 15:12:20 -0800185 REGULATOR_SUPPLY("cam_vio", "4-001a"),
186 REGULATOR_SUPPLY("cam_vio", "4-006c"),
Jay Chokshiea67c622011-07-29 17:12:26 -0700187};
188VREG_CONSUMERS(LVS6) = {
189 REGULATOR_SUPPLY("8921_lvs6", NULL),
190};
191VREG_CONSUMERS(LVS7) = {
192 REGULATOR_SUPPLY("8921_lvs7", NULL),
Matt Wagantall52dd0622012-02-02 18:26:16 -0800193 REGULATOR_SUPPLY("pll_vdd", "pil_riva"),
Jay Chokshiea67c622011-07-29 17:12:26 -0700194};
195VREG_CONSUMERS(USB_OTG) = {
196 REGULATOR_SUPPLY("8921_usb_otg", NULL),
Hemant Kumard86c4882012-01-24 19:39:37 -0800197 REGULATOR_SUPPLY("vbus_otg", "msm_otg"),
Jay Chokshiea67c622011-07-29 17:12:26 -0700198};
199VREG_CONSUMERS(HDMI_MVS) = {
200 REGULATOR_SUPPLY("8921_hdmi_mvs", NULL),
201};
202VREG_CONSUMERS(NCP) = {
203 REGULATOR_SUPPLY("8921_ncp", NULL),
204};
Jay Chokshi7805b5a2011-11-07 15:55:30 -0800205VREG_CONSUMERS(8821_S0) = {
206 REGULATOR_SUPPLY("8821_s0", NULL),
Vikram Mulukutlabc2e9572011-11-04 03:41:38 -0700207 REGULATOR_SUPPLY("krait2", NULL),
Jay Chokshi7805b5a2011-11-07 15:55:30 -0800208};
209VREG_CONSUMERS(8821_S1) = {
210 REGULATOR_SUPPLY("8821_s1", NULL),
Vikram Mulukutlabc2e9572011-11-04 03:41:38 -0700211 REGULATOR_SUPPLY("krait3", NULL),
Jay Chokshi7805b5a2011-11-07 15:55:30 -0800212};
David Collinsf0d00732012-01-25 15:46:50 -0800213VREG_CONSUMERS(EXT_5V) = {
214 REGULATOR_SUPPLY("ext_5v", NULL),
215};
Jay Chokshi1de4f9d2012-02-07 16:11:31 -0800216VREG_CONSUMERS(EXT_MPP8) = {
217 REGULATOR_SUPPLY("ext_mpp8", NULL),
218};
David Collinsf0d00732012-01-25 15:46:50 -0800219VREG_CONSUMERS(EXT_3P3V) = {
220 REGULATOR_SUPPLY("ext_3p3v", NULL),
Stepan Moskovchenkoc71c9792012-01-31 18:12:44 -0800221 REGULATOR_SUPPLY("vdd_io", "spi0.2"),
Hemant Kumar94e7da22012-02-03 16:52:29 -0800222 REGULATOR_SUPPLY("mhl_ext_3p3v", "msm_otg"),
David Collinsf0d00732012-01-25 15:46:50 -0800223};
David Collins390fc332012-02-07 14:38:16 -0800224VREG_CONSUMERS(EXT_TS_SW) = {
225 REGULATOR_SUPPLY("ext_ts_sw", NULL),
Jing Lin21ed4de2012-02-05 15:53:28 -0800226 REGULATOR_SUPPLY("vdd_ana", "3-005b"),
David Collins390fc332012-02-07 14:38:16 -0800227};
Jay Chokshiea67c622011-07-29 17:12:26 -0700228
David Collins75016742011-12-02 15:04:25 -0800229#define PM8XXX_VREG_INIT(_id, _name, _min_uV, _max_uV, _modes, _ops, \
230 _apply_uV, _pull_down, _always_on, _supply_regulator, \
231 _system_uA, _enable_time, _reg_id) \
Jay Chokshiea67c622011-07-29 17:12:26 -0700232 { \
233 .init_data = { \
234 .constraints = { \
235 .valid_modes_mask = _modes, \
236 .valid_ops_mask = _ops, \
237 .min_uV = _min_uV, \
238 .max_uV = _max_uV, \
239 .input_uV = _max_uV, \
240 .apply_uV = _apply_uV, \
241 .always_on = _always_on, \
David Collins75016742011-12-02 15:04:25 -0800242 .name = _name, \
Jay Chokshiea67c622011-07-29 17:12:26 -0700243 }, \
244 .num_consumer_supplies = \
245 ARRAY_SIZE(vreg_consumers_##_id), \
246 .consumer_supplies = vreg_consumers_##_id, \
247 .supply_regulator = _supply_regulator, \
248 }, \
David Collins75016742011-12-02 15:04:25 -0800249 .id = _reg_id, \
Jay Chokshiea67c622011-07-29 17:12:26 -0700250 .pull_down_enable = _pull_down, \
251 .system_uA = _system_uA, \
252 .enable_time = _enable_time, \
253 }
254
David Collins75016742011-12-02 15:04:25 -0800255#define PM8XXX_LDO(_id, _name, _always_on, _pull_down, _min_uV, _max_uV, \
256 _enable_time, _supply_regulator, _system_uA, _reg_id) \
257 PM8XXX_VREG_INIT(_id, _name, _min_uV, _max_uV, REGULATOR_MODE_NORMAL \
Jay Chokshiea67c622011-07-29 17:12:26 -0700258 | REGULATOR_MODE_IDLE, REGULATOR_CHANGE_VOLTAGE | \
259 REGULATOR_CHANGE_STATUS | REGULATOR_CHANGE_MODE | \
260 REGULATOR_CHANGE_DRMS, 0, _pull_down, _always_on, \
David Collins75016742011-12-02 15:04:25 -0800261 _supply_regulator, _system_uA, _enable_time, _reg_id)
Jay Chokshiea67c622011-07-29 17:12:26 -0700262
David Collins75016742011-12-02 15:04:25 -0800263#define PM8XXX_NLDO1200(_id, _name, _always_on, _pull_down, _min_uV, \
264 _max_uV, _enable_time, _supply_regulator, _system_uA, _reg_id) \
265 PM8XXX_VREG_INIT(_id, _name, _min_uV, _max_uV, REGULATOR_MODE_NORMAL \
Jay Chokshiea67c622011-07-29 17:12:26 -0700266 | REGULATOR_MODE_IDLE, REGULATOR_CHANGE_VOLTAGE | \
267 REGULATOR_CHANGE_STATUS | REGULATOR_CHANGE_MODE | \
268 REGULATOR_CHANGE_DRMS, 0, _pull_down, _always_on, \
David Collins75016742011-12-02 15:04:25 -0800269 _supply_regulator, _system_uA, _enable_time, _reg_id)
Jay Chokshiea67c622011-07-29 17:12:26 -0700270
David Collins75016742011-12-02 15:04:25 -0800271#define PM8XXX_SMPS(_id, _name, _always_on, _pull_down, _min_uV, _max_uV, \
272 _enable_time, _supply_regulator, _system_uA, _reg_id) \
273 PM8XXX_VREG_INIT(_id, _name, _min_uV, _max_uV, REGULATOR_MODE_NORMAL \
Jay Chokshiea67c622011-07-29 17:12:26 -0700274 | REGULATOR_MODE_IDLE, REGULATOR_CHANGE_VOLTAGE | \
275 REGULATOR_CHANGE_STATUS | REGULATOR_CHANGE_MODE | \
276 REGULATOR_CHANGE_DRMS, 0, _pull_down, _always_on, \
David Collins75016742011-12-02 15:04:25 -0800277 _supply_regulator, _system_uA, _enable_time, _reg_id)
Jay Chokshiea67c622011-07-29 17:12:26 -0700278
David Collins75016742011-12-02 15:04:25 -0800279#define PM8XXX_FTSMPS(_id, _name, _always_on, _pull_down, _min_uV, _max_uV, \
280 _enable_time, _supply_regulator, _system_uA, _reg_id) \
281 PM8XXX_VREG_INIT(_id, _name, _min_uV, _max_uV, REGULATOR_MODE_NORMAL, \
Jay Chokshiea67c622011-07-29 17:12:26 -0700282 REGULATOR_CHANGE_VOLTAGE | REGULATOR_CHANGE_STATUS \
283 | REGULATOR_CHANGE_MODE, 0, _pull_down, _always_on, \
David Collins75016742011-12-02 15:04:25 -0800284 _supply_regulator, _system_uA, _enable_time, _reg_id)
Jay Chokshiea67c622011-07-29 17:12:26 -0700285
David Collins75016742011-12-02 15:04:25 -0800286#define PM8XXX_VS(_id, _name, _always_on, _pull_down, _enable_time, \
287 _supply_regulator, _reg_id) \
288 PM8XXX_VREG_INIT(_id, _name, 0, 0, 0, REGULATOR_CHANGE_STATUS, 0, \
289 _pull_down, _always_on, _supply_regulator, 0, _enable_time, \
290 _reg_id)
Jay Chokshiea67c622011-07-29 17:12:26 -0700291
David Collins75016742011-12-02 15:04:25 -0800292#define PM8XXX_VS300(_id, _name, _always_on, _pull_down, _enable_time, \
293 _supply_regulator, _reg_id) \
294 PM8XXX_VREG_INIT(_id, _name, 0, 0, 0, REGULATOR_CHANGE_STATUS, 0, \
295 _pull_down, _always_on, _supply_regulator, 0, _enable_time, \
296 _reg_id)
Jay Chokshiea67c622011-07-29 17:12:26 -0700297
David Collins75016742011-12-02 15:04:25 -0800298#define PM8XXX_NCP(_id, _name, _always_on, _min_uV, _max_uV, _enable_time, \
299 _supply_regulator, _reg_id) \
300 PM8XXX_VREG_INIT(_id, _name, _min_uV, _max_uV, 0, \
301 REGULATOR_CHANGE_VOLTAGE | REGULATOR_CHANGE_STATUS, 0, 0, \
302 _always_on, _supply_regulator, 0, _enable_time, _reg_id)
Jay Chokshiea67c622011-07-29 17:12:26 -0700303
304/* Pin control initialization */
David Collins75016742011-12-02 15:04:25 -0800305#define PM8XXX_PC(_id, _name, _always_on, _pin_fn, _pin_ctrl, \
306 _supply_regulator, _reg_id) \
Jay Chokshiea67c622011-07-29 17:12:26 -0700307 { \
308 .init_data = { \
309 .constraints = { \
310 .valid_ops_mask = REGULATOR_CHANGE_STATUS, \
311 .always_on = _always_on, \
David Collins75016742011-12-02 15:04:25 -0800312 .name = _name, \
Jay Chokshiea67c622011-07-29 17:12:26 -0700313 }, \
314 .num_consumer_supplies = \
315 ARRAY_SIZE(vreg_consumers_##_id##_PC), \
316 .consumer_supplies = vreg_consumers_##_id##_PC, \
317 .supply_regulator = _supply_regulator, \
318 }, \
David Collins75016742011-12-02 15:04:25 -0800319 .id = _reg_id, \
320 .pin_fn = PM8XXX_VREG_PIN_FN_##_pin_fn, \
321 .pin_ctrl = _pin_ctrl, \
Jay Chokshiea67c622011-07-29 17:12:26 -0700322 }
323
David Collinsf0d00732012-01-25 15:46:50 -0800324#define GPIO_VREG(_id, _reg_name, _gpio_label, _gpio, _supply_regulator) \
325 [GPIO_VREG_ID_##_id] = { \
326 .init_data = { \
327 .constraints = { \
328 .valid_ops_mask = REGULATOR_CHANGE_STATUS, \
329 }, \
330 .num_consumer_supplies = \
331 ARRAY_SIZE(vreg_consumers_##_id), \
332 .consumer_supplies = vreg_consumers_##_id, \
333 .supply_regulator = _supply_regulator, \
334 }, \
335 .regulator_name = _reg_name, \
336 .gpio_label = _gpio_label, \
337 .gpio = _gpio, \
338 }
339
Jay Chokshiea67c622011-07-29 17:12:26 -0700340#define SAW_VREG_INIT(_id, _name, _min_uV, _max_uV) \
341 { \
342 .constraints = { \
343 .name = _name, \
344 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE, \
345 .min_uV = _min_uV, \
346 .max_uV = _max_uV, \
347 }, \
348 .num_consumer_supplies = ARRAY_SIZE(vreg_consumers_##_id), \
349 .consumer_supplies = vreg_consumers_##_id, \
350 }
351
David Collins2782b5c2012-02-06 10:02:42 -0800352#define RPM_INIT(_id, _min_uV, _max_uV, _modes, _ops, _apply_uV, _default_uV, \
353 _peak_uA, _avg_uA, _pull_down, _pin_ctrl, _freq, _pin_fn, \
354 _force_mode, _power_mode, _state, _sleep_selectable, \
355 _always_on, _supply_regulator, _system_uA) \
356 { \
357 .init_data = { \
358 .constraints = { \
359 .valid_modes_mask = _modes, \
360 .valid_ops_mask = _ops, \
361 .min_uV = _min_uV, \
362 .max_uV = _max_uV, \
363 .input_uV = _min_uV, \
364 .apply_uV = _apply_uV, \
365 .always_on = _always_on, \
366 }, \
367 .num_consumer_supplies = \
368 ARRAY_SIZE(vreg_consumers_##_id), \
369 .consumer_supplies = vreg_consumers_##_id, \
370 .supply_regulator = _supply_regulator, \
371 }, \
372 .id = RPM_VREG_ID_PM8921_##_id, \
373 .default_uV = _default_uV, \
374 .peak_uA = _peak_uA, \
375 .avg_uA = _avg_uA, \
376 .pull_down_enable = _pull_down, \
377 .pin_ctrl = _pin_ctrl, \
378 .freq = RPM_VREG_FREQ_##_freq, \
379 .pin_fn = _pin_fn, \
380 .force_mode = _force_mode, \
381 .power_mode = _power_mode, \
382 .state = _state, \
383 .sleep_selectable = _sleep_selectable, \
384 .system_uA = _system_uA, \
385 }
386
387#define RPM_LDO(_id, _always_on, _pd, _sleep_selectable, _min_uV, _max_uV, \
388 _supply_regulator, _system_uA, _init_peak_uA) \
389 RPM_INIT(_id, _min_uV, _max_uV, REGULATOR_MODE_NORMAL \
390 | REGULATOR_MODE_IDLE, REGULATOR_CHANGE_VOLTAGE \
391 | REGULATOR_CHANGE_STATUS | REGULATOR_CHANGE_MODE \
392 | REGULATOR_CHANGE_DRMS, 0, _max_uV, _init_peak_uA, 0, _pd, \
393 RPM_VREG_PIN_CTRL_NONE, NONE, RPM_VREG_PIN_FN_8960_NONE, \
394 RPM_VREG_FORCE_MODE_8960_NONE, RPM_VREG_POWER_MODE_8960_PWM, \
395 RPM_VREG_STATE_OFF, _sleep_selectable, _always_on, \
396 _supply_regulator, _system_uA)
397
398#define RPM_SMPS(_id, _always_on, _pd, _sleep_selectable, _min_uV, _max_uV, \
399 _supply_regulator, _system_uA, _freq) \
400 RPM_INIT(_id, _min_uV, _max_uV, REGULATOR_MODE_NORMAL \
401 | REGULATOR_MODE_IDLE, REGULATOR_CHANGE_VOLTAGE \
402 | REGULATOR_CHANGE_STATUS | REGULATOR_CHANGE_MODE \
403 | REGULATOR_CHANGE_DRMS, 0, _max_uV, _system_uA, 0, _pd, \
404 RPM_VREG_PIN_CTRL_NONE, _freq, RPM_VREG_PIN_FN_8960_NONE, \
405 RPM_VREG_FORCE_MODE_8960_NONE, RPM_VREG_POWER_MODE_8960_PWM, \
406 RPM_VREG_STATE_OFF, _sleep_selectable, _always_on, \
407 _supply_regulator, _system_uA)
408
409#define RPM_VS(_id, _always_on, _pd, _sleep_selectable, _supply_regulator) \
410 RPM_INIT(_id, 0, 0, 0, REGULATOR_CHANGE_STATUS, 0, 0, 1000, 1000, _pd, \
411 RPM_VREG_PIN_CTRL_NONE, NONE, RPM_VREG_PIN_FN_8960_NONE, \
412 RPM_VREG_FORCE_MODE_8960_NONE, RPM_VREG_POWER_MODE_8960_PWM, \
413 RPM_VREG_STATE_OFF, _sleep_selectable, _always_on, \
414 _supply_regulator, 0)
415
416#define RPM_NCP(_id, _always_on, _sleep_selectable, _min_uV, _max_uV, \
417 _supply_regulator, _freq) \
418 RPM_INIT(_id, _min_uV, _max_uV, 0, REGULATOR_CHANGE_VOLTAGE \
419 | REGULATOR_CHANGE_STATUS, 0, _max_uV, 1000, 1000, 0, \
420 RPM_VREG_PIN_CTRL_NONE, _freq, RPM_VREG_PIN_FN_8960_NONE, \
421 RPM_VREG_FORCE_MODE_8960_NONE, RPM_VREG_POWER_MODE_8960_PWM, \
422 RPM_VREG_STATE_OFF, _sleep_selectable, _always_on, \
423 _supply_regulator, 0)
424
425/* Pin control initialization */
426#define RPM_PC_INIT(_id, _always_on, _pin_fn, _pin_ctrl, _supply_regulator) \
427 { \
428 .init_data = { \
429 .constraints = { \
430 .valid_ops_mask = REGULATOR_CHANGE_STATUS, \
431 .always_on = _always_on, \
432 }, \
433 .num_consumer_supplies = \
434 ARRAY_SIZE(vreg_consumers_##_id##_PC), \
435 .consumer_supplies = vreg_consumers_##_id##_PC, \
436 .supply_regulator = _supply_regulator, \
437 }, \
438 .id = RPM_VREG_ID_PM8921_##_id##_PC, \
439 .pin_fn = RPM_VREG_PIN_FN_8960_##_pin_fn, \
440 .pin_ctrl = _pin_ctrl, \
441 }
442
David Collinsf0d00732012-01-25 15:46:50 -0800443/* GPIO regulator constraints */
444struct gpio_regulator_platform_data
445apq8064_gpio_regulator_pdata[] __devinitdata = {
446 /* ID vreg_name gpio_label gpio supply */
447 GPIO_VREG(EXT_5V, "ext_5v", "ext_5v_en", PM8921_MPP_PM_TO_SYS(7), NULL),
448 GPIO_VREG(EXT_3P3V, "ext_3p3v", "ext_3p3v_en",
449 APQ8064_EXT_3P3V_REG_EN_GPIO, NULL),
David Collins390fc332012-02-07 14:38:16 -0800450 GPIO_VREG(EXT_TS_SW, "ext_ts_sw", "ext_ts_sw_en",
451 PM8921_GPIO_PM_TO_SYS(23), "ext_3p3v"),
Jay Chokshi1de4f9d2012-02-07 16:11:31 -0800452 GPIO_VREG(EXT_MPP8, "ext_mpp8", "ext_mpp8_en",
453 PM8921_MPP_PM_TO_SYS(8), NULL),
David Collinsf0d00732012-01-25 15:46:50 -0800454};
455
Jay Chokshiea67c622011-07-29 17:12:26 -0700456/* SAW regulator constraints */
Jay Chokshi7805b5a2011-11-07 15:55:30 -0800457struct regulator_init_data msm8064_saw_regulator_pdata_8921_s5 =
Jay Chokshiea67c622011-07-29 17:12:26 -0700458 /* ID vreg_name min_uV max_uV */
Jay Chokshi7805b5a2011-11-07 15:55:30 -0800459 SAW_VREG_INIT(S5, "8921_s5", 950000, 1150000);
460struct regulator_init_data msm8064_saw_regulator_pdata_8921_s6 =
461 SAW_VREG_INIT(S6, "8921_s6", 950000, 1150000);
462
463struct regulator_init_data msm8064_saw_regulator_pdata_8821_s0 =
464 /* ID vreg_name min_uV max_uV */
465 SAW_VREG_INIT(8821_S0, "8821_s0", 950000, 1150000);
466struct regulator_init_data msm8064_saw_regulator_pdata_8821_s1 =
467 SAW_VREG_INIT(8821_S1, "8821_s1", 950000, 1150000);
Jay Chokshiea67c622011-07-29 17:12:26 -0700468
469/* PM8921 regulator constraints */
David Collins75016742011-12-02 15:04:25 -0800470struct pm8xxx_regulator_platform_data
Jay Chokshiea67c622011-07-29 17:12:26 -0700471msm8064_pm8921_regulator_pdata[] __devinitdata = {
David Collins75016742011-12-02 15:04:25 -0800472 /*
David Collins2782b5c2012-02-06 10:02:42 -0800473 * ID name always_on pd min_uV max_uV en_t supply
David Collins75016742011-12-02 15:04:25 -0800474 * system_uA reg_ID
475 */
David Collins75016742011-12-02 15:04:25 -0800476 PM8XXX_NLDO1200(L26, "8921_l26", 0, 1, 1050000, 1050000, 200, "8921_s7",
David Collins2782b5c2012-02-06 10:02:42 -0800477 0, 1),
Jay Chokshiea67c622011-07-29 17:12:26 -0700478
David Collins2782b5c2012-02-06 10:02:42 -0800479 /* ID name always_on pd en_t supply reg_ID */
480 PM8XXX_VS300(USB_OTG, "8921_usb_otg", 0, 0, 0, "ext_5v", 2),
481 PM8XXX_VS300(HDMI_MVS, "8921_hdmi_mvs", 0, 1, 0, "ext_5v", 3),
482};
Jay Chokshiea67c622011-07-29 17:12:26 -0700483
David Collins2782b5c2012-02-06 10:02:42 -0800484static struct rpm_regulator_init_data
485apq8064_rpm_regulator_init_data[] __devinitdata = {
486 /* ID a_on pd ss min_uV max_uV supply sys_uA freq */
487 RPM_SMPS(S1, 1, 1, 0, 1225000, 1225000, NULL, 100000, 3p20),
488 RPM_SMPS(S2, 0, 1, 0, 1300000, 1300000, NULL, 0, 1p60),
489 RPM_SMPS(S3, 0, 1, 1, 500000, 1150000, NULL, 100000, 4p80),
490 RPM_SMPS(S4, 1, 1, 0, 1800000, 1800000, NULL, 100000, 1p60),
491 RPM_SMPS(S7, 0, 1, 0, 1300000, 1300000, NULL, 100000, 3p20),
Jay Chokshiea67c622011-07-29 17:12:26 -0700492
David Collins2782b5c2012-02-06 10:02:42 -0800493 /* ID a_on pd ss min_uV max_uV supply sys_uA init_ip */
494 RPM_LDO(L1, 1, 1, 0, 1100000, 1100000, "8921_s4", 0, 10000),
495 RPM_LDO(L2, 0, 1, 0, 1200000, 1200000, "8921_s4", 0, 0),
496 RPM_LDO(L3, 0, 1, 0, 3075000, 3075000, NULL, 0, 0),
497 RPM_LDO(L4, 1, 1, 0, 1800000, 1800000, NULL, 10000, 10000),
498 RPM_LDO(L5, 0, 1, 0, 2950000, 2950000, NULL, 0, 0),
499 RPM_LDO(L6, 0, 1, 0, 2950000, 2950000, NULL, 0, 0),
500 RPM_LDO(L7, 0, 1, 0, 1850000, 2950000, NULL, 0, 0),
501 RPM_LDO(L8, 0, 1, 0, 2800000, 2800000, NULL, 0, 0),
502 RPM_LDO(L9, 0, 1, 0, 2850000, 2850000, NULL, 0, 0),
503 RPM_LDO(L10, 0, 1, 0, 2900000, 2900000, NULL, 0, 0),
504 RPM_LDO(L11, 0, 1, 0, 3000000, 3000000, NULL, 0, 0),
505 RPM_LDO(L12, 0, 1, 0, 1200000, 1200000, "8921_s4", 0, 0),
506 RPM_LDO(L14, 0, 1, 0, 1800000, 1800000, NULL, 0, 0),
507 RPM_LDO(L15, 0, 1, 0, 1800000, 2950000, NULL, 0, 0),
508 RPM_LDO(L16, 0, 1, 0, 2800000, 2800000, NULL, 0, 0),
509 RPM_LDO(L17, 0, 1, 0, 2000000, 2000000, NULL, 0, 0),
510 RPM_LDO(L18, 0, 1, 0, 1300000, 1800000, "8921_s4", 0, 0),
511 RPM_LDO(L22, 0, 1, 0, 2600000, 2600000, NULL, 0, 0),
512 RPM_LDO(L23, 0, 1, 0, 1800000, 1800000, NULL, 0, 0),
513 RPM_LDO(L24, 0, 1, 1, 750000, 1150000, "8921_s1", 10000, 10000),
514 RPM_LDO(L25, 1, 1, 0, 1225000, 1225000, "8921_s1", 10000, 10000),
515 RPM_LDO(L27, 0, 1, 0, 1100000, 1100000, "8921_s7", 0, 0),
516 RPM_LDO(L28, 0, 1, 0, 1050000, 1050000, "8921_s7", 0, 0),
517
518 /* ID a_on pd ss supply */
519 RPM_VS(LVS1, 0, 1, 0, "8921_s4"),
520 RPM_VS(LVS2, 0, 1, 0, "8921_s1"),
521 RPM_VS(LVS3, 0, 1, 0, "8921_s4"),
522 RPM_VS(LVS4, 0, 1, 0, "8921_s4"),
523 RPM_VS(LVS5, 0, 1, 0, "8921_s4"),
524 RPM_VS(LVS6, 0, 1, 0, "8921_s4"),
525 RPM_VS(LVS7, 1, 1, 1, "8921_s4"),
526
527 /* ID a_on ss min_uV max_uV supply freq */
528 RPM_NCP(NCP, 0, 0, 1800000, 1800000, "8921_l6", 1p60),
Jay Chokshiea67c622011-07-29 17:12:26 -0700529};
530
531int msm8064_pm8921_regulator_pdata_len __devinitdata =
532 ARRAY_SIZE(msm8064_pm8921_regulator_pdata);
David Collins2782b5c2012-02-06 10:02:42 -0800533
534struct rpm_regulator_platform_data apq8064_rpm_regulator_pdata __devinitdata = {
535 .init_data = apq8064_rpm_regulator_init_data,
536 .num_regulators = ARRAY_SIZE(apq8064_rpm_regulator_init_data),
537 .version = RPM_VREG_VERSION_8960,
538 .vreg_id_vdd_mem = RPM_VREG_ID_PM8921_L24,
539 .vreg_id_vdd_dig = RPM_VREG_ID_PM8921_S3,
540};