blob: 0d12bb5adeb1dc7bf4d448b0491953afe520a99f [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),
Kevin Chan330e4d52012-02-18 23:11:24 -080030 REGULATOR_SUPPLY("mipi_csi_vdd", "msm_csid.0"),
31 REGULATOR_SUPPLY("mipi_csi_vdd", "msm_csid.1"),
32 REGULATOR_SUPPLY("mipi_csi_vdd", "msm_csid.2"),
Ravishangar Kalyanamc2fee312012-02-09 19:11:22 -080033 REGULATOR_SUPPLY("lvds_pll_vdda", "lvds.0"),
34 REGULATOR_SUPPLY("dsi1_pll_vdda", "mipi_dsi.1"),
Jay Chokshiea67c622011-07-29 17:12:26 -070035};
36VREG_CONSUMERS(L3) = {
37 REGULATOR_SUPPLY("8921_l3", NULL),
Hemant Kumar6ddad592011-08-03 19:31:56 -070038 REGULATOR_SUPPLY("HSUSB_3p3", "msm_otg"),
Manu Gautamdccbca42011-11-08 15:13:38 +053039 REGULATOR_SUPPLY("HSUSB_3p3", "msm_ehci_host.0"),
40 REGULATOR_SUPPLY("HSUSB_3p3", "msm_ehci_host.1"),
Jay Chokshiea67c622011-07-29 17:12:26 -070041};
42VREG_CONSUMERS(L4) = {
43 REGULATOR_SUPPLY("8921_l4", NULL),
Hemant Kumar6ddad592011-08-03 19:31:56 -070044 REGULATOR_SUPPLY("HSUSB_1p8", "msm_otg"),
Subramanian Srinivasan04d2c832012-01-17 11:26:36 -080045 REGULATOR_SUPPLY("iris_vddxo", "wcnss_wlan.0"),
Jay Chokshiea67c622011-07-29 17:12:26 -070046};
47VREG_CONSUMERS(L5) = {
48 REGULATOR_SUPPLY("8921_l5", NULL),
Sahitya Tummalab4d883f2011-08-23 10:44:51 +053049 REGULATOR_SUPPLY("sdc_vdd", "msm_sdcc.1"),
Jay Chokshiea67c622011-07-29 17:12:26 -070050};
51VREG_CONSUMERS(L6) = {
52 REGULATOR_SUPPLY("8921_l6", NULL),
Sahitya Tummalab4d883f2011-08-23 10:44:51 +053053 REGULATOR_SUPPLY("sdc_vdd", "msm_sdcc.3"),
Jay Chokshiea67c622011-07-29 17:12:26 -070054};
55VREG_CONSUMERS(L7) = {
56 REGULATOR_SUPPLY("8921_l7", NULL),
Sahitya Tummalab4d883f2011-08-23 10:44:51 +053057 REGULATOR_SUPPLY("sdc_vddp", "msm_sdcc.3"),
Jay Chokshiea67c622011-07-29 17:12:26 -070058};
59VREG_CONSUMERS(L8) = {
60 REGULATOR_SUPPLY("8921_l8", NULL),
Jeyaprakash Soundrapandianf0d4d012012-01-16 15:12:20 -080061 REGULATOR_SUPPLY("cam_vana", "4-001a"),
62 REGULATOR_SUPPLY("cam_vana", "4-006c"),
Jay Chokshiea67c622011-07-29 17:12:26 -070063};
64VREG_CONSUMERS(L9) = {
65 REGULATOR_SUPPLY("8921_l9", NULL),
Anirudh Ghayal2917a5a2012-02-05 19:51:07 -080066 REGULATOR_SUPPLY("vdd", "3-0024"),
Jay Chokshiea67c622011-07-29 17:12:26 -070067};
68VREG_CONSUMERS(L10) = {
69 REGULATOR_SUPPLY("8921_l10", NULL),
Subramanian Srinivasan04d2c832012-01-17 11:26:36 -080070 REGULATOR_SUPPLY("iris_vddpa", "wcnss_wlan.0"),
Jay Chokshiea67c622011-07-29 17:12:26 -070071};
72VREG_CONSUMERS(L11) = {
73 REGULATOR_SUPPLY("8921_l11", NULL),
Ravishangar Kalyanamc2fee312012-02-09 19:11:22 -080074 REGULATOR_SUPPLY("dsi1_avdd", "mipi_dsi.1"),
Jay Chokshiea67c622011-07-29 17:12:26 -070075};
76VREG_CONSUMERS(L12) = {
Jeyaprakash Soundrapandianf0d4d012012-01-16 15:12:20 -080077 REGULATOR_SUPPLY("cam_vdig", "4-001a"),
78 REGULATOR_SUPPLY("cam_vdig", "4-006c"),
Jay Chokshiea67c622011-07-29 17:12:26 -070079 REGULATOR_SUPPLY("8921_l12", NULL),
80};
81VREG_CONSUMERS(L14) = {
82 REGULATOR_SUPPLY("8921_l14", NULL),
83};
84VREG_CONSUMERS(L15) = {
85 REGULATOR_SUPPLY("8921_l15", NULL),
86};
87VREG_CONSUMERS(L16) = {
88 REGULATOR_SUPPLY("8921_l16", NULL),
Jeyaprakash Soundrapandianf0d4d012012-01-16 15:12:20 -080089 REGULATOR_SUPPLY("cam_vaf", "4-001a"),
90 REGULATOR_SUPPLY("cam_vaf", "4-006c"),
Jay Chokshiea67c622011-07-29 17:12:26 -070091};
92VREG_CONSUMERS(L17) = {
93 REGULATOR_SUPPLY("8921_l17", NULL),
94};
95VREG_CONSUMERS(L18) = {
96 REGULATOR_SUPPLY("8921_l18", NULL),
97};
98VREG_CONSUMERS(L22) = {
99 REGULATOR_SUPPLY("8921_l22", NULL),
100};
101VREG_CONSUMERS(L23) = {
102 REGULATOR_SUPPLY("8921_l23", NULL),
Swaminathan Sathappan2316e082012-02-03 14:07:17 -0800103 REGULATOR_SUPPLY("pll_vdd", "pil_qdsp6v4.1"),
104 REGULATOR_SUPPLY("pll_vdd", "pil_qdsp6v4.2"),
Manu Gautam91223e02011-11-08 15:27:22 +0530105 REGULATOR_SUPPLY("HSUSB_1p8", "msm_ehci_host.0"),
106 REGULATOR_SUPPLY("HSUSB_1p8", "msm_ehci_host.1"),
Jay Chokshiea67c622011-07-29 17:12:26 -0700107};
108VREG_CONSUMERS(L24) = {
109 REGULATOR_SUPPLY("8921_l24", NULL),
Subramanian Srinivasan04d2c832012-01-17 11:26:36 -0800110 REGULATOR_SUPPLY("riva_vddmx", "wcnss_wlan.0"),
Jay Chokshiea67c622011-07-29 17:12:26 -0700111};
112VREG_CONSUMERS(L25) = {
113 REGULATOR_SUPPLY("8921_l25", NULL),
Swaminathan Sathappan2f51a752011-12-05 12:51:19 -0800114 REGULATOR_SUPPLY("VDDD_CDC_D", "tabla-slim"),
115 REGULATOR_SUPPLY("CDC_VDDA_A_1P2V", "tabla-slim"),
Swaminathan Sathappan2316e082012-02-03 14:07:17 -0800116 REGULATOR_SUPPLY("VDDD_CDC_D", "tabla2x-slim"),
117 REGULATOR_SUPPLY("CDC_VDDA_A_1P2V", "tabla2x-slim"),
Jay Chokshiea67c622011-07-29 17:12:26 -0700118};
119VREG_CONSUMERS(L26) = {
120 REGULATOR_SUPPLY("8921_l26", NULL),
Matt Wagantallb94b9a52012-02-02 21:59:54 -0800121 REGULATOR_SUPPLY("core_vdd", "pil_qdsp6v4.0"),
Jay Chokshiea67c622011-07-29 17:12:26 -0700122};
123VREG_CONSUMERS(L27) = {
124 REGULATOR_SUPPLY("8921_l27", NULL),
Swaminathan Sathappan2316e082012-02-03 14:07:17 -0800125 REGULATOR_SUPPLY("core_vdd", "pil_qdsp6v4.2"),
Jay Chokshiea67c622011-07-29 17:12:26 -0700126};
127VREG_CONSUMERS(L28) = {
128 REGULATOR_SUPPLY("8921_l28", NULL),
Swaminathan Sathappan2316e082012-02-03 14:07:17 -0800129 REGULATOR_SUPPLY("core_vdd", "pil_qdsp6v4.1"),
Jay Chokshiea67c622011-07-29 17:12:26 -0700130};
131VREG_CONSUMERS(S1) = {
132 REGULATOR_SUPPLY("8921_s1", NULL),
133};
134VREG_CONSUMERS(S2) = {
135 REGULATOR_SUPPLY("8921_s2", NULL),
Subramanian Srinivasan04d2c832012-01-17 11:26:36 -0800136 REGULATOR_SUPPLY("iris_vddrfa", "wcnss_wlan.0"),
Jay Chokshiea67c622011-07-29 17:12:26 -0700137};
138VREG_CONSUMERS(S3) = {
139 REGULATOR_SUPPLY("8921_s3", NULL),
Hemant Kumar6ddad592011-08-03 19:31:56 -0700140 REGULATOR_SUPPLY("HSUSB_VDDCX", "msm_otg"),
Manu Gautamdccbca42011-11-08 15:13:38 +0530141 REGULATOR_SUPPLY("HSUSB_VDDCX", "msm_ehci_host.0"),
142 REGULATOR_SUPPLY("HSUSB_VDDCX", "msm_ehci_host.1"),
Hemant Kumara945b472012-01-25 15:08:06 -0800143 REGULATOR_SUPPLY("HSIC_VDDCX", "msm_hsic_host"),
Subramanian Srinivasan04d2c832012-01-17 11:26:36 -0800144 REGULATOR_SUPPLY("riva_vddcx", "wcnss_wlan.0"),
Jay Chokshiea67c622011-07-29 17:12:26 -0700145};
146VREG_CONSUMERS(S4) = {
147 REGULATOR_SUPPLY("8921_s4", NULL),
Sahitya Tummalab4d883f2011-08-23 10:44:51 +0530148 REGULATOR_SUPPLY("sdc_vccq", "msm_sdcc.1"),
Swaminathan Sathappan2f51a752011-12-05 12:51:19 -0800149 REGULATOR_SUPPLY("VDDIO_CDC", "tabla-slim"),
150 REGULATOR_SUPPLY("CDC_VDD_CP", "tabla-slim"),
151 REGULATOR_SUPPLY("CDC_VDDA_TX", "tabla-slim"),
152 REGULATOR_SUPPLY("CDC_VDDA_RX", "tabla-slim"),
Swaminathan Sathappan2316e082012-02-03 14:07:17 -0800153 REGULATOR_SUPPLY("VDDIO_CDC", "tabla2x-slim"),
154 REGULATOR_SUPPLY("CDC_VDD_CP", "tabla2x-slim"),
155 REGULATOR_SUPPLY("CDC_VDDA_TX", "tabla2x-slim"),
156 REGULATOR_SUPPLY("CDC_VDDA_RX", "tabla2x-slim"),
Subramanian Srinivasan04d2c832012-01-17 11:26:36 -0800157 REGULATOR_SUPPLY("riva_vddpx", "wcnss_wlan.0"),
Jing Lin21ed4de2012-02-05 15:53:28 -0800158 REGULATOR_SUPPLY("vcc_i2c", "3-005b"),
Anirudh Ghayal2917a5a2012-02-05 19:51:07 -0800159 REGULATOR_SUPPLY("vcc_i2c", "3-0024"),
Amy Maloche70090f992012-02-16 16:35:26 -0800160 REGULATOR_SUPPLY("vddp", "0-0048"),
Jay Chokshiea67c622011-07-29 17:12:26 -0700161};
162VREG_CONSUMERS(S5) = {
163 REGULATOR_SUPPLY("8921_s5", NULL),
Vikram Mulukutlabc2e9572011-11-04 03:41:38 -0700164 REGULATOR_SUPPLY("krait0", NULL),
Jay Chokshiea67c622011-07-29 17:12:26 -0700165};
166VREG_CONSUMERS(S6) = {
167 REGULATOR_SUPPLY("8921_s6", NULL),
Vikram Mulukutlabc2e9572011-11-04 03:41:38 -0700168 REGULATOR_SUPPLY("krait1", NULL),
Jay Chokshiea67c622011-07-29 17:12:26 -0700169};
170VREG_CONSUMERS(S7) = {
171 REGULATOR_SUPPLY("8921_s7", NULL),
172};
173VREG_CONSUMERS(LVS1) = {
174 REGULATOR_SUPPLY("8921_lvs1", NULL),
Subramanian Srinivasan04d2c832012-01-17 11:26:36 -0800175 REGULATOR_SUPPLY("iris_vddio", "wcnss_wlan.0"),
Jay Chokshiea67c622011-07-29 17:12:26 -0700176};
177VREG_CONSUMERS(LVS2) = {
178 REGULATOR_SUPPLY("8921_lvs2", NULL),
Subramanian Srinivasan04d2c832012-01-17 11:26:36 -0800179 REGULATOR_SUPPLY("iris_vdddig", "wcnss_wlan.0"),
Jay Chokshiea67c622011-07-29 17:12:26 -0700180};
181VREG_CONSUMERS(LVS3) = {
182 REGULATOR_SUPPLY("8921_lvs3", NULL),
183};
184VREG_CONSUMERS(LVS4) = {
185 REGULATOR_SUPPLY("8921_lvs4", NULL),
186};
187VREG_CONSUMERS(LVS5) = {
188 REGULATOR_SUPPLY("8921_lvs5", NULL),
Jeyaprakash Soundrapandianf0d4d012012-01-16 15:12:20 -0800189 REGULATOR_SUPPLY("cam_vio", "4-001a"),
190 REGULATOR_SUPPLY("cam_vio", "4-006c"),
Jay Chokshiea67c622011-07-29 17:12:26 -0700191};
192VREG_CONSUMERS(LVS6) = {
193 REGULATOR_SUPPLY("8921_lvs6", NULL),
194};
195VREG_CONSUMERS(LVS7) = {
196 REGULATOR_SUPPLY("8921_lvs7", NULL),
Matt Wagantall52dd0622012-02-02 18:26:16 -0800197 REGULATOR_SUPPLY("pll_vdd", "pil_riva"),
Ravishangar Kalyanamc2fee312012-02-09 19:11:22 -0800198 REGULATOR_SUPPLY("lvds_vdda", "lvds.0"),
199 REGULATOR_SUPPLY("dsi1_vddio", "mipi_dsi.1"),
Jay Chokshiea67c622011-07-29 17:12:26 -0700200};
201VREG_CONSUMERS(USB_OTG) = {
202 REGULATOR_SUPPLY("8921_usb_otg", NULL),
Hemant Kumard86c4882012-01-24 19:39:37 -0800203 REGULATOR_SUPPLY("vbus_otg", "msm_otg"),
Jay Chokshiea67c622011-07-29 17:12:26 -0700204};
205VREG_CONSUMERS(HDMI_MVS) = {
206 REGULATOR_SUPPLY("8921_hdmi_mvs", NULL),
207};
208VREG_CONSUMERS(NCP) = {
209 REGULATOR_SUPPLY("8921_ncp", NULL),
210};
Jay Chokshi7805b5a2011-11-07 15:55:30 -0800211VREG_CONSUMERS(8821_S0) = {
212 REGULATOR_SUPPLY("8821_s0", NULL),
Vikram Mulukutlabc2e9572011-11-04 03:41:38 -0700213 REGULATOR_SUPPLY("krait2", NULL),
Jay Chokshi7805b5a2011-11-07 15:55:30 -0800214};
215VREG_CONSUMERS(8821_S1) = {
216 REGULATOR_SUPPLY("8821_s1", NULL),
Vikram Mulukutlabc2e9572011-11-04 03:41:38 -0700217 REGULATOR_SUPPLY("krait3", NULL),
Jay Chokshi7805b5a2011-11-07 15:55:30 -0800218};
David Collinsf0d00732012-01-25 15:46:50 -0800219VREG_CONSUMERS(EXT_5V) = {
220 REGULATOR_SUPPLY("ext_5v", NULL),
Manu Gautam91223e02011-11-08 15:27:22 +0530221 REGULATOR_SUPPLY("vbus", "msm_ehci_host.0"),
David Collinsf0d00732012-01-25 15:46:50 -0800222};
Jay Chokshi1de4f9d2012-02-07 16:11:31 -0800223VREG_CONSUMERS(EXT_MPP8) = {
224 REGULATOR_SUPPLY("ext_mpp8", NULL),
225};
David Collinsf0d00732012-01-25 15:46:50 -0800226VREG_CONSUMERS(EXT_3P3V) = {
227 REGULATOR_SUPPLY("ext_3p3v", NULL),
Stepan Moskovchenkoc71c9792012-01-31 18:12:44 -0800228 REGULATOR_SUPPLY("vdd_io", "spi0.2"),
Hemant Kumar94e7da22012-02-03 16:52:29 -0800229 REGULATOR_SUPPLY("mhl_ext_3p3v", "msm_otg"),
Ravishangar Kalyanamc2fee312012-02-09 19:11:22 -0800230 REGULATOR_SUPPLY("lvds_vccs_3p3v", "lvds.0"),
231 REGULATOR_SUPPLY("dsi1_vccs_3p3v", "mipi_dsi.1"),
David Collinsf0d00732012-01-25 15:46:50 -0800232};
David Collins390fc332012-02-07 14:38:16 -0800233VREG_CONSUMERS(EXT_TS_SW) = {
234 REGULATOR_SUPPLY("ext_ts_sw", NULL),
Jing Lin21ed4de2012-02-05 15:53:28 -0800235 REGULATOR_SUPPLY("vdd_ana", "3-005b"),
David Collins390fc332012-02-07 14:38:16 -0800236};
Jay Chokshiea67c622011-07-29 17:12:26 -0700237
David Collins75016742011-12-02 15:04:25 -0800238#define PM8XXX_VREG_INIT(_id, _name, _min_uV, _max_uV, _modes, _ops, \
239 _apply_uV, _pull_down, _always_on, _supply_regulator, \
240 _system_uA, _enable_time, _reg_id) \
Jay Chokshiea67c622011-07-29 17:12:26 -0700241 { \
242 .init_data = { \
243 .constraints = { \
244 .valid_modes_mask = _modes, \
245 .valid_ops_mask = _ops, \
246 .min_uV = _min_uV, \
247 .max_uV = _max_uV, \
248 .input_uV = _max_uV, \
249 .apply_uV = _apply_uV, \
250 .always_on = _always_on, \
David Collins75016742011-12-02 15:04:25 -0800251 .name = _name, \
Jay Chokshiea67c622011-07-29 17:12:26 -0700252 }, \
253 .num_consumer_supplies = \
254 ARRAY_SIZE(vreg_consumers_##_id), \
255 .consumer_supplies = vreg_consumers_##_id, \
256 .supply_regulator = _supply_regulator, \
257 }, \
David Collins75016742011-12-02 15:04:25 -0800258 .id = _reg_id, \
Jay Chokshiea67c622011-07-29 17:12:26 -0700259 .pull_down_enable = _pull_down, \
260 .system_uA = _system_uA, \
261 .enable_time = _enable_time, \
262 }
263
David Collins75016742011-12-02 15:04:25 -0800264#define PM8XXX_LDO(_id, _name, _always_on, _pull_down, _min_uV, _max_uV, \
265 _enable_time, _supply_regulator, _system_uA, _reg_id) \
266 PM8XXX_VREG_INIT(_id, _name, _min_uV, _max_uV, REGULATOR_MODE_NORMAL \
Jay Chokshiea67c622011-07-29 17:12:26 -0700267 | REGULATOR_MODE_IDLE, REGULATOR_CHANGE_VOLTAGE | \
268 REGULATOR_CHANGE_STATUS | REGULATOR_CHANGE_MODE | \
269 REGULATOR_CHANGE_DRMS, 0, _pull_down, _always_on, \
David Collins75016742011-12-02 15:04:25 -0800270 _supply_regulator, _system_uA, _enable_time, _reg_id)
Jay Chokshiea67c622011-07-29 17:12:26 -0700271
David Collins75016742011-12-02 15:04:25 -0800272#define PM8XXX_NLDO1200(_id, _name, _always_on, _pull_down, _min_uV, \
273 _max_uV, _enable_time, _supply_regulator, _system_uA, _reg_id) \
274 PM8XXX_VREG_INIT(_id, _name, _min_uV, _max_uV, REGULATOR_MODE_NORMAL \
Jay Chokshiea67c622011-07-29 17:12:26 -0700275 | REGULATOR_MODE_IDLE, REGULATOR_CHANGE_VOLTAGE | \
276 REGULATOR_CHANGE_STATUS | REGULATOR_CHANGE_MODE | \
277 REGULATOR_CHANGE_DRMS, 0, _pull_down, _always_on, \
David Collins75016742011-12-02 15:04:25 -0800278 _supply_regulator, _system_uA, _enable_time, _reg_id)
Jay Chokshiea67c622011-07-29 17:12:26 -0700279
David Collins75016742011-12-02 15:04:25 -0800280#define PM8XXX_SMPS(_id, _name, _always_on, _pull_down, _min_uV, _max_uV, \
281 _enable_time, _supply_regulator, _system_uA, _reg_id) \
282 PM8XXX_VREG_INIT(_id, _name, _min_uV, _max_uV, REGULATOR_MODE_NORMAL \
Jay Chokshiea67c622011-07-29 17:12:26 -0700283 | REGULATOR_MODE_IDLE, REGULATOR_CHANGE_VOLTAGE | \
284 REGULATOR_CHANGE_STATUS | REGULATOR_CHANGE_MODE | \
285 REGULATOR_CHANGE_DRMS, 0, _pull_down, _always_on, \
David Collins75016742011-12-02 15:04:25 -0800286 _supply_regulator, _system_uA, _enable_time, _reg_id)
Jay Chokshiea67c622011-07-29 17:12:26 -0700287
David Collins75016742011-12-02 15:04:25 -0800288#define PM8XXX_FTSMPS(_id, _name, _always_on, _pull_down, _min_uV, _max_uV, \
289 _enable_time, _supply_regulator, _system_uA, _reg_id) \
290 PM8XXX_VREG_INIT(_id, _name, _min_uV, _max_uV, REGULATOR_MODE_NORMAL, \
Jay Chokshiea67c622011-07-29 17:12:26 -0700291 REGULATOR_CHANGE_VOLTAGE | REGULATOR_CHANGE_STATUS \
292 | REGULATOR_CHANGE_MODE, 0, _pull_down, _always_on, \
David Collins75016742011-12-02 15:04:25 -0800293 _supply_regulator, _system_uA, _enable_time, _reg_id)
Jay Chokshiea67c622011-07-29 17:12:26 -0700294
David Collins75016742011-12-02 15:04:25 -0800295#define PM8XXX_VS(_id, _name, _always_on, _pull_down, _enable_time, \
296 _supply_regulator, _reg_id) \
297 PM8XXX_VREG_INIT(_id, _name, 0, 0, 0, REGULATOR_CHANGE_STATUS, 0, \
298 _pull_down, _always_on, _supply_regulator, 0, _enable_time, \
299 _reg_id)
Jay Chokshiea67c622011-07-29 17:12:26 -0700300
David Collins75016742011-12-02 15:04:25 -0800301#define PM8XXX_VS300(_id, _name, _always_on, _pull_down, _enable_time, \
302 _supply_regulator, _reg_id) \
303 PM8XXX_VREG_INIT(_id, _name, 0, 0, 0, REGULATOR_CHANGE_STATUS, 0, \
304 _pull_down, _always_on, _supply_regulator, 0, _enable_time, \
305 _reg_id)
Jay Chokshiea67c622011-07-29 17:12:26 -0700306
David Collins75016742011-12-02 15:04:25 -0800307#define PM8XXX_NCP(_id, _name, _always_on, _min_uV, _max_uV, _enable_time, \
308 _supply_regulator, _reg_id) \
309 PM8XXX_VREG_INIT(_id, _name, _min_uV, _max_uV, 0, \
310 REGULATOR_CHANGE_VOLTAGE | REGULATOR_CHANGE_STATUS, 0, 0, \
311 _always_on, _supply_regulator, 0, _enable_time, _reg_id)
Jay Chokshiea67c622011-07-29 17:12:26 -0700312
313/* Pin control initialization */
David Collins75016742011-12-02 15:04:25 -0800314#define PM8XXX_PC(_id, _name, _always_on, _pin_fn, _pin_ctrl, \
315 _supply_regulator, _reg_id) \
Jay Chokshiea67c622011-07-29 17:12:26 -0700316 { \
317 .init_data = { \
318 .constraints = { \
319 .valid_ops_mask = REGULATOR_CHANGE_STATUS, \
320 .always_on = _always_on, \
David Collins75016742011-12-02 15:04:25 -0800321 .name = _name, \
Jay Chokshiea67c622011-07-29 17:12:26 -0700322 }, \
323 .num_consumer_supplies = \
324 ARRAY_SIZE(vreg_consumers_##_id##_PC), \
325 .consumer_supplies = vreg_consumers_##_id##_PC, \
326 .supply_regulator = _supply_regulator, \
327 }, \
David Collins75016742011-12-02 15:04:25 -0800328 .id = _reg_id, \
329 .pin_fn = PM8XXX_VREG_PIN_FN_##_pin_fn, \
330 .pin_ctrl = _pin_ctrl, \
Jay Chokshiea67c622011-07-29 17:12:26 -0700331 }
332
David Collinsf0d00732012-01-25 15:46:50 -0800333#define GPIO_VREG(_id, _reg_name, _gpio_label, _gpio, _supply_regulator) \
334 [GPIO_VREG_ID_##_id] = { \
335 .init_data = { \
336 .constraints = { \
337 .valid_ops_mask = REGULATOR_CHANGE_STATUS, \
338 }, \
339 .num_consumer_supplies = \
340 ARRAY_SIZE(vreg_consumers_##_id), \
341 .consumer_supplies = vreg_consumers_##_id, \
342 .supply_regulator = _supply_regulator, \
343 }, \
344 .regulator_name = _reg_name, \
345 .gpio_label = _gpio_label, \
346 .gpio = _gpio, \
347 }
348
Jay Chokshiea67c622011-07-29 17:12:26 -0700349#define SAW_VREG_INIT(_id, _name, _min_uV, _max_uV) \
350 { \
351 .constraints = { \
352 .name = _name, \
353 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE, \
354 .min_uV = _min_uV, \
355 .max_uV = _max_uV, \
356 }, \
357 .num_consumer_supplies = ARRAY_SIZE(vreg_consumers_##_id), \
358 .consumer_supplies = vreg_consumers_##_id, \
359 }
360
David Collins2782b5c2012-02-06 10:02:42 -0800361#define RPM_INIT(_id, _min_uV, _max_uV, _modes, _ops, _apply_uV, _default_uV, \
362 _peak_uA, _avg_uA, _pull_down, _pin_ctrl, _freq, _pin_fn, \
363 _force_mode, _power_mode, _state, _sleep_selectable, \
364 _always_on, _supply_regulator, _system_uA) \
365 { \
366 .init_data = { \
367 .constraints = { \
368 .valid_modes_mask = _modes, \
369 .valid_ops_mask = _ops, \
370 .min_uV = _min_uV, \
371 .max_uV = _max_uV, \
372 .input_uV = _min_uV, \
373 .apply_uV = _apply_uV, \
374 .always_on = _always_on, \
375 }, \
376 .num_consumer_supplies = \
377 ARRAY_SIZE(vreg_consumers_##_id), \
378 .consumer_supplies = vreg_consumers_##_id, \
379 .supply_regulator = _supply_regulator, \
380 }, \
381 .id = RPM_VREG_ID_PM8921_##_id, \
382 .default_uV = _default_uV, \
383 .peak_uA = _peak_uA, \
384 .avg_uA = _avg_uA, \
385 .pull_down_enable = _pull_down, \
386 .pin_ctrl = _pin_ctrl, \
387 .freq = RPM_VREG_FREQ_##_freq, \
388 .pin_fn = _pin_fn, \
389 .force_mode = _force_mode, \
390 .power_mode = _power_mode, \
391 .state = _state, \
392 .sleep_selectable = _sleep_selectable, \
393 .system_uA = _system_uA, \
394 }
395
396#define RPM_LDO(_id, _always_on, _pd, _sleep_selectable, _min_uV, _max_uV, \
397 _supply_regulator, _system_uA, _init_peak_uA) \
398 RPM_INIT(_id, _min_uV, _max_uV, REGULATOR_MODE_NORMAL \
399 | REGULATOR_MODE_IDLE, REGULATOR_CHANGE_VOLTAGE \
400 | REGULATOR_CHANGE_STATUS | REGULATOR_CHANGE_MODE \
401 | REGULATOR_CHANGE_DRMS, 0, _max_uV, _init_peak_uA, 0, _pd, \
402 RPM_VREG_PIN_CTRL_NONE, NONE, RPM_VREG_PIN_FN_8960_NONE, \
403 RPM_VREG_FORCE_MODE_8960_NONE, RPM_VREG_POWER_MODE_8960_PWM, \
404 RPM_VREG_STATE_OFF, _sleep_selectable, _always_on, \
405 _supply_regulator, _system_uA)
406
407#define RPM_SMPS(_id, _always_on, _pd, _sleep_selectable, _min_uV, _max_uV, \
408 _supply_regulator, _system_uA, _freq) \
409 RPM_INIT(_id, _min_uV, _max_uV, REGULATOR_MODE_NORMAL \
410 | REGULATOR_MODE_IDLE, REGULATOR_CHANGE_VOLTAGE \
411 | REGULATOR_CHANGE_STATUS | REGULATOR_CHANGE_MODE \
412 | REGULATOR_CHANGE_DRMS, 0, _max_uV, _system_uA, 0, _pd, \
413 RPM_VREG_PIN_CTRL_NONE, _freq, RPM_VREG_PIN_FN_8960_NONE, \
414 RPM_VREG_FORCE_MODE_8960_NONE, RPM_VREG_POWER_MODE_8960_PWM, \
415 RPM_VREG_STATE_OFF, _sleep_selectable, _always_on, \
416 _supply_regulator, _system_uA)
417
418#define RPM_VS(_id, _always_on, _pd, _sleep_selectable, _supply_regulator) \
419 RPM_INIT(_id, 0, 0, 0, REGULATOR_CHANGE_STATUS, 0, 0, 1000, 1000, _pd, \
420 RPM_VREG_PIN_CTRL_NONE, NONE, 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#define RPM_NCP(_id, _always_on, _sleep_selectable, _min_uV, _max_uV, \
426 _supply_regulator, _freq) \
427 RPM_INIT(_id, _min_uV, _max_uV, 0, REGULATOR_CHANGE_VOLTAGE \
428 | REGULATOR_CHANGE_STATUS, 0, _max_uV, 1000, 1000, 0, \
429 RPM_VREG_PIN_CTRL_NONE, _freq, RPM_VREG_PIN_FN_8960_NONE, \
430 RPM_VREG_FORCE_MODE_8960_NONE, RPM_VREG_POWER_MODE_8960_PWM, \
431 RPM_VREG_STATE_OFF, _sleep_selectable, _always_on, \
432 _supply_regulator, 0)
433
434/* Pin control initialization */
435#define RPM_PC_INIT(_id, _always_on, _pin_fn, _pin_ctrl, _supply_regulator) \
436 { \
437 .init_data = { \
438 .constraints = { \
439 .valid_ops_mask = REGULATOR_CHANGE_STATUS, \
440 .always_on = _always_on, \
441 }, \
442 .num_consumer_supplies = \
443 ARRAY_SIZE(vreg_consumers_##_id##_PC), \
444 .consumer_supplies = vreg_consumers_##_id##_PC, \
445 .supply_regulator = _supply_regulator, \
446 }, \
447 .id = RPM_VREG_ID_PM8921_##_id##_PC, \
448 .pin_fn = RPM_VREG_PIN_FN_8960_##_pin_fn, \
449 .pin_ctrl = _pin_ctrl, \
450 }
451
David Collinsf0d00732012-01-25 15:46:50 -0800452/* GPIO regulator constraints */
453struct gpio_regulator_platform_data
454apq8064_gpio_regulator_pdata[] __devinitdata = {
455 /* ID vreg_name gpio_label gpio supply */
456 GPIO_VREG(EXT_5V, "ext_5v", "ext_5v_en", PM8921_MPP_PM_TO_SYS(7), NULL),
457 GPIO_VREG(EXT_3P3V, "ext_3p3v", "ext_3p3v_en",
458 APQ8064_EXT_3P3V_REG_EN_GPIO, NULL),
David Collins390fc332012-02-07 14:38:16 -0800459 GPIO_VREG(EXT_TS_SW, "ext_ts_sw", "ext_ts_sw_en",
460 PM8921_GPIO_PM_TO_SYS(23), "ext_3p3v"),
Jay Chokshi1de4f9d2012-02-07 16:11:31 -0800461 GPIO_VREG(EXT_MPP8, "ext_mpp8", "ext_mpp8_en",
462 PM8921_MPP_PM_TO_SYS(8), NULL),
David Collinsf0d00732012-01-25 15:46:50 -0800463};
464
Jay Chokshiea67c622011-07-29 17:12:26 -0700465/* SAW regulator constraints */
Jay Chokshi7805b5a2011-11-07 15:55:30 -0800466struct regulator_init_data msm8064_saw_regulator_pdata_8921_s5 =
Jay Chokshiea67c622011-07-29 17:12:26 -0700467 /* ID vreg_name min_uV max_uV */
Jay Chokshi7805b5a2011-11-07 15:55:30 -0800468 SAW_VREG_INIT(S5, "8921_s5", 950000, 1150000);
469struct regulator_init_data msm8064_saw_regulator_pdata_8921_s6 =
470 SAW_VREG_INIT(S6, "8921_s6", 950000, 1150000);
471
472struct regulator_init_data msm8064_saw_regulator_pdata_8821_s0 =
473 /* ID vreg_name min_uV max_uV */
474 SAW_VREG_INIT(8821_S0, "8821_s0", 950000, 1150000);
475struct regulator_init_data msm8064_saw_regulator_pdata_8821_s1 =
476 SAW_VREG_INIT(8821_S1, "8821_s1", 950000, 1150000);
Jay Chokshiea67c622011-07-29 17:12:26 -0700477
478/* PM8921 regulator constraints */
David Collins75016742011-12-02 15:04:25 -0800479struct pm8xxx_regulator_platform_data
Jay Chokshiea67c622011-07-29 17:12:26 -0700480msm8064_pm8921_regulator_pdata[] __devinitdata = {
David Collins75016742011-12-02 15:04:25 -0800481 /*
David Collins2782b5c2012-02-06 10:02:42 -0800482 * ID name always_on pd min_uV max_uV en_t supply
David Collins75016742011-12-02 15:04:25 -0800483 * system_uA reg_ID
484 */
David Collins75016742011-12-02 15:04:25 -0800485 PM8XXX_NLDO1200(L26, "8921_l26", 0, 1, 1050000, 1050000, 200, "8921_s7",
David Collins2782b5c2012-02-06 10:02:42 -0800486 0, 1),
Jay Chokshiea67c622011-07-29 17:12:26 -0700487
David Collins2782b5c2012-02-06 10:02:42 -0800488 /* ID name always_on pd en_t supply reg_ID */
489 PM8XXX_VS300(USB_OTG, "8921_usb_otg", 0, 0, 0, "ext_5v", 2),
490 PM8XXX_VS300(HDMI_MVS, "8921_hdmi_mvs", 0, 1, 0, "ext_5v", 3),
491};
Jay Chokshiea67c622011-07-29 17:12:26 -0700492
David Collins2782b5c2012-02-06 10:02:42 -0800493static struct rpm_regulator_init_data
494apq8064_rpm_regulator_init_data[] __devinitdata = {
495 /* ID a_on pd ss min_uV max_uV supply sys_uA freq */
496 RPM_SMPS(S1, 1, 1, 0, 1225000, 1225000, NULL, 100000, 3p20),
497 RPM_SMPS(S2, 0, 1, 0, 1300000, 1300000, NULL, 0, 1p60),
498 RPM_SMPS(S3, 0, 1, 1, 500000, 1150000, NULL, 100000, 4p80),
499 RPM_SMPS(S4, 1, 1, 0, 1800000, 1800000, NULL, 100000, 1p60),
500 RPM_SMPS(S7, 0, 1, 0, 1300000, 1300000, NULL, 100000, 3p20),
Jay Chokshiea67c622011-07-29 17:12:26 -0700501
David Collins2782b5c2012-02-06 10:02:42 -0800502 /* ID a_on pd ss min_uV max_uV supply sys_uA init_ip */
503 RPM_LDO(L1, 1, 1, 0, 1100000, 1100000, "8921_s4", 0, 10000),
504 RPM_LDO(L2, 0, 1, 0, 1200000, 1200000, "8921_s4", 0, 0),
505 RPM_LDO(L3, 0, 1, 0, 3075000, 3075000, NULL, 0, 0),
506 RPM_LDO(L4, 1, 1, 0, 1800000, 1800000, NULL, 10000, 10000),
507 RPM_LDO(L5, 0, 1, 0, 2950000, 2950000, NULL, 0, 0),
508 RPM_LDO(L6, 0, 1, 0, 2950000, 2950000, NULL, 0, 0),
509 RPM_LDO(L7, 0, 1, 0, 1850000, 2950000, NULL, 0, 0),
510 RPM_LDO(L8, 0, 1, 0, 2800000, 2800000, NULL, 0, 0),
Anirudh Ghayal62cec442012-02-17 13:02:39 -0800511 RPM_LDO(L9, 0, 1, 0, 3000000, 3000000, NULL, 0, 0),
David Collins2782b5c2012-02-06 10:02:42 -0800512 RPM_LDO(L10, 0, 1, 0, 2900000, 2900000, NULL, 0, 0),
513 RPM_LDO(L11, 0, 1, 0, 3000000, 3000000, NULL, 0, 0),
514 RPM_LDO(L12, 0, 1, 0, 1200000, 1200000, "8921_s4", 0, 0),
515 RPM_LDO(L14, 0, 1, 0, 1800000, 1800000, NULL, 0, 0),
516 RPM_LDO(L15, 0, 1, 0, 1800000, 2950000, NULL, 0, 0),
517 RPM_LDO(L16, 0, 1, 0, 2800000, 2800000, NULL, 0, 0),
518 RPM_LDO(L17, 0, 1, 0, 2000000, 2000000, NULL, 0, 0),
519 RPM_LDO(L18, 0, 1, 0, 1300000, 1800000, "8921_s4", 0, 0),
520 RPM_LDO(L22, 0, 1, 0, 2600000, 2600000, NULL, 0, 0),
521 RPM_LDO(L23, 0, 1, 0, 1800000, 1800000, NULL, 0, 0),
522 RPM_LDO(L24, 0, 1, 1, 750000, 1150000, "8921_s1", 10000, 10000),
523 RPM_LDO(L25, 1, 1, 0, 1225000, 1225000, "8921_s1", 10000, 10000),
524 RPM_LDO(L27, 0, 1, 0, 1100000, 1100000, "8921_s7", 0, 0),
525 RPM_LDO(L28, 0, 1, 0, 1050000, 1050000, "8921_s7", 0, 0),
526
527 /* ID a_on pd ss supply */
528 RPM_VS(LVS1, 0, 1, 0, "8921_s4"),
529 RPM_VS(LVS2, 0, 1, 0, "8921_s1"),
530 RPM_VS(LVS3, 0, 1, 0, "8921_s4"),
531 RPM_VS(LVS4, 0, 1, 0, "8921_s4"),
532 RPM_VS(LVS5, 0, 1, 0, "8921_s4"),
533 RPM_VS(LVS6, 0, 1, 0, "8921_s4"),
534 RPM_VS(LVS7, 1, 1, 1, "8921_s4"),
535
536 /* ID a_on ss min_uV max_uV supply freq */
537 RPM_NCP(NCP, 0, 0, 1800000, 1800000, "8921_l6", 1p60),
Jay Chokshiea67c622011-07-29 17:12:26 -0700538};
539
540int msm8064_pm8921_regulator_pdata_len __devinitdata =
541 ARRAY_SIZE(msm8064_pm8921_regulator_pdata);
David Collins2782b5c2012-02-06 10:02:42 -0800542
543struct rpm_regulator_platform_data apq8064_rpm_regulator_pdata __devinitdata = {
544 .init_data = apq8064_rpm_regulator_init_data,
545 .num_regulators = ARRAY_SIZE(apq8064_rpm_regulator_init_data),
546 .version = RPM_VREG_VERSION_8960,
547 .vreg_id_vdd_mem = RPM_VREG_ID_PM8921_L24,
548 .vreg_id_vdd_dig = RPM_VREG_ID_PM8921_S3,
549};