blob: 57ecc273c0fcbb5a00eb30fd9c90a1cdea71d322 [file] [log] [blame]
Jay Chokshiea67c622011-07-29 17:12:26 -07001/*
Sujit Reddy Thummab0d51e72012-12-31 15:37:16 +05302 * Copyright (c) 2011-2013, The Linux Foundation. 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"),
Santosh Mardi344455a2012-09-07 13:22:16 +053036 REGULATOR_SUPPLY("HRD_VDDD_CDC_D", "tabla2x-slim"),
37 REGULATOR_SUPPLY("HRD_CDC_VDDA_A_1P2V", "tabla2x-slim"),
Ravishangar Kalyanamad320022012-07-23 18:26:09 -070038 REGULATOR_SUPPLY("dsi_pll_vdda", "mdp.0"),
Jay Chokshiea67c622011-07-29 17:12:26 -070039};
40VREG_CONSUMERS(L3) = {
41 REGULATOR_SUPPLY("8921_l3", NULL),
Hemant Kumar6ddad592011-08-03 19:31:56 -070042 REGULATOR_SUPPLY("HSUSB_3p3", "msm_otg"),
Manu Gautamdccbca42011-11-08 15:13:38 +053043 REGULATOR_SUPPLY("HSUSB_3p3", "msm_ehci_host.0"),
44 REGULATOR_SUPPLY("HSUSB_3p3", "msm_ehci_host.1"),
Jay Chokshiea67c622011-07-29 17:12:26 -070045};
46VREG_CONSUMERS(L4) = {
47 REGULATOR_SUPPLY("8921_l4", NULL),
Hemant Kumar6ddad592011-08-03 19:31:56 -070048 REGULATOR_SUPPLY("HSUSB_1p8", "msm_otg"),
Subramanian Srinivasan04d2c832012-01-17 11:26:36 -080049 REGULATOR_SUPPLY("iris_vddxo", "wcnss_wlan.0"),
Ankit Verma6fe41b02012-09-13 16:12:11 +053050 REGULATOR_SUPPLY("bha_vddxo", "bt_power"),
Jay Chokshiea67c622011-07-29 17:12:26 -070051};
52VREG_CONSUMERS(L5) = {
53 REGULATOR_SUPPLY("8921_l5", NULL),
Sahitya Tummalab4d883f2011-08-23 10:44:51 +053054 REGULATOR_SUPPLY("sdc_vdd", "msm_sdcc.1"),
Jay Chokshiea67c622011-07-29 17:12:26 -070055};
56VREG_CONSUMERS(L6) = {
57 REGULATOR_SUPPLY("8921_l6", NULL),
Sahitya Tummalab4d883f2011-08-23 10:44:51 +053058 REGULATOR_SUPPLY("sdc_vdd", "msm_sdcc.3"),
Jay Chokshiea67c622011-07-29 17:12:26 -070059};
60VREG_CONSUMERS(L7) = {
61 REGULATOR_SUPPLY("8921_l7", NULL),
Subhash Jadavani937c7502012-06-01 15:34:46 +053062 REGULATOR_SUPPLY("sdc_vdd_io", "msm_sdcc.3"),
Jay Chokshiea67c622011-07-29 17:12:26 -070063};
64VREG_CONSUMERS(L8) = {
65 REGULATOR_SUPPLY("8921_l8", NULL),
Jeyaprakash Soundrapandianf0d4d012012-01-16 15:12:20 -080066 REGULATOR_SUPPLY("cam_vana", "4-001a"),
Punit Soni57850102012-09-26 11:31:27 -070067 REGULATOR_SUPPLY("cam_vana", "4-0010"),
Sreesudhan Ramakrish Ramkumar6c6f57c2012-02-21 15:12:44 -080068 REGULATOR_SUPPLY("cam_vana", "4-0048"),
Jeyaprakash Soundrapandianf0d4d012012-01-16 15:12:20 -080069 REGULATOR_SUPPLY("cam_vana", "4-006c"),
Sreesudhan Ramakrish Ramkumar3381da72012-01-27 08:08:32 -080070 REGULATOR_SUPPLY("cam_vana", "4-0034"),
Sreesudhan Ramakrish Ramkumar8002a792012-04-09 17:42:58 -070071 REGULATOR_SUPPLY("cam_vana", "4-0020"),
Jay Chokshiea67c622011-07-29 17:12:26 -070072};
73VREG_CONSUMERS(L9) = {
74 REGULATOR_SUPPLY("8921_l9", NULL),
Anirudh Ghayal2917a5a2012-02-05 19:51:07 -080075 REGULATOR_SUPPLY("vdd", "3-0024"),
Jay Chokshiea67c622011-07-29 17:12:26 -070076};
77VREG_CONSUMERS(L10) = {
78 REGULATOR_SUPPLY("8921_l10", NULL),
Subramanian Srinivasan04d2c832012-01-17 11:26:36 -080079 REGULATOR_SUPPLY("iris_vddpa", "wcnss_wlan.0"),
Ankit Verma6fe41b02012-09-13 16:12:11 +053080 REGULATOR_SUPPLY("bha_vddpa", "bt_power"),
Jay Chokshiea67c622011-07-29 17:12:26 -070081};
82VREG_CONSUMERS(L11) = {
83 REGULATOR_SUPPLY("8921_l11", NULL),
Ravishangar Kalyanamc2fee312012-02-09 19:11:22 -080084 REGULATOR_SUPPLY("dsi1_avdd", "mipi_dsi.1"),
Jay Chokshiea67c622011-07-29 17:12:26 -070085};
86VREG_CONSUMERS(L12) = {
Jeyaprakash Soundrapandianf0d4d012012-01-16 15:12:20 -080087 REGULATOR_SUPPLY("cam_vdig", "4-001a"),
Punit Soni57850102012-09-26 11:31:27 -070088 REGULATOR_SUPPLY("cam_vdig", "4-0010"),
Sreesudhan Ramakrish Ramkumar6c6f57c2012-02-21 15:12:44 -080089 REGULATOR_SUPPLY("cam_vdig", "4-0048"),
Jeyaprakash Soundrapandianf0d4d012012-01-16 15:12:20 -080090 REGULATOR_SUPPLY("cam_vdig", "4-006c"),
Sreesudhan Ramakrish Ramkumar3381da72012-01-27 08:08:32 -080091 REGULATOR_SUPPLY("cam_vdig", "4-0034"),
Sreesudhan Ramakrish Ramkumar8002a792012-04-09 17:42:58 -070092 REGULATOR_SUPPLY("cam_vdig", "4-0020"),
Jay Chokshiea67c622011-07-29 17:12:26 -070093 REGULATOR_SUPPLY("8921_l12", NULL),
94};
David Collinsd459ace2012-08-31 12:13:28 -070095VREG_CONSUMERS(L13) = {
96 REGULATOR_SUPPLY("8921_l13", NULL),
97};
Jay Chokshiea67c622011-07-29 17:12:26 -070098VREG_CONSUMERS(L14) = {
99 REGULATOR_SUPPLY("8921_l14", NULL),
David Keitel663abad2012-09-04 21:00:27 -0700100 REGULATOR_SUPPLY("vreg_xoadc", "pm8921-charger"),
Jay Chokshiea67c622011-07-29 17:12:26 -0700101};
102VREG_CONSUMERS(L15) = {
103 REGULATOR_SUPPLY("8921_l15", NULL),
104};
105VREG_CONSUMERS(L16) = {
106 REGULATOR_SUPPLY("8921_l16", NULL),
Jeyaprakash Soundrapandianf0d4d012012-01-16 15:12:20 -0800107 REGULATOR_SUPPLY("cam_vaf", "4-001a"),
Punit Soni57850102012-09-26 11:31:27 -0700108 REGULATOR_SUPPLY("cam_vaf", "4-0010"),
Sreesudhan Ramakrish Ramkumar6c6f57c2012-02-21 15:12:44 -0800109 REGULATOR_SUPPLY("cam_vaf", "4-0048"),
Jeyaprakash Soundrapandianf0d4d012012-01-16 15:12:20 -0800110 REGULATOR_SUPPLY("cam_vaf", "4-006c"),
Sreesudhan Ramakrish Ramkumar3381da72012-01-27 08:08:32 -0800111 REGULATOR_SUPPLY("cam_vaf", "4-0034"),
Sreesudhan Ramakrish Ramkumar8002a792012-04-09 17:42:58 -0700112 REGULATOR_SUPPLY("cam_vaf", "4-0020"),
Jay Chokshiea67c622011-07-29 17:12:26 -0700113};
114VREG_CONSUMERS(L17) = {
115 REGULATOR_SUPPLY("8921_l17", NULL),
116};
117VREG_CONSUMERS(L18) = {
118 REGULATOR_SUPPLY("8921_l18", NULL),
119};
David Collins1bf88da2012-05-03 14:58:34 -0700120VREG_CONSUMERS(L21) = {
121 REGULATOR_SUPPLY("8921_l21", NULL),
122};
Jay Chokshiea67c622011-07-29 17:12:26 -0700123VREG_CONSUMERS(L22) = {
124 REGULATOR_SUPPLY("8921_l22", NULL),
125};
126VREG_CONSUMERS(L23) = {
127 REGULATOR_SUPPLY("8921_l23", NULL),
Manu Gautam91223e02011-11-08 15:27:22 +0530128 REGULATOR_SUPPLY("HSUSB_1p8", "msm_ehci_host.0"),
129 REGULATOR_SUPPLY("HSUSB_1p8", "msm_ehci_host.1"),
Jay Chokshiea67c622011-07-29 17:12:26 -0700130};
131VREG_CONSUMERS(L24) = {
132 REGULATOR_SUPPLY("8921_l24", NULL),
Subramanian Srinivasan04d2c832012-01-17 11:26:36 -0800133 REGULATOR_SUPPLY("riva_vddmx", "wcnss_wlan.0"),
Jay Chokshiea67c622011-07-29 17:12:26 -0700134};
135VREG_CONSUMERS(L25) = {
136 REGULATOR_SUPPLY("8921_l25", NULL),
Swaminathan Sathappan2f51a752011-12-05 12:51:19 -0800137 REGULATOR_SUPPLY("VDDD_CDC_D", "tabla-slim"),
138 REGULATOR_SUPPLY("CDC_VDDA_A_1P2V", "tabla-slim"),
Swaminathan Sathappan2316e082012-02-03 14:07:17 -0800139 REGULATOR_SUPPLY("VDDD_CDC_D", "tabla2x-slim"),
140 REGULATOR_SUPPLY("CDC_VDDA_A_1P2V", "tabla2x-slim"),
Kuirong Wangf8c5e142012-06-21 16:17:32 -0700141 REGULATOR_SUPPLY("VDDD_CDC_D", "0-000d"),
142 REGULATOR_SUPPLY("CDC_VDDA_A_1P2V", "0-000d"),
Jay Chokshiea67c622011-07-29 17:12:26 -0700143};
144VREG_CONSUMERS(L26) = {
145 REGULATOR_SUPPLY("8921_l26", NULL),
Stephen Boydbdb53f32012-06-05 18:39:47 -0700146 REGULATOR_SUPPLY("core_vdd", "pil-q6v4-lpass"),
Jay Chokshiea67c622011-07-29 17:12:26 -0700147};
148VREG_CONSUMERS(L27) = {
149 REGULATOR_SUPPLY("8921_l27", NULL),
150};
151VREG_CONSUMERS(L28) = {
152 REGULATOR_SUPPLY("8921_l28", NULL),
153};
David Collins1bf88da2012-05-03 14:58:34 -0700154VREG_CONSUMERS(L29) = {
155 REGULATOR_SUPPLY("8921_l29", NULL),
156};
Jay Chokshiea67c622011-07-29 17:12:26 -0700157VREG_CONSUMERS(S2) = {
158 REGULATOR_SUPPLY("8921_s2", NULL),
Subramanian Srinivasan04d2c832012-01-17 11:26:36 -0800159 REGULATOR_SUPPLY("iris_vddrfa", "wcnss_wlan.0"),
Jay Chokshiea67c622011-07-29 17:12:26 -0700160};
161VREG_CONSUMERS(S3) = {
162 REGULATOR_SUPPLY("8921_s3", NULL),
Hemant Kumar6ddad592011-08-03 19:31:56 -0700163 REGULATOR_SUPPLY("HSUSB_VDDCX", "msm_otg"),
Manu Gautamdccbca42011-11-08 15:13:38 +0530164 REGULATOR_SUPPLY("HSUSB_VDDCX", "msm_ehci_host.0"),
165 REGULATOR_SUPPLY("HSUSB_VDDCX", "msm_ehci_host.1"),
Hemant Kumara945b472012-01-25 15:08:06 -0800166 REGULATOR_SUPPLY("HSIC_VDDCX", "msm_hsic_host"),
Subramanian Srinivasan04d2c832012-01-17 11:26:36 -0800167 REGULATOR_SUPPLY("riva_vddcx", "wcnss_wlan.0"),
Niranjana Vishwanathapura06f89332012-05-03 17:11:13 -0600168 REGULATOR_SUPPLY("vp_pcie", "msm_pcie"),
169 REGULATOR_SUPPLY("vptx_pcie", "msm_pcie"),
Jay Chokshiea67c622011-07-29 17:12:26 -0700170};
171VREG_CONSUMERS(S4) = {
172 REGULATOR_SUPPLY("8921_s4", NULL),
Subhash Jadavani937c7502012-06-01 15:34:46 +0530173 REGULATOR_SUPPLY("sdc_vdd_io", "msm_sdcc.1"),
Swaminathan Sathappan2f51a752011-12-05 12:51:19 -0800174 REGULATOR_SUPPLY("VDDIO_CDC", "tabla-slim"),
175 REGULATOR_SUPPLY("CDC_VDD_CP", "tabla-slim"),
176 REGULATOR_SUPPLY("CDC_VDDA_TX", "tabla-slim"),
177 REGULATOR_SUPPLY("CDC_VDDA_RX", "tabla-slim"),
Swaminathan Sathappan2316e082012-02-03 14:07:17 -0800178 REGULATOR_SUPPLY("VDDIO_CDC", "tabla2x-slim"),
179 REGULATOR_SUPPLY("CDC_VDD_CP", "tabla2x-slim"),
180 REGULATOR_SUPPLY("CDC_VDDA_TX", "tabla2x-slim"),
181 REGULATOR_SUPPLY("CDC_VDDA_RX", "tabla2x-slim"),
Kuirong Wangf8c5e142012-06-21 16:17:32 -0700182 REGULATOR_SUPPLY("VDDIO_CDC", "0-000d"),
183 REGULATOR_SUPPLY("CDC_VDD_CP", "0-000d"),
184 REGULATOR_SUPPLY("CDC_VDDA_TX", "0-000d"),
185 REGULATOR_SUPPLY("CDC_VDDA_RX", "0-000d"),
Subramanian Srinivasan04d2c832012-01-17 11:26:36 -0800186 REGULATOR_SUPPLY("riva_vddpx", "wcnss_wlan.0"),
Ankit Verma6fe41b02012-09-13 16:12:11 +0530187 REGULATOR_SUPPLY("bha_vddpx", "bt_power"),
Jing Lin21ed4de2012-02-05 15:53:28 -0800188 REGULATOR_SUPPLY("vcc_i2c", "3-005b"),
Anirudh Ghayal2917a5a2012-02-05 19:51:07 -0800189 REGULATOR_SUPPLY("vcc_i2c", "3-0024"),
Amy Maloche70090f992012-02-16 16:35:26 -0800190 REGULATOR_SUPPLY("vddp", "0-0048"),
Aravind Venkateswaran0507c8c2012-02-16 17:16:05 -0800191 REGULATOR_SUPPLY("hdmi_lvl_tsl", "hdmi_msm.0"),
Stepan Moskovchenkofdea9402012-09-10 18:51:43 -0700192 REGULATOR_SUPPLY("vdd-io", "spi0.2"),
Sujit Reddy Thummab0d51e72012-12-31 15:37:16 +0530193 REGULATOR_SUPPLY("sata_pmp_pwr", "msm_sata.0"),
Jay Chokshiea67c622011-07-29 17:12:26 -0700194};
195VREG_CONSUMERS(S5) = {
196 REGULATOR_SUPPLY("8921_s5", NULL),
Matt Wagantallf5cc3892012-06-07 19:47:02 -0700197 REGULATOR_SUPPLY("krait0", "acpuclk-8064"),
Jay Chokshiea67c622011-07-29 17:12:26 -0700198};
199VREG_CONSUMERS(S6) = {
200 REGULATOR_SUPPLY("8921_s6", NULL),
Matt Wagantallf5cc3892012-06-07 19:47:02 -0700201 REGULATOR_SUPPLY("krait1", "acpuclk-8064"),
Jay Chokshiea67c622011-07-29 17:12:26 -0700202};
203VREG_CONSUMERS(S7) = {
204 REGULATOR_SUPPLY("8921_s7", NULL),
205};
David Collins1bf88da2012-05-03 14:58:34 -0700206VREG_CONSUMERS(S8) = {
207 REGULATOR_SUPPLY("8921_s8", NULL),
208};
Jay Chokshiea67c622011-07-29 17:12:26 -0700209VREG_CONSUMERS(LVS1) = {
210 REGULATOR_SUPPLY("8921_lvs1", NULL),
Subramanian Srinivasan04d2c832012-01-17 11:26:36 -0800211 REGULATOR_SUPPLY("iris_vddio", "wcnss_wlan.0"),
Jay Chokshiea67c622011-07-29 17:12:26 -0700212};
Jay Chokshiea67c622011-07-29 17:12:26 -0700213VREG_CONSUMERS(LVS3) = {
214 REGULATOR_SUPPLY("8921_lvs3", NULL),
215};
216VREG_CONSUMERS(LVS4) = {
217 REGULATOR_SUPPLY("8921_lvs4", NULL),
218};
219VREG_CONSUMERS(LVS5) = {
220 REGULATOR_SUPPLY("8921_lvs5", NULL),
Jeyaprakash Soundrapandianf0d4d012012-01-16 15:12:20 -0800221 REGULATOR_SUPPLY("cam_vio", "4-001a"),
Punit Soni57850102012-09-26 11:31:27 -0700222 REGULATOR_SUPPLY("cam_vio", "4-0010"),
Sreesudhan Ramakrish Ramkumar6c6f57c2012-02-21 15:12:44 -0800223 REGULATOR_SUPPLY("cam_vio", "4-0048"),
Jeyaprakash Soundrapandianf0d4d012012-01-16 15:12:20 -0800224 REGULATOR_SUPPLY("cam_vio", "4-006c"),
Sreesudhan Ramakrish Ramkumar3381da72012-01-27 08:08:32 -0800225 REGULATOR_SUPPLY("cam_vio", "4-0034"),
Sreesudhan Ramakrish Ramkumar8002a792012-04-09 17:42:58 -0700226 REGULATOR_SUPPLY("cam_vio", "4-0020"),
Jay Chokshiea67c622011-07-29 17:12:26 -0700227};
228VREG_CONSUMERS(LVS6) = {
229 REGULATOR_SUPPLY("8921_lvs6", NULL),
Niranjana Vishwanathapura06f89332012-05-03 17:11:13 -0600230 REGULATOR_SUPPLY("vdd_pcie_vph", "msm_pcie"),
Jay Chokshiea67c622011-07-29 17:12:26 -0700231};
232VREG_CONSUMERS(LVS7) = {
233 REGULATOR_SUPPLY("8921_lvs7", NULL),
Matt Wagantall52dd0622012-02-02 18:26:16 -0800234 REGULATOR_SUPPLY("pll_vdd", "pil_riva"),
Ravishangar Kalyanamc2fee312012-02-09 19:11:22 -0800235 REGULATOR_SUPPLY("lvds_vdda", "lvds.0"),
236 REGULATOR_SUPPLY("dsi1_vddio", "mipi_dsi.1"),
Ravishangar Kalyanamad320022012-07-23 18:26:09 -0700237 REGULATOR_SUPPLY("dsi_pll_vddio", "mdp.0"),
Aravind Venkateswaran0507c8c2012-02-16 17:16:05 -0800238 REGULATOR_SUPPLY("hdmi_vdda", "hdmi_msm.0"),
Jay Chokshiea67c622011-07-29 17:12:26 -0700239};
240VREG_CONSUMERS(USB_OTG) = {
241 REGULATOR_SUPPLY("8921_usb_otg", NULL),
Hemant Kumard86c4882012-01-24 19:39:37 -0800242 REGULATOR_SUPPLY("vbus_otg", "msm_otg"),
Jay Chokshiea67c622011-07-29 17:12:26 -0700243};
Jay Chokshi7805b5a2011-11-07 15:55:30 -0800244VREG_CONSUMERS(8821_S0) = {
245 REGULATOR_SUPPLY("8821_s0", NULL),
Matt Wagantallf5cc3892012-06-07 19:47:02 -0700246 REGULATOR_SUPPLY("krait2", "acpuclk-8064"),
Jay Chokshi7805b5a2011-11-07 15:55:30 -0800247};
248VREG_CONSUMERS(8821_S1) = {
249 REGULATOR_SUPPLY("8821_s1", NULL),
Matt Wagantallf5cc3892012-06-07 19:47:02 -0700250 REGULATOR_SUPPLY("krait3", "acpuclk-8064"),
Jay Chokshi7805b5a2011-11-07 15:55:30 -0800251};
Jay Chokshi1de4f9d2012-02-07 16:11:31 -0800252VREG_CONSUMERS(EXT_MPP8) = {
253 REGULATOR_SUPPLY("ext_mpp8", NULL),
Hemant Kumar1d66e1c2012-02-13 15:24:59 -0800254 REGULATOR_SUPPLY("vbus", "msm_ehci_host.1"),
Jay Chokshi1de4f9d2012-02-07 16:11:31 -0800255};
David Collinsf0d00732012-01-25 15:46:50 -0800256VREG_CONSUMERS(EXT_3P3V) = {
257 REGULATOR_SUPPLY("ext_3p3v", NULL),
Stepan Moskovchenkofdea9402012-09-10 18:51:43 -0700258 REGULATOR_SUPPLY("vdd-phy", "spi0.2"),
Pavankumar Kondeti57fc8962012-07-06 08:20:18 +0530259 REGULATOR_SUPPLY("mhl_usb_hs_switch", "msm_otg"),
Ravishangar Kalyanamc2fee312012-02-09 19:11:22 -0800260 REGULATOR_SUPPLY("lvds_vccs_3p3v", "lvds.0"),
261 REGULATOR_SUPPLY("dsi1_vccs_3p3v", "mipi_dsi.1"),
Aravind Venkateswaran0507c8c2012-02-16 17:16:05 -0800262 REGULATOR_SUPPLY("hdmi_mux_vdd", "hdmi_msm.0"),
Niranjana Vishwanathapura06f89332012-05-03 17:11:13 -0600263 REGULATOR_SUPPLY("pcie_ext_3p3v", "msm_pcie"),
David Collinsf0d00732012-01-25 15:46:50 -0800264};
David Collins390fc332012-02-07 14:38:16 -0800265VREG_CONSUMERS(EXT_TS_SW) = {
266 REGULATOR_SUPPLY("ext_ts_sw", NULL),
Jing Lin21ed4de2012-02-05 15:53:28 -0800267 REGULATOR_SUPPLY("vdd_ana", "3-005b"),
David Collins390fc332012-02-07 14:38:16 -0800268};
Sujit Reddy Thummab0d51e72012-12-31 15:37:16 +0530269VREG_CONSUMERS(EXT_SATA_PWR) = {
270 REGULATOR_SUPPLY("ext_sata_pwr", NULL),
271 REGULATOR_SUPPLY("sata_ext_3p3v", "msm_sata.0"),
272};
Jay Chokshi1b7eaa92012-04-04 14:53:14 -0700273VREG_CONSUMERS(AVC_1P2V) = {
274 REGULATOR_SUPPLY("avc_1p2v", NULL),
275};
276VREG_CONSUMERS(AVC_1P8V) = {
277 REGULATOR_SUPPLY("avc_1p8v", NULL),
278};
279VREG_CONSUMERS(AVC_2P2V) = {
280 REGULATOR_SUPPLY("avc_2p2v", NULL),
281};
282VREG_CONSUMERS(AVC_5V) = {
283 REGULATOR_SUPPLY("avc_5v", NULL),
284};
285VREG_CONSUMERS(AVC_3P3V) = {
286 REGULATOR_SUPPLY("avc_3p3v", NULL),
287};
Jay Chokshiea67c622011-07-29 17:12:26 -0700288
David Collins793793b2012-08-21 15:43:02 -0700289/* Regulators that are only present when using PM8921 */
290VREG_CONSUMERS(S1) = {
291 REGULATOR_SUPPLY("8921_s1", NULL),
292};
293VREG_CONSUMERS(LVS2) = {
294 REGULATOR_SUPPLY("8921_lvs2", NULL),
295 REGULATOR_SUPPLY("iris_vdddig", "wcnss_wlan.0"),
296};
297VREG_CONSUMERS(HDMI_MVS) = {
298 REGULATOR_SUPPLY("8921_hdmi_mvs", NULL),
299 REGULATOR_SUPPLY("hdmi_mvs", "hdmi_msm.0"),
300};
301VREG_CONSUMERS(NCP) = {
302 REGULATOR_SUPPLY("8921_ncp", NULL),
303};
304VREG_CONSUMERS(EXT_5V) = {
305 REGULATOR_SUPPLY("ext_5v", NULL),
David Collins793793b2012-08-21 15:43:02 -0700306 REGULATOR_SUPPLY("vbus", "msm_ehci_host.0"),
307};
308
309/* Regulators that are only present when using PM8917 */
310VREG_CONSUMERS(8917_S1) = {
311 REGULATOR_SUPPLY("8921_s1", NULL),
312 REGULATOR_SUPPLY("iris_vdddig", "wcnss_wlan.0"),
313};
314VREG_CONSUMERS(L30) = {
315 REGULATOR_SUPPLY("8917_l30", NULL),
316};
317VREG_CONSUMERS(L31) = {
318 REGULATOR_SUPPLY("8917_l31", NULL),
319};
320VREG_CONSUMERS(L32) = {
321 REGULATOR_SUPPLY("8917_l32", NULL),
322};
323VREG_CONSUMERS(L33) = {
324 REGULATOR_SUPPLY("8917_l33", NULL),
325};
326VREG_CONSUMERS(L34) = {
327 REGULATOR_SUPPLY("8917_l34", NULL),
328};
329VREG_CONSUMERS(L35) = {
330 REGULATOR_SUPPLY("8917_l35", NULL),
331};
332VREG_CONSUMERS(L36) = {
333 REGULATOR_SUPPLY("8917_l36", NULL),
334};
335VREG_CONSUMERS(BOOST) = {
336 REGULATOR_SUPPLY("8917_boost", NULL),
337 REGULATOR_SUPPLY("ext_ddr3", NULL),
338 REGULATOR_SUPPLY("vbus", "msm_ehci_host.0"),
339 REGULATOR_SUPPLY("hdmi_mvs", "hdmi_msm.0"),
340};
341
David Collins75016742011-12-02 15:04:25 -0800342#define PM8XXX_VREG_INIT(_id, _name, _min_uV, _max_uV, _modes, _ops, \
343 _apply_uV, _pull_down, _always_on, _supply_regulator, \
344 _system_uA, _enable_time, _reg_id) \
Jay Chokshiea67c622011-07-29 17:12:26 -0700345 { \
346 .init_data = { \
347 .constraints = { \
348 .valid_modes_mask = _modes, \
349 .valid_ops_mask = _ops, \
350 .min_uV = _min_uV, \
351 .max_uV = _max_uV, \
352 .input_uV = _max_uV, \
353 .apply_uV = _apply_uV, \
354 .always_on = _always_on, \
David Collins75016742011-12-02 15:04:25 -0800355 .name = _name, \
Jay Chokshiea67c622011-07-29 17:12:26 -0700356 }, \
357 .num_consumer_supplies = \
358 ARRAY_SIZE(vreg_consumers_##_id), \
359 .consumer_supplies = vreg_consumers_##_id, \
360 .supply_regulator = _supply_regulator, \
361 }, \
David Collins75016742011-12-02 15:04:25 -0800362 .id = _reg_id, \
Jay Chokshiea67c622011-07-29 17:12:26 -0700363 .pull_down_enable = _pull_down, \
364 .system_uA = _system_uA, \
365 .enable_time = _enable_time, \
366 }
367
David Collins75016742011-12-02 15:04:25 -0800368#define PM8XXX_LDO(_id, _name, _always_on, _pull_down, _min_uV, _max_uV, \
369 _enable_time, _supply_regulator, _system_uA, _reg_id) \
370 PM8XXX_VREG_INIT(_id, _name, _min_uV, _max_uV, REGULATOR_MODE_NORMAL \
Jay Chokshiea67c622011-07-29 17:12:26 -0700371 | REGULATOR_MODE_IDLE, REGULATOR_CHANGE_VOLTAGE | \
372 REGULATOR_CHANGE_STATUS | REGULATOR_CHANGE_MODE | \
373 REGULATOR_CHANGE_DRMS, 0, _pull_down, _always_on, \
David Collins75016742011-12-02 15:04:25 -0800374 _supply_regulator, _system_uA, _enable_time, _reg_id)
Jay Chokshiea67c622011-07-29 17:12:26 -0700375
David Collins75016742011-12-02 15:04:25 -0800376#define PM8XXX_NLDO1200(_id, _name, _always_on, _pull_down, _min_uV, \
377 _max_uV, _enable_time, _supply_regulator, _system_uA, _reg_id) \
378 PM8XXX_VREG_INIT(_id, _name, _min_uV, _max_uV, REGULATOR_MODE_NORMAL \
Jay Chokshiea67c622011-07-29 17:12:26 -0700379 | REGULATOR_MODE_IDLE, REGULATOR_CHANGE_VOLTAGE | \
380 REGULATOR_CHANGE_STATUS | REGULATOR_CHANGE_MODE | \
381 REGULATOR_CHANGE_DRMS, 0, _pull_down, _always_on, \
David Collins75016742011-12-02 15:04:25 -0800382 _supply_regulator, _system_uA, _enable_time, _reg_id)
Jay Chokshiea67c622011-07-29 17:12:26 -0700383
David Collins75016742011-12-02 15:04:25 -0800384#define PM8XXX_SMPS(_id, _name, _always_on, _pull_down, _min_uV, _max_uV, \
385 _enable_time, _supply_regulator, _system_uA, _reg_id) \
386 PM8XXX_VREG_INIT(_id, _name, _min_uV, _max_uV, REGULATOR_MODE_NORMAL \
Jay Chokshiea67c622011-07-29 17:12:26 -0700387 | REGULATOR_MODE_IDLE, REGULATOR_CHANGE_VOLTAGE | \
388 REGULATOR_CHANGE_STATUS | REGULATOR_CHANGE_MODE | \
389 REGULATOR_CHANGE_DRMS, 0, _pull_down, _always_on, \
David Collins75016742011-12-02 15:04:25 -0800390 _supply_regulator, _system_uA, _enable_time, _reg_id)
Jay Chokshiea67c622011-07-29 17:12:26 -0700391
David Collins75016742011-12-02 15:04:25 -0800392#define PM8XXX_FTSMPS(_id, _name, _always_on, _pull_down, _min_uV, _max_uV, \
393 _enable_time, _supply_regulator, _system_uA, _reg_id) \
394 PM8XXX_VREG_INIT(_id, _name, _min_uV, _max_uV, REGULATOR_MODE_NORMAL, \
Jay Chokshiea67c622011-07-29 17:12:26 -0700395 REGULATOR_CHANGE_VOLTAGE | REGULATOR_CHANGE_STATUS \
396 | REGULATOR_CHANGE_MODE, 0, _pull_down, _always_on, \
David Collins75016742011-12-02 15:04:25 -0800397 _supply_regulator, _system_uA, _enable_time, _reg_id)
Jay Chokshiea67c622011-07-29 17:12:26 -0700398
David Collins75016742011-12-02 15:04:25 -0800399#define PM8XXX_VS(_id, _name, _always_on, _pull_down, _enable_time, \
400 _supply_regulator, _reg_id) \
401 PM8XXX_VREG_INIT(_id, _name, 0, 0, 0, REGULATOR_CHANGE_STATUS, 0, \
402 _pull_down, _always_on, _supply_regulator, 0, _enable_time, \
403 _reg_id)
Jay Chokshiea67c622011-07-29 17:12:26 -0700404
David Collins75016742011-12-02 15:04:25 -0800405#define PM8XXX_VS300(_id, _name, _always_on, _pull_down, _enable_time, \
406 _supply_regulator, _reg_id) \
407 PM8XXX_VREG_INIT(_id, _name, 0, 0, 0, REGULATOR_CHANGE_STATUS, 0, \
408 _pull_down, _always_on, _supply_regulator, 0, _enable_time, \
409 _reg_id)
Jay Chokshiea67c622011-07-29 17:12:26 -0700410
David Collins75016742011-12-02 15:04:25 -0800411#define PM8XXX_NCP(_id, _name, _always_on, _min_uV, _max_uV, _enable_time, \
412 _supply_regulator, _reg_id) \
413 PM8XXX_VREG_INIT(_id, _name, _min_uV, _max_uV, 0, \
414 REGULATOR_CHANGE_VOLTAGE | REGULATOR_CHANGE_STATUS, 0, 0, \
415 _always_on, _supply_regulator, 0, _enable_time, _reg_id)
Jay Chokshiea67c622011-07-29 17:12:26 -0700416
David Collins793793b2012-08-21 15:43:02 -0700417#define PM8XXX_BOOST(_id, _name, _always_on, _min_uV, _max_uV, _enable_time, \
418 _supply_regulator, _reg_id) \
419 PM8XXX_VREG_INIT(_id, _name, _min_uV, _max_uV, 0, \
420 REGULATOR_CHANGE_VOLTAGE | REGULATOR_CHANGE_STATUS, 0, 0, \
421 _always_on, _supply_regulator, 0, _enable_time, _reg_id)
422
Jay Chokshiea67c622011-07-29 17:12:26 -0700423/* Pin control initialization */
David Collins75016742011-12-02 15:04:25 -0800424#define PM8XXX_PC(_id, _name, _always_on, _pin_fn, _pin_ctrl, \
425 _supply_regulator, _reg_id) \
Jay Chokshiea67c622011-07-29 17:12:26 -0700426 { \
427 .init_data = { \
428 .constraints = { \
429 .valid_ops_mask = REGULATOR_CHANGE_STATUS, \
430 .always_on = _always_on, \
David Collins75016742011-12-02 15:04:25 -0800431 .name = _name, \
Jay Chokshiea67c622011-07-29 17:12:26 -0700432 }, \
433 .num_consumer_supplies = \
434 ARRAY_SIZE(vreg_consumers_##_id##_PC), \
435 .consumer_supplies = vreg_consumers_##_id##_PC, \
436 .supply_regulator = _supply_regulator, \
437 }, \
David Collins75016742011-12-02 15:04:25 -0800438 .id = _reg_id, \
439 .pin_fn = PM8XXX_VREG_PIN_FN_##_pin_fn, \
440 .pin_ctrl = _pin_ctrl, \
Jay Chokshiea67c622011-07-29 17:12:26 -0700441 }
442
Sujit Reddy Thummab0d51e72012-12-31 15:37:16 +0530443#define GPIO_VREG(_id, _reg_name, _gpio_label, _gpio, _supply_regulator, \
444 _active_low) \
David Collinsf0d00732012-01-25 15:46:50 -0800445 [GPIO_VREG_ID_##_id] = { \
446 .init_data = { \
447 .constraints = { \
448 .valid_ops_mask = REGULATOR_CHANGE_STATUS, \
449 }, \
450 .num_consumer_supplies = \
451 ARRAY_SIZE(vreg_consumers_##_id), \
452 .consumer_supplies = vreg_consumers_##_id, \
453 .supply_regulator = _supply_regulator, \
454 }, \
455 .regulator_name = _reg_name, \
456 .gpio_label = _gpio_label, \
457 .gpio = _gpio, \
Sujit Reddy Thummab0d51e72012-12-31 15:37:16 +0530458 .active_low = _active_low, \
David Collinsf0d00732012-01-25 15:46:50 -0800459 }
460
Sujit Reddy Thummaf97e5ec2013-01-16 15:02:17 +0530461#define FIXED_VREG_INIT(_id, _supply_regulator) \
462 { \
463 .constraints = { \
464 .valid_ops_mask = REGULATOR_CHANGE_STATUS, \
465 }, \
466 .num_consumer_supplies = ARRAY_SIZE(vreg_consumers_##_id), \
467 .consumer_supplies = vreg_consumers_##_id, \
468 .supply_regulator = _supply_regulator, \
469 }
470
Jay Chokshiea67c622011-07-29 17:12:26 -0700471#define SAW_VREG_INIT(_id, _name, _min_uV, _max_uV) \
472 { \
473 .constraints = { \
474 .name = _name, \
Michael Bohanee3ce19c2012-11-13 14:57:40 -0800475 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE | \
476 REGULATOR_CHANGE_STATUS, \
Jay Chokshiea67c622011-07-29 17:12:26 -0700477 .min_uV = _min_uV, \
478 .max_uV = _max_uV, \
479 }, \
480 .num_consumer_supplies = ARRAY_SIZE(vreg_consumers_##_id), \
481 .consumer_supplies = vreg_consumers_##_id, \
482 }
483
David Collins2782b5c2012-02-06 10:02:42 -0800484#define RPM_INIT(_id, _min_uV, _max_uV, _modes, _ops, _apply_uV, _default_uV, \
485 _peak_uA, _avg_uA, _pull_down, _pin_ctrl, _freq, _pin_fn, \
David Collins15789042012-03-19 10:44:36 -0700486 _force_mode, _sleep_set_force_mode, _power_mode, _state, \
487 _sleep_selectable, _always_on, _supply_regulator, _system_uA) \
David Collins2782b5c2012-02-06 10:02:42 -0800488 { \
489 .init_data = { \
490 .constraints = { \
491 .valid_modes_mask = _modes, \
492 .valid_ops_mask = _ops, \
493 .min_uV = _min_uV, \
494 .max_uV = _max_uV, \
495 .input_uV = _min_uV, \
496 .apply_uV = _apply_uV, \
497 .always_on = _always_on, \
498 }, \
499 .num_consumer_supplies = \
500 ARRAY_SIZE(vreg_consumers_##_id), \
501 .consumer_supplies = vreg_consumers_##_id, \
502 .supply_regulator = _supply_regulator, \
503 }, \
504 .id = RPM_VREG_ID_PM8921_##_id, \
505 .default_uV = _default_uV, \
506 .peak_uA = _peak_uA, \
507 .avg_uA = _avg_uA, \
508 .pull_down_enable = _pull_down, \
509 .pin_ctrl = _pin_ctrl, \
510 .freq = RPM_VREG_FREQ_##_freq, \
511 .pin_fn = _pin_fn, \
512 .force_mode = _force_mode, \
David Collins15789042012-03-19 10:44:36 -0700513 .sleep_set_force_mode = _sleep_set_force_mode, \
David Collins2782b5c2012-02-06 10:02:42 -0800514 .power_mode = _power_mode, \
515 .state = _state, \
516 .sleep_selectable = _sleep_selectable, \
517 .system_uA = _system_uA, \
518 }
519
520#define RPM_LDO(_id, _always_on, _pd, _sleep_selectable, _min_uV, _max_uV, \
521 _supply_regulator, _system_uA, _init_peak_uA) \
522 RPM_INIT(_id, _min_uV, _max_uV, REGULATOR_MODE_NORMAL \
523 | REGULATOR_MODE_IDLE, REGULATOR_CHANGE_VOLTAGE \
524 | REGULATOR_CHANGE_STATUS | REGULATOR_CHANGE_MODE \
525 | REGULATOR_CHANGE_DRMS, 0, _max_uV, _init_peak_uA, 0, _pd, \
526 RPM_VREG_PIN_CTRL_NONE, NONE, RPM_VREG_PIN_FN_8960_NONE, \
David Collins15789042012-03-19 10:44:36 -0700527 RPM_VREG_FORCE_MODE_8960_NONE, \
David Collins2782b5c2012-02-06 10:02:42 -0800528 RPM_VREG_FORCE_MODE_8960_NONE, RPM_VREG_POWER_MODE_8960_PWM, \
529 RPM_VREG_STATE_OFF, _sleep_selectable, _always_on, \
530 _supply_regulator, _system_uA)
531
532#define RPM_SMPS(_id, _always_on, _pd, _sleep_selectable, _min_uV, _max_uV, \
David Collins3d2b9452012-03-19 11:00:30 -0700533 _supply_regulator, _system_uA, _freq, _force_mode, \
534 _sleep_set_force_mode) \
David Collins2782b5c2012-02-06 10:02:42 -0800535 RPM_INIT(_id, _min_uV, _max_uV, REGULATOR_MODE_NORMAL \
536 | REGULATOR_MODE_IDLE, REGULATOR_CHANGE_VOLTAGE \
537 | REGULATOR_CHANGE_STATUS | REGULATOR_CHANGE_MODE \
538 | REGULATOR_CHANGE_DRMS, 0, _max_uV, _system_uA, 0, _pd, \
539 RPM_VREG_PIN_CTRL_NONE, _freq, RPM_VREG_PIN_FN_8960_NONE, \
David Collins3d2b9452012-03-19 11:00:30 -0700540 RPM_VREG_FORCE_MODE_8960_##_force_mode, \
541 RPM_VREG_FORCE_MODE_8960_##_sleep_set_force_mode, \
542 RPM_VREG_POWER_MODE_8960_PWM, RPM_VREG_STATE_OFF, \
543 _sleep_selectable, _always_on, _supply_regulator, _system_uA)
David Collins2782b5c2012-02-06 10:02:42 -0800544
545#define RPM_VS(_id, _always_on, _pd, _sleep_selectable, _supply_regulator) \
546 RPM_INIT(_id, 0, 0, 0, REGULATOR_CHANGE_STATUS, 0, 0, 1000, 1000, _pd, \
547 RPM_VREG_PIN_CTRL_NONE, NONE, RPM_VREG_PIN_FN_8960_NONE, \
David Collins15789042012-03-19 10:44:36 -0700548 RPM_VREG_FORCE_MODE_8960_NONE, \
David Collins2782b5c2012-02-06 10:02:42 -0800549 RPM_VREG_FORCE_MODE_8960_NONE, RPM_VREG_POWER_MODE_8960_PWM, \
550 RPM_VREG_STATE_OFF, _sleep_selectable, _always_on, \
551 _supply_regulator, 0)
552
553#define RPM_NCP(_id, _always_on, _sleep_selectable, _min_uV, _max_uV, \
554 _supply_regulator, _freq) \
555 RPM_INIT(_id, _min_uV, _max_uV, 0, REGULATOR_CHANGE_VOLTAGE \
556 | REGULATOR_CHANGE_STATUS, 0, _max_uV, 1000, 1000, 0, \
557 RPM_VREG_PIN_CTRL_NONE, _freq, RPM_VREG_PIN_FN_8960_NONE, \
David Collins15789042012-03-19 10:44:36 -0700558 RPM_VREG_FORCE_MODE_8960_NONE, \
David Collins2782b5c2012-02-06 10:02:42 -0800559 RPM_VREG_FORCE_MODE_8960_NONE, RPM_VREG_POWER_MODE_8960_PWM, \
560 RPM_VREG_STATE_OFF, _sleep_selectable, _always_on, \
561 _supply_regulator, 0)
562
563/* Pin control initialization */
564#define RPM_PC_INIT(_id, _always_on, _pin_fn, _pin_ctrl, _supply_regulator) \
565 { \
566 .init_data = { \
567 .constraints = { \
568 .valid_ops_mask = REGULATOR_CHANGE_STATUS, \
569 .always_on = _always_on, \
570 }, \
571 .num_consumer_supplies = \
572 ARRAY_SIZE(vreg_consumers_##_id##_PC), \
573 .consumer_supplies = vreg_consumers_##_id##_PC, \
574 .supply_regulator = _supply_regulator, \
575 }, \
576 .id = RPM_VREG_ID_PM8921_##_id##_PC, \
577 .pin_fn = RPM_VREG_PIN_FN_8960_##_pin_fn, \
578 .pin_ctrl = _pin_ctrl, \
579 }
580
David Collinsf0d00732012-01-25 15:46:50 -0800581/* GPIO regulator constraints */
582struct gpio_regulator_platform_data
583apq8064_gpio_regulator_pdata[] __devinitdata = {
Sujit Reddy Thummab0d51e72012-12-31 15:37:16 +0530584 /* ID vreg_name gpio_label gpio supply active_low */
585 GPIO_VREG(EXT_5V, "ext_5v", "ext_5v_en",
586 PM8921_MPP_PM_TO_SYS(7), NULL, 0),
David Collinsf0d00732012-01-25 15:46:50 -0800587 GPIO_VREG(EXT_3P3V, "ext_3p3v", "ext_3p3v_en",
Sujit Reddy Thummab0d51e72012-12-31 15:37:16 +0530588 APQ8064_EXT_3P3V_REG_EN_GPIO, NULL, 0),
David Collins390fc332012-02-07 14:38:16 -0800589 GPIO_VREG(EXT_TS_SW, "ext_ts_sw", "ext_ts_sw_en",
Sujit Reddy Thummab0d51e72012-12-31 15:37:16 +0530590 PM8921_GPIO_PM_TO_SYS(23), "ext_3p3v", 0),
Jay Chokshi1de4f9d2012-02-07 16:11:31 -0800591 GPIO_VREG(EXT_MPP8, "ext_mpp8", "ext_mpp8_en",
Sujit Reddy Thummab0d51e72012-12-31 15:37:16 +0530592 PM8921_MPP_PM_TO_SYS(8), NULL, 0),
593 GPIO_VREG(EXT_SATA_PWR, "ext_sata_pwr", "ext_sata_pwr_en",
594 PM8921_MPP_PM_TO_SYS(4), "ext_3p3v", 1),
David Collinsf0d00732012-01-25 15:46:50 -0800595};
596
Jay Chokshi1b7eaa92012-04-04 14:53:14 -0700597struct gpio_regulator_platform_data
598mpq8064_gpio_regulator_pdata[] __devinitdata = {
Sujit Reddy Thummab0d51e72012-12-31 15:37:16 +0530599 GPIO_VREG(AVC_1P2V, "avc_1p2v", "avc_1p2v_en",
600 SX150X_GPIO(4, 2), NULL, 0),
601 GPIO_VREG(AVC_1P8V, "avc_1p8v", "avc_1p8v_en",
602 SX150X_GPIO(4, 4), NULL, 0),
Jay Chokshi1b7eaa92012-04-04 14:53:14 -0700603 GPIO_VREG(AVC_2P2V, "avc_2p2v", "avc_2p2v_en",
Sujit Reddy Thummab0d51e72012-12-31 15:37:16 +0530604 SX150X_GPIO(4, 14), NULL, 0),
605 GPIO_VREG(AVC_5V, "avc_5v", "avc_5v_en", SX150X_GPIO(4, 3), NULL, 0),
Jay Chokshi1b7eaa92012-04-04 14:53:14 -0700606 GPIO_VREG(AVC_3P3V, "avc_3p3v", "avc_3p3v_en",
Sujit Reddy Thummab0d51e72012-12-31 15:37:16 +0530607 SX150X_GPIO(4, 15), "avc_5v", 0),
Jay Chokshi1b7eaa92012-04-04 14:53:14 -0700608};
609
Sujit Reddy Thummaf97e5ec2013-01-16 15:02:17 +0530610/* Fixed regulator constraints */
611static struct regulator_init_data mpq8064_3p3_regulator_init =
612 /* ID supply */
613 FIXED_VREG_INIT(EXT_3P3V, NULL);
614
615struct fixed_voltage_config mpq8064_3p3_regulator_pdata = {
616 .supply_name = "ext_3p3v",
617 .gpio = -EINVAL,
618 .init_data = &mpq8064_3p3_regulator_init,
619};
620
Jay Chokshiea67c622011-07-29 17:12:26 -0700621/* SAW regulator constraints */
Jay Chokshi7805b5a2011-11-07 15:55:30 -0800622struct regulator_init_data msm8064_saw_regulator_pdata_8921_s5 =
Jay Chokshiea67c622011-07-29 17:12:26 -0700623 /* ID vreg_name min_uV max_uV */
Tianyi Goudff51062012-06-04 20:22:23 -0700624 SAW_VREG_INIT(S5, "8921_s5", 850000, 1300000);
Jay Chokshi7805b5a2011-11-07 15:55:30 -0800625struct regulator_init_data msm8064_saw_regulator_pdata_8921_s6 =
Tianyi Goudff51062012-06-04 20:22:23 -0700626 SAW_VREG_INIT(S6, "8921_s6", 850000, 1300000);
Jay Chokshi7805b5a2011-11-07 15:55:30 -0800627
628struct regulator_init_data msm8064_saw_regulator_pdata_8821_s0 =
629 /* ID vreg_name min_uV max_uV */
Tianyi Goudff51062012-06-04 20:22:23 -0700630 SAW_VREG_INIT(8821_S0, "8821_s0", 850000, 1300000);
Jay Chokshi7805b5a2011-11-07 15:55:30 -0800631struct regulator_init_data msm8064_saw_regulator_pdata_8821_s1 =
Tianyi Goudff51062012-06-04 20:22:23 -0700632 SAW_VREG_INIT(8821_S1, "8821_s1", 850000, 1300000);
Jay Chokshiea67c622011-07-29 17:12:26 -0700633
634/* PM8921 regulator constraints */
David Collins75016742011-12-02 15:04:25 -0800635struct pm8xxx_regulator_platform_data
Jay Chokshiea67c622011-07-29 17:12:26 -0700636msm8064_pm8921_regulator_pdata[] __devinitdata = {
David Collins75016742011-12-02 15:04:25 -0800637 /*
David Collins2782b5c2012-02-06 10:02:42 -0800638 * ID name always_on pd min_uV max_uV en_t supply
David Collins75016742011-12-02 15:04:25 -0800639 * system_uA reg_ID
640 */
Matt Wagantalled36d822012-05-25 18:13:40 -0700641 PM8XXX_NLDO1200(L26, "8921_l26", 0, 1, 375000, 1050000, 200, "8921_s7",
David Collins2782b5c2012-02-06 10:02:42 -0800642 0, 1),
Jay Chokshiea67c622011-07-29 17:12:26 -0700643
David Collins2782b5c2012-02-06 10:02:42 -0800644 /* ID name always_on pd en_t supply reg_ID */
645 PM8XXX_VS300(USB_OTG, "8921_usb_otg", 0, 0, 0, "ext_5v", 2),
646 PM8XXX_VS300(HDMI_MVS, "8921_hdmi_mvs", 0, 1, 0, "ext_5v", 3),
647};
Jay Chokshiea67c622011-07-29 17:12:26 -0700648
David Collins793793b2012-08-21 15:43:02 -0700649/* PM8917 regulator constraints */
650struct pm8xxx_regulator_platform_data
651msm8064_pm8917_regulator_pdata[] __devinitdata = {
652 /*
653 * ID name always_on pd min_uV max_uV en_t supply
654 * system_uA reg_ID
655 */
656 PM8XXX_NLDO1200(L26, "8921_l26", 0, 1, 375000, 1050000, 200, "8921_s7",
657 0, 1),
658 PM8XXX_LDO(L30, "8917_l30", 0, 1, 1800000, 1800000, 200, NULL,
659 0, 2),
660 PM8XXX_LDO(L31, "8917_l31", 0, 1, 1800000, 1800000, 200, NULL,
661 0, 3),
662 PM8XXX_LDO(L32, "8917_l32", 0, 1, 2800000, 2800000, 200, NULL,
663 0, 4),
664 PM8XXX_LDO(L33, "8917_l33", 0, 1, 2800000, 2800000, 200, NULL,
665 0, 5),
666 PM8XXX_LDO(L34, "8917_l34", 0, 1, 1800000, 1800000, 200, NULL,
667 0, 6),
668 PM8XXX_LDO(L35, "8917_l35", 0, 1, 3000000, 3000000, 200, NULL,
669 0, 7),
670 PM8XXX_LDO(L36, "8917_l36", 0, 1, 1800000, 1800000, 200, NULL,
671 0, 8),
672
673 /*
674 * ID name always_on min_uV max_uV en_t supply reg_ID
675 */
676 PM8XXX_BOOST(BOOST, "8917_boost", 0, 5000000, 5000000, 500, NULL, 9),
677
678 /* ID name always_on pd en_t supply reg_ID */
679 PM8XXX_VS300(USB_OTG, "8921_usb_otg", 0, 1, 0, "8917_boost", 10),
680};
681
David Collins2782b5c2012-02-06 10:02:42 -0800682static struct rpm_regulator_init_data
683apq8064_rpm_regulator_init_data[] __devinitdata = {
David Collins3d2b9452012-03-19 11:00:30 -0700684 /* ID a_on pd ss min_uV max_uV supply sys_uA freq fm ss_fm */
685 RPM_SMPS(S1, 1, 1, 0, 1225000, 1225000, NULL, 100000, 3p20, NONE, NONE),
686 RPM_SMPS(S2, 0, 1, 0, 1300000, 1300000, NULL, 0, 1p60, NONE, NONE),
687 RPM_SMPS(S3, 0, 1, 1, 500000, 1150000, NULL, 100000, 4p80, NONE, NONE),
David Collins423c05d2012-04-26 17:31:02 -0700688 RPM_SMPS(S4, 1, 1, 0, 1800000, 1800000, NULL, 100000, 1p60, AUTO, AUTO),
David Collinsfd487fd2012-06-18 13:07:31 -0700689 RPM_SMPS(S7, 0, 0, 0, 1300000, 1300000, NULL, 100000, 3p20, NONE, NONE),
David Collins1bf88da2012-05-03 14:58:34 -0700690 RPM_SMPS(S8, 0, 1, 0, 2200000, 2200000, NULL, 0, 1p60, NONE, NONE),
Jay Chokshiea67c622011-07-29 17:12:26 -0700691
David Collins2782b5c2012-02-06 10:02:42 -0800692 /* ID a_on pd ss min_uV max_uV supply sys_uA init_ip */
David Collins423c05d2012-04-26 17:31:02 -0700693 RPM_LDO(L1, 1, 1, 0, 1100000, 1100000, "8921_s4", 0, 1000),
David Collins2782b5c2012-02-06 10:02:42 -0800694 RPM_LDO(L2, 0, 1, 0, 1200000, 1200000, "8921_s4", 0, 0),
695 RPM_LDO(L3, 0, 1, 0, 3075000, 3075000, NULL, 0, 0),
David Collins423c05d2012-04-26 17:31:02 -0700696 RPM_LDO(L4, 1, 1, 0, 1800000, 1800000, NULL, 0, 10000),
David Collins2782b5c2012-02-06 10:02:42 -0800697 RPM_LDO(L5, 0, 1, 0, 2950000, 2950000, NULL, 0, 0),
698 RPM_LDO(L6, 0, 1, 0, 2950000, 2950000, NULL, 0, 0),
699 RPM_LDO(L7, 0, 1, 0, 1850000, 2950000, NULL, 0, 0),
700 RPM_LDO(L8, 0, 1, 0, 2800000, 2800000, NULL, 0, 0),
Anirudh Ghayal62cec442012-02-17 13:02:39 -0800701 RPM_LDO(L9, 0, 1, 0, 3000000, 3000000, NULL, 0, 0),
David Collins2782b5c2012-02-06 10:02:42 -0800702 RPM_LDO(L10, 0, 1, 0, 2900000, 2900000, NULL, 0, 0),
703 RPM_LDO(L11, 0, 1, 0, 3000000, 3000000, NULL, 0, 0),
704 RPM_LDO(L12, 0, 1, 0, 1200000, 1200000, "8921_s4", 0, 0),
David Collinsd459ace2012-08-31 12:13:28 -0700705 RPM_LDO(L13, 0, 0, 0, 2220000, 2220000, NULL, 0, 0),
David Collins2782b5c2012-02-06 10:02:42 -0800706 RPM_LDO(L14, 0, 1, 0, 1800000, 1800000, NULL, 0, 0),
707 RPM_LDO(L15, 0, 1, 0, 1800000, 2950000, NULL, 0, 0),
708 RPM_LDO(L16, 0, 1, 0, 2800000, 2800000, NULL, 0, 0),
709 RPM_LDO(L17, 0, 1, 0, 2000000, 2000000, NULL, 0, 0),
710 RPM_LDO(L18, 0, 1, 0, 1300000, 1800000, "8921_s4", 0, 0),
David Collins1bf88da2012-05-03 14:58:34 -0700711 RPM_LDO(L21, 0, 1, 0, 1050000, 1050000, NULL, 0, 0),
David Collins2782b5c2012-02-06 10:02:42 -0800712 RPM_LDO(L22, 0, 1, 0, 2600000, 2600000, NULL, 0, 0),
713 RPM_LDO(L23, 0, 1, 0, 1800000, 1800000, NULL, 0, 0),
714 RPM_LDO(L24, 0, 1, 1, 750000, 1150000, "8921_s1", 10000, 10000),
David Collins62debe82012-06-06 17:01:03 -0700715 RPM_LDO(L25, 1, 1, 0, 1250000, 1250000, "8921_s1", 10000, 10000),
David Collinsfd487fd2012-06-18 13:07:31 -0700716 RPM_LDO(L27, 0, 0, 0, 1100000, 1100000, "8921_s7", 0, 0),
David Collins2782b5c2012-02-06 10:02:42 -0800717 RPM_LDO(L28, 0, 1, 0, 1050000, 1050000, "8921_s7", 0, 0),
David Collins1bf88da2012-05-03 14:58:34 -0700718 RPM_LDO(L29, 0, 1, 0, 2000000, 2000000, NULL, 0, 0),
David Collins2782b5c2012-02-06 10:02:42 -0800719
720 /* ID a_on pd ss supply */
721 RPM_VS(LVS1, 0, 1, 0, "8921_s4"),
David Collins2782b5c2012-02-06 10:02:42 -0800722 RPM_VS(LVS3, 0, 1, 0, "8921_s4"),
723 RPM_VS(LVS4, 0, 1, 0, "8921_s4"),
724 RPM_VS(LVS5, 0, 1, 0, "8921_s4"),
725 RPM_VS(LVS6, 0, 1, 0, "8921_s4"),
Jay Chokshi9dace162012-03-13 19:07:57 -0700726 RPM_VS(LVS7, 0, 1, 1, "8921_s4"),
David Collins793793b2012-08-21 15:43:02 -0700727};
728
729static struct rpm_regulator_init_data
730apq8064_rpm_regulator_pm8921_init_data[] __devinitdata = {
731 /* ID a_on pd ss supply */
732 RPM_VS(LVS2, 0, 1, 0, "8921_s1"),
David Collins2782b5c2012-02-06 10:02:42 -0800733
734 /* ID a_on ss min_uV max_uV supply freq */
735 RPM_NCP(NCP, 0, 0, 1800000, 1800000, "8921_l6", 1p60),
Jay Chokshiea67c622011-07-29 17:12:26 -0700736};
737
738int msm8064_pm8921_regulator_pdata_len __devinitdata =
739 ARRAY_SIZE(msm8064_pm8921_regulator_pdata);
David Collins793793b2012-08-21 15:43:02 -0700740int msm8064_pm8917_regulator_pdata_len __devinitdata =
741 ARRAY_SIZE(msm8064_pm8917_regulator_pdata);
David Collins2782b5c2012-02-06 10:02:42 -0800742
Matt Wagantallf5cc3892012-06-07 19:47:02 -0700743#define RPM_REG_MAP(_id, _sleep_also, _voter, _supply, _dev_name) \
744 { \
745 .vreg_id = RPM_VREG_ID_PM8921_##_id, \
746 .sleep_also = _sleep_also, \
747 .voter = _voter, \
748 .supply = _supply, \
749 .dev_name = _dev_name, \
750 }
751static struct rpm_regulator_consumer_mapping
752 msm_rpm_regulator_consumer_mapping[] __devinitdata = {
753 RPM_REG_MAP(LVS7, 0, 1, "krait0_hfpll", "acpuclk-8064"),
754 RPM_REG_MAP(LVS7, 0, 2, "krait1_hfpll", "acpuclk-8064"),
755 RPM_REG_MAP(LVS7, 0, 4, "krait2_hfpll", "acpuclk-8064"),
756 RPM_REG_MAP(LVS7, 0, 5, "krait3_hfpll", "acpuclk-8064"),
757 RPM_REG_MAP(LVS7, 0, 6, "l2_hfpll", "acpuclk-8064"),
758 RPM_REG_MAP(L24, 0, 1, "krait0_mem", "acpuclk-8064"),
759 RPM_REG_MAP(L24, 0, 2, "krait1_mem", "acpuclk-8064"),
760 RPM_REG_MAP(L24, 0, 4, "krait2_mem", "acpuclk-8064"),
761 RPM_REG_MAP(L24, 0, 5, "krait3_mem", "acpuclk-8064"),
762 RPM_REG_MAP(S3, 0, 1, "krait0_dig", "acpuclk-8064"),
763 RPM_REG_MAP(S3, 0, 2, "krait1_dig", "acpuclk-8064"),
764 RPM_REG_MAP(S3, 0, 4, "krait2_dig", "acpuclk-8064"),
765 RPM_REG_MAP(S3, 0, 5, "krait3_dig", "acpuclk-8064"),
766};
767
David Collins2782b5c2012-02-06 10:02:42 -0800768struct rpm_regulator_platform_data apq8064_rpm_regulator_pdata __devinitdata = {
David Collinsbbc92bc2012-07-31 16:39:11 -0700769 .init_data = apq8064_rpm_regulator_init_data,
770 .num_regulators = ARRAY_SIZE(apq8064_rpm_regulator_init_data),
771 .version = RPM_VREG_VERSION_8960,
772 .vreg_id_vdd_mem = RPM_VREG_ID_PM8921_L24,
773 .vreg_id_vdd_dig = RPM_VREG_ID_PM8921_S3,
774 .requires_tcxo_workaround = true,
775 .consumer_map = msm_rpm_regulator_consumer_mapping,
Matt Wagantallf5cc3892012-06-07 19:47:02 -0700776 .consumer_map_len = ARRAY_SIZE(msm_rpm_regulator_consumer_mapping),
David Collins2782b5c2012-02-06 10:02:42 -0800777};
David Collins793793b2012-08-21 15:43:02 -0700778
779/* Regulators that are only present when using PM8921 */
780struct rpm_regulator_platform_data
781apq8064_rpm_regulator_pm8921_pdata __devinitdata = {
782 .init_data = apq8064_rpm_regulator_pm8921_init_data,
783 .num_regulators = ARRAY_SIZE(apq8064_rpm_regulator_pm8921_init_data),
784 .version = RPM_VREG_VERSION_8960,
785 .vreg_id_vdd_mem = RPM_VREG_ID_PM8921_L24,
786 .vreg_id_vdd_dig = RPM_VREG_ID_PM8921_S3,
787 .requires_tcxo_workaround = true,
788};
789
790/*
791 * Fix up regulator consumer data that moves to a different regulator when
792 * PM8917 is used.
793 */
794void __init configure_apq8064_pm8917_power_grid(void)
795{
796 static struct rpm_regulator_init_data *rpm_data;
797 int i;
798
799 for (i = 0; i < ARRAY_SIZE(apq8064_rpm_regulator_init_data); i++) {
800 rpm_data = &apq8064_rpm_regulator_init_data[i];
801 if (rpm_data->id == RPM_VREG_ID_PM8921_S1) {
802 rpm_data->init_data.consumer_supplies
803 = vreg_consumers_8917_S1;
804 rpm_data->init_data.num_consumer_supplies
805 = ARRAY_SIZE(vreg_consumers_8917_S1);
806 }
807 }
David Collinse93ed7d2012-10-02 15:05:28 -0700808
809 /*
810 * Switch to 8960_PM8917 rpm-regulator version so that TCXO workaround
811 * is applied to PM8917 regulators L25, L26, L27, and L28.
812 */
813 apq8064_rpm_regulator_pdata.version = RPM_VREG_VERSION_8960_PM8917;
David Collins793793b2012-08-21 15:43:02 -0700814}