Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1 | /* |
Anirudh Ghayal | b6060e7 | 2013-07-23 15:07:31 +0530 | [diff] [blame] | 2 | * Copyright (c) 2011-2013, The Linux Foundation. All rights reserved. |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3 | * |
| 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 Collins | 7501674 | 2011-12-02 15:04:25 -0800 | [diff] [blame] | 14 | #include <linux/regulator/pm8xxx-regulator.h> |
Steve Muckle | f132c6c | 2012-06-06 18:30:57 -0700 | [diff] [blame] | 15 | #include <linux/regulator/msm-gpio-regulator.h> |
David Collins | 26f0556 | 2011-06-20 09:56:28 -0700 | [diff] [blame] | 16 | #include <mach/rpm-regulator.h> |
David Collins | e68647e | 2012-09-04 15:44:19 -0700 | [diff] [blame] | 17 | #include <mach/socinfo.h> |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 18 | |
Stepan Moskovchenko | 5a83dba | 2011-12-05 17:30:17 -0800 | [diff] [blame] | 19 | #include "board-8960.h" |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 20 | |
| 21 | #define VREG_CONSUMERS(_id) \ |
| 22 | static struct regulator_consumer_supply vreg_consumers_##_id[] |
| 23 | |
| 24 | /* |
| 25 | * Consumer specific regulator names: |
| 26 | * regulator name consumer dev_name |
| 27 | */ |
| 28 | VREG_CONSUMERS(L1) = { |
| 29 | REGULATOR_SUPPLY("8921_l1", NULL), |
| 30 | }; |
| 31 | VREG_CONSUMERS(L2) = { |
| 32 | REGULATOR_SUPPLY("8921_l2", NULL), |
| 33 | REGULATOR_SUPPLY("dsi_vdda", "mipi_dsi.1"), |
Ravishangar Kalyanam | ad32002 | 2012-07-23 18:26:09 -0700 | [diff] [blame] | 34 | REGULATOR_SUPPLY("dsi_pll_vdda", "mdp.0"), |
Kevin Chan | 330e4d5 | 2012-02-18 23:11:24 -0800 | [diff] [blame] | 35 | REGULATOR_SUPPLY("mipi_csi_vdd", "msm_csid.0"), |
| 36 | REGULATOR_SUPPLY("mipi_csi_vdd", "msm_csid.1"), |
| 37 | REGULATOR_SUPPLY("mipi_csi_vdd", "msm_csid.2"), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 38 | }; |
| 39 | VREG_CONSUMERS(L3) = { |
| 40 | REGULATOR_SUPPLY("8921_l3", NULL), |
| 41 | REGULATOR_SUPPLY("HSUSB_3p3", "msm_otg"), |
| 42 | }; |
| 43 | VREG_CONSUMERS(L4) = { |
| 44 | REGULATOR_SUPPLY("8921_l4", NULL), |
| 45 | REGULATOR_SUPPLY("HSUSB_1p8", "msm_otg"), |
| 46 | REGULATOR_SUPPLY("iris_vddxo", "wcnss_wlan.0"), |
| 47 | }; |
| 48 | VREG_CONSUMERS(L5) = { |
| 49 | REGULATOR_SUPPLY("8921_l5", NULL), |
| 50 | REGULATOR_SUPPLY("sdc_vdd", "msm_sdcc.1"), |
| 51 | }; |
| 52 | VREG_CONSUMERS(L6) = { |
| 53 | REGULATOR_SUPPLY("8921_l6", NULL), |
| 54 | REGULATOR_SUPPLY("sdc_vdd", "msm_sdcc.3"), |
| 55 | }; |
| 56 | VREG_CONSUMERS(L7) = { |
| 57 | REGULATOR_SUPPLY("8921_l7", NULL), |
Subhash Jadavani | 937c750 | 2012-06-01 15:34:46 +0530 | [diff] [blame] | 58 | REGULATOR_SUPPLY("sdc_vdd_io", "msm_sdcc.3"), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 59 | }; |
| 60 | VREG_CONSUMERS(L8) = { |
| 61 | REGULATOR_SUPPLY("8921_l8", NULL), |
| 62 | REGULATOR_SUPPLY("dsi_vdc", "mipi_dsi.1"), |
| 63 | }; |
| 64 | VREG_CONSUMERS(L9) = { |
| 65 | REGULATOR_SUPPLY("8921_l9", NULL), |
| 66 | REGULATOR_SUPPLY("vdd", "3-0024"), |
Amy Maloche | f3c9db4 | 2011-12-08 15:17:35 -0800 | [diff] [blame] | 67 | REGULATOR_SUPPLY("vdd_ana", "3-004a"), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 68 | }; |
| 69 | VREG_CONSUMERS(L10) = { |
| 70 | REGULATOR_SUPPLY("8921_l10", NULL), |
| 71 | REGULATOR_SUPPLY("iris_vddpa", "wcnss_wlan.0"), |
| 72 | |
| 73 | }; |
| 74 | VREG_CONSUMERS(L11) = { |
| 75 | REGULATOR_SUPPLY("8921_l11", NULL), |
Kevin Chan | 09f4e66 | 2011-12-16 08:17:02 -0800 | [diff] [blame] | 76 | REGULATOR_SUPPLY("cam_vana", "4-001a"), |
| 77 | REGULATOR_SUPPLY("cam_vana", "4-006c"), |
| 78 | REGULATOR_SUPPLY("cam_vana", "4-0048"), |
Sreesudhan Ramakrish Ramkumar | 8f11b8b | 2012-01-04 17:09:05 -0800 | [diff] [blame] | 79 | REGULATOR_SUPPLY("cam_vana", "4-0020"), |
Sreesudhan Ramakrish Ramkumar | 3381da7 | 2012-01-27 08:08:32 -0800 | [diff] [blame] | 80 | REGULATOR_SUPPLY("cam_vana", "4-0034"), |
Punit Soni | 5785010 | 2012-09-26 11:31:27 -0700 | [diff] [blame] | 81 | REGULATOR_SUPPLY("cam_vana", "4-0010"), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 82 | }; |
| 83 | VREG_CONSUMERS(L12) = { |
| 84 | REGULATOR_SUPPLY("8921_l12", NULL), |
Kevin Chan | 09f4e66 | 2011-12-16 08:17:02 -0800 | [diff] [blame] | 85 | REGULATOR_SUPPLY("cam_vdig", "4-001a"), |
| 86 | REGULATOR_SUPPLY("cam_vdig", "4-006c"), |
| 87 | REGULATOR_SUPPLY("cam_vdig", "4-0048"), |
Sreesudhan Ramakrish Ramkumar | 8f11b8b | 2012-01-04 17:09:05 -0800 | [diff] [blame] | 88 | REGULATOR_SUPPLY("cam_vdig", "4-0020"), |
Sreesudhan Ramakrish Ramkumar | 3381da7 | 2012-01-27 08:08:32 -0800 | [diff] [blame] | 89 | REGULATOR_SUPPLY("cam_vdig", "4-0034"), |
Punit Soni | 5785010 | 2012-09-26 11:31:27 -0700 | [diff] [blame] | 90 | REGULATOR_SUPPLY("cam_vdig", "4-0010"), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 91 | }; |
| 92 | VREG_CONSUMERS(L14) = { |
| 93 | REGULATOR_SUPPLY("8921_l14", NULL), |
Siddartha Mohanadoss | af91d90 | 2011-10-20 10:23:34 -0700 | [diff] [blame] | 94 | REGULATOR_SUPPLY("pa_therm", "pm8xxx-adc"), |
David Keitel | 663abad | 2012-09-04 21:00:27 -0700 | [diff] [blame] | 95 | REGULATOR_SUPPLY("vreg_xoadc", "pm8921-charger"), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 96 | }; |
| 97 | VREG_CONSUMERS(L15) = { |
| 98 | REGULATOR_SUPPLY("8921_l15", NULL), |
| 99 | }; |
| 100 | VREG_CONSUMERS(L16) = { |
| 101 | REGULATOR_SUPPLY("8921_l16", NULL), |
Kevin Chan | 09f4e66 | 2011-12-16 08:17:02 -0800 | [diff] [blame] | 102 | REGULATOR_SUPPLY("cam_vaf", "4-001a"), |
| 103 | REGULATOR_SUPPLY("cam_vaf", "4-006c"), |
| 104 | REGULATOR_SUPPLY("cam_vaf", "4-0048"), |
Sreesudhan Ramakrish Ramkumar | 8f11b8b | 2012-01-04 17:09:05 -0800 | [diff] [blame] | 105 | REGULATOR_SUPPLY("cam_vaf", "4-0020"), |
Sreesudhan Ramakrish Ramkumar | 3381da7 | 2012-01-27 08:08:32 -0800 | [diff] [blame] | 106 | REGULATOR_SUPPLY("cam_vaf", "4-0034"), |
Punit Soni | 5785010 | 2012-09-26 11:31:27 -0700 | [diff] [blame] | 107 | REGULATOR_SUPPLY("cam_vaf", "4-0010"), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 108 | }; |
| 109 | VREG_CONSUMERS(L17) = { |
| 110 | REGULATOR_SUPPLY("8921_l17", NULL), |
| 111 | }; |
| 112 | VREG_CONSUMERS(L18) = { |
| 113 | REGULATOR_SUPPLY("8921_l18", NULL), |
| 114 | }; |
| 115 | VREG_CONSUMERS(L21) = { |
| 116 | REGULATOR_SUPPLY("8921_l21", NULL), |
| 117 | }; |
| 118 | VREG_CONSUMERS(L22) = { |
| 119 | REGULATOR_SUPPLY("8921_l22", NULL), |
| 120 | }; |
| 121 | VREG_CONSUMERS(L23) = { |
| 122 | REGULATOR_SUPPLY("8921_l23", NULL), |
| 123 | REGULATOR_SUPPLY("dsi_vddio", "mipi_dsi.1"), |
Ravishangar Kalyanam | ad32002 | 2012-07-23 18:26:09 -0700 | [diff] [blame] | 124 | REGULATOR_SUPPLY("dsi_pll_vddio", "mdp.0"), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 125 | REGULATOR_SUPPLY("hdmi_avdd", "hdmi_msm.0"), |
Stephen Boyd | 3bbdf6c | 2011-12-21 16:02:26 -0800 | [diff] [blame] | 126 | REGULATOR_SUPPLY("pll_vdd", "pil_riva"), |
Stephen Boyd | bdb53f3 | 2012-06-05 18:39:47 -0700 | [diff] [blame] | 127 | REGULATOR_SUPPLY("pll_vdd", "pil-q6v4-modem"), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 128 | }; |
| 129 | VREG_CONSUMERS(L24) = { |
| 130 | REGULATOR_SUPPLY("8921_l24", NULL), |
| 131 | REGULATOR_SUPPLY("riva_vddmx", "wcnss_wlan.0"), |
| 132 | }; |
| 133 | VREG_CONSUMERS(L25) = { |
| 134 | REGULATOR_SUPPLY("8921_l25", NULL), |
| 135 | REGULATOR_SUPPLY("VDDD_CDC_D", "tabla-slim"), |
| 136 | REGULATOR_SUPPLY("CDC_VDDA_A_1P2V", "tabla-slim"), |
Santosh Mardi | 60e19d9 | 2011-10-28 01:15:14 +0530 | [diff] [blame] | 137 | REGULATOR_SUPPLY("VDDD_CDC_D", "tabla2x-slim"), |
| 138 | REGULATOR_SUPPLY("CDC_VDDA_A_1P2V", "tabla2x-slim"), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 139 | }; |
| 140 | VREG_CONSUMERS(L26) = { |
| 141 | REGULATOR_SUPPLY("8921_l26", NULL), |
Stephen Boyd | bdb53f3 | 2012-06-05 18:39:47 -0700 | [diff] [blame] | 142 | REGULATOR_SUPPLY("core_vdd", "pil-q6v4-lpass"), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 143 | }; |
| 144 | VREG_CONSUMERS(L27) = { |
| 145 | REGULATOR_SUPPLY("8921_l27", NULL), |
Stephen Boyd | bdb53f3 | 2012-06-05 18:39:47 -0700 | [diff] [blame] | 146 | REGULATOR_SUPPLY("sw_core_vdd", "pil-q6v4-modem"), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 147 | }; |
| 148 | VREG_CONSUMERS(L28) = { |
| 149 | REGULATOR_SUPPLY("8921_l28", NULL), |
Stephen Boyd | bdb53f3 | 2012-06-05 18:39:47 -0700 | [diff] [blame] | 150 | REGULATOR_SUPPLY("fw_core_vdd", "pil-q6v4-modem"), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 151 | }; |
| 152 | VREG_CONSUMERS(L29) = { |
| 153 | REGULATOR_SUPPLY("8921_l29", NULL), |
| 154 | }; |
| 155 | VREG_CONSUMERS(S1) = { |
| 156 | REGULATOR_SUPPLY("8921_s1", NULL), |
| 157 | }; |
| 158 | VREG_CONSUMERS(S2) = { |
| 159 | REGULATOR_SUPPLY("8921_s2", NULL), |
| 160 | REGULATOR_SUPPLY("iris_vddrfa", "wcnss_wlan.0"), |
| 161 | |
| 162 | }; |
| 163 | VREG_CONSUMERS(S3) = { |
| 164 | REGULATOR_SUPPLY("8921_s3", NULL), |
| 165 | REGULATOR_SUPPLY("HSUSB_VDDCX", "msm_otg"), |
| 166 | REGULATOR_SUPPLY("riva_vddcx", "wcnss_wlan.0"), |
Vijayavardhan Vennapusa | 39025fe | 2011-10-15 05:55:10 +0530 | [diff] [blame] | 167 | REGULATOR_SUPPLY("HSIC_VDDCX", "msm_hsic_host"), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 168 | }; |
| 169 | VREG_CONSUMERS(S4) = { |
| 170 | REGULATOR_SUPPLY("8921_s4", NULL), |
Subhash Jadavani | 937c750 | 2012-06-01 15:34:46 +0530 | [diff] [blame] | 171 | REGULATOR_SUPPLY("sdc_vdd_io", "msm_sdcc.1"), |
Pratibhasagar V | 57c808e | 2012-01-12 13:47:30 +0530 | [diff] [blame] | 172 | REGULATOR_SUPPLY("sdc_vdd", "msm_sdcc.2"), |
Subhash Jadavani | 937c750 | 2012-06-01 15:34:46 +0530 | [diff] [blame] | 173 | REGULATOR_SUPPLY("sdc_vdd_io", "msm_sdcc.4"), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 174 | REGULATOR_SUPPLY("riva_vddpx", "wcnss_wlan.0"), |
| 175 | REGULATOR_SUPPLY("hdmi_vcc", "hdmi_msm.0"), |
| 176 | REGULATOR_SUPPLY("VDDIO_CDC", "tabla-slim"), |
| 177 | REGULATOR_SUPPLY("CDC_VDD_CP", "tabla-slim"), |
| 178 | REGULATOR_SUPPLY("CDC_VDDA_TX", "tabla-slim"), |
| 179 | REGULATOR_SUPPLY("CDC_VDDA_RX", "tabla-slim"), |
Santosh Mardi | 60e19d9 | 2011-10-28 01:15:14 +0530 | [diff] [blame] | 180 | REGULATOR_SUPPLY("VDDIO_CDC", "tabla2x-slim"), |
| 181 | REGULATOR_SUPPLY("CDC_VDD_CP", "tabla2x-slim"), |
| 182 | REGULATOR_SUPPLY("CDC_VDDA_TX", "tabla2x-slim"), |
| 183 | REGULATOR_SUPPLY("CDC_VDDA_RX", "tabla2x-slim"), |
Mohan Pallaka | 20c876f | 2011-08-05 12:57:38 +0530 | [diff] [blame] | 184 | REGULATOR_SUPPLY("vcc_i2c", "3-005b"), |
Vijayavardhan Vennapusa | afbbb8f | 2012-04-13 16:28:45 +0530 | [diff] [blame] | 185 | REGULATOR_SUPPLY("EXT_HUB_VDDIO", "msm_smsc_hub"), |
Mohan Pallaka | 5e49039 | 2011-09-09 15:18:41 +0530 | [diff] [blame] | 186 | REGULATOR_SUPPLY("vcc_i2c", "10-0048"), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 187 | }; |
| 188 | VREG_CONSUMERS(S5) = { |
| 189 | REGULATOR_SUPPLY("8921_s5", NULL), |
Matt Wagantall | 6115d78 | 2012-06-07 20:13:51 -0700 | [diff] [blame] | 190 | REGULATOR_SUPPLY("krait0", "acpuclk-8960"), |
Patrick Daly | 6578e0c | 2012-07-19 18:50:02 -0700 | [diff] [blame] | 191 | REGULATOR_SUPPLY("krait0", "acpuclk-8960ab"), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 192 | }; |
| 193 | VREG_CONSUMERS(S6) = { |
| 194 | REGULATOR_SUPPLY("8921_s6", NULL), |
Matt Wagantall | 6115d78 | 2012-06-07 20:13:51 -0700 | [diff] [blame] | 195 | REGULATOR_SUPPLY("krait1", "acpuclk-8960"), |
Patrick Daly | 6578e0c | 2012-07-19 18:50:02 -0700 | [diff] [blame] | 196 | REGULATOR_SUPPLY("krait1", "acpuclk-8960ab"), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 197 | }; |
| 198 | VREG_CONSUMERS(S7) = { |
| 199 | REGULATOR_SUPPLY("8921_s7", NULL), |
| 200 | }; |
| 201 | VREG_CONSUMERS(S8) = { |
| 202 | REGULATOR_SUPPLY("8921_s8", NULL), |
| 203 | }; |
| 204 | VREG_CONSUMERS(LVS1) = { |
| 205 | REGULATOR_SUPPLY("8921_lvs1", NULL), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 206 | REGULATOR_SUPPLY("iris_vddio", "wcnss_wlan.0"), |
| 207 | }; |
| 208 | VREG_CONSUMERS(LVS2) = { |
| 209 | REGULATOR_SUPPLY("8921_lvs2", NULL), |
| 210 | REGULATOR_SUPPLY("iris_vdddig", "wcnss_wlan.0"), |
| 211 | }; |
| 212 | VREG_CONSUMERS(LVS3) = { |
| 213 | REGULATOR_SUPPLY("8921_lvs3", NULL), |
| 214 | }; |
| 215 | VREG_CONSUMERS(LVS4) = { |
| 216 | REGULATOR_SUPPLY("8921_lvs4", NULL), |
| 217 | REGULATOR_SUPPLY("vcc_i2c", "3-0024"), |
Amy Maloche | f3c9db4 | 2011-12-08 15:17:35 -0800 | [diff] [blame] | 218 | REGULATOR_SUPPLY("vcc_i2c", "3-004a"), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 219 | }; |
| 220 | VREG_CONSUMERS(LVS5) = { |
| 221 | REGULATOR_SUPPLY("8921_lvs5", NULL), |
Kevin Chan | 09f4e66 | 2011-12-16 08:17:02 -0800 | [diff] [blame] | 222 | REGULATOR_SUPPLY("cam_vio", "4-001a"), |
| 223 | REGULATOR_SUPPLY("cam_vio", "4-006c"), |
| 224 | REGULATOR_SUPPLY("cam_vio", "4-0048"), |
Sreesudhan Ramakrish Ramkumar | 8f11b8b | 2012-01-04 17:09:05 -0800 | [diff] [blame] | 225 | REGULATOR_SUPPLY("cam_vio", "4-0020"), |
Sreesudhan Ramakrish Ramkumar | 3381da7 | 2012-01-27 08:08:32 -0800 | [diff] [blame] | 226 | REGULATOR_SUPPLY("cam_vio", "4-0034"), |
Punit Soni | 5785010 | 2012-09-26 11:31:27 -0700 | [diff] [blame] | 227 | REGULATOR_SUPPLY("cam_vio", "4-0010"), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 228 | }; |
David Collins | e68647e | 2012-09-04 15:44:19 -0700 | [diff] [blame] | 229 | /* This mapping is used for CDP only. */ |
| 230 | VREG_CONSUMERS(CDP_LVS6) = { |
| 231 | REGULATOR_SUPPLY("8921_lvs6", NULL), |
| 232 | REGULATOR_SUPPLY("vdd-io", "spi0.0"), |
| 233 | }; |
| 234 | /* This mapping is used for non-CDP targets only. */ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 235 | VREG_CONSUMERS(LVS6) = { |
| 236 | REGULATOR_SUPPLY("8921_lvs6", NULL), |
David Collins | e68647e | 2012-09-04 15:44:19 -0700 | [diff] [blame] | 237 | REGULATOR_SUPPLY("vdd-io", "spi0.0"), |
| 238 | REGULATOR_SUPPLY("vdd-phy", "spi0.0"), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 239 | }; |
| 240 | VREG_CONSUMERS(LVS7) = { |
| 241 | REGULATOR_SUPPLY("8921_lvs7", NULL), |
| 242 | }; |
| 243 | VREG_CONSUMERS(USB_OTG) = { |
| 244 | REGULATOR_SUPPLY("8921_usb_otg", NULL), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 245 | }; |
| 246 | VREG_CONSUMERS(HDMI_MVS) = { |
| 247 | REGULATOR_SUPPLY("8921_hdmi_mvs", NULL), |
| 248 | REGULATOR_SUPPLY("hdmi_mvs", "hdmi_msm.0"), |
| 249 | }; |
| 250 | VREG_CONSUMERS(NCP) = { |
| 251 | REGULATOR_SUPPLY("8921_ncp", NULL), |
| 252 | }; |
| 253 | VREG_CONSUMERS(EXT_5V) = { |
| 254 | REGULATOR_SUPPLY("ext_5v", NULL), |
| 255 | }; |
| 256 | VREG_CONSUMERS(EXT_L2) = { |
| 257 | REGULATOR_SUPPLY("ext_l2", NULL), |
David Collins | e68647e | 2012-09-04 15:44:19 -0700 | [diff] [blame] | 258 | REGULATOR_SUPPLY("vdd-phy", "spi0.0"), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 259 | }; |
David Collins | b10be1d | 2011-09-02 10:29:31 -0700 | [diff] [blame] | 260 | VREG_CONSUMERS(EXT_3P3V) = { |
| 261 | REGULATOR_SUPPLY("ext_3p3v", NULL), |
Amy Maloche | 21115eb | 2011-11-02 09:04:37 -0700 | [diff] [blame] | 262 | REGULATOR_SUPPLY("vdd_ana", "3-005b"), |
Amir Samuelov | 0c7270f | 2011-09-07 03:13:47 +0300 | [diff] [blame] | 263 | REGULATOR_SUPPLY("vdd_lvds_3p3v", "mipi_dsi.1"), |
Pavankumar Kondeti | 56dc742 | 2012-07-02 12:45:19 +0530 | [diff] [blame] | 264 | REGULATOR_SUPPLY("mhl_usb_hs_switch", "msm_otg"), |
David Collins | b10be1d | 2011-09-02 10:29:31 -0700 | [diff] [blame] | 265 | }; |
David Collins | 35a78f5 | 2011-12-14 15:54:25 -0800 | [diff] [blame] | 266 | VREG_CONSUMERS(EXT_OTG_SW) = { |
| 267 | REGULATOR_SUPPLY("ext_otg_sw", NULL), |
David Collins | 96aa3e1 | 2012-02-29 10:31:34 -0800 | [diff] [blame] | 268 | REGULATOR_SUPPLY("vbus_otg", "msm_otg"), |
David Collins | 35a78f5 | 2011-12-14 15:54:25 -0800 | [diff] [blame] | 269 | }; |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 270 | |
David Collins | 7501674 | 2011-12-02 15:04:25 -0800 | [diff] [blame] | 271 | #define PM8XXX_VREG_INIT(_id, _name, _min_uV, _max_uV, _modes, _ops, \ |
| 272 | _apply_uV, _pull_down, _always_on, _supply_regulator, \ |
David Collins | 5aead23 | 2012-02-29 10:18:56 -0800 | [diff] [blame] | 273 | _system_uA, _enable_time, _reg_id) \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 274 | { \ |
| 275 | .init_data = { \ |
| 276 | .constraints = { \ |
| 277 | .valid_modes_mask = _modes, \ |
| 278 | .valid_ops_mask = _ops, \ |
| 279 | .min_uV = _min_uV, \ |
| 280 | .max_uV = _max_uV, \ |
| 281 | .input_uV = _max_uV, \ |
| 282 | .apply_uV = _apply_uV, \ |
| 283 | .always_on = _always_on, \ |
David Collins | 7501674 | 2011-12-02 15:04:25 -0800 | [diff] [blame] | 284 | .name = _name, \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 285 | }, \ |
| 286 | .num_consumer_supplies = \ |
| 287 | ARRAY_SIZE(vreg_consumers_##_id), \ |
| 288 | .consumer_supplies = vreg_consumers_##_id, \ |
| 289 | .supply_regulator = _supply_regulator, \ |
| 290 | }, \ |
David Collins | 7501674 | 2011-12-02 15:04:25 -0800 | [diff] [blame] | 291 | .id = _reg_id, \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 292 | .pull_down_enable = _pull_down, \ |
| 293 | .system_uA = _system_uA, \ |
David Collins | 4317676 | 2011-07-26 15:33:38 -0700 | [diff] [blame] | 294 | .enable_time = _enable_time, \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 295 | } |
| 296 | |
David Collins | 7501674 | 2011-12-02 15:04:25 -0800 | [diff] [blame] | 297 | #define PM8XXX_LDO(_id, _name, _always_on, _pull_down, _min_uV, _max_uV, \ |
| 298 | _enable_time, _supply_regulator, _system_uA, _reg_id) \ |
| 299 | PM8XXX_VREG_INIT(_id, _name, _min_uV, _max_uV, REGULATOR_MODE_NORMAL \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 300 | | REGULATOR_MODE_IDLE, REGULATOR_CHANGE_VOLTAGE | \ |
| 301 | REGULATOR_CHANGE_STATUS | REGULATOR_CHANGE_MODE | \ |
| 302 | REGULATOR_CHANGE_DRMS, 0, _pull_down, _always_on, \ |
David Collins | 5aead23 | 2012-02-29 10:18:56 -0800 | [diff] [blame] | 303 | _supply_regulator, _system_uA, _enable_time, _reg_id) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 304 | |
David Collins | 7501674 | 2011-12-02 15:04:25 -0800 | [diff] [blame] | 305 | #define PM8XXX_NLDO1200(_id, _name, _always_on, _pull_down, _min_uV, \ |
| 306 | _max_uV, _enable_time, _supply_regulator, _system_uA, _reg_id) \ |
| 307 | PM8XXX_VREG_INIT(_id, _name, _min_uV, _max_uV, REGULATOR_MODE_NORMAL \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 308 | | REGULATOR_MODE_IDLE, REGULATOR_CHANGE_VOLTAGE | \ |
| 309 | REGULATOR_CHANGE_STATUS | REGULATOR_CHANGE_MODE | \ |
| 310 | REGULATOR_CHANGE_DRMS, 0, _pull_down, _always_on, \ |
David Collins | 5aead23 | 2012-02-29 10:18:56 -0800 | [diff] [blame] | 311 | _supply_regulator, _system_uA, _enable_time, _reg_id) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 312 | |
David Collins | 7501674 | 2011-12-02 15:04:25 -0800 | [diff] [blame] | 313 | #define PM8XXX_SMPS(_id, _name, _always_on, _pull_down, _min_uV, _max_uV, \ |
| 314 | _enable_time, _supply_regulator, _system_uA, _reg_id) \ |
| 315 | PM8XXX_VREG_INIT(_id, _name, _min_uV, _max_uV, REGULATOR_MODE_NORMAL \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 316 | | REGULATOR_MODE_IDLE, REGULATOR_CHANGE_VOLTAGE | \ |
| 317 | REGULATOR_CHANGE_STATUS | REGULATOR_CHANGE_MODE | \ |
| 318 | REGULATOR_CHANGE_DRMS, 0, _pull_down, _always_on, \ |
David Collins | 5aead23 | 2012-02-29 10:18:56 -0800 | [diff] [blame] | 319 | _supply_regulator, _system_uA, _enable_time, _reg_id) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 320 | |
David Collins | 7501674 | 2011-12-02 15:04:25 -0800 | [diff] [blame] | 321 | #define PM8XXX_FTSMPS(_id, _name, _always_on, _pull_down, _min_uV, _max_uV, \ |
| 322 | _enable_time, _supply_regulator, _system_uA, _reg_id) \ |
| 323 | PM8XXX_VREG_INIT(_id, _name, _min_uV, _max_uV, REGULATOR_MODE_NORMAL, \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 324 | REGULATOR_CHANGE_VOLTAGE | REGULATOR_CHANGE_STATUS \ |
| 325 | | REGULATOR_CHANGE_MODE, 0, _pull_down, _always_on, \ |
David Collins | 5aead23 | 2012-02-29 10:18:56 -0800 | [diff] [blame] | 326 | _supply_regulator, _system_uA, _enable_time, _reg_id) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 327 | |
David Collins | 7501674 | 2011-12-02 15:04:25 -0800 | [diff] [blame] | 328 | #define PM8XXX_VS(_id, _name, _always_on, _pull_down, _enable_time, \ |
David Collins | 5aead23 | 2012-02-29 10:18:56 -0800 | [diff] [blame] | 329 | _supply_regulator, _reg_id) \ |
David Collins | 7501674 | 2011-12-02 15:04:25 -0800 | [diff] [blame] | 330 | PM8XXX_VREG_INIT(_id, _name, 0, 0, 0, REGULATOR_CHANGE_STATUS, 0, \ |
| 331 | _pull_down, _always_on, _supply_regulator, 0, _enable_time, \ |
David Collins | 5aead23 | 2012-02-29 10:18:56 -0800 | [diff] [blame] | 332 | _reg_id) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 333 | |
David Collins | 7501674 | 2011-12-02 15:04:25 -0800 | [diff] [blame] | 334 | #define PM8XXX_VS300(_id, _name, _always_on, _pull_down, _enable_time, \ |
David Collins | 5aead23 | 2012-02-29 10:18:56 -0800 | [diff] [blame] | 335 | _supply_regulator, _reg_id) \ |
David Collins | 7501674 | 2011-12-02 15:04:25 -0800 | [diff] [blame] | 336 | PM8XXX_VREG_INIT(_id, _name, 0, 0, 0, REGULATOR_CHANGE_STATUS, 0, \ |
| 337 | _pull_down, _always_on, _supply_regulator, 0, _enable_time, \ |
David Collins | 5aead23 | 2012-02-29 10:18:56 -0800 | [diff] [blame] | 338 | _reg_id) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 339 | |
David Collins | 7501674 | 2011-12-02 15:04:25 -0800 | [diff] [blame] | 340 | #define PM8XXX_NCP(_id, _name, _always_on, _min_uV, _max_uV, _enable_time, \ |
| 341 | _supply_regulator, _reg_id) \ |
| 342 | PM8XXX_VREG_INIT(_id, _name, _min_uV, _max_uV, 0, \ |
| 343 | REGULATOR_CHANGE_VOLTAGE | REGULATOR_CHANGE_STATUS, 0, 0, \ |
David Collins | 5aead23 | 2012-02-29 10:18:56 -0800 | [diff] [blame] | 344 | _always_on, _supply_regulator, 0, _enable_time, _reg_id) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 345 | |
| 346 | /* Pin control initialization */ |
David Collins | 7501674 | 2011-12-02 15:04:25 -0800 | [diff] [blame] | 347 | #define PM8XXX_PC(_id, _name, _always_on, _pin_fn, _pin_ctrl, \ |
| 348 | _supply_regulator, _reg_id) \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 349 | { \ |
| 350 | .init_data = { \ |
| 351 | .constraints = { \ |
| 352 | .valid_ops_mask = REGULATOR_CHANGE_STATUS, \ |
| 353 | .always_on = _always_on, \ |
David Collins | 7501674 | 2011-12-02 15:04:25 -0800 | [diff] [blame] | 354 | .name = _name, \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 355 | }, \ |
| 356 | .num_consumer_supplies = \ |
| 357 | ARRAY_SIZE(vreg_consumers_##_id##_PC), \ |
| 358 | .consumer_supplies = vreg_consumers_##_id##_PC, \ |
| 359 | .supply_regulator = _supply_regulator, \ |
| 360 | }, \ |
David Collins | 7501674 | 2011-12-02 15:04:25 -0800 | [diff] [blame] | 361 | .id = _reg_id, \ |
| 362 | .pin_fn = PM8XXX_VREG_PIN_FN_##_pin_fn, \ |
| 363 | .pin_ctrl = _pin_ctrl, \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 364 | } |
| 365 | |
David Collins | 35a78f5 | 2011-12-14 15:54:25 -0800 | [diff] [blame] | 366 | #define GPIO_VREG(_id, _reg_name, _gpio_label, _gpio, _supply_regulator) \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 367 | [GPIO_VREG_ID_##_id] = { \ |
| 368 | .init_data = { \ |
| 369 | .constraints = { \ |
| 370 | .valid_ops_mask = REGULATOR_CHANGE_STATUS, \ |
| 371 | }, \ |
| 372 | .num_consumer_supplies = \ |
| 373 | ARRAY_SIZE(vreg_consumers_##_id), \ |
| 374 | .consumer_supplies = vreg_consumers_##_id, \ |
David Collins | 35a78f5 | 2011-12-14 15:54:25 -0800 | [diff] [blame] | 375 | .supply_regulator = _supply_regulator, \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 376 | }, \ |
| 377 | .regulator_name = _reg_name, \ |
| 378 | .gpio_label = _gpio_label, \ |
| 379 | .gpio = _gpio, \ |
| 380 | } |
| 381 | |
| 382 | #define SAW_VREG_INIT(_id, _name, _min_uV, _max_uV) \ |
| 383 | { \ |
| 384 | .constraints = { \ |
| 385 | .name = _name, \ |
Michael Bohan | ee3ce19c | 2012-11-13 14:57:40 -0800 | [diff] [blame] | 386 | .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE | \ |
| 387 | REGULATOR_CHANGE_STATUS, \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 388 | .min_uV = _min_uV, \ |
| 389 | .max_uV = _max_uV, \ |
| 390 | }, \ |
| 391 | .num_consumer_supplies = ARRAY_SIZE(vreg_consumers_##_id), \ |
| 392 | .consumer_supplies = vreg_consumers_##_id, \ |
| 393 | } |
| 394 | |
David Collins | 26f0556 | 2011-06-20 09:56:28 -0700 | [diff] [blame] | 395 | #define RPM_INIT(_id, _min_uV, _max_uV, _modes, _ops, _apply_uV, _default_uV, \ |
| 396 | _peak_uA, _avg_uA, _pull_down, _pin_ctrl, _freq, _pin_fn, \ |
David Collins | 1578904 | 2012-03-19 10:44:36 -0700 | [diff] [blame] | 397 | _force_mode, _sleep_set_force_mode, _power_mode, _state, \ |
| 398 | _sleep_selectable, _always_on, _supply_regulator, _system_uA) \ |
David Collins | 26f0556 | 2011-06-20 09:56:28 -0700 | [diff] [blame] | 399 | { \ |
| 400 | .init_data = { \ |
| 401 | .constraints = { \ |
| 402 | .valid_modes_mask = _modes, \ |
| 403 | .valid_ops_mask = _ops, \ |
| 404 | .min_uV = _min_uV, \ |
| 405 | .max_uV = _max_uV, \ |
| 406 | .input_uV = _min_uV, \ |
| 407 | .apply_uV = _apply_uV, \ |
| 408 | .always_on = _always_on, \ |
| 409 | }, \ |
| 410 | .num_consumer_supplies = \ |
| 411 | ARRAY_SIZE(vreg_consumers_##_id), \ |
| 412 | .consumer_supplies = vreg_consumers_##_id, \ |
| 413 | .supply_regulator = _supply_regulator, \ |
| 414 | }, \ |
| 415 | .id = RPM_VREG_ID_PM8921_##_id, \ |
| 416 | .default_uV = _default_uV, \ |
| 417 | .peak_uA = _peak_uA, \ |
| 418 | .avg_uA = _avg_uA, \ |
| 419 | .pull_down_enable = _pull_down, \ |
| 420 | .pin_ctrl = _pin_ctrl, \ |
| 421 | .freq = RPM_VREG_FREQ_##_freq, \ |
| 422 | .pin_fn = _pin_fn, \ |
| 423 | .force_mode = _force_mode, \ |
David Collins | 1578904 | 2012-03-19 10:44:36 -0700 | [diff] [blame] | 424 | .sleep_set_force_mode = _sleep_set_force_mode, \ |
David Collins | 26f0556 | 2011-06-20 09:56:28 -0700 | [diff] [blame] | 425 | .power_mode = _power_mode, \ |
| 426 | .state = _state, \ |
| 427 | .sleep_selectable = _sleep_selectable, \ |
| 428 | .system_uA = _system_uA, \ |
| 429 | } |
| 430 | |
| 431 | #define RPM_LDO(_id, _always_on, _pd, _sleep_selectable, _min_uV, _max_uV, \ |
| 432 | _supply_regulator, _system_uA, _init_peak_uA) \ |
| 433 | RPM_INIT(_id, _min_uV, _max_uV, REGULATOR_MODE_NORMAL \ |
| 434 | | REGULATOR_MODE_IDLE, REGULATOR_CHANGE_VOLTAGE \ |
| 435 | | REGULATOR_CHANGE_STATUS | REGULATOR_CHANGE_MODE \ |
| 436 | | REGULATOR_CHANGE_DRMS, 0, _max_uV, _init_peak_uA, 0, _pd, \ |
David Collins | 6f032ba | 2011-08-31 14:08:15 -0700 | [diff] [blame] | 437 | RPM_VREG_PIN_CTRL_NONE, NONE, RPM_VREG_PIN_FN_8960_NONE, \ |
David Collins | 1578904 | 2012-03-19 10:44:36 -0700 | [diff] [blame] | 438 | RPM_VREG_FORCE_MODE_8960_NONE, \ |
David Collins | 6f032ba | 2011-08-31 14:08:15 -0700 | [diff] [blame] | 439 | RPM_VREG_FORCE_MODE_8960_NONE, RPM_VREG_POWER_MODE_8960_PWM, \ |
David Collins | 26f0556 | 2011-06-20 09:56:28 -0700 | [diff] [blame] | 440 | RPM_VREG_STATE_OFF, _sleep_selectable, _always_on, \ |
| 441 | _supply_regulator, _system_uA) |
| 442 | |
| 443 | #define RPM_SMPS(_id, _always_on, _pd, _sleep_selectable, _min_uV, _max_uV, \ |
David Collins | 3d2b945 | 2012-03-19 11:00:30 -0700 | [diff] [blame] | 444 | _supply_regulator, _system_uA, _freq, _force_mode, \ |
| 445 | _sleep_set_force_mode) \ |
David Collins | 26f0556 | 2011-06-20 09:56:28 -0700 | [diff] [blame] | 446 | RPM_INIT(_id, _min_uV, _max_uV, REGULATOR_MODE_NORMAL \ |
| 447 | | REGULATOR_MODE_IDLE, REGULATOR_CHANGE_VOLTAGE \ |
| 448 | | REGULATOR_CHANGE_STATUS | REGULATOR_CHANGE_MODE \ |
| 449 | | REGULATOR_CHANGE_DRMS, 0, _max_uV, _system_uA, 0, _pd, \ |
David Collins | 6f032ba | 2011-08-31 14:08:15 -0700 | [diff] [blame] | 450 | RPM_VREG_PIN_CTRL_NONE, _freq, RPM_VREG_PIN_FN_8960_NONE, \ |
David Collins | 3d2b945 | 2012-03-19 11:00:30 -0700 | [diff] [blame] | 451 | RPM_VREG_FORCE_MODE_8960_##_force_mode, \ |
| 452 | RPM_VREG_FORCE_MODE_8960_##_sleep_set_force_mode, \ |
| 453 | RPM_VREG_POWER_MODE_8960_PWM, RPM_VREG_STATE_OFF, \ |
| 454 | _sleep_selectable, _always_on, _supply_regulator, _system_uA) |
David Collins | 26f0556 | 2011-06-20 09:56:28 -0700 | [diff] [blame] | 455 | |
| 456 | #define RPM_VS(_id, _always_on, _pd, _sleep_selectable, _supply_regulator) \ |
| 457 | RPM_INIT(_id, 0, 0, 0, REGULATOR_CHANGE_STATUS, 0, 0, 1000, 1000, _pd, \ |
David Collins | 6f032ba | 2011-08-31 14:08:15 -0700 | [diff] [blame] | 458 | RPM_VREG_PIN_CTRL_NONE, NONE, RPM_VREG_PIN_FN_8960_NONE, \ |
David Collins | 1578904 | 2012-03-19 10:44:36 -0700 | [diff] [blame] | 459 | RPM_VREG_FORCE_MODE_8960_NONE, \ |
David Collins | 6f032ba | 2011-08-31 14:08:15 -0700 | [diff] [blame] | 460 | RPM_VREG_FORCE_MODE_8960_NONE, RPM_VREG_POWER_MODE_8960_PWM, \ |
David Collins | 26f0556 | 2011-06-20 09:56:28 -0700 | [diff] [blame] | 461 | RPM_VREG_STATE_OFF, _sleep_selectable, _always_on, \ |
| 462 | _supply_regulator, 0) |
| 463 | |
| 464 | #define RPM_NCP(_id, _always_on, _sleep_selectable, _min_uV, _max_uV, \ |
| 465 | _supply_regulator, _freq) \ |
| 466 | RPM_INIT(_id, _min_uV, _max_uV, 0, REGULATOR_CHANGE_VOLTAGE \ |
| 467 | | REGULATOR_CHANGE_STATUS, 0, _max_uV, 1000, 1000, 0, \ |
David Collins | 6f032ba | 2011-08-31 14:08:15 -0700 | [diff] [blame] | 468 | RPM_VREG_PIN_CTRL_NONE, _freq, RPM_VREG_PIN_FN_8960_NONE, \ |
David Collins | 1578904 | 2012-03-19 10:44:36 -0700 | [diff] [blame] | 469 | RPM_VREG_FORCE_MODE_8960_NONE, \ |
David Collins | 6f032ba | 2011-08-31 14:08:15 -0700 | [diff] [blame] | 470 | RPM_VREG_FORCE_MODE_8960_NONE, RPM_VREG_POWER_MODE_8960_PWM, \ |
David Collins | 26f0556 | 2011-06-20 09:56:28 -0700 | [diff] [blame] | 471 | RPM_VREG_STATE_OFF, _sleep_selectable, _always_on, \ |
| 472 | _supply_regulator, 0) |
| 473 | |
| 474 | /* Pin control initialization */ |
| 475 | #define RPM_PC_INIT(_id, _always_on, _pin_fn, _pin_ctrl, _supply_regulator) \ |
| 476 | { \ |
| 477 | .init_data = { \ |
| 478 | .constraints = { \ |
| 479 | .valid_ops_mask = REGULATOR_CHANGE_STATUS, \ |
| 480 | .always_on = _always_on, \ |
| 481 | }, \ |
| 482 | .num_consumer_supplies = \ |
| 483 | ARRAY_SIZE(vreg_consumers_##_id##_PC), \ |
| 484 | .consumer_supplies = vreg_consumers_##_id##_PC, \ |
| 485 | .supply_regulator = _supply_regulator, \ |
| 486 | }, \ |
| 487 | .id = RPM_VREG_ID_PM8921_##_id##_PC, \ |
David Collins | 6f032ba | 2011-08-31 14:08:15 -0700 | [diff] [blame] | 488 | .pin_fn = RPM_VREG_PIN_FN_8960_##_pin_fn, \ |
David Collins | 26f0556 | 2011-06-20 09:56:28 -0700 | [diff] [blame] | 489 | .pin_ctrl = _pin_ctrl, \ |
| 490 | } |
| 491 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 492 | /* GPIO regulator constraints */ |
| 493 | struct gpio_regulator_platform_data msm_gpio_regulator_pdata[] __devinitdata = { |
David Collins | 35a78f5 | 2011-12-14 15:54:25 -0800 | [diff] [blame] | 494 | /* ID vreg_name gpio_label gpio supply */ |
| 495 | GPIO_VREG(EXT_5V, "ext_5v", "ext_5v_en", PM8921_MPP_PM_TO_SYS(7), NULL), |
| 496 | GPIO_VREG(EXT_L2, "ext_l2", "ext_l2_en", 91, NULL), |
| 497 | GPIO_VREG(EXT_3P3V, "ext_3p3v", "ext_3p3v_en", |
| 498 | PM8921_GPIO_PM_TO_SYS(17), NULL), |
| 499 | GPIO_VREG(EXT_OTG_SW, "ext_otg_sw", "ext_otg_sw_en", |
David Collins | 96aa3e1 | 2012-02-29 10:31:34 -0800 | [diff] [blame] | 500 | PM8921_GPIO_PM_TO_SYS(42), "8921_usb_otg"), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 501 | }; |
| 502 | |
| 503 | /* SAW regulator constraints */ |
| 504 | struct regulator_init_data msm_saw_regulator_pdata_s5 = |
| 505 | /* ID vreg_name min_uV max_uV */ |
Stephen Boyd | 9d0fab1 | 2011-12-08 10:56:06 -0800 | [diff] [blame] | 506 | SAW_VREG_INIT(S5, "8921_s5", 850000, 1300000); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 507 | struct regulator_init_data msm_saw_regulator_pdata_s6 = |
Stephen Boyd | 9d0fab1 | 2011-12-08 10:56:06 -0800 | [diff] [blame] | 508 | SAW_VREG_INIT(S6, "8921_s6", 850000, 1300000); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 509 | |
| 510 | /* PM8921 regulator constraints */ |
David Collins | 7501674 | 2011-12-02 15:04:25 -0800 | [diff] [blame] | 511 | struct pm8xxx_regulator_platform_data |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 512 | msm_pm8921_regulator_pdata[] __devinitdata = { |
David Collins | 26f0556 | 2011-06-20 09:56:28 -0700 | [diff] [blame] | 513 | /* |
David Collins | 7501674 | 2011-12-02 15:04:25 -0800 | [diff] [blame] | 514 | * ID name always_on pd min_uV max_uV en_t supply |
| 515 | * system_uA reg_ID |
David Collins | 26f0556 | 2011-06-20 09:56:28 -0700 | [diff] [blame] | 516 | */ |
Matt Wagantall | ed36d82 | 2012-05-25 18:13:40 -0700 | [diff] [blame] | 517 | PM8XXX_NLDO1200(L26, "8921_l26", 0, 1, 375000, 1050000, 200, "8921_s7", |
David Collins | 7501674 | 2011-12-02 15:04:25 -0800 | [diff] [blame] | 518 | 0, 1), |
Matt Wagantall | ed36d82 | 2012-05-25 18:13:40 -0700 | [diff] [blame] | 519 | PM8XXX_NLDO1200(L27, "8921_l27", 0, 1, 375000, 1050000, 200, "8921_s7", |
David Collins | 7501674 | 2011-12-02 15:04:25 -0800 | [diff] [blame] | 520 | 0, 2), |
Matt Wagantall | ed36d82 | 2012-05-25 18:13:40 -0700 | [diff] [blame] | 521 | PM8XXX_NLDO1200(L28, "8921_l28", 0, 1, 375000, 1050000, 200, "8921_s7", |
David Collins | 7501674 | 2011-12-02 15:04:25 -0800 | [diff] [blame] | 522 | 0, 3), |
| 523 | PM8XXX_LDO(L29, "8921_l29", 0, 1, 2050000, 2100000, 200, "8921_s8", |
| 524 | 0, 4), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 525 | |
David Collins | 5aead23 | 2012-02-29 10:18:56 -0800 | [diff] [blame] | 526 | /* ID name always_on pd en_t supply reg_ID */ |
David Collins | 96aa3e1 | 2012-02-29 10:31:34 -0800 | [diff] [blame] | 527 | PM8XXX_VS300(USB_OTG, "8921_usb_otg", 0, 1, 0, "ext_5v", 5), |
David Collins | 5aead23 | 2012-02-29 10:18:56 -0800 | [diff] [blame] | 528 | PM8XXX_VS300(HDMI_MVS, "8921_hdmi_mvs", 0, 1, 0, "ext_5v", 6), |
David Collins | 26f0556 | 2011-06-20 09:56:28 -0700 | [diff] [blame] | 529 | }; |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 530 | |
David Collins | 26f0556 | 2011-06-20 09:56:28 -0700 | [diff] [blame] | 531 | static struct rpm_regulator_init_data |
| 532 | msm_rpm_regulator_init_data[] __devinitdata = { |
David Collins | 3d2b945 | 2012-03-19 11:00:30 -0700 | [diff] [blame] | 533 | /* ID a_on pd ss min_uV max_uV supply sys_uA freq fm ss_fm */ |
| 534 | RPM_SMPS(S1, 1, 1, 0, 1225000, 1225000, NULL, 100000, 3p20, NONE, NONE), |
| 535 | RPM_SMPS(S2, 0, 1, 0, 1300000, 1300000, NULL, 0, 1p60, NONE, NONE), |
| 536 | RPM_SMPS(S3, 0, 1, 1, 500000, 1150000, NULL, 100000, 4p80, NONE, NONE), |
David Collins | 09c8f73 | 2012-03-19 11:05:20 -0700 | [diff] [blame] | 537 | RPM_SMPS(S4, 1, 1, 0, 1800000, 1800000, NULL, 100000, 1p60, AUTO, AUTO), |
David Collins | 3d2b945 | 2012-03-19 11:00:30 -0700 | [diff] [blame] | 538 | RPM_SMPS(S7, 0, 1, 0, 1150000, 1150000, NULL, 100000, 3p20, NONE, NONE), |
David Collins | 9a81d6c | 2012-03-29 15:11:33 -0700 | [diff] [blame] | 539 | RPM_SMPS(S8, 1, 1, 1, 2050000, 2050000, NULL, 100000, 1p60, NONE, NONE), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 540 | |
David Collins | 26f0556 | 2011-06-20 09:56:28 -0700 | [diff] [blame] | 541 | /* ID a_on pd ss min_uV max_uV supply sys_uA init_ip */ |
| 542 | RPM_LDO(L1, 1, 1, 0, 1050000, 1050000, "8921_s4", 0, 10000), |
| 543 | RPM_LDO(L2, 0, 1, 0, 1200000, 1200000, "8921_s4", 0, 0), |
| 544 | RPM_LDO(L3, 0, 1, 0, 3075000, 3075000, NULL, 0, 0), |
| 545 | RPM_LDO(L4, 1, 1, 0, 1800000, 1800000, NULL, 10000, 10000), |
| 546 | RPM_LDO(L5, 0, 1, 0, 2950000, 2950000, NULL, 0, 0), |
| 547 | RPM_LDO(L6, 0, 1, 0, 2950000, 2950000, NULL, 0, 0), |
| 548 | RPM_LDO(L7, 1, 1, 0, 1850000, 2950000, NULL, 10000, 10000), |
| 549 | RPM_LDO(L8, 0, 1, 0, 2800000, 3000000, NULL, 0, 0), |
Anirudh Ghayal | 62cec44 | 2012-02-17 13:02:39 -0800 | [diff] [blame] | 550 | RPM_LDO(L9, 0, 1, 0, 3000000, 3000000, NULL, 0, 0), |
Sameer Thalappil | 1107a18 | 2011-09-07 14:42:31 -0700 | [diff] [blame] | 551 | RPM_LDO(L10, 0, 1, 0, 3000000, 3000000, NULL, 0, 0), |
David Collins | 26f0556 | 2011-06-20 09:56:28 -0700 | [diff] [blame] | 552 | RPM_LDO(L11, 0, 1, 0, 2850000, 2850000, NULL, 0, 0), |
| 553 | RPM_LDO(L12, 0, 1, 0, 1200000, 1200000, "8921_s4", 0, 0), |
| 554 | RPM_LDO(L14, 0, 1, 0, 1800000, 1800000, NULL, 0, 0), |
| 555 | RPM_LDO(L15, 0, 1, 0, 1800000, 2950000, NULL, 0, 0), |
| 556 | RPM_LDO(L16, 0, 1, 0, 2800000, 2800000, NULL, 0, 0), |
| 557 | RPM_LDO(L17, 0, 1, 0, 1800000, 2950000, NULL, 0, 0), |
| 558 | RPM_LDO(L18, 0, 1, 0, 1300000, 1300000, "8921_s4", 0, 0), |
| 559 | RPM_LDO(L21, 0, 1, 0, 1900000, 1900000, "8921_s8", 0, 0), |
| 560 | RPM_LDO(L22, 0, 1, 0, 2750000, 2750000, NULL, 0, 0), |
Matt Wagantall | cb12c39 | 2011-10-19 10:32:07 -0700 | [diff] [blame] | 561 | RPM_LDO(L23, 1, 1, 1, 1800000, 1800000, "8921_s8", 10000, 10000), |
David Collins | 156bca9 | 2011-09-07 17:05:21 -0700 | [diff] [blame] | 562 | RPM_LDO(L24, 0, 1, 1, 750000, 1150000, "8921_s1", 10000, 10000), |
David Collins | 8f2a196 | 2012-05-18 09:47:59 -0700 | [diff] [blame] | 563 | RPM_LDO(L25, 1, 1, 0, 1250000, 1250000, "8921_s1", 10000, 10000), |
David Collins | 26f0556 | 2011-06-20 09:56:28 -0700 | [diff] [blame] | 564 | |
| 565 | /* ID a_on pd ss supply */ |
| 566 | RPM_VS(LVS1, 0, 1, 0, "8921_s4"), |
| 567 | RPM_VS(LVS2, 0, 1, 0, "8921_s1"), |
| 568 | RPM_VS(LVS3, 0, 1, 0, "8921_s4"), |
| 569 | RPM_VS(LVS4, 0, 1, 0, "8921_s4"), |
| 570 | RPM_VS(LVS5, 0, 1, 0, "8921_s4"), |
| 571 | RPM_VS(LVS6, 0, 1, 0, "8921_s4"), |
| 572 | RPM_VS(LVS7, 0, 1, 0, "8921_s4"), |
| 573 | |
| 574 | /* ID a_on ss min_uV max_uV supply freq */ |
| 575 | RPM_NCP(NCP, 0, 0, 1800000, 1800000, "8921_l6", 1p60), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 576 | }; |
| 577 | |
| 578 | int msm_pm8921_regulator_pdata_len __devinitdata = |
| 579 | ARRAY_SIZE(msm_pm8921_regulator_pdata); |
David Collins | 26f0556 | 2011-06-20 09:56:28 -0700 | [diff] [blame] | 580 | |
Matt Wagantall | 6115d78 | 2012-06-07 20:13:51 -0700 | [diff] [blame] | 581 | #define RPM_REG_MAP(_id, _sleep_also, _voter, _supply, _dev_name) \ |
| 582 | { \ |
| 583 | .vreg_id = RPM_VREG_ID_PM8921_##_id, \ |
| 584 | .sleep_also = _sleep_also, \ |
| 585 | .voter = _voter, \ |
| 586 | .supply = _supply, \ |
| 587 | .dev_name = _dev_name, \ |
| 588 | } |
| 589 | static struct rpm_regulator_consumer_mapping |
| 590 | msm_rpm_regulator_consumer_mapping[] __devinitdata = { |
| 591 | RPM_REG_MAP(L23, 0, 1, "krait0_l23", "acpuclk-8960"), |
| 592 | RPM_REG_MAP(L23, 0, 2, "krait1_l23", "acpuclk-8960"), |
| 593 | RPM_REG_MAP(L23, 0, 6, "l2_l23", "acpuclk-8960"), |
| 594 | RPM_REG_MAP(L24, 0, 1, "krait0_mem", "acpuclk-8960"), |
| 595 | RPM_REG_MAP(L24, 0, 2, "krait1_mem", "acpuclk-8960"), |
| 596 | RPM_REG_MAP(S3, 0, 1, "krait0_dig", "acpuclk-8960"), |
| 597 | RPM_REG_MAP(S3, 0, 2, "krait1_dig", "acpuclk-8960"), |
| 598 | RPM_REG_MAP(S8, 0, 1, "krait0_s8", "acpuclk-8960"), |
| 599 | RPM_REG_MAP(S8, 0, 2, "krait1_s8", "acpuclk-8960"), |
| 600 | RPM_REG_MAP(S8, 0, 6, "l2_s8", "acpuclk-8960"), |
Patrick Daly | 6578e0c | 2012-07-19 18:50:02 -0700 | [diff] [blame] | 601 | |
| 602 | RPM_REG_MAP(L23, 0, 1, "krait0_l23", "acpuclk-8960ab"), |
| 603 | RPM_REG_MAP(L23, 0, 2, "krait1_l23", "acpuclk-8960ab"), |
| 604 | RPM_REG_MAP(L23, 0, 6, "l2_l23", "acpuclk-8960ab"), |
| 605 | RPM_REG_MAP(L24, 0, 1, "krait0_mem", "acpuclk-8960ab"), |
| 606 | RPM_REG_MAP(L24, 0, 2, "krait1_mem", "acpuclk-8960ab"), |
| 607 | RPM_REG_MAP(S3, 0, 1, "krait0_dig", "acpuclk-8960ab"), |
| 608 | RPM_REG_MAP(S3, 0, 2, "krait1_dig", "acpuclk-8960ab"), |
| 609 | RPM_REG_MAP(S8, 0, 1, "krait0_s8", "acpuclk-8960ab"), |
| 610 | RPM_REG_MAP(S8, 0, 2, "krait1_s8", "acpuclk-8960ab"), |
| 611 | RPM_REG_MAP(S8, 0, 6, "l2_s8", "acpuclk-8960ab"), |
Matt Wagantall | 6115d78 | 2012-06-07 20:13:51 -0700 | [diff] [blame] | 612 | }; |
| 613 | |
David Collins | 26f0556 | 2011-06-20 09:56:28 -0700 | [diff] [blame] | 614 | struct rpm_regulator_platform_data msm_rpm_regulator_pdata __devinitdata = { |
David Collins | 6f032ba | 2011-08-31 14:08:15 -0700 | [diff] [blame] | 615 | .init_data = msm_rpm_regulator_init_data, |
| 616 | .num_regulators = ARRAY_SIZE(msm_rpm_regulator_init_data), |
| 617 | .version = RPM_VREG_VERSION_8960, |
| 618 | .vreg_id_vdd_mem = RPM_VREG_ID_PM8921_L24, |
| 619 | .vreg_id_vdd_dig = RPM_VREG_ID_PM8921_S3, |
Matt Wagantall | 6115d78 | 2012-06-07 20:13:51 -0700 | [diff] [blame] | 620 | .consumer_map = msm_rpm_regulator_consumer_mapping, |
| 621 | .consumer_map_len = ARRAY_SIZE(msm_rpm_regulator_consumer_mapping), |
David Collins | 26f0556 | 2011-06-20 09:56:28 -0700 | [diff] [blame] | 622 | }; |
David Collins | e68647e | 2012-09-04 15:44:19 -0700 | [diff] [blame] | 623 | |
| 624 | /* |
| 625 | * Fix up regulator consumer data that moves to a different regulator based on |
| 626 | * the current target. |
| 627 | */ |
| 628 | void __init configure_msm8960_power_grid(void) |
| 629 | { |
| 630 | static struct rpm_regulator_init_data *rpm_data; |
| 631 | int i; |
| 632 | |
Anirudh Ghayal | b6060e7 | 2013-07-23 15:07:31 +0530 | [diff] [blame] | 633 | if (machine_is_msm8960_cdp() || cpu_is_msm8960ab()) { |
David Collins | e68647e | 2012-09-04 15:44:19 -0700 | [diff] [blame] | 634 | /* Only modify LVS6 consumers for CDP targets. */ |
| 635 | for (i = 0; i < ARRAY_SIZE(msm_rpm_regulator_init_data); i++) { |
| 636 | rpm_data = &msm_rpm_regulator_init_data[i]; |
Anirudh Ghayal | b6060e7 | 2013-07-23 15:07:31 +0530 | [diff] [blame] | 637 | if (machine_is_msm8960_cdp() && |
| 638 | rpm_data->id == RPM_VREG_ID_PM8921_LVS6) { |
David Collins | e68647e | 2012-09-04 15:44:19 -0700 | [diff] [blame] | 639 | rpm_data->init_data.consumer_supplies |
| 640 | = vreg_consumers_CDP_LVS6; |
| 641 | rpm_data->init_data.num_consumer_supplies |
| 642 | = ARRAY_SIZE(vreg_consumers_CDP_LVS6); |
| 643 | } |
Anirudh Ghayal | b6060e7 | 2013-07-23 15:07:31 +0530 | [diff] [blame] | 644 | if (cpu_is_msm8960ab() && |
| 645 | rpm_data->id == RPM_VREG_ID_PM8921_S7) { |
| 646 | rpm_data->init_data.constraints.min_uV = |
| 647 | 1275000; |
| 648 | rpm_data->init_data.constraints.max_uV = |
| 649 | 1275000; |
| 650 | rpm_data->init_data.constraints.input_uV = |
| 651 | 1275000; |
| 652 | rpm_data->default_uV = 1275000; |
| 653 | } |
David Collins | e68647e | 2012-09-04 15:44:19 -0700 | [diff] [blame] | 654 | } |
| 655 | } |
| 656 | } |