blob: a29bb8853190f9c5159314cc004ca5742575e4cc [file] [log] [blame]
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001/*
Anirudh Ghayalb6060e72013-07-23 15:07:31 +05302 * Copyright (c) 2011-2013, The Linux Foundation. All rights reserved.
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -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>
Steve Mucklef132c6c2012-06-06 18:30:57 -070015#include <linux/regulator/msm-gpio-regulator.h>
David Collins26f05562011-06-20 09:56:28 -070016#include <mach/rpm-regulator.h>
David Collinse68647e2012-09-04 15:44:19 -070017#include <mach/socinfo.h>
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070018
Stepan Moskovchenko5a83dba2011-12-05 17:30:17 -080019#include "board-8960.h"
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070020
21#define VREG_CONSUMERS(_id) \
22 static struct regulator_consumer_supply vreg_consumers_##_id[]
23
24/*
25 * Consumer specific regulator names:
26 * regulator name consumer dev_name
27 */
28VREG_CONSUMERS(L1) = {
29 REGULATOR_SUPPLY("8921_l1", NULL),
30};
31VREG_CONSUMERS(L2) = {
32 REGULATOR_SUPPLY("8921_l2", NULL),
33 REGULATOR_SUPPLY("dsi_vdda", "mipi_dsi.1"),
Ravishangar Kalyanamad320022012-07-23 18:26:09 -070034 REGULATOR_SUPPLY("dsi_pll_vdda", "mdp.0"),
Kevin Chan330e4d52012-02-18 23:11:24 -080035 REGULATOR_SUPPLY("mipi_csi_vdd", "msm_csid.0"),
36 REGULATOR_SUPPLY("mipi_csi_vdd", "msm_csid.1"),
37 REGULATOR_SUPPLY("mipi_csi_vdd", "msm_csid.2"),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070038};
39VREG_CONSUMERS(L3) = {
40 REGULATOR_SUPPLY("8921_l3", NULL),
41 REGULATOR_SUPPLY("HSUSB_3p3", "msm_otg"),
42};
43VREG_CONSUMERS(L4) = {
44 REGULATOR_SUPPLY("8921_l4", NULL),
45 REGULATOR_SUPPLY("HSUSB_1p8", "msm_otg"),
46 REGULATOR_SUPPLY("iris_vddxo", "wcnss_wlan.0"),
47};
48VREG_CONSUMERS(L5) = {
49 REGULATOR_SUPPLY("8921_l5", NULL),
50 REGULATOR_SUPPLY("sdc_vdd", "msm_sdcc.1"),
51};
52VREG_CONSUMERS(L6) = {
53 REGULATOR_SUPPLY("8921_l6", NULL),
54 REGULATOR_SUPPLY("sdc_vdd", "msm_sdcc.3"),
55};
56VREG_CONSUMERS(L7) = {
57 REGULATOR_SUPPLY("8921_l7", NULL),
Subhash Jadavani937c7502012-06-01 15:34:46 +053058 REGULATOR_SUPPLY("sdc_vdd_io", "msm_sdcc.3"),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070059};
60VREG_CONSUMERS(L8) = {
61 REGULATOR_SUPPLY("8921_l8", NULL),
62 REGULATOR_SUPPLY("dsi_vdc", "mipi_dsi.1"),
63};
64VREG_CONSUMERS(L9) = {
65 REGULATOR_SUPPLY("8921_l9", NULL),
66 REGULATOR_SUPPLY("vdd", "3-0024"),
Amy Malochef3c9db42011-12-08 15:17:35 -080067 REGULATOR_SUPPLY("vdd_ana", "3-004a"),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070068};
69VREG_CONSUMERS(L10) = {
70 REGULATOR_SUPPLY("8921_l10", NULL),
71 REGULATOR_SUPPLY("iris_vddpa", "wcnss_wlan.0"),
72
73};
74VREG_CONSUMERS(L11) = {
75 REGULATOR_SUPPLY("8921_l11", NULL),
Kevin Chan09f4e662011-12-16 08:17:02 -080076 REGULATOR_SUPPLY("cam_vana", "4-001a"),
77 REGULATOR_SUPPLY("cam_vana", "4-006c"),
78 REGULATOR_SUPPLY("cam_vana", "4-0048"),
Sreesudhan Ramakrish Ramkumar8f11b8b2012-01-04 17:09:05 -080079 REGULATOR_SUPPLY("cam_vana", "4-0020"),
Sreesudhan Ramakrish Ramkumar3381da72012-01-27 08:08:32 -080080 REGULATOR_SUPPLY("cam_vana", "4-0034"),
Punit Soni57850102012-09-26 11:31:27 -070081 REGULATOR_SUPPLY("cam_vana", "4-0010"),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070082};
83VREG_CONSUMERS(L12) = {
84 REGULATOR_SUPPLY("8921_l12", NULL),
Kevin Chan09f4e662011-12-16 08:17:02 -080085 REGULATOR_SUPPLY("cam_vdig", "4-001a"),
86 REGULATOR_SUPPLY("cam_vdig", "4-006c"),
87 REGULATOR_SUPPLY("cam_vdig", "4-0048"),
Sreesudhan Ramakrish Ramkumar8f11b8b2012-01-04 17:09:05 -080088 REGULATOR_SUPPLY("cam_vdig", "4-0020"),
Sreesudhan Ramakrish Ramkumar3381da72012-01-27 08:08:32 -080089 REGULATOR_SUPPLY("cam_vdig", "4-0034"),
Punit Soni57850102012-09-26 11:31:27 -070090 REGULATOR_SUPPLY("cam_vdig", "4-0010"),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070091};
92VREG_CONSUMERS(L14) = {
93 REGULATOR_SUPPLY("8921_l14", NULL),
Siddartha Mohanadossaf91d902011-10-20 10:23:34 -070094 REGULATOR_SUPPLY("pa_therm", "pm8xxx-adc"),
David Keitel663abad2012-09-04 21:00:27 -070095 REGULATOR_SUPPLY("vreg_xoadc", "pm8921-charger"),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070096};
97VREG_CONSUMERS(L15) = {
98 REGULATOR_SUPPLY("8921_l15", NULL),
99};
100VREG_CONSUMERS(L16) = {
101 REGULATOR_SUPPLY("8921_l16", NULL),
Kevin Chan09f4e662011-12-16 08:17:02 -0800102 REGULATOR_SUPPLY("cam_vaf", "4-001a"),
103 REGULATOR_SUPPLY("cam_vaf", "4-006c"),
104 REGULATOR_SUPPLY("cam_vaf", "4-0048"),
Sreesudhan Ramakrish Ramkumar8f11b8b2012-01-04 17:09:05 -0800105 REGULATOR_SUPPLY("cam_vaf", "4-0020"),
Sreesudhan Ramakrish Ramkumar3381da72012-01-27 08:08:32 -0800106 REGULATOR_SUPPLY("cam_vaf", "4-0034"),
Punit Soni57850102012-09-26 11:31:27 -0700107 REGULATOR_SUPPLY("cam_vaf", "4-0010"),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700108};
109VREG_CONSUMERS(L17) = {
110 REGULATOR_SUPPLY("8921_l17", NULL),
111};
112VREG_CONSUMERS(L18) = {
113 REGULATOR_SUPPLY("8921_l18", NULL),
114};
115VREG_CONSUMERS(L21) = {
116 REGULATOR_SUPPLY("8921_l21", NULL),
117};
118VREG_CONSUMERS(L22) = {
119 REGULATOR_SUPPLY("8921_l22", NULL),
120};
121VREG_CONSUMERS(L23) = {
122 REGULATOR_SUPPLY("8921_l23", NULL),
123 REGULATOR_SUPPLY("dsi_vddio", "mipi_dsi.1"),
Ravishangar Kalyanamad320022012-07-23 18:26:09 -0700124 REGULATOR_SUPPLY("dsi_pll_vddio", "mdp.0"),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700125 REGULATOR_SUPPLY("hdmi_avdd", "hdmi_msm.0"),
Stephen Boyd3bbdf6c2011-12-21 16:02:26 -0800126 REGULATOR_SUPPLY("pll_vdd", "pil_riva"),
Stephen Boydbdb53f32012-06-05 18:39:47 -0700127 REGULATOR_SUPPLY("pll_vdd", "pil-q6v4-modem"),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700128};
129VREG_CONSUMERS(L24) = {
130 REGULATOR_SUPPLY("8921_l24", NULL),
131 REGULATOR_SUPPLY("riva_vddmx", "wcnss_wlan.0"),
132};
133VREG_CONSUMERS(L25) = {
134 REGULATOR_SUPPLY("8921_l25", NULL),
135 REGULATOR_SUPPLY("VDDD_CDC_D", "tabla-slim"),
136 REGULATOR_SUPPLY("CDC_VDDA_A_1P2V", "tabla-slim"),
Santosh Mardi60e19d92011-10-28 01:15:14 +0530137 REGULATOR_SUPPLY("VDDD_CDC_D", "tabla2x-slim"),
138 REGULATOR_SUPPLY("CDC_VDDA_A_1P2V", "tabla2x-slim"),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700139};
140VREG_CONSUMERS(L26) = {
141 REGULATOR_SUPPLY("8921_l26", NULL),
Stephen Boydbdb53f32012-06-05 18:39:47 -0700142 REGULATOR_SUPPLY("core_vdd", "pil-q6v4-lpass"),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700143};
144VREG_CONSUMERS(L27) = {
145 REGULATOR_SUPPLY("8921_l27", NULL),
Stephen Boydbdb53f32012-06-05 18:39:47 -0700146 REGULATOR_SUPPLY("sw_core_vdd", "pil-q6v4-modem"),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700147};
148VREG_CONSUMERS(L28) = {
149 REGULATOR_SUPPLY("8921_l28", NULL),
Stephen Boydbdb53f32012-06-05 18:39:47 -0700150 REGULATOR_SUPPLY("fw_core_vdd", "pil-q6v4-modem"),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700151};
152VREG_CONSUMERS(L29) = {
153 REGULATOR_SUPPLY("8921_l29", NULL),
154};
155VREG_CONSUMERS(S1) = {
156 REGULATOR_SUPPLY("8921_s1", NULL),
157};
158VREG_CONSUMERS(S2) = {
159 REGULATOR_SUPPLY("8921_s2", NULL),
160 REGULATOR_SUPPLY("iris_vddrfa", "wcnss_wlan.0"),
161
162};
163VREG_CONSUMERS(S3) = {
164 REGULATOR_SUPPLY("8921_s3", NULL),
165 REGULATOR_SUPPLY("HSUSB_VDDCX", "msm_otg"),
166 REGULATOR_SUPPLY("riva_vddcx", "wcnss_wlan.0"),
Vijayavardhan Vennapusa39025fe2011-10-15 05:55:10 +0530167 REGULATOR_SUPPLY("HSIC_VDDCX", "msm_hsic_host"),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700168};
169VREG_CONSUMERS(S4) = {
170 REGULATOR_SUPPLY("8921_s4", NULL),
Subhash Jadavani937c7502012-06-01 15:34:46 +0530171 REGULATOR_SUPPLY("sdc_vdd_io", "msm_sdcc.1"),
Pratibhasagar V57c808e2012-01-12 13:47:30 +0530172 REGULATOR_SUPPLY("sdc_vdd", "msm_sdcc.2"),
Subhash Jadavani937c7502012-06-01 15:34:46 +0530173 REGULATOR_SUPPLY("sdc_vdd_io", "msm_sdcc.4"),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700174 REGULATOR_SUPPLY("riva_vddpx", "wcnss_wlan.0"),
175 REGULATOR_SUPPLY("hdmi_vcc", "hdmi_msm.0"),
176 REGULATOR_SUPPLY("VDDIO_CDC", "tabla-slim"),
177 REGULATOR_SUPPLY("CDC_VDD_CP", "tabla-slim"),
178 REGULATOR_SUPPLY("CDC_VDDA_TX", "tabla-slim"),
179 REGULATOR_SUPPLY("CDC_VDDA_RX", "tabla-slim"),
Santosh Mardi60e19d92011-10-28 01:15:14 +0530180 REGULATOR_SUPPLY("VDDIO_CDC", "tabla2x-slim"),
181 REGULATOR_SUPPLY("CDC_VDD_CP", "tabla2x-slim"),
182 REGULATOR_SUPPLY("CDC_VDDA_TX", "tabla2x-slim"),
183 REGULATOR_SUPPLY("CDC_VDDA_RX", "tabla2x-slim"),
Mohan Pallaka20c876f2011-08-05 12:57:38 +0530184 REGULATOR_SUPPLY("vcc_i2c", "3-005b"),
Vijayavardhan Vennapusaafbbb8f2012-04-13 16:28:45 +0530185 REGULATOR_SUPPLY("EXT_HUB_VDDIO", "msm_smsc_hub"),
Mohan Pallaka5e490392011-09-09 15:18:41 +0530186 REGULATOR_SUPPLY("vcc_i2c", "10-0048"),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700187};
188VREG_CONSUMERS(S5) = {
189 REGULATOR_SUPPLY("8921_s5", NULL),
Matt Wagantall6115d782012-06-07 20:13:51 -0700190 REGULATOR_SUPPLY("krait0", "acpuclk-8960"),
Patrick Daly6578e0c2012-07-19 18:50:02 -0700191 REGULATOR_SUPPLY("krait0", "acpuclk-8960ab"),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700192};
193VREG_CONSUMERS(S6) = {
194 REGULATOR_SUPPLY("8921_s6", NULL),
Matt Wagantall6115d782012-06-07 20:13:51 -0700195 REGULATOR_SUPPLY("krait1", "acpuclk-8960"),
Patrick Daly6578e0c2012-07-19 18:50:02 -0700196 REGULATOR_SUPPLY("krait1", "acpuclk-8960ab"),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700197};
198VREG_CONSUMERS(S7) = {
199 REGULATOR_SUPPLY("8921_s7", NULL),
200};
201VREG_CONSUMERS(S8) = {
202 REGULATOR_SUPPLY("8921_s8", NULL),
203};
204VREG_CONSUMERS(LVS1) = {
205 REGULATOR_SUPPLY("8921_lvs1", NULL),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700206 REGULATOR_SUPPLY("iris_vddio", "wcnss_wlan.0"),
207};
208VREG_CONSUMERS(LVS2) = {
209 REGULATOR_SUPPLY("8921_lvs2", NULL),
210 REGULATOR_SUPPLY("iris_vdddig", "wcnss_wlan.0"),
211};
212VREG_CONSUMERS(LVS3) = {
213 REGULATOR_SUPPLY("8921_lvs3", NULL),
214};
215VREG_CONSUMERS(LVS4) = {
216 REGULATOR_SUPPLY("8921_lvs4", NULL),
217 REGULATOR_SUPPLY("vcc_i2c", "3-0024"),
Amy Malochef3c9db42011-12-08 15:17:35 -0800218 REGULATOR_SUPPLY("vcc_i2c", "3-004a"),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700219};
220VREG_CONSUMERS(LVS5) = {
221 REGULATOR_SUPPLY("8921_lvs5", NULL),
Kevin Chan09f4e662011-12-16 08:17:02 -0800222 REGULATOR_SUPPLY("cam_vio", "4-001a"),
223 REGULATOR_SUPPLY("cam_vio", "4-006c"),
224 REGULATOR_SUPPLY("cam_vio", "4-0048"),
Sreesudhan Ramakrish Ramkumar8f11b8b2012-01-04 17:09:05 -0800225 REGULATOR_SUPPLY("cam_vio", "4-0020"),
Sreesudhan Ramakrish Ramkumar3381da72012-01-27 08:08:32 -0800226 REGULATOR_SUPPLY("cam_vio", "4-0034"),
Punit Soni57850102012-09-26 11:31:27 -0700227 REGULATOR_SUPPLY("cam_vio", "4-0010"),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700228};
David Collinse68647e2012-09-04 15:44:19 -0700229/* This mapping is used for CDP only. */
230VREG_CONSUMERS(CDP_LVS6) = {
231 REGULATOR_SUPPLY("8921_lvs6", NULL),
232 REGULATOR_SUPPLY("vdd-io", "spi0.0"),
233};
234/* This mapping is used for non-CDP targets only. */
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700235VREG_CONSUMERS(LVS6) = {
236 REGULATOR_SUPPLY("8921_lvs6", NULL),
David Collinse68647e2012-09-04 15:44:19 -0700237 REGULATOR_SUPPLY("vdd-io", "spi0.0"),
238 REGULATOR_SUPPLY("vdd-phy", "spi0.0"),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700239};
240VREG_CONSUMERS(LVS7) = {
241 REGULATOR_SUPPLY("8921_lvs7", NULL),
242};
243VREG_CONSUMERS(USB_OTG) = {
244 REGULATOR_SUPPLY("8921_usb_otg", NULL),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700245};
246VREG_CONSUMERS(HDMI_MVS) = {
247 REGULATOR_SUPPLY("8921_hdmi_mvs", NULL),
248 REGULATOR_SUPPLY("hdmi_mvs", "hdmi_msm.0"),
249};
250VREG_CONSUMERS(NCP) = {
251 REGULATOR_SUPPLY("8921_ncp", NULL),
252};
253VREG_CONSUMERS(EXT_5V) = {
254 REGULATOR_SUPPLY("ext_5v", NULL),
255};
256VREG_CONSUMERS(EXT_L2) = {
257 REGULATOR_SUPPLY("ext_l2", NULL),
David Collinse68647e2012-09-04 15:44:19 -0700258 REGULATOR_SUPPLY("vdd-phy", "spi0.0"),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700259};
David Collinsb10be1d2011-09-02 10:29:31 -0700260VREG_CONSUMERS(EXT_3P3V) = {
261 REGULATOR_SUPPLY("ext_3p3v", NULL),
Amy Maloche21115eb2011-11-02 09:04:37 -0700262 REGULATOR_SUPPLY("vdd_ana", "3-005b"),
Amir Samuelov0c7270f2011-09-07 03:13:47 +0300263 REGULATOR_SUPPLY("vdd_lvds_3p3v", "mipi_dsi.1"),
Pavankumar Kondeti56dc7422012-07-02 12:45:19 +0530264 REGULATOR_SUPPLY("mhl_usb_hs_switch", "msm_otg"),
David Collinsb10be1d2011-09-02 10:29:31 -0700265};
David Collins35a78f52011-12-14 15:54:25 -0800266VREG_CONSUMERS(EXT_OTG_SW) = {
267 REGULATOR_SUPPLY("ext_otg_sw", NULL),
David Collins96aa3e12012-02-29 10:31:34 -0800268 REGULATOR_SUPPLY("vbus_otg", "msm_otg"),
David Collins35a78f52011-12-14 15:54:25 -0800269};
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700270
David Collins75016742011-12-02 15:04:25 -0800271#define PM8XXX_VREG_INIT(_id, _name, _min_uV, _max_uV, _modes, _ops, \
272 _apply_uV, _pull_down, _always_on, _supply_regulator, \
David Collins5aead232012-02-29 10:18:56 -0800273 _system_uA, _enable_time, _reg_id) \
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700274 { \
275 .init_data = { \
276 .constraints = { \
277 .valid_modes_mask = _modes, \
278 .valid_ops_mask = _ops, \
279 .min_uV = _min_uV, \
280 .max_uV = _max_uV, \
281 .input_uV = _max_uV, \
282 .apply_uV = _apply_uV, \
283 .always_on = _always_on, \
David Collins75016742011-12-02 15:04:25 -0800284 .name = _name, \
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700285 }, \
286 .num_consumer_supplies = \
287 ARRAY_SIZE(vreg_consumers_##_id), \
288 .consumer_supplies = vreg_consumers_##_id, \
289 .supply_regulator = _supply_regulator, \
290 }, \
David Collins75016742011-12-02 15:04:25 -0800291 .id = _reg_id, \
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700292 .pull_down_enable = _pull_down, \
293 .system_uA = _system_uA, \
David Collins43176762011-07-26 15:33:38 -0700294 .enable_time = _enable_time, \
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700295 }
296
David Collins75016742011-12-02 15:04:25 -0800297#define PM8XXX_LDO(_id, _name, _always_on, _pull_down, _min_uV, _max_uV, \
298 _enable_time, _supply_regulator, _system_uA, _reg_id) \
299 PM8XXX_VREG_INIT(_id, _name, _min_uV, _max_uV, REGULATOR_MODE_NORMAL \
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700300 | REGULATOR_MODE_IDLE, REGULATOR_CHANGE_VOLTAGE | \
301 REGULATOR_CHANGE_STATUS | REGULATOR_CHANGE_MODE | \
302 REGULATOR_CHANGE_DRMS, 0, _pull_down, _always_on, \
David Collins5aead232012-02-29 10:18:56 -0800303 _supply_regulator, _system_uA, _enable_time, _reg_id)
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700304
David Collins75016742011-12-02 15:04:25 -0800305#define PM8XXX_NLDO1200(_id, _name, _always_on, _pull_down, _min_uV, \
306 _max_uV, _enable_time, _supply_regulator, _system_uA, _reg_id) \
307 PM8XXX_VREG_INIT(_id, _name, _min_uV, _max_uV, REGULATOR_MODE_NORMAL \
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700308 | REGULATOR_MODE_IDLE, REGULATOR_CHANGE_VOLTAGE | \
309 REGULATOR_CHANGE_STATUS | REGULATOR_CHANGE_MODE | \
310 REGULATOR_CHANGE_DRMS, 0, _pull_down, _always_on, \
David Collins5aead232012-02-29 10:18:56 -0800311 _supply_regulator, _system_uA, _enable_time, _reg_id)
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700312
David Collins75016742011-12-02 15:04:25 -0800313#define PM8XXX_SMPS(_id, _name, _always_on, _pull_down, _min_uV, _max_uV, \
314 _enable_time, _supply_regulator, _system_uA, _reg_id) \
315 PM8XXX_VREG_INIT(_id, _name, _min_uV, _max_uV, REGULATOR_MODE_NORMAL \
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700316 | REGULATOR_MODE_IDLE, REGULATOR_CHANGE_VOLTAGE | \
317 REGULATOR_CHANGE_STATUS | REGULATOR_CHANGE_MODE | \
318 REGULATOR_CHANGE_DRMS, 0, _pull_down, _always_on, \
David Collins5aead232012-02-29 10:18:56 -0800319 _supply_regulator, _system_uA, _enable_time, _reg_id)
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700320
David Collins75016742011-12-02 15:04:25 -0800321#define PM8XXX_FTSMPS(_id, _name, _always_on, _pull_down, _min_uV, _max_uV, \
322 _enable_time, _supply_regulator, _system_uA, _reg_id) \
323 PM8XXX_VREG_INIT(_id, _name, _min_uV, _max_uV, REGULATOR_MODE_NORMAL, \
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700324 REGULATOR_CHANGE_VOLTAGE | REGULATOR_CHANGE_STATUS \
325 | REGULATOR_CHANGE_MODE, 0, _pull_down, _always_on, \
David Collins5aead232012-02-29 10:18:56 -0800326 _supply_regulator, _system_uA, _enable_time, _reg_id)
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700327
David Collins75016742011-12-02 15:04:25 -0800328#define PM8XXX_VS(_id, _name, _always_on, _pull_down, _enable_time, \
David Collins5aead232012-02-29 10:18:56 -0800329 _supply_regulator, _reg_id) \
David Collins75016742011-12-02 15:04:25 -0800330 PM8XXX_VREG_INIT(_id, _name, 0, 0, 0, REGULATOR_CHANGE_STATUS, 0, \
331 _pull_down, _always_on, _supply_regulator, 0, _enable_time, \
David Collins5aead232012-02-29 10:18:56 -0800332 _reg_id)
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700333
David Collins75016742011-12-02 15:04:25 -0800334#define PM8XXX_VS300(_id, _name, _always_on, _pull_down, _enable_time, \
David Collins5aead232012-02-29 10:18:56 -0800335 _supply_regulator, _reg_id) \
David Collins75016742011-12-02 15:04:25 -0800336 PM8XXX_VREG_INIT(_id, _name, 0, 0, 0, REGULATOR_CHANGE_STATUS, 0, \
337 _pull_down, _always_on, _supply_regulator, 0, _enable_time, \
David Collins5aead232012-02-29 10:18:56 -0800338 _reg_id)
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700339
David Collins75016742011-12-02 15:04:25 -0800340#define PM8XXX_NCP(_id, _name, _always_on, _min_uV, _max_uV, _enable_time, \
341 _supply_regulator, _reg_id) \
342 PM8XXX_VREG_INIT(_id, _name, _min_uV, _max_uV, 0, \
343 REGULATOR_CHANGE_VOLTAGE | REGULATOR_CHANGE_STATUS, 0, 0, \
David Collins5aead232012-02-29 10:18:56 -0800344 _always_on, _supply_regulator, 0, _enable_time, _reg_id)
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700345
346/* Pin control initialization */
David Collins75016742011-12-02 15:04:25 -0800347#define PM8XXX_PC(_id, _name, _always_on, _pin_fn, _pin_ctrl, \
348 _supply_regulator, _reg_id) \
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700349 { \
350 .init_data = { \
351 .constraints = { \
352 .valid_ops_mask = REGULATOR_CHANGE_STATUS, \
353 .always_on = _always_on, \
David Collins75016742011-12-02 15:04:25 -0800354 .name = _name, \
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700355 }, \
356 .num_consumer_supplies = \
357 ARRAY_SIZE(vreg_consumers_##_id##_PC), \
358 .consumer_supplies = vreg_consumers_##_id##_PC, \
359 .supply_regulator = _supply_regulator, \
360 }, \
David Collins75016742011-12-02 15:04:25 -0800361 .id = _reg_id, \
362 .pin_fn = PM8XXX_VREG_PIN_FN_##_pin_fn, \
363 .pin_ctrl = _pin_ctrl, \
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700364 }
365
David Collins35a78f52011-12-14 15:54:25 -0800366#define GPIO_VREG(_id, _reg_name, _gpio_label, _gpio, _supply_regulator) \
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700367 [GPIO_VREG_ID_##_id] = { \
368 .init_data = { \
369 .constraints = { \
370 .valid_ops_mask = REGULATOR_CHANGE_STATUS, \
371 }, \
372 .num_consumer_supplies = \
373 ARRAY_SIZE(vreg_consumers_##_id), \
374 .consumer_supplies = vreg_consumers_##_id, \
David Collins35a78f52011-12-14 15:54:25 -0800375 .supply_regulator = _supply_regulator, \
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700376 }, \
377 .regulator_name = _reg_name, \
378 .gpio_label = _gpio_label, \
379 .gpio = _gpio, \
380 }
381
382#define SAW_VREG_INIT(_id, _name, _min_uV, _max_uV) \
383 { \
384 .constraints = { \
385 .name = _name, \
Michael Bohanee3ce19c2012-11-13 14:57:40 -0800386 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE | \
387 REGULATOR_CHANGE_STATUS, \
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700388 .min_uV = _min_uV, \
389 .max_uV = _max_uV, \
390 }, \
391 .num_consumer_supplies = ARRAY_SIZE(vreg_consumers_##_id), \
392 .consumer_supplies = vreg_consumers_##_id, \
393 }
394
David Collins26f05562011-06-20 09:56:28 -0700395#define RPM_INIT(_id, _min_uV, _max_uV, _modes, _ops, _apply_uV, _default_uV, \
396 _peak_uA, _avg_uA, _pull_down, _pin_ctrl, _freq, _pin_fn, \
David Collins15789042012-03-19 10:44:36 -0700397 _force_mode, _sleep_set_force_mode, _power_mode, _state, \
398 _sleep_selectable, _always_on, _supply_regulator, _system_uA) \
David Collins26f05562011-06-20 09:56:28 -0700399 { \
400 .init_data = { \
401 .constraints = { \
402 .valid_modes_mask = _modes, \
403 .valid_ops_mask = _ops, \
404 .min_uV = _min_uV, \
405 .max_uV = _max_uV, \
406 .input_uV = _min_uV, \
407 .apply_uV = _apply_uV, \
408 .always_on = _always_on, \
409 }, \
410 .num_consumer_supplies = \
411 ARRAY_SIZE(vreg_consumers_##_id), \
412 .consumer_supplies = vreg_consumers_##_id, \
413 .supply_regulator = _supply_regulator, \
414 }, \
415 .id = RPM_VREG_ID_PM8921_##_id, \
416 .default_uV = _default_uV, \
417 .peak_uA = _peak_uA, \
418 .avg_uA = _avg_uA, \
419 .pull_down_enable = _pull_down, \
420 .pin_ctrl = _pin_ctrl, \
421 .freq = RPM_VREG_FREQ_##_freq, \
422 .pin_fn = _pin_fn, \
423 .force_mode = _force_mode, \
David Collins15789042012-03-19 10:44:36 -0700424 .sleep_set_force_mode = _sleep_set_force_mode, \
David Collins26f05562011-06-20 09:56:28 -0700425 .power_mode = _power_mode, \
426 .state = _state, \
427 .sleep_selectable = _sleep_selectable, \
428 .system_uA = _system_uA, \
429 }
430
431#define RPM_LDO(_id, _always_on, _pd, _sleep_selectable, _min_uV, _max_uV, \
432 _supply_regulator, _system_uA, _init_peak_uA) \
433 RPM_INIT(_id, _min_uV, _max_uV, REGULATOR_MODE_NORMAL \
434 | REGULATOR_MODE_IDLE, REGULATOR_CHANGE_VOLTAGE \
435 | REGULATOR_CHANGE_STATUS | REGULATOR_CHANGE_MODE \
436 | REGULATOR_CHANGE_DRMS, 0, _max_uV, _init_peak_uA, 0, _pd, \
David Collins6f032ba2011-08-31 14:08:15 -0700437 RPM_VREG_PIN_CTRL_NONE, NONE, RPM_VREG_PIN_FN_8960_NONE, \
David Collins15789042012-03-19 10:44:36 -0700438 RPM_VREG_FORCE_MODE_8960_NONE, \
David Collins6f032ba2011-08-31 14:08:15 -0700439 RPM_VREG_FORCE_MODE_8960_NONE, RPM_VREG_POWER_MODE_8960_PWM, \
David Collins26f05562011-06-20 09:56:28 -0700440 RPM_VREG_STATE_OFF, _sleep_selectable, _always_on, \
441 _supply_regulator, _system_uA)
442
443#define RPM_SMPS(_id, _always_on, _pd, _sleep_selectable, _min_uV, _max_uV, \
David Collins3d2b9452012-03-19 11:00:30 -0700444 _supply_regulator, _system_uA, _freq, _force_mode, \
445 _sleep_set_force_mode) \
David Collins26f05562011-06-20 09:56:28 -0700446 RPM_INIT(_id, _min_uV, _max_uV, REGULATOR_MODE_NORMAL \
447 | REGULATOR_MODE_IDLE, REGULATOR_CHANGE_VOLTAGE \
448 | REGULATOR_CHANGE_STATUS | REGULATOR_CHANGE_MODE \
449 | REGULATOR_CHANGE_DRMS, 0, _max_uV, _system_uA, 0, _pd, \
David Collins6f032ba2011-08-31 14:08:15 -0700450 RPM_VREG_PIN_CTRL_NONE, _freq, RPM_VREG_PIN_FN_8960_NONE, \
David Collins3d2b9452012-03-19 11:00:30 -0700451 RPM_VREG_FORCE_MODE_8960_##_force_mode, \
452 RPM_VREG_FORCE_MODE_8960_##_sleep_set_force_mode, \
453 RPM_VREG_POWER_MODE_8960_PWM, RPM_VREG_STATE_OFF, \
454 _sleep_selectable, _always_on, _supply_regulator, _system_uA)
David Collins26f05562011-06-20 09:56:28 -0700455
456#define RPM_VS(_id, _always_on, _pd, _sleep_selectable, _supply_regulator) \
457 RPM_INIT(_id, 0, 0, 0, REGULATOR_CHANGE_STATUS, 0, 0, 1000, 1000, _pd, \
David Collins6f032ba2011-08-31 14:08:15 -0700458 RPM_VREG_PIN_CTRL_NONE, NONE, RPM_VREG_PIN_FN_8960_NONE, \
David Collins15789042012-03-19 10:44:36 -0700459 RPM_VREG_FORCE_MODE_8960_NONE, \
David Collins6f032ba2011-08-31 14:08:15 -0700460 RPM_VREG_FORCE_MODE_8960_NONE, RPM_VREG_POWER_MODE_8960_PWM, \
David Collins26f05562011-06-20 09:56:28 -0700461 RPM_VREG_STATE_OFF, _sleep_selectable, _always_on, \
462 _supply_regulator, 0)
463
464#define RPM_NCP(_id, _always_on, _sleep_selectable, _min_uV, _max_uV, \
465 _supply_regulator, _freq) \
466 RPM_INIT(_id, _min_uV, _max_uV, 0, REGULATOR_CHANGE_VOLTAGE \
467 | REGULATOR_CHANGE_STATUS, 0, _max_uV, 1000, 1000, 0, \
David Collins6f032ba2011-08-31 14:08:15 -0700468 RPM_VREG_PIN_CTRL_NONE, _freq, RPM_VREG_PIN_FN_8960_NONE, \
David Collins15789042012-03-19 10:44:36 -0700469 RPM_VREG_FORCE_MODE_8960_NONE, \
David Collins6f032ba2011-08-31 14:08:15 -0700470 RPM_VREG_FORCE_MODE_8960_NONE, RPM_VREG_POWER_MODE_8960_PWM, \
David Collins26f05562011-06-20 09:56:28 -0700471 RPM_VREG_STATE_OFF, _sleep_selectable, _always_on, \
472 _supply_regulator, 0)
473
474/* Pin control initialization */
475#define RPM_PC_INIT(_id, _always_on, _pin_fn, _pin_ctrl, _supply_regulator) \
476 { \
477 .init_data = { \
478 .constraints = { \
479 .valid_ops_mask = REGULATOR_CHANGE_STATUS, \
480 .always_on = _always_on, \
481 }, \
482 .num_consumer_supplies = \
483 ARRAY_SIZE(vreg_consumers_##_id##_PC), \
484 .consumer_supplies = vreg_consumers_##_id##_PC, \
485 .supply_regulator = _supply_regulator, \
486 }, \
487 .id = RPM_VREG_ID_PM8921_##_id##_PC, \
David Collins6f032ba2011-08-31 14:08:15 -0700488 .pin_fn = RPM_VREG_PIN_FN_8960_##_pin_fn, \
David Collins26f05562011-06-20 09:56:28 -0700489 .pin_ctrl = _pin_ctrl, \
490 }
491
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700492/* GPIO regulator constraints */
493struct gpio_regulator_platform_data msm_gpio_regulator_pdata[] __devinitdata = {
David Collins35a78f52011-12-14 15:54:25 -0800494 /* ID vreg_name gpio_label gpio supply */
495 GPIO_VREG(EXT_5V, "ext_5v", "ext_5v_en", PM8921_MPP_PM_TO_SYS(7), NULL),
496 GPIO_VREG(EXT_L2, "ext_l2", "ext_l2_en", 91, NULL),
497 GPIO_VREG(EXT_3P3V, "ext_3p3v", "ext_3p3v_en",
498 PM8921_GPIO_PM_TO_SYS(17), NULL),
499 GPIO_VREG(EXT_OTG_SW, "ext_otg_sw", "ext_otg_sw_en",
David Collins96aa3e12012-02-29 10:31:34 -0800500 PM8921_GPIO_PM_TO_SYS(42), "8921_usb_otg"),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700501};
502
503/* SAW regulator constraints */
504struct regulator_init_data msm_saw_regulator_pdata_s5 =
505 /* ID vreg_name min_uV max_uV */
Stephen Boyd9d0fab12011-12-08 10:56:06 -0800506 SAW_VREG_INIT(S5, "8921_s5", 850000, 1300000);
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700507struct regulator_init_data msm_saw_regulator_pdata_s6 =
Stephen Boyd9d0fab12011-12-08 10:56:06 -0800508 SAW_VREG_INIT(S6, "8921_s6", 850000, 1300000);
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700509
510/* PM8921 regulator constraints */
David Collins75016742011-12-02 15:04:25 -0800511struct pm8xxx_regulator_platform_data
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700512msm_pm8921_regulator_pdata[] __devinitdata = {
David Collins26f05562011-06-20 09:56:28 -0700513 /*
David Collins75016742011-12-02 15:04:25 -0800514 * ID name always_on pd min_uV max_uV en_t supply
515 * system_uA reg_ID
David Collins26f05562011-06-20 09:56:28 -0700516 */
Matt Wagantalled36d822012-05-25 18:13:40 -0700517 PM8XXX_NLDO1200(L26, "8921_l26", 0, 1, 375000, 1050000, 200, "8921_s7",
David Collins75016742011-12-02 15:04:25 -0800518 0, 1),
Matt Wagantalled36d822012-05-25 18:13:40 -0700519 PM8XXX_NLDO1200(L27, "8921_l27", 0, 1, 375000, 1050000, 200, "8921_s7",
David Collins75016742011-12-02 15:04:25 -0800520 0, 2),
Matt Wagantalled36d822012-05-25 18:13:40 -0700521 PM8XXX_NLDO1200(L28, "8921_l28", 0, 1, 375000, 1050000, 200, "8921_s7",
David Collins75016742011-12-02 15:04:25 -0800522 0, 3),
523 PM8XXX_LDO(L29, "8921_l29", 0, 1, 2050000, 2100000, 200, "8921_s8",
524 0, 4),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700525
David Collins5aead232012-02-29 10:18:56 -0800526 /* ID name always_on pd en_t supply reg_ID */
David Collins96aa3e12012-02-29 10:31:34 -0800527 PM8XXX_VS300(USB_OTG, "8921_usb_otg", 0, 1, 0, "ext_5v", 5),
David Collins5aead232012-02-29 10:18:56 -0800528 PM8XXX_VS300(HDMI_MVS, "8921_hdmi_mvs", 0, 1, 0, "ext_5v", 6),
David Collins26f05562011-06-20 09:56:28 -0700529};
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700530
David Collins26f05562011-06-20 09:56:28 -0700531static struct rpm_regulator_init_data
532msm_rpm_regulator_init_data[] __devinitdata = {
David Collins3d2b9452012-03-19 11:00:30 -0700533 /* ID a_on pd ss min_uV max_uV supply sys_uA freq fm ss_fm */
534 RPM_SMPS(S1, 1, 1, 0, 1225000, 1225000, NULL, 100000, 3p20, NONE, NONE),
535 RPM_SMPS(S2, 0, 1, 0, 1300000, 1300000, NULL, 0, 1p60, NONE, NONE),
536 RPM_SMPS(S3, 0, 1, 1, 500000, 1150000, NULL, 100000, 4p80, NONE, NONE),
David Collins09c8f732012-03-19 11:05:20 -0700537 RPM_SMPS(S4, 1, 1, 0, 1800000, 1800000, NULL, 100000, 1p60, AUTO, AUTO),
David Collins3d2b9452012-03-19 11:00:30 -0700538 RPM_SMPS(S7, 0, 1, 0, 1150000, 1150000, NULL, 100000, 3p20, NONE, NONE),
David Collins9a81d6c2012-03-29 15:11:33 -0700539 RPM_SMPS(S8, 1, 1, 1, 2050000, 2050000, NULL, 100000, 1p60, NONE, NONE),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700540
David Collins26f05562011-06-20 09:56:28 -0700541 /* ID a_on pd ss min_uV max_uV supply sys_uA init_ip */
542 RPM_LDO(L1, 1, 1, 0, 1050000, 1050000, "8921_s4", 0, 10000),
543 RPM_LDO(L2, 0, 1, 0, 1200000, 1200000, "8921_s4", 0, 0),
544 RPM_LDO(L3, 0, 1, 0, 3075000, 3075000, NULL, 0, 0),
545 RPM_LDO(L4, 1, 1, 0, 1800000, 1800000, NULL, 10000, 10000),
546 RPM_LDO(L5, 0, 1, 0, 2950000, 2950000, NULL, 0, 0),
547 RPM_LDO(L6, 0, 1, 0, 2950000, 2950000, NULL, 0, 0),
548 RPM_LDO(L7, 1, 1, 0, 1850000, 2950000, NULL, 10000, 10000),
549 RPM_LDO(L8, 0, 1, 0, 2800000, 3000000, NULL, 0, 0),
Anirudh Ghayal62cec442012-02-17 13:02:39 -0800550 RPM_LDO(L9, 0, 1, 0, 3000000, 3000000, NULL, 0, 0),
Sameer Thalappil1107a182011-09-07 14:42:31 -0700551 RPM_LDO(L10, 0, 1, 0, 3000000, 3000000, NULL, 0, 0),
David Collins26f05562011-06-20 09:56:28 -0700552 RPM_LDO(L11, 0, 1, 0, 2850000, 2850000, NULL, 0, 0),
553 RPM_LDO(L12, 0, 1, 0, 1200000, 1200000, "8921_s4", 0, 0),
554 RPM_LDO(L14, 0, 1, 0, 1800000, 1800000, NULL, 0, 0),
555 RPM_LDO(L15, 0, 1, 0, 1800000, 2950000, NULL, 0, 0),
556 RPM_LDO(L16, 0, 1, 0, 2800000, 2800000, NULL, 0, 0),
557 RPM_LDO(L17, 0, 1, 0, 1800000, 2950000, NULL, 0, 0),
558 RPM_LDO(L18, 0, 1, 0, 1300000, 1300000, "8921_s4", 0, 0),
559 RPM_LDO(L21, 0, 1, 0, 1900000, 1900000, "8921_s8", 0, 0),
560 RPM_LDO(L22, 0, 1, 0, 2750000, 2750000, NULL, 0, 0),
Matt Wagantallcb12c392011-10-19 10:32:07 -0700561 RPM_LDO(L23, 1, 1, 1, 1800000, 1800000, "8921_s8", 10000, 10000),
David Collins156bca92011-09-07 17:05:21 -0700562 RPM_LDO(L24, 0, 1, 1, 750000, 1150000, "8921_s1", 10000, 10000),
David Collins8f2a1962012-05-18 09:47:59 -0700563 RPM_LDO(L25, 1, 1, 0, 1250000, 1250000, "8921_s1", 10000, 10000),
David Collins26f05562011-06-20 09:56:28 -0700564
565 /* ID a_on pd ss supply */
566 RPM_VS(LVS1, 0, 1, 0, "8921_s4"),
567 RPM_VS(LVS2, 0, 1, 0, "8921_s1"),
568 RPM_VS(LVS3, 0, 1, 0, "8921_s4"),
569 RPM_VS(LVS4, 0, 1, 0, "8921_s4"),
570 RPM_VS(LVS5, 0, 1, 0, "8921_s4"),
571 RPM_VS(LVS6, 0, 1, 0, "8921_s4"),
572 RPM_VS(LVS7, 0, 1, 0, "8921_s4"),
573
574 /* ID a_on ss min_uV max_uV supply freq */
575 RPM_NCP(NCP, 0, 0, 1800000, 1800000, "8921_l6", 1p60),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700576};
577
578int msm_pm8921_regulator_pdata_len __devinitdata =
579 ARRAY_SIZE(msm_pm8921_regulator_pdata);
David Collins26f05562011-06-20 09:56:28 -0700580
Matt Wagantall6115d782012-06-07 20:13:51 -0700581#define RPM_REG_MAP(_id, _sleep_also, _voter, _supply, _dev_name) \
582 { \
583 .vreg_id = RPM_VREG_ID_PM8921_##_id, \
584 .sleep_also = _sleep_also, \
585 .voter = _voter, \
586 .supply = _supply, \
587 .dev_name = _dev_name, \
588 }
589static struct rpm_regulator_consumer_mapping
590 msm_rpm_regulator_consumer_mapping[] __devinitdata = {
591 RPM_REG_MAP(L23, 0, 1, "krait0_l23", "acpuclk-8960"),
592 RPM_REG_MAP(L23, 0, 2, "krait1_l23", "acpuclk-8960"),
593 RPM_REG_MAP(L23, 0, 6, "l2_l23", "acpuclk-8960"),
594 RPM_REG_MAP(L24, 0, 1, "krait0_mem", "acpuclk-8960"),
595 RPM_REG_MAP(L24, 0, 2, "krait1_mem", "acpuclk-8960"),
596 RPM_REG_MAP(S3, 0, 1, "krait0_dig", "acpuclk-8960"),
597 RPM_REG_MAP(S3, 0, 2, "krait1_dig", "acpuclk-8960"),
598 RPM_REG_MAP(S8, 0, 1, "krait0_s8", "acpuclk-8960"),
599 RPM_REG_MAP(S8, 0, 2, "krait1_s8", "acpuclk-8960"),
600 RPM_REG_MAP(S8, 0, 6, "l2_s8", "acpuclk-8960"),
Patrick Daly6578e0c2012-07-19 18:50:02 -0700601
602 RPM_REG_MAP(L23, 0, 1, "krait0_l23", "acpuclk-8960ab"),
603 RPM_REG_MAP(L23, 0, 2, "krait1_l23", "acpuclk-8960ab"),
604 RPM_REG_MAP(L23, 0, 6, "l2_l23", "acpuclk-8960ab"),
605 RPM_REG_MAP(L24, 0, 1, "krait0_mem", "acpuclk-8960ab"),
606 RPM_REG_MAP(L24, 0, 2, "krait1_mem", "acpuclk-8960ab"),
607 RPM_REG_MAP(S3, 0, 1, "krait0_dig", "acpuclk-8960ab"),
608 RPM_REG_MAP(S3, 0, 2, "krait1_dig", "acpuclk-8960ab"),
609 RPM_REG_MAP(S8, 0, 1, "krait0_s8", "acpuclk-8960ab"),
610 RPM_REG_MAP(S8, 0, 2, "krait1_s8", "acpuclk-8960ab"),
611 RPM_REG_MAP(S8, 0, 6, "l2_s8", "acpuclk-8960ab"),
Matt Wagantall6115d782012-06-07 20:13:51 -0700612};
613
David Collins26f05562011-06-20 09:56:28 -0700614struct rpm_regulator_platform_data msm_rpm_regulator_pdata __devinitdata = {
David Collins6f032ba2011-08-31 14:08:15 -0700615 .init_data = msm_rpm_regulator_init_data,
616 .num_regulators = ARRAY_SIZE(msm_rpm_regulator_init_data),
617 .version = RPM_VREG_VERSION_8960,
618 .vreg_id_vdd_mem = RPM_VREG_ID_PM8921_L24,
619 .vreg_id_vdd_dig = RPM_VREG_ID_PM8921_S3,
Matt Wagantall6115d782012-06-07 20:13:51 -0700620 .consumer_map = msm_rpm_regulator_consumer_mapping,
621 .consumer_map_len = ARRAY_SIZE(msm_rpm_regulator_consumer_mapping),
David Collins26f05562011-06-20 09:56:28 -0700622};
David Collinse68647e2012-09-04 15:44:19 -0700623
624/*
625 * Fix up regulator consumer data that moves to a different regulator based on
626 * the current target.
627 */
628void __init configure_msm8960_power_grid(void)
629{
630 static struct rpm_regulator_init_data *rpm_data;
631 int i;
632
Anirudh Ghayalb6060e72013-07-23 15:07:31 +0530633 if (machine_is_msm8960_cdp() || cpu_is_msm8960ab()) {
David Collinse68647e2012-09-04 15:44:19 -0700634 /* Only modify LVS6 consumers for CDP targets. */
635 for (i = 0; i < ARRAY_SIZE(msm_rpm_regulator_init_data); i++) {
636 rpm_data = &msm_rpm_regulator_init_data[i];
Anirudh Ghayalb6060e72013-07-23 15:07:31 +0530637 if (machine_is_msm8960_cdp() &&
638 rpm_data->id == RPM_VREG_ID_PM8921_LVS6) {
David Collinse68647e2012-09-04 15:44:19 -0700639 rpm_data->init_data.consumer_supplies
640 = vreg_consumers_CDP_LVS6;
641 rpm_data->init_data.num_consumer_supplies
642 = ARRAY_SIZE(vreg_consumers_CDP_LVS6);
643 }
Anirudh Ghayalb6060e72013-07-23 15:07:31 +0530644 if (cpu_is_msm8960ab() &&
645 rpm_data->id == RPM_VREG_ID_PM8921_S7) {
646 rpm_data->init_data.constraints.min_uV =
647 1275000;
648 rpm_data->init_data.constraints.max_uV =
649 1275000;
650 rpm_data->init_data.constraints.input_uV =
651 1275000;
652 rpm_data->default_uV = 1275000;
653 }
David Collinse68647e2012-09-04 15:44:19 -0700654 }
655 }
656}