Jay Chokshi | ea67c62 | 2011-07-29 17:12:26 -0700 | [diff] [blame] | 1 | /* |
Vikram Mulukutla | bc2e957 | 2011-11-04 03:41:38 -0700 | [diff] [blame] | 2 | * Copyright (c) 2011-2012, Code Aurora Forum. All rights reserved. |
Jay Chokshi | ea67c62 | 2011-07-29 17:12:26 -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> |
Jay Chokshi | ea67c62 | 2011-07-29 17:12:26 -0700 | [diff] [blame] | 15 | |
Stepan Moskovchenko | 5a83dba | 2011-12-05 17:30:17 -0800 | [diff] [blame] | 16 | #include "board-8064.h" |
Jay Chokshi | ea67c62 | 2011-07-29 17:12:26 -0700 | [diff] [blame] | 17 | |
| 18 | #define VREG_CONSUMERS(_id) \ |
| 19 | static struct regulator_consumer_supply vreg_consumers_##_id[] |
| 20 | |
| 21 | /* |
| 22 | * Consumer specific regulator names: |
| 23 | * regulator name consumer dev_name |
| 24 | */ |
| 25 | VREG_CONSUMERS(L1) = { |
| 26 | REGULATOR_SUPPLY("8921_l1", NULL), |
| 27 | }; |
| 28 | VREG_CONSUMERS(L2) = { |
| 29 | REGULATOR_SUPPLY("8921_l2", NULL), |
Jeyaprakash Soundrapandian | f0d4d01 | 2012-01-16 15:12:20 -0800 | [diff] [blame] | 30 | REGULATOR_SUPPLY("mipi_csi_vdd", "4-001a"), |
| 31 | REGULATOR_SUPPLY("mipi_csi_vdd", "4-006c"), |
Jay Chokshi | ea67c62 | 2011-07-29 17:12:26 -0700 | [diff] [blame] | 32 | }; |
| 33 | VREG_CONSUMERS(L3) = { |
| 34 | REGULATOR_SUPPLY("8921_l3", NULL), |
Hemant Kumar | 6ddad59 | 2011-08-03 19:31:56 -0700 | [diff] [blame] | 35 | REGULATOR_SUPPLY("HSUSB_3p3", "msm_otg"), |
Manu Gautam | dccbca4 | 2011-11-08 15:13:38 +0530 | [diff] [blame] | 36 | REGULATOR_SUPPLY("HSUSB_3p3", "msm_ehci_host.0"), |
| 37 | REGULATOR_SUPPLY("HSUSB_3p3", "msm_ehci_host.1"), |
Jay Chokshi | ea67c62 | 2011-07-29 17:12:26 -0700 | [diff] [blame] | 38 | }; |
| 39 | VREG_CONSUMERS(L4) = { |
| 40 | REGULATOR_SUPPLY("8921_l4", NULL), |
Hemant Kumar | 6ddad59 | 2011-08-03 19:31:56 -0700 | [diff] [blame] | 41 | REGULATOR_SUPPLY("HSUSB_1p8", "msm_otg"), |
Manu Gautam | dccbca4 | 2011-11-08 15:13:38 +0530 | [diff] [blame] | 42 | REGULATOR_SUPPLY("HSUSB_1p8", "msm_ehci_host.0"), |
| 43 | REGULATOR_SUPPLY("HSUSB_1p8", "msm_ehci_host.1"), |
Subramanian Srinivasan | 04d2c83 | 2012-01-17 11:26:36 -0800 | [diff] [blame] | 44 | REGULATOR_SUPPLY("iris_vddxo", "wcnss_wlan.0"), |
Jay Chokshi | ea67c62 | 2011-07-29 17:12:26 -0700 | [diff] [blame] | 45 | }; |
| 46 | VREG_CONSUMERS(L5) = { |
| 47 | REGULATOR_SUPPLY("8921_l5", NULL), |
Sahitya Tummala | b4d883f | 2011-08-23 10:44:51 +0530 | [diff] [blame] | 48 | REGULATOR_SUPPLY("sdc_vdd", "msm_sdcc.1"), |
Jay Chokshi | ea67c62 | 2011-07-29 17:12:26 -0700 | [diff] [blame] | 49 | }; |
| 50 | VREG_CONSUMERS(L6) = { |
| 51 | REGULATOR_SUPPLY("8921_l6", NULL), |
Sahitya Tummala | b4d883f | 2011-08-23 10:44:51 +0530 | [diff] [blame] | 52 | REGULATOR_SUPPLY("sdc_vdd", "msm_sdcc.3"), |
Jay Chokshi | ea67c62 | 2011-07-29 17:12:26 -0700 | [diff] [blame] | 53 | }; |
| 54 | VREG_CONSUMERS(L7) = { |
| 55 | REGULATOR_SUPPLY("8921_l7", NULL), |
Sahitya Tummala | b4d883f | 2011-08-23 10:44:51 +0530 | [diff] [blame] | 56 | REGULATOR_SUPPLY("sdc_vddp", "msm_sdcc.3"), |
Jay Chokshi | ea67c62 | 2011-07-29 17:12:26 -0700 | [diff] [blame] | 57 | }; |
| 58 | VREG_CONSUMERS(L8) = { |
| 59 | REGULATOR_SUPPLY("8921_l8", NULL), |
Jeyaprakash Soundrapandian | f0d4d01 | 2012-01-16 15:12:20 -0800 | [diff] [blame] | 60 | REGULATOR_SUPPLY("cam_vana", "4-001a"), |
| 61 | REGULATOR_SUPPLY("cam_vana", "4-006c"), |
Jay Chokshi | ea67c62 | 2011-07-29 17:12:26 -0700 | [diff] [blame] | 62 | }; |
| 63 | VREG_CONSUMERS(L9) = { |
| 64 | REGULATOR_SUPPLY("8921_l9", NULL), |
| 65 | }; |
| 66 | VREG_CONSUMERS(L10) = { |
| 67 | REGULATOR_SUPPLY("8921_l10", NULL), |
Subramanian Srinivasan | 04d2c83 | 2012-01-17 11:26:36 -0800 | [diff] [blame] | 68 | REGULATOR_SUPPLY("iris_vddpa", "wcnss_wlan.0"), |
Jay Chokshi | ea67c62 | 2011-07-29 17:12:26 -0700 | [diff] [blame] | 69 | }; |
| 70 | VREG_CONSUMERS(L11) = { |
| 71 | REGULATOR_SUPPLY("8921_l11", NULL), |
| 72 | }; |
| 73 | VREG_CONSUMERS(L12) = { |
Jeyaprakash Soundrapandian | f0d4d01 | 2012-01-16 15:12:20 -0800 | [diff] [blame] | 74 | REGULATOR_SUPPLY("cam_vdig", "4-001a"), |
| 75 | REGULATOR_SUPPLY("cam_vdig", "4-006c"), |
Jay Chokshi | ea67c62 | 2011-07-29 17:12:26 -0700 | [diff] [blame] | 76 | REGULATOR_SUPPLY("8921_l12", NULL), |
| 77 | }; |
| 78 | VREG_CONSUMERS(L14) = { |
| 79 | REGULATOR_SUPPLY("8921_l14", NULL), |
| 80 | }; |
| 81 | VREG_CONSUMERS(L15) = { |
| 82 | REGULATOR_SUPPLY("8921_l15", NULL), |
| 83 | }; |
| 84 | VREG_CONSUMERS(L16) = { |
| 85 | REGULATOR_SUPPLY("8921_l16", NULL), |
Jeyaprakash Soundrapandian | f0d4d01 | 2012-01-16 15:12:20 -0800 | [diff] [blame] | 86 | REGULATOR_SUPPLY("cam_vaf", "4-001a"), |
| 87 | REGULATOR_SUPPLY("cam_vaf", "4-006c"), |
Jay Chokshi | ea67c62 | 2011-07-29 17:12:26 -0700 | [diff] [blame] | 88 | }; |
| 89 | VREG_CONSUMERS(L17) = { |
| 90 | REGULATOR_SUPPLY("8921_l17", NULL), |
| 91 | }; |
| 92 | VREG_CONSUMERS(L18) = { |
| 93 | REGULATOR_SUPPLY("8921_l18", NULL), |
| 94 | }; |
| 95 | VREG_CONSUMERS(L22) = { |
| 96 | REGULATOR_SUPPLY("8921_l22", NULL), |
| 97 | }; |
| 98 | VREG_CONSUMERS(L23) = { |
| 99 | REGULATOR_SUPPLY("8921_l23", NULL), |
Swaminathan Sathappan | 2316e08 | 2012-02-03 14:07:17 -0800 | [diff] [blame^] | 100 | REGULATOR_SUPPLY("pll_vdd", "pil_qdsp6v4.1"), |
| 101 | REGULATOR_SUPPLY("pll_vdd", "pil_qdsp6v4.2"), |
| 102 | |
Jay Chokshi | ea67c62 | 2011-07-29 17:12:26 -0700 | [diff] [blame] | 103 | }; |
| 104 | VREG_CONSUMERS(L24) = { |
| 105 | REGULATOR_SUPPLY("8921_l24", NULL), |
Subramanian Srinivasan | 04d2c83 | 2012-01-17 11:26:36 -0800 | [diff] [blame] | 106 | REGULATOR_SUPPLY("riva_vddmx", "wcnss_wlan.0"), |
Jay Chokshi | ea67c62 | 2011-07-29 17:12:26 -0700 | [diff] [blame] | 107 | }; |
| 108 | VREG_CONSUMERS(L25) = { |
| 109 | REGULATOR_SUPPLY("8921_l25", NULL), |
Swaminathan Sathappan | 2f51a75 | 2011-12-05 12:51:19 -0800 | [diff] [blame] | 110 | REGULATOR_SUPPLY("VDDD_CDC_D", "tabla-slim"), |
| 111 | REGULATOR_SUPPLY("CDC_VDDA_A_1P2V", "tabla-slim"), |
Swaminathan Sathappan | 2316e08 | 2012-02-03 14:07:17 -0800 | [diff] [blame^] | 112 | REGULATOR_SUPPLY("VDDD_CDC_D", "tabla2x-slim"), |
| 113 | REGULATOR_SUPPLY("CDC_VDDA_A_1P2V", "tabla2x-slim"), |
Jay Chokshi | ea67c62 | 2011-07-29 17:12:26 -0700 | [diff] [blame] | 114 | }; |
| 115 | VREG_CONSUMERS(L26) = { |
| 116 | REGULATOR_SUPPLY("8921_l26", NULL), |
Matt Wagantall | b94b9a5 | 2012-02-02 21:59:54 -0800 | [diff] [blame] | 117 | REGULATOR_SUPPLY("core_vdd", "pil_qdsp6v4.0"), |
Jay Chokshi | ea67c62 | 2011-07-29 17:12:26 -0700 | [diff] [blame] | 118 | }; |
| 119 | VREG_CONSUMERS(L27) = { |
| 120 | REGULATOR_SUPPLY("8921_l27", NULL), |
Swaminathan Sathappan | 2316e08 | 2012-02-03 14:07:17 -0800 | [diff] [blame^] | 121 | REGULATOR_SUPPLY("core_vdd", "pil_qdsp6v4.2"), |
Jay Chokshi | ea67c62 | 2011-07-29 17:12:26 -0700 | [diff] [blame] | 122 | }; |
| 123 | VREG_CONSUMERS(L28) = { |
| 124 | REGULATOR_SUPPLY("8921_l28", NULL), |
Swaminathan Sathappan | 2316e08 | 2012-02-03 14:07:17 -0800 | [diff] [blame^] | 125 | REGULATOR_SUPPLY("core_vdd", "pil_qdsp6v4.1"), |
Jay Chokshi | ea67c62 | 2011-07-29 17:12:26 -0700 | [diff] [blame] | 126 | }; |
| 127 | VREG_CONSUMERS(S1) = { |
| 128 | REGULATOR_SUPPLY("8921_s1", NULL), |
| 129 | }; |
| 130 | VREG_CONSUMERS(S2) = { |
| 131 | REGULATOR_SUPPLY("8921_s2", NULL), |
Subramanian Srinivasan | 04d2c83 | 2012-01-17 11:26:36 -0800 | [diff] [blame] | 132 | REGULATOR_SUPPLY("iris_vddrfa", "wcnss_wlan.0"), |
Jay Chokshi | ea67c62 | 2011-07-29 17:12:26 -0700 | [diff] [blame] | 133 | }; |
| 134 | VREG_CONSUMERS(S3) = { |
| 135 | REGULATOR_SUPPLY("8921_s3", NULL), |
Hemant Kumar | 6ddad59 | 2011-08-03 19:31:56 -0700 | [diff] [blame] | 136 | REGULATOR_SUPPLY("HSUSB_VDDCX", "msm_otg"), |
Manu Gautam | dccbca4 | 2011-11-08 15:13:38 +0530 | [diff] [blame] | 137 | REGULATOR_SUPPLY("HSUSB_VDDCX", "msm_ehci_host.0"), |
| 138 | REGULATOR_SUPPLY("HSUSB_VDDCX", "msm_ehci_host.1"), |
Hemant Kumar | a945b47 | 2012-01-25 15:08:06 -0800 | [diff] [blame] | 139 | REGULATOR_SUPPLY("HSIC_VDDCX", "msm_hsic_host"), |
Subramanian Srinivasan | 04d2c83 | 2012-01-17 11:26:36 -0800 | [diff] [blame] | 140 | REGULATOR_SUPPLY("riva_vddcx", "wcnss_wlan.0"), |
Jay Chokshi | ea67c62 | 2011-07-29 17:12:26 -0700 | [diff] [blame] | 141 | }; |
| 142 | VREG_CONSUMERS(S4) = { |
| 143 | REGULATOR_SUPPLY("8921_s4", NULL), |
Sahitya Tummala | b4d883f | 2011-08-23 10:44:51 +0530 | [diff] [blame] | 144 | REGULATOR_SUPPLY("sdc_vccq", "msm_sdcc.1"), |
Swaminathan Sathappan | 2f51a75 | 2011-12-05 12:51:19 -0800 | [diff] [blame] | 145 | REGULATOR_SUPPLY("VDDIO_CDC", "tabla-slim"), |
| 146 | REGULATOR_SUPPLY("CDC_VDD_CP", "tabla-slim"), |
| 147 | REGULATOR_SUPPLY("CDC_VDDA_TX", "tabla-slim"), |
| 148 | REGULATOR_SUPPLY("CDC_VDDA_RX", "tabla-slim"), |
Swaminathan Sathappan | 2316e08 | 2012-02-03 14:07:17 -0800 | [diff] [blame^] | 149 | REGULATOR_SUPPLY("VDDIO_CDC", "tabla2x-slim"), |
| 150 | REGULATOR_SUPPLY("CDC_VDD_CP", "tabla2x-slim"), |
| 151 | REGULATOR_SUPPLY("CDC_VDDA_TX", "tabla2x-slim"), |
| 152 | REGULATOR_SUPPLY("CDC_VDDA_RX", "tabla2x-slim"), |
Subramanian Srinivasan | 04d2c83 | 2012-01-17 11:26:36 -0800 | [diff] [blame] | 153 | REGULATOR_SUPPLY("riva_vddpx", "wcnss_wlan.0"), |
Jay Chokshi | ea67c62 | 2011-07-29 17:12:26 -0700 | [diff] [blame] | 154 | }; |
| 155 | VREG_CONSUMERS(S5) = { |
| 156 | REGULATOR_SUPPLY("8921_s5", NULL), |
Vikram Mulukutla | bc2e957 | 2011-11-04 03:41:38 -0700 | [diff] [blame] | 157 | REGULATOR_SUPPLY("krait0", NULL), |
Jay Chokshi | ea67c62 | 2011-07-29 17:12:26 -0700 | [diff] [blame] | 158 | }; |
| 159 | VREG_CONSUMERS(S6) = { |
| 160 | REGULATOR_SUPPLY("8921_s6", NULL), |
Vikram Mulukutla | bc2e957 | 2011-11-04 03:41:38 -0700 | [diff] [blame] | 161 | REGULATOR_SUPPLY("krait1", NULL), |
Jay Chokshi | ea67c62 | 2011-07-29 17:12:26 -0700 | [diff] [blame] | 162 | }; |
| 163 | VREG_CONSUMERS(S7) = { |
| 164 | REGULATOR_SUPPLY("8921_s7", NULL), |
| 165 | }; |
| 166 | VREG_CONSUMERS(LVS1) = { |
| 167 | REGULATOR_SUPPLY("8921_lvs1", NULL), |
Subramanian Srinivasan | 04d2c83 | 2012-01-17 11:26:36 -0800 | [diff] [blame] | 168 | REGULATOR_SUPPLY("iris_vddio", "wcnss_wlan.0"), |
Jay Chokshi | ea67c62 | 2011-07-29 17:12:26 -0700 | [diff] [blame] | 169 | }; |
| 170 | VREG_CONSUMERS(LVS2) = { |
| 171 | REGULATOR_SUPPLY("8921_lvs2", NULL), |
Subramanian Srinivasan | 04d2c83 | 2012-01-17 11:26:36 -0800 | [diff] [blame] | 172 | REGULATOR_SUPPLY("iris_vdddig", "wcnss_wlan.0"), |
Jay Chokshi | ea67c62 | 2011-07-29 17:12:26 -0700 | [diff] [blame] | 173 | }; |
| 174 | VREG_CONSUMERS(LVS3) = { |
| 175 | REGULATOR_SUPPLY("8921_lvs3", NULL), |
| 176 | }; |
| 177 | VREG_CONSUMERS(LVS4) = { |
| 178 | REGULATOR_SUPPLY("8921_lvs4", NULL), |
| 179 | }; |
| 180 | VREG_CONSUMERS(LVS5) = { |
| 181 | REGULATOR_SUPPLY("8921_lvs5", NULL), |
Jeyaprakash Soundrapandian | f0d4d01 | 2012-01-16 15:12:20 -0800 | [diff] [blame] | 182 | REGULATOR_SUPPLY("cam_vio", "4-001a"), |
| 183 | REGULATOR_SUPPLY("cam_vio", "4-006c"), |
Jay Chokshi | ea67c62 | 2011-07-29 17:12:26 -0700 | [diff] [blame] | 184 | }; |
| 185 | VREG_CONSUMERS(LVS6) = { |
| 186 | REGULATOR_SUPPLY("8921_lvs6", NULL), |
| 187 | }; |
| 188 | VREG_CONSUMERS(LVS7) = { |
| 189 | REGULATOR_SUPPLY("8921_lvs7", NULL), |
Matt Wagantall | 52dd062 | 2012-02-02 18:26:16 -0800 | [diff] [blame] | 190 | REGULATOR_SUPPLY("pll_vdd", "pil_riva"), |
Jay Chokshi | ea67c62 | 2011-07-29 17:12:26 -0700 | [diff] [blame] | 191 | }; |
| 192 | VREG_CONSUMERS(USB_OTG) = { |
| 193 | REGULATOR_SUPPLY("8921_usb_otg", NULL), |
Hemant Kumar | d86c488 | 2012-01-24 19:39:37 -0800 | [diff] [blame] | 194 | REGULATOR_SUPPLY("vbus_otg", "msm_otg"), |
Jay Chokshi | ea67c62 | 2011-07-29 17:12:26 -0700 | [diff] [blame] | 195 | }; |
| 196 | VREG_CONSUMERS(HDMI_MVS) = { |
| 197 | REGULATOR_SUPPLY("8921_hdmi_mvs", NULL), |
| 198 | }; |
| 199 | VREG_CONSUMERS(NCP) = { |
| 200 | REGULATOR_SUPPLY("8921_ncp", NULL), |
| 201 | }; |
Jay Chokshi | 7805b5a | 2011-11-07 15:55:30 -0800 | [diff] [blame] | 202 | VREG_CONSUMERS(8821_S0) = { |
| 203 | REGULATOR_SUPPLY("8821_s0", NULL), |
Vikram Mulukutla | bc2e957 | 2011-11-04 03:41:38 -0700 | [diff] [blame] | 204 | REGULATOR_SUPPLY("krait2", NULL), |
Jay Chokshi | 7805b5a | 2011-11-07 15:55:30 -0800 | [diff] [blame] | 205 | }; |
| 206 | VREG_CONSUMERS(8821_S1) = { |
| 207 | REGULATOR_SUPPLY("8821_s1", NULL), |
Vikram Mulukutla | bc2e957 | 2011-11-04 03:41:38 -0700 | [diff] [blame] | 208 | REGULATOR_SUPPLY("krait3", NULL), |
Jay Chokshi | 7805b5a | 2011-11-07 15:55:30 -0800 | [diff] [blame] | 209 | }; |
David Collins | f0d0073 | 2012-01-25 15:46:50 -0800 | [diff] [blame] | 210 | VREG_CONSUMERS(EXT_5V) = { |
| 211 | REGULATOR_SUPPLY("ext_5v", NULL), |
| 212 | }; |
| 213 | VREG_CONSUMERS(EXT_3P3V) = { |
| 214 | REGULATOR_SUPPLY("ext_3p3v", NULL), |
Stepan Moskovchenko | c71c979 | 2012-01-31 18:12:44 -0800 | [diff] [blame] | 215 | REGULATOR_SUPPLY("vdd_io", "spi0.2"), |
Hemant Kumar | 94e7da2 | 2012-02-03 16:52:29 -0800 | [diff] [blame] | 216 | REGULATOR_SUPPLY("mhl_ext_3p3v", "msm_otg"), |
David Collins | f0d0073 | 2012-01-25 15:46:50 -0800 | [diff] [blame] | 217 | }; |
Jay Chokshi | ea67c62 | 2011-07-29 17:12:26 -0700 | [diff] [blame] | 218 | |
David Collins | 7501674 | 2011-12-02 15:04:25 -0800 | [diff] [blame] | 219 | #define PM8XXX_VREG_INIT(_id, _name, _min_uV, _max_uV, _modes, _ops, \ |
| 220 | _apply_uV, _pull_down, _always_on, _supply_regulator, \ |
| 221 | _system_uA, _enable_time, _reg_id) \ |
Jay Chokshi | ea67c62 | 2011-07-29 17:12:26 -0700 | [diff] [blame] | 222 | { \ |
| 223 | .init_data = { \ |
| 224 | .constraints = { \ |
| 225 | .valid_modes_mask = _modes, \ |
| 226 | .valid_ops_mask = _ops, \ |
| 227 | .min_uV = _min_uV, \ |
| 228 | .max_uV = _max_uV, \ |
| 229 | .input_uV = _max_uV, \ |
| 230 | .apply_uV = _apply_uV, \ |
| 231 | .always_on = _always_on, \ |
David Collins | 7501674 | 2011-12-02 15:04:25 -0800 | [diff] [blame] | 232 | .name = _name, \ |
Jay Chokshi | ea67c62 | 2011-07-29 17:12:26 -0700 | [diff] [blame] | 233 | }, \ |
| 234 | .num_consumer_supplies = \ |
| 235 | ARRAY_SIZE(vreg_consumers_##_id), \ |
| 236 | .consumer_supplies = vreg_consumers_##_id, \ |
| 237 | .supply_regulator = _supply_regulator, \ |
| 238 | }, \ |
David Collins | 7501674 | 2011-12-02 15:04:25 -0800 | [diff] [blame] | 239 | .id = _reg_id, \ |
Jay Chokshi | ea67c62 | 2011-07-29 17:12:26 -0700 | [diff] [blame] | 240 | .pull_down_enable = _pull_down, \ |
| 241 | .system_uA = _system_uA, \ |
| 242 | .enable_time = _enable_time, \ |
| 243 | } |
| 244 | |
David Collins | 7501674 | 2011-12-02 15:04:25 -0800 | [diff] [blame] | 245 | #define PM8XXX_LDO(_id, _name, _always_on, _pull_down, _min_uV, _max_uV, \ |
| 246 | _enable_time, _supply_regulator, _system_uA, _reg_id) \ |
| 247 | PM8XXX_VREG_INIT(_id, _name, _min_uV, _max_uV, REGULATOR_MODE_NORMAL \ |
Jay Chokshi | ea67c62 | 2011-07-29 17:12:26 -0700 | [diff] [blame] | 248 | | REGULATOR_MODE_IDLE, REGULATOR_CHANGE_VOLTAGE | \ |
| 249 | REGULATOR_CHANGE_STATUS | REGULATOR_CHANGE_MODE | \ |
| 250 | REGULATOR_CHANGE_DRMS, 0, _pull_down, _always_on, \ |
David Collins | 7501674 | 2011-12-02 15:04:25 -0800 | [diff] [blame] | 251 | _supply_regulator, _system_uA, _enable_time, _reg_id) |
Jay Chokshi | ea67c62 | 2011-07-29 17:12:26 -0700 | [diff] [blame] | 252 | |
David Collins | 7501674 | 2011-12-02 15:04:25 -0800 | [diff] [blame] | 253 | #define PM8XXX_NLDO1200(_id, _name, _always_on, _pull_down, _min_uV, \ |
| 254 | _max_uV, _enable_time, _supply_regulator, _system_uA, _reg_id) \ |
| 255 | PM8XXX_VREG_INIT(_id, _name, _min_uV, _max_uV, REGULATOR_MODE_NORMAL \ |
Jay Chokshi | ea67c62 | 2011-07-29 17:12:26 -0700 | [diff] [blame] | 256 | | REGULATOR_MODE_IDLE, REGULATOR_CHANGE_VOLTAGE | \ |
| 257 | REGULATOR_CHANGE_STATUS | REGULATOR_CHANGE_MODE | \ |
| 258 | REGULATOR_CHANGE_DRMS, 0, _pull_down, _always_on, \ |
David Collins | 7501674 | 2011-12-02 15:04:25 -0800 | [diff] [blame] | 259 | _supply_regulator, _system_uA, _enable_time, _reg_id) |
Jay Chokshi | ea67c62 | 2011-07-29 17:12:26 -0700 | [diff] [blame] | 260 | |
David Collins | 7501674 | 2011-12-02 15:04:25 -0800 | [diff] [blame] | 261 | #define PM8XXX_SMPS(_id, _name, _always_on, _pull_down, _min_uV, _max_uV, \ |
| 262 | _enable_time, _supply_regulator, _system_uA, _reg_id) \ |
| 263 | PM8XXX_VREG_INIT(_id, _name, _min_uV, _max_uV, REGULATOR_MODE_NORMAL \ |
Jay Chokshi | ea67c62 | 2011-07-29 17:12:26 -0700 | [diff] [blame] | 264 | | REGULATOR_MODE_IDLE, REGULATOR_CHANGE_VOLTAGE | \ |
| 265 | REGULATOR_CHANGE_STATUS | REGULATOR_CHANGE_MODE | \ |
| 266 | REGULATOR_CHANGE_DRMS, 0, _pull_down, _always_on, \ |
David Collins | 7501674 | 2011-12-02 15:04:25 -0800 | [diff] [blame] | 267 | _supply_regulator, _system_uA, _enable_time, _reg_id) |
Jay Chokshi | ea67c62 | 2011-07-29 17:12:26 -0700 | [diff] [blame] | 268 | |
David Collins | 7501674 | 2011-12-02 15:04:25 -0800 | [diff] [blame] | 269 | #define PM8XXX_FTSMPS(_id, _name, _always_on, _pull_down, _min_uV, _max_uV, \ |
| 270 | _enable_time, _supply_regulator, _system_uA, _reg_id) \ |
| 271 | PM8XXX_VREG_INIT(_id, _name, _min_uV, _max_uV, REGULATOR_MODE_NORMAL, \ |
Jay Chokshi | ea67c62 | 2011-07-29 17:12:26 -0700 | [diff] [blame] | 272 | REGULATOR_CHANGE_VOLTAGE | REGULATOR_CHANGE_STATUS \ |
| 273 | | REGULATOR_CHANGE_MODE, 0, _pull_down, _always_on, \ |
David Collins | 7501674 | 2011-12-02 15:04:25 -0800 | [diff] [blame] | 274 | _supply_regulator, _system_uA, _enable_time, _reg_id) |
Jay Chokshi | ea67c62 | 2011-07-29 17:12:26 -0700 | [diff] [blame] | 275 | |
David Collins | 7501674 | 2011-12-02 15:04:25 -0800 | [diff] [blame] | 276 | #define PM8XXX_VS(_id, _name, _always_on, _pull_down, _enable_time, \ |
| 277 | _supply_regulator, _reg_id) \ |
| 278 | PM8XXX_VREG_INIT(_id, _name, 0, 0, 0, REGULATOR_CHANGE_STATUS, 0, \ |
| 279 | _pull_down, _always_on, _supply_regulator, 0, _enable_time, \ |
| 280 | _reg_id) |
Jay Chokshi | ea67c62 | 2011-07-29 17:12:26 -0700 | [diff] [blame] | 281 | |
David Collins | 7501674 | 2011-12-02 15:04:25 -0800 | [diff] [blame] | 282 | #define PM8XXX_VS300(_id, _name, _always_on, _pull_down, _enable_time, \ |
| 283 | _supply_regulator, _reg_id) \ |
| 284 | PM8XXX_VREG_INIT(_id, _name, 0, 0, 0, REGULATOR_CHANGE_STATUS, 0, \ |
| 285 | _pull_down, _always_on, _supply_regulator, 0, _enable_time, \ |
| 286 | _reg_id) |
Jay Chokshi | ea67c62 | 2011-07-29 17:12:26 -0700 | [diff] [blame] | 287 | |
David Collins | 7501674 | 2011-12-02 15:04:25 -0800 | [diff] [blame] | 288 | #define PM8XXX_NCP(_id, _name, _always_on, _min_uV, _max_uV, _enable_time, \ |
| 289 | _supply_regulator, _reg_id) \ |
| 290 | PM8XXX_VREG_INIT(_id, _name, _min_uV, _max_uV, 0, \ |
| 291 | REGULATOR_CHANGE_VOLTAGE | REGULATOR_CHANGE_STATUS, 0, 0, \ |
| 292 | _always_on, _supply_regulator, 0, _enable_time, _reg_id) |
Jay Chokshi | ea67c62 | 2011-07-29 17:12:26 -0700 | [diff] [blame] | 293 | |
| 294 | /* Pin control initialization */ |
David Collins | 7501674 | 2011-12-02 15:04:25 -0800 | [diff] [blame] | 295 | #define PM8XXX_PC(_id, _name, _always_on, _pin_fn, _pin_ctrl, \ |
| 296 | _supply_regulator, _reg_id) \ |
Jay Chokshi | ea67c62 | 2011-07-29 17:12:26 -0700 | [diff] [blame] | 297 | { \ |
| 298 | .init_data = { \ |
| 299 | .constraints = { \ |
| 300 | .valid_ops_mask = REGULATOR_CHANGE_STATUS, \ |
| 301 | .always_on = _always_on, \ |
David Collins | 7501674 | 2011-12-02 15:04:25 -0800 | [diff] [blame] | 302 | .name = _name, \ |
Jay Chokshi | ea67c62 | 2011-07-29 17:12:26 -0700 | [diff] [blame] | 303 | }, \ |
| 304 | .num_consumer_supplies = \ |
| 305 | ARRAY_SIZE(vreg_consumers_##_id##_PC), \ |
| 306 | .consumer_supplies = vreg_consumers_##_id##_PC, \ |
| 307 | .supply_regulator = _supply_regulator, \ |
| 308 | }, \ |
David Collins | 7501674 | 2011-12-02 15:04:25 -0800 | [diff] [blame] | 309 | .id = _reg_id, \ |
| 310 | .pin_fn = PM8XXX_VREG_PIN_FN_##_pin_fn, \ |
| 311 | .pin_ctrl = _pin_ctrl, \ |
Jay Chokshi | ea67c62 | 2011-07-29 17:12:26 -0700 | [diff] [blame] | 312 | } |
| 313 | |
David Collins | f0d0073 | 2012-01-25 15:46:50 -0800 | [diff] [blame] | 314 | #define GPIO_VREG(_id, _reg_name, _gpio_label, _gpio, _supply_regulator) \ |
| 315 | [GPIO_VREG_ID_##_id] = { \ |
| 316 | .init_data = { \ |
| 317 | .constraints = { \ |
| 318 | .valid_ops_mask = REGULATOR_CHANGE_STATUS, \ |
| 319 | }, \ |
| 320 | .num_consumer_supplies = \ |
| 321 | ARRAY_SIZE(vreg_consumers_##_id), \ |
| 322 | .consumer_supplies = vreg_consumers_##_id, \ |
| 323 | .supply_regulator = _supply_regulator, \ |
| 324 | }, \ |
| 325 | .regulator_name = _reg_name, \ |
| 326 | .gpio_label = _gpio_label, \ |
| 327 | .gpio = _gpio, \ |
| 328 | } |
| 329 | |
Jay Chokshi | ea67c62 | 2011-07-29 17:12:26 -0700 | [diff] [blame] | 330 | #define SAW_VREG_INIT(_id, _name, _min_uV, _max_uV) \ |
| 331 | { \ |
| 332 | .constraints = { \ |
| 333 | .name = _name, \ |
| 334 | .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE, \ |
| 335 | .min_uV = _min_uV, \ |
| 336 | .max_uV = _max_uV, \ |
| 337 | }, \ |
| 338 | .num_consumer_supplies = ARRAY_SIZE(vreg_consumers_##_id), \ |
| 339 | .consumer_supplies = vreg_consumers_##_id, \ |
| 340 | } |
| 341 | |
David Collins | f0d0073 | 2012-01-25 15:46:50 -0800 | [diff] [blame] | 342 | /* GPIO regulator constraints */ |
| 343 | struct gpio_regulator_platform_data |
| 344 | apq8064_gpio_regulator_pdata[] __devinitdata = { |
| 345 | /* ID vreg_name gpio_label gpio supply */ |
| 346 | GPIO_VREG(EXT_5V, "ext_5v", "ext_5v_en", PM8921_MPP_PM_TO_SYS(7), NULL), |
| 347 | GPIO_VREG(EXT_3P3V, "ext_3p3v", "ext_3p3v_en", |
| 348 | APQ8064_EXT_3P3V_REG_EN_GPIO, NULL), |
| 349 | }; |
| 350 | |
Jay Chokshi | ea67c62 | 2011-07-29 17:12:26 -0700 | [diff] [blame] | 351 | /* SAW regulator constraints */ |
Jay Chokshi | 7805b5a | 2011-11-07 15:55:30 -0800 | [diff] [blame] | 352 | struct regulator_init_data msm8064_saw_regulator_pdata_8921_s5 = |
Jay Chokshi | ea67c62 | 2011-07-29 17:12:26 -0700 | [diff] [blame] | 353 | /* ID vreg_name min_uV max_uV */ |
Jay Chokshi | 7805b5a | 2011-11-07 15:55:30 -0800 | [diff] [blame] | 354 | SAW_VREG_INIT(S5, "8921_s5", 950000, 1150000); |
| 355 | struct regulator_init_data msm8064_saw_regulator_pdata_8921_s6 = |
| 356 | SAW_VREG_INIT(S6, "8921_s6", 950000, 1150000); |
| 357 | |
| 358 | struct regulator_init_data msm8064_saw_regulator_pdata_8821_s0 = |
| 359 | /* ID vreg_name min_uV max_uV */ |
| 360 | SAW_VREG_INIT(8821_S0, "8821_s0", 950000, 1150000); |
| 361 | struct regulator_init_data msm8064_saw_regulator_pdata_8821_s1 = |
| 362 | SAW_VREG_INIT(8821_S1, "8821_s1", 950000, 1150000); |
Jay Chokshi | ea67c62 | 2011-07-29 17:12:26 -0700 | [diff] [blame] | 363 | |
| 364 | /* PM8921 regulator constraints */ |
David Collins | 7501674 | 2011-12-02 15:04:25 -0800 | [diff] [blame] | 365 | struct pm8xxx_regulator_platform_data |
Jay Chokshi | ea67c62 | 2011-07-29 17:12:26 -0700 | [diff] [blame] | 366 | msm8064_pm8921_regulator_pdata[] __devinitdata = { |
David Collins | 7501674 | 2011-12-02 15:04:25 -0800 | [diff] [blame] | 367 | /* |
| 368 | * ID name always_on pd min_uV max_uV en_t supply |
| 369 | * system_uA reg_ID |
| 370 | */ |
| 371 | PM8XXX_SMPS(S1, "8921_s1", 1, 1, 1225000, 1225000, 500, NULL, 100000, |
| 372 | 1), |
| 373 | PM8XXX_SMPS(S2, "8921_s2", 0, 1, 1300000, 1300000, 500, NULL, 0, 2), |
| 374 | PM8XXX_SMPS(S3, "8921_s3", 1, 1, 1150000, 1150000, 500, NULL, 100000, |
| 375 | 3), |
| 376 | PM8XXX_SMPS(S4, "8921_s4", 1, 1, 1800000, 1800000, 500, NULL, 100000, |
| 377 | 4), |
David Collins | 584ba45 | 2012-02-01 10:52:51 -0800 | [diff] [blame] | 378 | PM8XXX_SMPS(S7, "8921_s7", 0, 1, 1300000, 1300000, 500, NULL, 100000, |
David Collins | 7501674 | 2011-12-02 15:04:25 -0800 | [diff] [blame] | 379 | 5), |
Jay Chokshi | ea67c62 | 2011-07-29 17:12:26 -0700 | [diff] [blame] | 380 | |
David Collins | 7501674 | 2011-12-02 15:04:25 -0800 | [diff] [blame] | 381 | PM8XXX_LDO(L1, "8921_l1", 1, 1, 1100000, 1100000, 200, "8921_s4", 0, |
| 382 | 6), |
| 383 | PM8XXX_LDO(L2, "8921_l2", 0, 1, 1200000, 1200000, 200, "8921_s4", 0, |
| 384 | 7), |
| 385 | PM8XXX_LDO(L3, "8921_l3", 0, 1, 3075000, 3075000, 200, NULL, 0, 8), |
David Collins | 584ba45 | 2012-02-01 10:52:51 -0800 | [diff] [blame] | 386 | PM8XXX_LDO(L4, "8921_l4", 1, 1, 1800000, 1800000, 200, NULL, 10000, |
| 387 | 9), |
David Collins | 7501674 | 2011-12-02 15:04:25 -0800 | [diff] [blame] | 388 | PM8XXX_LDO(L5, "8921_l5", 0, 1, 2950000, 2950000, 200, NULL, 0, 10), |
| 389 | PM8XXX_LDO(L6, "8921_l6", 0, 1, 2950000, 2950000, 200, NULL, 0, 11), |
David Collins | 584ba45 | 2012-02-01 10:52:51 -0800 | [diff] [blame] | 390 | PM8XXX_LDO(L7, "8921_l7", 0, 1, 1850000, 2950000, 200, NULL, 0, 12), |
David Collins | 7501674 | 2011-12-02 15:04:25 -0800 | [diff] [blame] | 391 | PM8XXX_LDO(L8, "8921_l8", 0, 1, 2800000, 2800000, 200, NULL, 0, 13), |
| 392 | PM8XXX_LDO(L9, "8921_l9", 0, 1, 2850000, 2850000, 200, NULL, 0, 14), |
| 393 | PM8XXX_LDO(L10, "8921_l10", 0, 1, 2900000, 2900000, 200, NULL, 0, 15), |
| 394 | PM8XXX_LDO(L11, "8921_l11", 0, 1, 3000000, 3000000, 200, NULL, 0, 16), |
| 395 | PM8XXX_LDO(L12, "8921_l12", 0, 1, 1200000, 1200000, 200, "8921_s4", 0, |
| 396 | 17), |
| 397 | PM8XXX_LDO(L14, "8921_l14", 0, 1, 1800000, 1800000, 200, NULL, 0, 18), |
| 398 | PM8XXX_LDO(L15, "8921_l15", 0, 1, 1800000, 2950000, 200, NULL, 0, 19), |
| 399 | PM8XXX_LDO(L16, "8921_l16", 0, 1, 2800000, 2800000, 200, NULL, 0, 20), |
| 400 | PM8XXX_LDO(L17, "8921_l17", 0, 1, 2000000, 2000000, 200, NULL, 0, 21), |
| 401 | PM8XXX_LDO(L18, "8921_l18", 0, 1, 1300000, 1800000, 200, "8921_s4", 0, |
| 402 | 22), |
| 403 | PM8XXX_LDO(L22, "8921_l22", 0, 1, 2600000, 2600000, 200, NULL, 0, 23), |
| 404 | PM8XXX_LDO(L23, "8921_l23", 0, 1, 1800000, 1800000, 200, NULL, 0, 24), |
| 405 | PM8XXX_NLDO1200(L24, "8921_l24", 1, 1, 1150000, 1150000, 200, "8921_s1", |
| 406 | 10000, 25), |
| 407 | PM8XXX_NLDO1200(L25, "8921_l25", 1, 1, 1225000, 1225000, 200, "8921_s1", |
David Collins | 584ba45 | 2012-02-01 10:52:51 -0800 | [diff] [blame] | 408 | 10000, 26), |
David Collins | 7501674 | 2011-12-02 15:04:25 -0800 | [diff] [blame] | 409 | PM8XXX_NLDO1200(L26, "8921_l26", 0, 1, 1050000, 1050000, 200, "8921_s7", |
| 410 | 0, 27), |
David Collins | 584ba45 | 2012-02-01 10:52:51 -0800 | [diff] [blame] | 411 | PM8XXX_NLDO1200(L27, "8921_l27", 0, 1, 1100000, 1100000, 200, "8921_s7", |
David Collins | 7501674 | 2011-12-02 15:04:25 -0800 | [diff] [blame] | 412 | 0, 28), |
| 413 | PM8XXX_NLDO1200(L28, "8921_l28", 0, 1, 1050000, 1050000, 200, "8921_s7", |
| 414 | 0, 29), |
Jay Chokshi | ea67c62 | 2011-07-29 17:12:26 -0700 | [diff] [blame] | 415 | |
David Collins | 7501674 | 2011-12-02 15:04:25 -0800 | [diff] [blame] | 416 | /* ID name always_on pd en_t supply reg_ID */ |
| 417 | PM8XXX_VS(LVS1, "8921_lvs1", 0, 1, 0, "8921_s4", 30), |
| 418 | PM8XXX_VS300(LVS2, "8921_lvs2", 0, 1, 0, "8921_s1", 31), |
| 419 | PM8XXX_VS(LVS3, "8921_lvs3", 0, 1, 0, "8921_s4", 32), |
| 420 | PM8XXX_VS(LVS4, "8921_lvs4", 0, 1, 0, "8921_s4", 33), |
| 421 | PM8XXX_VS(LVS5, "8921_lvs5", 0, 1, 0, "8921_s4", 34), |
| 422 | PM8XXX_VS(LVS6, "8921_lvs6", 0, 1, 0, "8921_s4", 35), |
| 423 | PM8XXX_VS(LVS7, "8921_lvs7", 1, 1, 0, "8921_s4", 36), |
Jay Chokshi | ea67c62 | 2011-07-29 17:12:26 -0700 | [diff] [blame] | 424 | |
David Collins | f0d0073 | 2012-01-25 15:46:50 -0800 | [diff] [blame] | 425 | PM8XXX_VS300(USB_OTG, "8921_usb_otg", 0, 0, 0, "ext_5v", 37), |
| 426 | PM8XXX_VS300(HDMI_MVS, "8921_hdmi_mvs", 0, 1, 0, "ext_5v", 38), |
Jay Chokshi | ea67c62 | 2011-07-29 17:12:26 -0700 | [diff] [blame] | 427 | |
David Collins | 7501674 | 2011-12-02 15:04:25 -0800 | [diff] [blame] | 428 | /* ID name always_on min_uV max_uV en_t supply reg_ID */ |
| 429 | PM8XXX_NCP(NCP, "8921_ncp", 0, 1800000, 1800000, 200, "8921_l6", 39), |
Jay Chokshi | ea67c62 | 2011-07-29 17:12:26 -0700 | [diff] [blame] | 430 | }; |
| 431 | |
| 432 | int msm8064_pm8921_regulator_pdata_len __devinitdata = |
| 433 | ARRAY_SIZE(msm8064_pm8921_regulator_pdata); |