blob: 1a5924db24a36476be7575c84692a793c632abbe [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
David Collins793793b2012-08-21 15:43:02 -070021/* Regulators that are present when using either PM8921 or PM8917 */
Jay Chokshiea67c622011-07-29 17:12:26 -070022/*
23 * Consumer specific regulator names:
24 * regulator name consumer dev_name
25 */
26VREG_CONSUMERS(L1) = {
27 REGULATOR_SUPPLY("8921_l1", NULL),
28};
29VREG_CONSUMERS(L2) = {
30 REGULATOR_SUPPLY("8921_l2", NULL),
Kevin Chan330e4d52012-02-18 23:11:24 -080031 REGULATOR_SUPPLY("mipi_csi_vdd", "msm_csid.0"),
32 REGULATOR_SUPPLY("mipi_csi_vdd", "msm_csid.1"),
33 REGULATOR_SUPPLY("mipi_csi_vdd", "msm_csid.2"),
Ravishangar Kalyanamc2fee312012-02-09 19:11:22 -080034 REGULATOR_SUPPLY("lvds_pll_vdda", "lvds.0"),
35 REGULATOR_SUPPLY("dsi1_pll_vdda", "mipi_dsi.1"),
Jay Chokshiea67c622011-07-29 17:12:26 -070036};
37VREG_CONSUMERS(L3) = {
38 REGULATOR_SUPPLY("8921_l3", NULL),
Hemant Kumar6ddad592011-08-03 19:31:56 -070039 REGULATOR_SUPPLY("HSUSB_3p3", "msm_otg"),
Manu Gautamdccbca42011-11-08 15:13:38 +053040 REGULATOR_SUPPLY("HSUSB_3p3", "msm_ehci_host.0"),
41 REGULATOR_SUPPLY("HSUSB_3p3", "msm_ehci_host.1"),
Jay Chokshiea67c622011-07-29 17:12:26 -070042};
43VREG_CONSUMERS(L4) = {
44 REGULATOR_SUPPLY("8921_l4", NULL),
Hemant Kumar6ddad592011-08-03 19:31:56 -070045 REGULATOR_SUPPLY("HSUSB_1p8", "msm_otg"),
Subramanian Srinivasan04d2c832012-01-17 11:26:36 -080046 REGULATOR_SUPPLY("iris_vddxo", "wcnss_wlan.0"),
Jay Chokshiea67c622011-07-29 17:12:26 -070047};
48VREG_CONSUMERS(L5) = {
49 REGULATOR_SUPPLY("8921_l5", NULL),
Sahitya Tummalab4d883f2011-08-23 10:44:51 +053050 REGULATOR_SUPPLY("sdc_vdd", "msm_sdcc.1"),
Jay Chokshiea67c622011-07-29 17:12:26 -070051};
52VREG_CONSUMERS(L6) = {
53 REGULATOR_SUPPLY("8921_l6", NULL),
Sahitya Tummalab4d883f2011-08-23 10:44:51 +053054 REGULATOR_SUPPLY("sdc_vdd", "msm_sdcc.3"),
Jay Chokshiea67c622011-07-29 17:12:26 -070055};
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"),
Jay Chokshiea67c622011-07-29 17:12:26 -070059};
60VREG_CONSUMERS(L8) = {
61 REGULATOR_SUPPLY("8921_l8", NULL),
Jeyaprakash Soundrapandianf0d4d012012-01-16 15:12:20 -080062 REGULATOR_SUPPLY("cam_vana", "4-001a"),
Sreesudhan Ramakrish Ramkumar6c6f57c2012-02-21 15:12:44 -080063 REGULATOR_SUPPLY("cam_vana", "4-0048"),
Jeyaprakash Soundrapandianf0d4d012012-01-16 15:12:20 -080064 REGULATOR_SUPPLY("cam_vana", "4-006c"),
Sreesudhan Ramakrish Ramkumar3381da72012-01-27 08:08:32 -080065 REGULATOR_SUPPLY("cam_vana", "4-0034"),
Sreesudhan Ramakrish Ramkumar8002a792012-04-09 17:42:58 -070066 REGULATOR_SUPPLY("cam_vana", "4-0020"),
Jay Chokshiea67c622011-07-29 17:12:26 -070067};
68VREG_CONSUMERS(L9) = {
69 REGULATOR_SUPPLY("8921_l9", NULL),
Anirudh Ghayal2917a5a2012-02-05 19:51:07 -080070 REGULATOR_SUPPLY("vdd", "3-0024"),
Jay Chokshiea67c622011-07-29 17:12:26 -070071};
72VREG_CONSUMERS(L10) = {
73 REGULATOR_SUPPLY("8921_l10", NULL),
Subramanian Srinivasan04d2c832012-01-17 11:26:36 -080074 REGULATOR_SUPPLY("iris_vddpa", "wcnss_wlan.0"),
Jay Chokshiea67c622011-07-29 17:12:26 -070075};
76VREG_CONSUMERS(L11) = {
77 REGULATOR_SUPPLY("8921_l11", NULL),
Ravishangar Kalyanamc2fee312012-02-09 19:11:22 -080078 REGULATOR_SUPPLY("dsi1_avdd", "mipi_dsi.1"),
Jay Chokshiea67c622011-07-29 17:12:26 -070079};
80VREG_CONSUMERS(L12) = {
Jeyaprakash Soundrapandianf0d4d012012-01-16 15:12:20 -080081 REGULATOR_SUPPLY("cam_vdig", "4-001a"),
Sreesudhan Ramakrish Ramkumar6c6f57c2012-02-21 15:12:44 -080082 REGULATOR_SUPPLY("cam_vdig", "4-0048"),
Jeyaprakash Soundrapandianf0d4d012012-01-16 15:12:20 -080083 REGULATOR_SUPPLY("cam_vdig", "4-006c"),
Sreesudhan Ramakrish Ramkumar3381da72012-01-27 08:08:32 -080084 REGULATOR_SUPPLY("cam_vdig", "4-0034"),
Sreesudhan Ramakrish Ramkumar8002a792012-04-09 17:42:58 -070085 REGULATOR_SUPPLY("cam_vdig", "4-0020"),
Jay Chokshiea67c622011-07-29 17:12:26 -070086 REGULATOR_SUPPLY("8921_l12", NULL),
87};
David Collinsd459ace2012-08-31 12:13:28 -070088VREG_CONSUMERS(L13) = {
89 REGULATOR_SUPPLY("8921_l13", NULL),
90};
Jay Chokshiea67c622011-07-29 17:12:26 -070091VREG_CONSUMERS(L14) = {
92 REGULATOR_SUPPLY("8921_l14", NULL),
93};
94VREG_CONSUMERS(L15) = {
95 REGULATOR_SUPPLY("8921_l15", NULL),
96};
97VREG_CONSUMERS(L16) = {
98 REGULATOR_SUPPLY("8921_l16", NULL),
Jeyaprakash Soundrapandianf0d4d012012-01-16 15:12:20 -080099 REGULATOR_SUPPLY("cam_vaf", "4-001a"),
Sreesudhan Ramakrish Ramkumar6c6f57c2012-02-21 15:12:44 -0800100 REGULATOR_SUPPLY("cam_vaf", "4-0048"),
Jeyaprakash Soundrapandianf0d4d012012-01-16 15:12:20 -0800101 REGULATOR_SUPPLY("cam_vaf", "4-006c"),
Sreesudhan Ramakrish Ramkumar3381da72012-01-27 08:08:32 -0800102 REGULATOR_SUPPLY("cam_vaf", "4-0034"),
Sreesudhan Ramakrish Ramkumar8002a792012-04-09 17:42:58 -0700103 REGULATOR_SUPPLY("cam_vaf", "4-0020"),
Jay Chokshiea67c622011-07-29 17:12:26 -0700104};
105VREG_CONSUMERS(L17) = {
106 REGULATOR_SUPPLY("8921_l17", NULL),
107};
108VREG_CONSUMERS(L18) = {
109 REGULATOR_SUPPLY("8921_l18", NULL),
110};
David Collins1bf88da2012-05-03 14:58:34 -0700111VREG_CONSUMERS(L21) = {
112 REGULATOR_SUPPLY("8921_l21", NULL),
113};
Jay Chokshiea67c622011-07-29 17:12:26 -0700114VREG_CONSUMERS(L22) = {
115 REGULATOR_SUPPLY("8921_l22", NULL),
116};
117VREG_CONSUMERS(L23) = {
118 REGULATOR_SUPPLY("8921_l23", NULL),
Swaminathan Sathappan2316e082012-02-03 14:07:17 -0800119 REGULATOR_SUPPLY("pll_vdd", "pil_qdsp6v4.1"),
120 REGULATOR_SUPPLY("pll_vdd", "pil_qdsp6v4.2"),
Manu Gautam91223e02011-11-08 15:27:22 +0530121 REGULATOR_SUPPLY("HSUSB_1p8", "msm_ehci_host.0"),
122 REGULATOR_SUPPLY("HSUSB_1p8", "msm_ehci_host.1"),
Jay Chokshiea67c622011-07-29 17:12:26 -0700123};
124VREG_CONSUMERS(L24) = {
125 REGULATOR_SUPPLY("8921_l24", NULL),
Subramanian Srinivasan04d2c832012-01-17 11:26:36 -0800126 REGULATOR_SUPPLY("riva_vddmx", "wcnss_wlan.0"),
Jay Chokshiea67c622011-07-29 17:12:26 -0700127};
128VREG_CONSUMERS(L25) = {
129 REGULATOR_SUPPLY("8921_l25", NULL),
Swaminathan Sathappan2f51a752011-12-05 12:51:19 -0800130 REGULATOR_SUPPLY("VDDD_CDC_D", "tabla-slim"),
131 REGULATOR_SUPPLY("CDC_VDDA_A_1P2V", "tabla-slim"),
Swaminathan Sathappan2316e082012-02-03 14:07:17 -0800132 REGULATOR_SUPPLY("VDDD_CDC_D", "tabla2x-slim"),
133 REGULATOR_SUPPLY("CDC_VDDA_A_1P2V", "tabla2x-slim"),
Kuirong Wangf8c5e142012-06-21 16:17:32 -0700134 REGULATOR_SUPPLY("VDDD_CDC_D", "0-000d"),
135 REGULATOR_SUPPLY("CDC_VDDA_A_1P2V", "0-000d"),
Jay Chokshiea67c622011-07-29 17:12:26 -0700136};
137VREG_CONSUMERS(L26) = {
138 REGULATOR_SUPPLY("8921_l26", NULL),
Matt Wagantallb94b9a52012-02-02 21:59:54 -0800139 REGULATOR_SUPPLY("core_vdd", "pil_qdsp6v4.0"),
Jay Chokshiea67c622011-07-29 17:12:26 -0700140};
141VREG_CONSUMERS(L27) = {
142 REGULATOR_SUPPLY("8921_l27", NULL),
Swaminathan Sathappan2316e082012-02-03 14:07:17 -0800143 REGULATOR_SUPPLY("core_vdd", "pil_qdsp6v4.2"),
Jay Chokshiea67c622011-07-29 17:12:26 -0700144};
145VREG_CONSUMERS(L28) = {
146 REGULATOR_SUPPLY("8921_l28", NULL),
Swaminathan Sathappan2316e082012-02-03 14:07:17 -0800147 REGULATOR_SUPPLY("core_vdd", "pil_qdsp6v4.1"),
Jay Chokshiea67c622011-07-29 17:12:26 -0700148};
David Collins1bf88da2012-05-03 14:58:34 -0700149VREG_CONSUMERS(L29) = {
150 REGULATOR_SUPPLY("8921_l29", NULL),
151};
Jay Chokshiea67c622011-07-29 17:12:26 -0700152VREG_CONSUMERS(S2) = {
153 REGULATOR_SUPPLY("8921_s2", NULL),
Subramanian Srinivasan04d2c832012-01-17 11:26:36 -0800154 REGULATOR_SUPPLY("iris_vddrfa", "wcnss_wlan.0"),
Jay Chokshiea67c622011-07-29 17:12:26 -0700155};
156VREG_CONSUMERS(S3) = {
157 REGULATOR_SUPPLY("8921_s3", NULL),
Hemant Kumar6ddad592011-08-03 19:31:56 -0700158 REGULATOR_SUPPLY("HSUSB_VDDCX", "msm_otg"),
Manu Gautamdccbca42011-11-08 15:13:38 +0530159 REGULATOR_SUPPLY("HSUSB_VDDCX", "msm_ehci_host.0"),
160 REGULATOR_SUPPLY("HSUSB_VDDCX", "msm_ehci_host.1"),
Hemant Kumara945b472012-01-25 15:08:06 -0800161 REGULATOR_SUPPLY("HSIC_VDDCX", "msm_hsic_host"),
Subramanian Srinivasan04d2c832012-01-17 11:26:36 -0800162 REGULATOR_SUPPLY("riva_vddcx", "wcnss_wlan.0"),
Niranjana Vishwanathapura06f89332012-05-03 17:11:13 -0600163 REGULATOR_SUPPLY("vp_pcie", "msm_pcie"),
164 REGULATOR_SUPPLY("vptx_pcie", "msm_pcie"),
Jay Chokshiea67c622011-07-29 17:12:26 -0700165};
166VREG_CONSUMERS(S4) = {
167 REGULATOR_SUPPLY("8921_s4", NULL),
Subhash Jadavani937c7502012-06-01 15:34:46 +0530168 REGULATOR_SUPPLY("sdc_vdd_io", "msm_sdcc.1"),
Swaminathan Sathappan2f51a752011-12-05 12:51:19 -0800169 REGULATOR_SUPPLY("VDDIO_CDC", "tabla-slim"),
170 REGULATOR_SUPPLY("CDC_VDD_CP", "tabla-slim"),
171 REGULATOR_SUPPLY("CDC_VDDA_TX", "tabla-slim"),
172 REGULATOR_SUPPLY("CDC_VDDA_RX", "tabla-slim"),
Swaminathan Sathappan2316e082012-02-03 14:07:17 -0800173 REGULATOR_SUPPLY("VDDIO_CDC", "tabla2x-slim"),
174 REGULATOR_SUPPLY("CDC_VDD_CP", "tabla2x-slim"),
175 REGULATOR_SUPPLY("CDC_VDDA_TX", "tabla2x-slim"),
176 REGULATOR_SUPPLY("CDC_VDDA_RX", "tabla2x-slim"),
Kuirong Wangf8c5e142012-06-21 16:17:32 -0700177 REGULATOR_SUPPLY("VDDIO_CDC", "0-000d"),
178 REGULATOR_SUPPLY("CDC_VDD_CP", "0-000d"),
179 REGULATOR_SUPPLY("CDC_VDDA_TX", "0-000d"),
180 REGULATOR_SUPPLY("CDC_VDDA_RX", "0-000d"),
Subramanian Srinivasan04d2c832012-01-17 11:26:36 -0800181 REGULATOR_SUPPLY("riva_vddpx", "wcnss_wlan.0"),
Jing Lin21ed4de2012-02-05 15:53:28 -0800182 REGULATOR_SUPPLY("vcc_i2c", "3-005b"),
Anirudh Ghayal2917a5a2012-02-05 19:51:07 -0800183 REGULATOR_SUPPLY("vcc_i2c", "3-0024"),
Amy Maloche70090f992012-02-16 16:35:26 -0800184 REGULATOR_SUPPLY("vddp", "0-0048"),
Aravind Venkateswaran0507c8c2012-02-16 17:16:05 -0800185 REGULATOR_SUPPLY("hdmi_lvl_tsl", "hdmi_msm.0"),
Jay Chokshiea67c622011-07-29 17:12:26 -0700186};
187VREG_CONSUMERS(S5) = {
188 REGULATOR_SUPPLY("8921_s5", NULL),
Matt Wagantallf5cc3892012-06-07 19:47:02 -0700189 REGULATOR_SUPPLY("krait0", "acpuclk-8064"),
Jay Chokshiea67c622011-07-29 17:12:26 -0700190};
191VREG_CONSUMERS(S6) = {
192 REGULATOR_SUPPLY("8921_s6", NULL),
Matt Wagantallf5cc3892012-06-07 19:47:02 -0700193 REGULATOR_SUPPLY("krait1", "acpuclk-8064"),
Jay Chokshiea67c622011-07-29 17:12:26 -0700194};
195VREG_CONSUMERS(S7) = {
196 REGULATOR_SUPPLY("8921_s7", NULL),
197};
David Collins1bf88da2012-05-03 14:58:34 -0700198VREG_CONSUMERS(S8) = {
199 REGULATOR_SUPPLY("8921_s8", NULL),
200};
Jay Chokshiea67c622011-07-29 17:12:26 -0700201VREG_CONSUMERS(LVS1) = {
202 REGULATOR_SUPPLY("8921_lvs1", NULL),
Subramanian Srinivasan04d2c832012-01-17 11:26:36 -0800203 REGULATOR_SUPPLY("iris_vddio", "wcnss_wlan.0"),
Jay Chokshiea67c622011-07-29 17:12:26 -0700204};
Jay Chokshiea67c622011-07-29 17:12:26 -0700205VREG_CONSUMERS(LVS3) = {
206 REGULATOR_SUPPLY("8921_lvs3", NULL),
207};
208VREG_CONSUMERS(LVS4) = {
209 REGULATOR_SUPPLY("8921_lvs4", NULL),
210};
211VREG_CONSUMERS(LVS5) = {
212 REGULATOR_SUPPLY("8921_lvs5", NULL),
Jeyaprakash Soundrapandianf0d4d012012-01-16 15:12:20 -0800213 REGULATOR_SUPPLY("cam_vio", "4-001a"),
Sreesudhan Ramakrish Ramkumar6c6f57c2012-02-21 15:12:44 -0800214 REGULATOR_SUPPLY("cam_vio", "4-0048"),
Jeyaprakash Soundrapandianf0d4d012012-01-16 15:12:20 -0800215 REGULATOR_SUPPLY("cam_vio", "4-006c"),
Sreesudhan Ramakrish Ramkumar3381da72012-01-27 08:08:32 -0800216 REGULATOR_SUPPLY("cam_vio", "4-0034"),
Sreesudhan Ramakrish Ramkumar8002a792012-04-09 17:42:58 -0700217 REGULATOR_SUPPLY("cam_vio", "4-0020"),
Jay Chokshiea67c622011-07-29 17:12:26 -0700218};
219VREG_CONSUMERS(LVS6) = {
220 REGULATOR_SUPPLY("8921_lvs6", NULL),
Niranjana Vishwanathapura06f89332012-05-03 17:11:13 -0600221 REGULATOR_SUPPLY("vdd_pcie_vph", "msm_pcie"),
Jay Chokshiea67c622011-07-29 17:12:26 -0700222};
223VREG_CONSUMERS(LVS7) = {
224 REGULATOR_SUPPLY("8921_lvs7", NULL),
Matt Wagantall52dd0622012-02-02 18:26:16 -0800225 REGULATOR_SUPPLY("pll_vdd", "pil_riva"),
Ravishangar Kalyanamc2fee312012-02-09 19:11:22 -0800226 REGULATOR_SUPPLY("lvds_vdda", "lvds.0"),
227 REGULATOR_SUPPLY("dsi1_vddio", "mipi_dsi.1"),
Aravind Venkateswaran0507c8c2012-02-16 17:16:05 -0800228 REGULATOR_SUPPLY("hdmi_vdda", "hdmi_msm.0"),
Jay Chokshiea67c622011-07-29 17:12:26 -0700229};
230VREG_CONSUMERS(USB_OTG) = {
231 REGULATOR_SUPPLY("8921_usb_otg", NULL),
Hemant Kumard86c4882012-01-24 19:39:37 -0800232 REGULATOR_SUPPLY("vbus_otg", "msm_otg"),
Jay Chokshiea67c622011-07-29 17:12:26 -0700233};
Jay Chokshi7805b5a2011-11-07 15:55:30 -0800234VREG_CONSUMERS(8821_S0) = {
235 REGULATOR_SUPPLY("8821_s0", NULL),
Matt Wagantallf5cc3892012-06-07 19:47:02 -0700236 REGULATOR_SUPPLY("krait2", "acpuclk-8064"),
Jay Chokshi7805b5a2011-11-07 15:55:30 -0800237};
238VREG_CONSUMERS(8821_S1) = {
239 REGULATOR_SUPPLY("8821_s1", NULL),
Matt Wagantallf5cc3892012-06-07 19:47:02 -0700240 REGULATOR_SUPPLY("krait3", "acpuclk-8064"),
Jay Chokshi7805b5a2011-11-07 15:55:30 -0800241};
Jay Chokshi1de4f9d2012-02-07 16:11:31 -0800242VREG_CONSUMERS(EXT_MPP8) = {
243 REGULATOR_SUPPLY("ext_mpp8", NULL),
Hemant Kumar1d66e1c2012-02-13 15:24:59 -0800244 REGULATOR_SUPPLY("vbus", "msm_ehci_host.1"),
Jay Chokshi1de4f9d2012-02-07 16:11:31 -0800245};
David Collinsf0d00732012-01-25 15:46:50 -0800246VREG_CONSUMERS(EXT_3P3V) = {
247 REGULATOR_SUPPLY("ext_3p3v", NULL),
Stepan Moskovchenkoc71c9792012-01-31 18:12:44 -0800248 REGULATOR_SUPPLY("vdd_io", "spi0.2"),
Pavankumar Kondeti57fc8962012-07-06 08:20:18 +0530249 REGULATOR_SUPPLY("mhl_usb_hs_switch", "msm_otg"),
Ravishangar Kalyanamc2fee312012-02-09 19:11:22 -0800250 REGULATOR_SUPPLY("lvds_vccs_3p3v", "lvds.0"),
251 REGULATOR_SUPPLY("dsi1_vccs_3p3v", "mipi_dsi.1"),
Aravind Venkateswaran0507c8c2012-02-16 17:16:05 -0800252 REGULATOR_SUPPLY("hdmi_mux_vdd", "hdmi_msm.0"),
Niranjana Vishwanathapura06f89332012-05-03 17:11:13 -0600253 REGULATOR_SUPPLY("pcie_ext_3p3v", "msm_pcie"),
David Collinsf0d00732012-01-25 15:46:50 -0800254};
David Collins390fc332012-02-07 14:38:16 -0800255VREG_CONSUMERS(EXT_TS_SW) = {
256 REGULATOR_SUPPLY("ext_ts_sw", NULL),
Jing Lin21ed4de2012-02-05 15:53:28 -0800257 REGULATOR_SUPPLY("vdd_ana", "3-005b"),
David Collins390fc332012-02-07 14:38:16 -0800258};
Jay Chokshi1b7eaa92012-04-04 14:53:14 -0700259VREG_CONSUMERS(AVC_1P2V) = {
260 REGULATOR_SUPPLY("avc_1p2v", NULL),
261};
262VREG_CONSUMERS(AVC_1P8V) = {
263 REGULATOR_SUPPLY("avc_1p8v", NULL),
264};
265VREG_CONSUMERS(AVC_2P2V) = {
266 REGULATOR_SUPPLY("avc_2p2v", NULL),
267};
268VREG_CONSUMERS(AVC_5V) = {
269 REGULATOR_SUPPLY("avc_5v", NULL),
270};
271VREG_CONSUMERS(AVC_3P3V) = {
272 REGULATOR_SUPPLY("avc_3p3v", NULL),
273};
Jay Chokshiea67c622011-07-29 17:12:26 -0700274
David Collins793793b2012-08-21 15:43:02 -0700275/* Regulators that are only present when using PM8921 */
276VREG_CONSUMERS(S1) = {
277 REGULATOR_SUPPLY("8921_s1", NULL),
278};
279VREG_CONSUMERS(LVS2) = {
280 REGULATOR_SUPPLY("8921_lvs2", NULL),
281 REGULATOR_SUPPLY("iris_vdddig", "wcnss_wlan.0"),
282};
283VREG_CONSUMERS(HDMI_MVS) = {
284 REGULATOR_SUPPLY("8921_hdmi_mvs", NULL),
285 REGULATOR_SUPPLY("hdmi_mvs", "hdmi_msm.0"),
286};
287VREG_CONSUMERS(NCP) = {
288 REGULATOR_SUPPLY("8921_ncp", NULL),
289};
290VREG_CONSUMERS(EXT_5V) = {
291 REGULATOR_SUPPLY("ext_5v", NULL),
292 REGULATOR_SUPPLY("ext_ddr3", NULL),
293 REGULATOR_SUPPLY("vbus", "msm_ehci_host.0"),
294};
295
296/* Regulators that are only present when using PM8917 */
297VREG_CONSUMERS(8917_S1) = {
298 REGULATOR_SUPPLY("8921_s1", NULL),
299 REGULATOR_SUPPLY("iris_vdddig", "wcnss_wlan.0"),
300};
301VREG_CONSUMERS(L30) = {
302 REGULATOR_SUPPLY("8917_l30", NULL),
303};
304VREG_CONSUMERS(L31) = {
305 REGULATOR_SUPPLY("8917_l31", NULL),
306};
307VREG_CONSUMERS(L32) = {
308 REGULATOR_SUPPLY("8917_l32", NULL),
309};
310VREG_CONSUMERS(L33) = {
311 REGULATOR_SUPPLY("8917_l33", NULL),
312};
313VREG_CONSUMERS(L34) = {
314 REGULATOR_SUPPLY("8917_l34", NULL),
315};
316VREG_CONSUMERS(L35) = {
317 REGULATOR_SUPPLY("8917_l35", NULL),
318};
319VREG_CONSUMERS(L36) = {
320 REGULATOR_SUPPLY("8917_l36", NULL),
321};
322VREG_CONSUMERS(BOOST) = {
323 REGULATOR_SUPPLY("8917_boost", NULL),
324 REGULATOR_SUPPLY("ext_ddr3", NULL),
325 REGULATOR_SUPPLY("vbus", "msm_ehci_host.0"),
326 REGULATOR_SUPPLY("hdmi_mvs", "hdmi_msm.0"),
327};
328
David Collins75016742011-12-02 15:04:25 -0800329#define PM8XXX_VREG_INIT(_id, _name, _min_uV, _max_uV, _modes, _ops, \
330 _apply_uV, _pull_down, _always_on, _supply_regulator, \
331 _system_uA, _enable_time, _reg_id) \
Jay Chokshiea67c622011-07-29 17:12:26 -0700332 { \
333 .init_data = { \
334 .constraints = { \
335 .valid_modes_mask = _modes, \
336 .valid_ops_mask = _ops, \
337 .min_uV = _min_uV, \
338 .max_uV = _max_uV, \
339 .input_uV = _max_uV, \
340 .apply_uV = _apply_uV, \
341 .always_on = _always_on, \
David Collins75016742011-12-02 15:04:25 -0800342 .name = _name, \
Jay Chokshiea67c622011-07-29 17:12:26 -0700343 }, \
344 .num_consumer_supplies = \
345 ARRAY_SIZE(vreg_consumers_##_id), \
346 .consumer_supplies = vreg_consumers_##_id, \
347 .supply_regulator = _supply_regulator, \
348 }, \
David Collins75016742011-12-02 15:04:25 -0800349 .id = _reg_id, \
Jay Chokshiea67c622011-07-29 17:12:26 -0700350 .pull_down_enable = _pull_down, \
351 .system_uA = _system_uA, \
352 .enable_time = _enable_time, \
353 }
354
David Collins75016742011-12-02 15:04:25 -0800355#define PM8XXX_LDO(_id, _name, _always_on, _pull_down, _min_uV, _max_uV, \
356 _enable_time, _supply_regulator, _system_uA, _reg_id) \
357 PM8XXX_VREG_INIT(_id, _name, _min_uV, _max_uV, REGULATOR_MODE_NORMAL \
Jay Chokshiea67c622011-07-29 17:12:26 -0700358 | REGULATOR_MODE_IDLE, REGULATOR_CHANGE_VOLTAGE | \
359 REGULATOR_CHANGE_STATUS | REGULATOR_CHANGE_MODE | \
360 REGULATOR_CHANGE_DRMS, 0, _pull_down, _always_on, \
David Collins75016742011-12-02 15:04:25 -0800361 _supply_regulator, _system_uA, _enable_time, _reg_id)
Jay Chokshiea67c622011-07-29 17:12:26 -0700362
David Collins75016742011-12-02 15:04:25 -0800363#define PM8XXX_NLDO1200(_id, _name, _always_on, _pull_down, _min_uV, \
364 _max_uV, _enable_time, _supply_regulator, _system_uA, _reg_id) \
365 PM8XXX_VREG_INIT(_id, _name, _min_uV, _max_uV, REGULATOR_MODE_NORMAL \
Jay Chokshiea67c622011-07-29 17:12:26 -0700366 | REGULATOR_MODE_IDLE, REGULATOR_CHANGE_VOLTAGE | \
367 REGULATOR_CHANGE_STATUS | REGULATOR_CHANGE_MODE | \
368 REGULATOR_CHANGE_DRMS, 0, _pull_down, _always_on, \
David Collins75016742011-12-02 15:04:25 -0800369 _supply_regulator, _system_uA, _enable_time, _reg_id)
Jay Chokshiea67c622011-07-29 17:12:26 -0700370
David Collins75016742011-12-02 15:04:25 -0800371#define PM8XXX_SMPS(_id, _name, _always_on, _pull_down, _min_uV, _max_uV, \
372 _enable_time, _supply_regulator, _system_uA, _reg_id) \
373 PM8XXX_VREG_INIT(_id, _name, _min_uV, _max_uV, REGULATOR_MODE_NORMAL \
Jay Chokshiea67c622011-07-29 17:12:26 -0700374 | REGULATOR_MODE_IDLE, REGULATOR_CHANGE_VOLTAGE | \
375 REGULATOR_CHANGE_STATUS | REGULATOR_CHANGE_MODE | \
376 REGULATOR_CHANGE_DRMS, 0, _pull_down, _always_on, \
David Collins75016742011-12-02 15:04:25 -0800377 _supply_regulator, _system_uA, _enable_time, _reg_id)
Jay Chokshiea67c622011-07-29 17:12:26 -0700378
David Collins75016742011-12-02 15:04:25 -0800379#define PM8XXX_FTSMPS(_id, _name, _always_on, _pull_down, _min_uV, _max_uV, \
380 _enable_time, _supply_regulator, _system_uA, _reg_id) \
381 PM8XXX_VREG_INIT(_id, _name, _min_uV, _max_uV, REGULATOR_MODE_NORMAL, \
Jay Chokshiea67c622011-07-29 17:12:26 -0700382 REGULATOR_CHANGE_VOLTAGE | REGULATOR_CHANGE_STATUS \
383 | REGULATOR_CHANGE_MODE, 0, _pull_down, _always_on, \
David Collins75016742011-12-02 15:04:25 -0800384 _supply_regulator, _system_uA, _enable_time, _reg_id)
Jay Chokshiea67c622011-07-29 17:12:26 -0700385
David Collins75016742011-12-02 15:04:25 -0800386#define PM8XXX_VS(_id, _name, _always_on, _pull_down, _enable_time, \
387 _supply_regulator, _reg_id) \
388 PM8XXX_VREG_INIT(_id, _name, 0, 0, 0, REGULATOR_CHANGE_STATUS, 0, \
389 _pull_down, _always_on, _supply_regulator, 0, _enable_time, \
390 _reg_id)
Jay Chokshiea67c622011-07-29 17:12:26 -0700391
David Collins75016742011-12-02 15:04:25 -0800392#define PM8XXX_VS300(_id, _name, _always_on, _pull_down, _enable_time, \
393 _supply_regulator, _reg_id) \
394 PM8XXX_VREG_INIT(_id, _name, 0, 0, 0, REGULATOR_CHANGE_STATUS, 0, \
395 _pull_down, _always_on, _supply_regulator, 0, _enable_time, \
396 _reg_id)
Jay Chokshiea67c622011-07-29 17:12:26 -0700397
David Collins75016742011-12-02 15:04:25 -0800398#define PM8XXX_NCP(_id, _name, _always_on, _min_uV, _max_uV, _enable_time, \
399 _supply_regulator, _reg_id) \
400 PM8XXX_VREG_INIT(_id, _name, _min_uV, _max_uV, 0, \
401 REGULATOR_CHANGE_VOLTAGE | REGULATOR_CHANGE_STATUS, 0, 0, \
402 _always_on, _supply_regulator, 0, _enable_time, _reg_id)
Jay Chokshiea67c622011-07-29 17:12:26 -0700403
David Collins793793b2012-08-21 15:43:02 -0700404#define PM8XXX_BOOST(_id, _name, _always_on, _min_uV, _max_uV, _enable_time, \
405 _supply_regulator, _reg_id) \
406 PM8XXX_VREG_INIT(_id, _name, _min_uV, _max_uV, 0, \
407 REGULATOR_CHANGE_VOLTAGE | REGULATOR_CHANGE_STATUS, 0, 0, \
408 _always_on, _supply_regulator, 0, _enable_time, _reg_id)
409
Jay Chokshiea67c622011-07-29 17:12:26 -0700410/* Pin control initialization */
David Collins75016742011-12-02 15:04:25 -0800411#define PM8XXX_PC(_id, _name, _always_on, _pin_fn, _pin_ctrl, \
412 _supply_regulator, _reg_id) \
Jay Chokshiea67c622011-07-29 17:12:26 -0700413 { \
414 .init_data = { \
415 .constraints = { \
416 .valid_ops_mask = REGULATOR_CHANGE_STATUS, \
417 .always_on = _always_on, \
David Collins75016742011-12-02 15:04:25 -0800418 .name = _name, \
Jay Chokshiea67c622011-07-29 17:12:26 -0700419 }, \
420 .num_consumer_supplies = \
421 ARRAY_SIZE(vreg_consumers_##_id##_PC), \
422 .consumer_supplies = vreg_consumers_##_id##_PC, \
423 .supply_regulator = _supply_regulator, \
424 }, \
David Collins75016742011-12-02 15:04:25 -0800425 .id = _reg_id, \
426 .pin_fn = PM8XXX_VREG_PIN_FN_##_pin_fn, \
427 .pin_ctrl = _pin_ctrl, \
Jay Chokshiea67c622011-07-29 17:12:26 -0700428 }
429
David Collinsf0d00732012-01-25 15:46:50 -0800430#define GPIO_VREG(_id, _reg_name, _gpio_label, _gpio, _supply_regulator) \
431 [GPIO_VREG_ID_##_id] = { \
432 .init_data = { \
433 .constraints = { \
434 .valid_ops_mask = REGULATOR_CHANGE_STATUS, \
435 }, \
436 .num_consumer_supplies = \
437 ARRAY_SIZE(vreg_consumers_##_id), \
438 .consumer_supplies = vreg_consumers_##_id, \
439 .supply_regulator = _supply_regulator, \
440 }, \
441 .regulator_name = _reg_name, \
442 .gpio_label = _gpio_label, \
443 .gpio = _gpio, \
444 }
445
Jay Chokshiea67c622011-07-29 17:12:26 -0700446#define SAW_VREG_INIT(_id, _name, _min_uV, _max_uV) \
447 { \
448 .constraints = { \
449 .name = _name, \
450 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE, \
451 .min_uV = _min_uV, \
452 .max_uV = _max_uV, \
453 }, \
454 .num_consumer_supplies = ARRAY_SIZE(vreg_consumers_##_id), \
455 .consumer_supplies = vreg_consumers_##_id, \
456 }
457
David Collins2782b5c2012-02-06 10:02:42 -0800458#define RPM_INIT(_id, _min_uV, _max_uV, _modes, _ops, _apply_uV, _default_uV, \
459 _peak_uA, _avg_uA, _pull_down, _pin_ctrl, _freq, _pin_fn, \
David Collins15789042012-03-19 10:44:36 -0700460 _force_mode, _sleep_set_force_mode, _power_mode, _state, \
461 _sleep_selectable, _always_on, _supply_regulator, _system_uA) \
David Collins2782b5c2012-02-06 10:02:42 -0800462 { \
463 .init_data = { \
464 .constraints = { \
465 .valid_modes_mask = _modes, \
466 .valid_ops_mask = _ops, \
467 .min_uV = _min_uV, \
468 .max_uV = _max_uV, \
469 .input_uV = _min_uV, \
470 .apply_uV = _apply_uV, \
471 .always_on = _always_on, \
472 }, \
473 .num_consumer_supplies = \
474 ARRAY_SIZE(vreg_consumers_##_id), \
475 .consumer_supplies = vreg_consumers_##_id, \
476 .supply_regulator = _supply_regulator, \
477 }, \
478 .id = RPM_VREG_ID_PM8921_##_id, \
479 .default_uV = _default_uV, \
480 .peak_uA = _peak_uA, \
481 .avg_uA = _avg_uA, \
482 .pull_down_enable = _pull_down, \
483 .pin_ctrl = _pin_ctrl, \
484 .freq = RPM_VREG_FREQ_##_freq, \
485 .pin_fn = _pin_fn, \
486 .force_mode = _force_mode, \
David Collins15789042012-03-19 10:44:36 -0700487 .sleep_set_force_mode = _sleep_set_force_mode, \
David Collins2782b5c2012-02-06 10:02:42 -0800488 .power_mode = _power_mode, \
489 .state = _state, \
490 .sleep_selectable = _sleep_selectable, \
491 .system_uA = _system_uA, \
492 }
493
494#define RPM_LDO(_id, _always_on, _pd, _sleep_selectable, _min_uV, _max_uV, \
495 _supply_regulator, _system_uA, _init_peak_uA) \
496 RPM_INIT(_id, _min_uV, _max_uV, REGULATOR_MODE_NORMAL \
497 | REGULATOR_MODE_IDLE, REGULATOR_CHANGE_VOLTAGE \
498 | REGULATOR_CHANGE_STATUS | REGULATOR_CHANGE_MODE \
499 | REGULATOR_CHANGE_DRMS, 0, _max_uV, _init_peak_uA, 0, _pd, \
500 RPM_VREG_PIN_CTRL_NONE, NONE, RPM_VREG_PIN_FN_8960_NONE, \
David Collins15789042012-03-19 10:44:36 -0700501 RPM_VREG_FORCE_MODE_8960_NONE, \
David Collins2782b5c2012-02-06 10:02:42 -0800502 RPM_VREG_FORCE_MODE_8960_NONE, RPM_VREG_POWER_MODE_8960_PWM, \
503 RPM_VREG_STATE_OFF, _sleep_selectable, _always_on, \
504 _supply_regulator, _system_uA)
505
506#define RPM_SMPS(_id, _always_on, _pd, _sleep_selectable, _min_uV, _max_uV, \
David Collins3d2b9452012-03-19 11:00:30 -0700507 _supply_regulator, _system_uA, _freq, _force_mode, \
508 _sleep_set_force_mode) \
David Collins2782b5c2012-02-06 10:02:42 -0800509 RPM_INIT(_id, _min_uV, _max_uV, REGULATOR_MODE_NORMAL \
510 | REGULATOR_MODE_IDLE, REGULATOR_CHANGE_VOLTAGE \
511 | REGULATOR_CHANGE_STATUS | REGULATOR_CHANGE_MODE \
512 | REGULATOR_CHANGE_DRMS, 0, _max_uV, _system_uA, 0, _pd, \
513 RPM_VREG_PIN_CTRL_NONE, _freq, RPM_VREG_PIN_FN_8960_NONE, \
David Collins3d2b9452012-03-19 11:00:30 -0700514 RPM_VREG_FORCE_MODE_8960_##_force_mode, \
515 RPM_VREG_FORCE_MODE_8960_##_sleep_set_force_mode, \
516 RPM_VREG_POWER_MODE_8960_PWM, RPM_VREG_STATE_OFF, \
517 _sleep_selectable, _always_on, _supply_regulator, _system_uA)
David Collins2782b5c2012-02-06 10:02:42 -0800518
519#define RPM_VS(_id, _always_on, _pd, _sleep_selectable, _supply_regulator) \
520 RPM_INIT(_id, 0, 0, 0, REGULATOR_CHANGE_STATUS, 0, 0, 1000, 1000, _pd, \
521 RPM_VREG_PIN_CTRL_NONE, NONE, RPM_VREG_PIN_FN_8960_NONE, \
David Collins15789042012-03-19 10:44:36 -0700522 RPM_VREG_FORCE_MODE_8960_NONE, \
David Collins2782b5c2012-02-06 10:02:42 -0800523 RPM_VREG_FORCE_MODE_8960_NONE, RPM_VREG_POWER_MODE_8960_PWM, \
524 RPM_VREG_STATE_OFF, _sleep_selectable, _always_on, \
525 _supply_regulator, 0)
526
527#define RPM_NCP(_id, _always_on, _sleep_selectable, _min_uV, _max_uV, \
528 _supply_regulator, _freq) \
529 RPM_INIT(_id, _min_uV, _max_uV, 0, REGULATOR_CHANGE_VOLTAGE \
530 | REGULATOR_CHANGE_STATUS, 0, _max_uV, 1000, 1000, 0, \
531 RPM_VREG_PIN_CTRL_NONE, _freq, RPM_VREG_PIN_FN_8960_NONE, \
David Collins15789042012-03-19 10:44:36 -0700532 RPM_VREG_FORCE_MODE_8960_NONE, \
David Collins2782b5c2012-02-06 10:02:42 -0800533 RPM_VREG_FORCE_MODE_8960_NONE, RPM_VREG_POWER_MODE_8960_PWM, \
534 RPM_VREG_STATE_OFF, _sleep_selectable, _always_on, \
535 _supply_regulator, 0)
536
537/* Pin control initialization */
538#define RPM_PC_INIT(_id, _always_on, _pin_fn, _pin_ctrl, _supply_regulator) \
539 { \
540 .init_data = { \
541 .constraints = { \
542 .valid_ops_mask = REGULATOR_CHANGE_STATUS, \
543 .always_on = _always_on, \
544 }, \
545 .num_consumer_supplies = \
546 ARRAY_SIZE(vreg_consumers_##_id##_PC), \
547 .consumer_supplies = vreg_consumers_##_id##_PC, \
548 .supply_regulator = _supply_regulator, \
549 }, \
550 .id = RPM_VREG_ID_PM8921_##_id##_PC, \
551 .pin_fn = RPM_VREG_PIN_FN_8960_##_pin_fn, \
552 .pin_ctrl = _pin_ctrl, \
553 }
554
David Collinsf0d00732012-01-25 15:46:50 -0800555/* GPIO regulator constraints */
556struct gpio_regulator_platform_data
557apq8064_gpio_regulator_pdata[] __devinitdata = {
558 /* ID vreg_name gpio_label gpio supply */
559 GPIO_VREG(EXT_5V, "ext_5v", "ext_5v_en", PM8921_MPP_PM_TO_SYS(7), NULL),
560 GPIO_VREG(EXT_3P3V, "ext_3p3v", "ext_3p3v_en",
561 APQ8064_EXT_3P3V_REG_EN_GPIO, NULL),
David Collins390fc332012-02-07 14:38:16 -0800562 GPIO_VREG(EXT_TS_SW, "ext_ts_sw", "ext_ts_sw_en",
563 PM8921_GPIO_PM_TO_SYS(23), "ext_3p3v"),
Jay Chokshi1de4f9d2012-02-07 16:11:31 -0800564 GPIO_VREG(EXT_MPP8, "ext_mpp8", "ext_mpp8_en",
565 PM8921_MPP_PM_TO_SYS(8), NULL),
David Collinsf0d00732012-01-25 15:46:50 -0800566};
567
Jay Chokshi1b7eaa92012-04-04 14:53:14 -0700568struct gpio_regulator_platform_data
569mpq8064_gpio_regulator_pdata[] __devinitdata = {
Jay Chokshi1b7eaa92012-04-04 14:53:14 -0700570 GPIO_VREG(AVC_1P2V, "avc_1p2v", "avc_1p2v_en", SX150X_GPIO(4, 2), NULL),
571 GPIO_VREG(AVC_1P8V, "avc_1p8v", "avc_1p8v_en", SX150X_GPIO(4, 4), NULL),
572 GPIO_VREG(AVC_2P2V, "avc_2p2v", "avc_2p2v_en",
573 SX150X_GPIO(4, 14), NULL),
574 GPIO_VREG(AVC_5V, "avc_5v", "avc_5v_en", SX150X_GPIO(4, 3), NULL),
575 GPIO_VREG(AVC_3P3V, "avc_3p3v", "avc_3p3v_en",
576 SX150X_GPIO(4, 15), "avc_5v"),
577};
578
Jay Chokshiea67c622011-07-29 17:12:26 -0700579/* SAW regulator constraints */
Jay Chokshi7805b5a2011-11-07 15:55:30 -0800580struct regulator_init_data msm8064_saw_regulator_pdata_8921_s5 =
Jay Chokshiea67c622011-07-29 17:12:26 -0700581 /* ID vreg_name min_uV max_uV */
Tianyi Goudff51062012-06-04 20:22:23 -0700582 SAW_VREG_INIT(S5, "8921_s5", 850000, 1300000);
Jay Chokshi7805b5a2011-11-07 15:55:30 -0800583struct regulator_init_data msm8064_saw_regulator_pdata_8921_s6 =
Tianyi Goudff51062012-06-04 20:22:23 -0700584 SAW_VREG_INIT(S6, "8921_s6", 850000, 1300000);
Jay Chokshi7805b5a2011-11-07 15:55:30 -0800585
586struct regulator_init_data msm8064_saw_regulator_pdata_8821_s0 =
587 /* ID vreg_name min_uV max_uV */
Tianyi Goudff51062012-06-04 20:22:23 -0700588 SAW_VREG_INIT(8821_S0, "8821_s0", 850000, 1300000);
Jay Chokshi7805b5a2011-11-07 15:55:30 -0800589struct regulator_init_data msm8064_saw_regulator_pdata_8821_s1 =
Tianyi Goudff51062012-06-04 20:22:23 -0700590 SAW_VREG_INIT(8821_S1, "8821_s1", 850000, 1300000);
Jay Chokshiea67c622011-07-29 17:12:26 -0700591
592/* PM8921 regulator constraints */
David Collins75016742011-12-02 15:04:25 -0800593struct pm8xxx_regulator_platform_data
Jay Chokshiea67c622011-07-29 17:12:26 -0700594msm8064_pm8921_regulator_pdata[] __devinitdata = {
David Collins75016742011-12-02 15:04:25 -0800595 /*
David Collins2782b5c2012-02-06 10:02:42 -0800596 * ID name always_on pd min_uV max_uV en_t supply
David Collins75016742011-12-02 15:04:25 -0800597 * system_uA reg_ID
598 */
Matt Wagantalled36d822012-05-25 18:13:40 -0700599 PM8XXX_NLDO1200(L26, "8921_l26", 0, 1, 375000, 1050000, 200, "8921_s7",
David Collins2782b5c2012-02-06 10:02:42 -0800600 0, 1),
Jay Chokshiea67c622011-07-29 17:12:26 -0700601
David Collins2782b5c2012-02-06 10:02:42 -0800602 /* ID name always_on pd en_t supply reg_ID */
603 PM8XXX_VS300(USB_OTG, "8921_usb_otg", 0, 0, 0, "ext_5v", 2),
604 PM8XXX_VS300(HDMI_MVS, "8921_hdmi_mvs", 0, 1, 0, "ext_5v", 3),
605};
Jay Chokshiea67c622011-07-29 17:12:26 -0700606
David Collins793793b2012-08-21 15:43:02 -0700607/* PM8917 regulator constraints */
608struct pm8xxx_regulator_platform_data
609msm8064_pm8917_regulator_pdata[] __devinitdata = {
610 /*
611 * ID name always_on pd min_uV max_uV en_t supply
612 * system_uA reg_ID
613 */
614 PM8XXX_NLDO1200(L26, "8921_l26", 0, 1, 375000, 1050000, 200, "8921_s7",
615 0, 1),
616 PM8XXX_LDO(L30, "8917_l30", 0, 1, 1800000, 1800000, 200, NULL,
617 0, 2),
618 PM8XXX_LDO(L31, "8917_l31", 0, 1, 1800000, 1800000, 200, NULL,
619 0, 3),
620 PM8XXX_LDO(L32, "8917_l32", 0, 1, 2800000, 2800000, 200, NULL,
621 0, 4),
622 PM8XXX_LDO(L33, "8917_l33", 0, 1, 2800000, 2800000, 200, NULL,
623 0, 5),
624 PM8XXX_LDO(L34, "8917_l34", 0, 1, 1800000, 1800000, 200, NULL,
625 0, 6),
626 PM8XXX_LDO(L35, "8917_l35", 0, 1, 3000000, 3000000, 200, NULL,
627 0, 7),
628 PM8XXX_LDO(L36, "8917_l36", 0, 1, 1800000, 1800000, 200, NULL,
629 0, 8),
630
631 /*
632 * ID name always_on min_uV max_uV en_t supply reg_ID
633 */
634 PM8XXX_BOOST(BOOST, "8917_boost", 0, 5000000, 5000000, 500, NULL, 9),
635
636 /* ID name always_on pd en_t supply reg_ID */
637 PM8XXX_VS300(USB_OTG, "8921_usb_otg", 0, 1, 0, "8917_boost", 10),
638};
639
David Collins2782b5c2012-02-06 10:02:42 -0800640static struct rpm_regulator_init_data
641apq8064_rpm_regulator_init_data[] __devinitdata = {
David Collins3d2b9452012-03-19 11:00:30 -0700642 /* ID a_on pd ss min_uV max_uV supply sys_uA freq fm ss_fm */
643 RPM_SMPS(S1, 1, 1, 0, 1225000, 1225000, NULL, 100000, 3p20, NONE, NONE),
644 RPM_SMPS(S2, 0, 1, 0, 1300000, 1300000, NULL, 0, 1p60, NONE, NONE),
645 RPM_SMPS(S3, 0, 1, 1, 500000, 1150000, NULL, 100000, 4p80, NONE, NONE),
David Collins423c05d2012-04-26 17:31:02 -0700646 RPM_SMPS(S4, 1, 1, 0, 1800000, 1800000, NULL, 100000, 1p60, AUTO, AUTO),
David Collinsfd487fd2012-06-18 13:07:31 -0700647 RPM_SMPS(S7, 0, 0, 0, 1300000, 1300000, NULL, 100000, 3p20, NONE, NONE),
David Collins1bf88da2012-05-03 14:58:34 -0700648 RPM_SMPS(S8, 0, 1, 0, 2200000, 2200000, NULL, 0, 1p60, NONE, NONE),
Jay Chokshiea67c622011-07-29 17:12:26 -0700649
David Collins2782b5c2012-02-06 10:02:42 -0800650 /* ID a_on pd ss min_uV max_uV supply sys_uA init_ip */
David Collins423c05d2012-04-26 17:31:02 -0700651 RPM_LDO(L1, 1, 1, 0, 1100000, 1100000, "8921_s4", 0, 1000),
David Collins2782b5c2012-02-06 10:02:42 -0800652 RPM_LDO(L2, 0, 1, 0, 1200000, 1200000, "8921_s4", 0, 0),
653 RPM_LDO(L3, 0, 1, 0, 3075000, 3075000, NULL, 0, 0),
David Collins423c05d2012-04-26 17:31:02 -0700654 RPM_LDO(L4, 1, 1, 0, 1800000, 1800000, NULL, 0, 10000),
David Collins2782b5c2012-02-06 10:02:42 -0800655 RPM_LDO(L5, 0, 1, 0, 2950000, 2950000, NULL, 0, 0),
656 RPM_LDO(L6, 0, 1, 0, 2950000, 2950000, NULL, 0, 0),
657 RPM_LDO(L7, 0, 1, 0, 1850000, 2950000, NULL, 0, 0),
658 RPM_LDO(L8, 0, 1, 0, 2800000, 2800000, NULL, 0, 0),
Anirudh Ghayal62cec442012-02-17 13:02:39 -0800659 RPM_LDO(L9, 0, 1, 0, 3000000, 3000000, NULL, 0, 0),
David Collins2782b5c2012-02-06 10:02:42 -0800660 RPM_LDO(L10, 0, 1, 0, 2900000, 2900000, NULL, 0, 0),
661 RPM_LDO(L11, 0, 1, 0, 3000000, 3000000, NULL, 0, 0),
662 RPM_LDO(L12, 0, 1, 0, 1200000, 1200000, "8921_s4", 0, 0),
David Collinsd459ace2012-08-31 12:13:28 -0700663 RPM_LDO(L13, 0, 0, 0, 2220000, 2220000, NULL, 0, 0),
David Collins2782b5c2012-02-06 10:02:42 -0800664 RPM_LDO(L14, 0, 1, 0, 1800000, 1800000, NULL, 0, 0),
665 RPM_LDO(L15, 0, 1, 0, 1800000, 2950000, NULL, 0, 0),
666 RPM_LDO(L16, 0, 1, 0, 2800000, 2800000, NULL, 0, 0),
667 RPM_LDO(L17, 0, 1, 0, 2000000, 2000000, NULL, 0, 0),
668 RPM_LDO(L18, 0, 1, 0, 1300000, 1800000, "8921_s4", 0, 0),
David Collins1bf88da2012-05-03 14:58:34 -0700669 RPM_LDO(L21, 0, 1, 0, 1050000, 1050000, NULL, 0, 0),
David Collins2782b5c2012-02-06 10:02:42 -0800670 RPM_LDO(L22, 0, 1, 0, 2600000, 2600000, NULL, 0, 0),
671 RPM_LDO(L23, 0, 1, 0, 1800000, 1800000, NULL, 0, 0),
672 RPM_LDO(L24, 0, 1, 1, 750000, 1150000, "8921_s1", 10000, 10000),
David Collins62debe82012-06-06 17:01:03 -0700673 RPM_LDO(L25, 1, 1, 0, 1250000, 1250000, "8921_s1", 10000, 10000),
David Collinsfd487fd2012-06-18 13:07:31 -0700674 RPM_LDO(L27, 0, 0, 0, 1100000, 1100000, "8921_s7", 0, 0),
David Collins2782b5c2012-02-06 10:02:42 -0800675 RPM_LDO(L28, 0, 1, 0, 1050000, 1050000, "8921_s7", 0, 0),
David Collins1bf88da2012-05-03 14:58:34 -0700676 RPM_LDO(L29, 0, 1, 0, 2000000, 2000000, NULL, 0, 0),
David Collins2782b5c2012-02-06 10:02:42 -0800677
678 /* ID a_on pd ss supply */
679 RPM_VS(LVS1, 0, 1, 0, "8921_s4"),
David Collins2782b5c2012-02-06 10:02:42 -0800680 RPM_VS(LVS3, 0, 1, 0, "8921_s4"),
681 RPM_VS(LVS4, 0, 1, 0, "8921_s4"),
682 RPM_VS(LVS5, 0, 1, 0, "8921_s4"),
683 RPM_VS(LVS6, 0, 1, 0, "8921_s4"),
Jay Chokshi9dace162012-03-13 19:07:57 -0700684 RPM_VS(LVS7, 0, 1, 1, "8921_s4"),
David Collins793793b2012-08-21 15:43:02 -0700685};
686
687static struct rpm_regulator_init_data
688apq8064_rpm_regulator_pm8921_init_data[] __devinitdata = {
689 /* ID a_on pd ss supply */
690 RPM_VS(LVS2, 0, 1, 0, "8921_s1"),
David Collins2782b5c2012-02-06 10:02:42 -0800691
692 /* ID a_on ss min_uV max_uV supply freq */
693 RPM_NCP(NCP, 0, 0, 1800000, 1800000, "8921_l6", 1p60),
Jay Chokshiea67c622011-07-29 17:12:26 -0700694};
695
696int msm8064_pm8921_regulator_pdata_len __devinitdata =
697 ARRAY_SIZE(msm8064_pm8921_regulator_pdata);
David Collins793793b2012-08-21 15:43:02 -0700698int msm8064_pm8917_regulator_pdata_len __devinitdata =
699 ARRAY_SIZE(msm8064_pm8917_regulator_pdata);
David Collins2782b5c2012-02-06 10:02:42 -0800700
Matt Wagantallf5cc3892012-06-07 19:47:02 -0700701#define RPM_REG_MAP(_id, _sleep_also, _voter, _supply, _dev_name) \
702 { \
703 .vreg_id = RPM_VREG_ID_PM8921_##_id, \
704 .sleep_also = _sleep_also, \
705 .voter = _voter, \
706 .supply = _supply, \
707 .dev_name = _dev_name, \
708 }
709static struct rpm_regulator_consumer_mapping
710 msm_rpm_regulator_consumer_mapping[] __devinitdata = {
711 RPM_REG_MAP(LVS7, 0, 1, "krait0_hfpll", "acpuclk-8064"),
712 RPM_REG_MAP(LVS7, 0, 2, "krait1_hfpll", "acpuclk-8064"),
713 RPM_REG_MAP(LVS7, 0, 4, "krait2_hfpll", "acpuclk-8064"),
714 RPM_REG_MAP(LVS7, 0, 5, "krait3_hfpll", "acpuclk-8064"),
715 RPM_REG_MAP(LVS7, 0, 6, "l2_hfpll", "acpuclk-8064"),
716 RPM_REG_MAP(L24, 0, 1, "krait0_mem", "acpuclk-8064"),
717 RPM_REG_MAP(L24, 0, 2, "krait1_mem", "acpuclk-8064"),
718 RPM_REG_MAP(L24, 0, 4, "krait2_mem", "acpuclk-8064"),
719 RPM_REG_MAP(L24, 0, 5, "krait3_mem", "acpuclk-8064"),
720 RPM_REG_MAP(S3, 0, 1, "krait0_dig", "acpuclk-8064"),
721 RPM_REG_MAP(S3, 0, 2, "krait1_dig", "acpuclk-8064"),
722 RPM_REG_MAP(S3, 0, 4, "krait2_dig", "acpuclk-8064"),
723 RPM_REG_MAP(S3, 0, 5, "krait3_dig", "acpuclk-8064"),
724};
725
David Collins2782b5c2012-02-06 10:02:42 -0800726struct rpm_regulator_platform_data apq8064_rpm_regulator_pdata __devinitdata = {
David Collinsbbc92bc2012-07-31 16:39:11 -0700727 .init_data = apq8064_rpm_regulator_init_data,
728 .num_regulators = ARRAY_SIZE(apq8064_rpm_regulator_init_data),
729 .version = RPM_VREG_VERSION_8960,
730 .vreg_id_vdd_mem = RPM_VREG_ID_PM8921_L24,
731 .vreg_id_vdd_dig = RPM_VREG_ID_PM8921_S3,
732 .requires_tcxo_workaround = true,
733 .consumer_map = msm_rpm_regulator_consumer_mapping,
Matt Wagantallf5cc3892012-06-07 19:47:02 -0700734 .consumer_map_len = ARRAY_SIZE(msm_rpm_regulator_consumer_mapping),
David Collins2782b5c2012-02-06 10:02:42 -0800735};
David Collins793793b2012-08-21 15:43:02 -0700736
737/* Regulators that are only present when using PM8921 */
738struct rpm_regulator_platform_data
739apq8064_rpm_regulator_pm8921_pdata __devinitdata = {
740 .init_data = apq8064_rpm_regulator_pm8921_init_data,
741 .num_regulators = ARRAY_SIZE(apq8064_rpm_regulator_pm8921_init_data),
742 .version = RPM_VREG_VERSION_8960,
743 .vreg_id_vdd_mem = RPM_VREG_ID_PM8921_L24,
744 .vreg_id_vdd_dig = RPM_VREG_ID_PM8921_S3,
745 .requires_tcxo_workaround = true,
746};
747
748/*
749 * Fix up regulator consumer data that moves to a different regulator when
750 * PM8917 is used.
751 */
752void __init configure_apq8064_pm8917_power_grid(void)
753{
754 static struct rpm_regulator_init_data *rpm_data;
755 int i;
756
757 for (i = 0; i < ARRAY_SIZE(apq8064_rpm_regulator_init_data); i++) {
758 rpm_data = &apq8064_rpm_regulator_init_data[i];
759 if (rpm_data->id == RPM_VREG_ID_PM8921_S1) {
760 rpm_data->init_data.consumer_supplies
761 = vreg_consumers_8917_S1;
762 rpm_data->init_data.num_consumer_supplies
763 = ARRAY_SIZE(vreg_consumers_8917_S1);
764 }
765 }
766}