David Collins | 1d4061b | 2011-12-06 15:36:40 -0800 | [diff] [blame] | 1 | /* |
David Collins | b455842 | 2012-01-05 10:50:49 -0800 | [diff] [blame] | 2 | * Copyright (c) 2011-2012, Code Aurora Forum. All rights reserved. |
David Collins | 1d4061b | 2011-12-06 15:36:40 -0800 | [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 | |
| 14 | #include <linux/regulator/pm8xxx-regulator.h> |
| 15 | |
| 16 | #include "board-8930.h" |
| 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("8038_l1", NULL), |
Subramanian Srinivasan | c698a44 | 2012-01-11 13:41:57 -0800 | [diff] [blame] | 27 | REGULATOR_SUPPLY("iris_vddrfa", "wcnss_wlan.0"), |
David Collins | 1d4061b | 2011-12-06 15:36:40 -0800 | [diff] [blame] | 28 | }; |
| 29 | VREG_CONSUMERS(L2) = { |
| 30 | REGULATOR_SUPPLY("8038_l2", NULL), |
Subramanian Srinivasan | c698a44 | 2012-01-11 13:41:57 -0800 | [diff] [blame] | 31 | REGULATOR_SUPPLY("iris_vdddig", "wcnss_wlan.0"), |
Chandan Uddaraju | 59894ca | 2011-12-05 17:07:02 -0800 | [diff] [blame] | 32 | REGULATOR_SUPPLY("dsi_vdda", "mipi_dsi.1"), |
Kevin Chan | 330e4d5 | 2012-02-18 23:11:24 -0800 | [diff] [blame] | 33 | REGULATOR_SUPPLY("mipi_csi_vdd", "msm_csid.0"), |
| 34 | REGULATOR_SUPPLY("mipi_csi_vdd", "msm_csid.1"), |
| 35 | REGULATOR_SUPPLY("mipi_csi_vdd", "msm_csid.2"), |
David Collins | 1d4061b | 2011-12-06 15:36:40 -0800 | [diff] [blame] | 36 | }; |
| 37 | VREG_CONSUMERS(L3) = { |
| 38 | REGULATOR_SUPPLY("8038_l3", NULL), |
Mayank Rana | bf5084a | 2011-12-12 17:06:54 +0530 | [diff] [blame] | 39 | REGULATOR_SUPPLY("HSUSB_3p3", "msm_otg"), |
David Collins | 1d4061b | 2011-12-06 15:36:40 -0800 | [diff] [blame] | 40 | }; |
| 41 | VREG_CONSUMERS(L4) = { |
| 42 | REGULATOR_SUPPLY("8038_l4", NULL), |
Mayank Rana | bf5084a | 2011-12-12 17:06:54 +0530 | [diff] [blame] | 43 | REGULATOR_SUPPLY("HSUSB_1p8", "msm_otg"), |
Subramanian Srinivasan | c698a44 | 2012-01-11 13:41:57 -0800 | [diff] [blame] | 44 | REGULATOR_SUPPLY("iris_vddxo", "wcnss_wlan.0"), |
David Collins | 1d4061b | 2011-12-06 15:36:40 -0800 | [diff] [blame] | 45 | }; |
| 46 | VREG_CONSUMERS(L5) = { |
| 47 | REGULATOR_SUPPLY("8038_l5", NULL), |
Krishna Konda | 40ec7e9 | 2011-12-20 19:28:25 -0800 | [diff] [blame] | 48 | REGULATOR_SUPPLY("sdc_vdd", "msm_sdcc.1"), |
David Collins | 1d4061b | 2011-12-06 15:36:40 -0800 | [diff] [blame] | 49 | }; |
| 50 | VREG_CONSUMERS(L6) = { |
| 51 | REGULATOR_SUPPLY("8038_l6", NULL), |
Krishna Konda | 40ec7e9 | 2011-12-20 19:28:25 -0800 | [diff] [blame] | 52 | REGULATOR_SUPPLY("sdc_vdd", "msm_sdcc.3"), |
David Collins | 1d4061b | 2011-12-06 15:36:40 -0800 | [diff] [blame] | 53 | }; |
| 54 | VREG_CONSUMERS(L7) = { |
| 55 | REGULATOR_SUPPLY("8038_l7", NULL), |
| 56 | }; |
| 57 | VREG_CONSUMERS(L8) = { |
| 58 | REGULATOR_SUPPLY("8038_l8", NULL), |
Chandan Uddaraju | 59894ca | 2011-12-05 17:07:02 -0800 | [diff] [blame] | 59 | REGULATOR_SUPPLY("dsi_vdc", "mipi_dsi.1"), |
David Collins | 1d4061b | 2011-12-06 15:36:40 -0800 | [diff] [blame] | 60 | }; |
| 61 | VREG_CONSUMERS(L9) = { |
| 62 | REGULATOR_SUPPLY("8038_l9", NULL), |
Anirudh Ghayal | d7ad84c | 2012-01-09 09:17:53 +0530 | [diff] [blame] | 63 | REGULATOR_SUPPLY("vdd_ana", "3-004a"), |
Amy Maloche | 32a36c3 | 2012-01-11 10:39:11 -0800 | [diff] [blame] | 64 | REGULATOR_SUPPLY("vdd", "3-0024"), |
Kevin Chan | 6776a37 | 2012-01-12 14:18:53 -0800 | [diff] [blame] | 65 | REGULATOR_SUPPLY("cam_vana", "4-001a"), |
| 66 | REGULATOR_SUPPLY("cam_vana", "4-006c"), |
| 67 | REGULATOR_SUPPLY("cam_vana", "4-0048"), |
| 68 | REGULATOR_SUPPLY("cam_vaf", "4-001a"), |
| 69 | REGULATOR_SUPPLY("cam_vaf", "4-006c"), |
| 70 | REGULATOR_SUPPLY("cam_vaf", "4-0048"), |
Sreesudhan Ramakrish Ramkumar | 8f11b8b | 2012-01-04 17:09:05 -0800 | [diff] [blame] | 71 | REGULATOR_SUPPLY("cam_vana", "4-0020"), |
| 72 | REGULATOR_SUPPLY("cam_vaf", "4-0020"), |
Wentao Xu | f59ce4e | 2012-05-22 17:30:13 -0400 | [diff] [blame] | 73 | REGULATOR_SUPPLY("vdd", "12-0018"), |
| 74 | REGULATOR_SUPPLY("vdd", "12-0068"), |
David Collins | 1d4061b | 2011-12-06 15:36:40 -0800 | [diff] [blame] | 75 | }; |
| 76 | VREG_CONSUMERS(L10) = { |
| 77 | REGULATOR_SUPPLY("8038_l10", NULL), |
Subramanian Srinivasan | c698a44 | 2012-01-11 13:41:57 -0800 | [diff] [blame] | 78 | REGULATOR_SUPPLY("iris_vddpa", "wcnss_wlan.0"), |
David Collins | 1d4061b | 2011-12-06 15:36:40 -0800 | [diff] [blame] | 79 | }; |
| 80 | VREG_CONSUMERS(L11) = { |
| 81 | REGULATOR_SUPPLY("8038_l11", NULL), |
Anirudh Ghayal | d7ad84c | 2012-01-09 09:17:53 +0530 | [diff] [blame] | 82 | REGULATOR_SUPPLY("vdd_dig", "3-004a"), |
Subramanian Srinivasan | c698a44 | 2012-01-11 13:41:57 -0800 | [diff] [blame] | 83 | REGULATOR_SUPPLY("iris_vddio", "wcnss_wlan.0"), |
| 84 | REGULATOR_SUPPLY("riva_vddpx", "wcnss_wlan.0"), |
Subhash Jadavani | 937c750 | 2012-06-01 15:34:46 +0530 | [diff] [blame] | 85 | REGULATOR_SUPPLY("sdc_vdd_io", "msm_sdcc.1"), |
Asish Bhattacharya | cdaa99d | 2012-01-10 06:05:00 +0530 | [diff] [blame] | 86 | REGULATOR_SUPPLY("VDDIO_CDC", "sitar-slim"), |
| 87 | REGULATOR_SUPPLY("CDC_VDDA_TX", "sitar-slim"), |
| 88 | REGULATOR_SUPPLY("CDC_VDDA_RX", "sitar-slim"), |
Bhalchandra Gajare | 83c81f6 | 2012-05-18 16:09:05 -0700 | [diff] [blame] | 89 | REGULATOR_SUPPLY("VDDIO_CDC", "sitar1p1-slim"), |
| 90 | REGULATOR_SUPPLY("CDC_VDDA_TX", "sitar1p1-slim"), |
| 91 | REGULATOR_SUPPLY("CDC_VDDA_RX", "sitar1p1-slim"), |
Amy Maloche | e8de95d | 2012-02-23 10:40:25 -0800 | [diff] [blame] | 92 | REGULATOR_SUPPLY("vddp", "0-0048"), |
Manoj Rao | c6d904c | 2012-06-22 00:32:14 -0700 | [diff] [blame] | 93 | REGULATOR_SUPPLY("mhl_iovcc18", "0-0039"), |
David Collins | 1d4061b | 2011-12-06 15:36:40 -0800 | [diff] [blame] | 94 | }; |
| 95 | VREG_CONSUMERS(L12) = { |
| 96 | REGULATOR_SUPPLY("8038_l12", NULL), |
Kevin Chan | 6776a37 | 2012-01-12 14:18:53 -0800 | [diff] [blame] | 97 | REGULATOR_SUPPLY("cam_vdig", "4-001a"), |
| 98 | REGULATOR_SUPPLY("cam_vdig", "4-006c"), |
| 99 | REGULATOR_SUPPLY("cam_vdig", "4-0048"), |
Sreesudhan Ramakrish Ramkumar | 8f11b8b | 2012-01-04 17:09:05 -0800 | [diff] [blame] | 100 | REGULATOR_SUPPLY("cam_vdig", "4-0020"), |
David Collins | 1d4061b | 2011-12-06 15:36:40 -0800 | [diff] [blame] | 101 | }; |
| 102 | VREG_CONSUMERS(L14) = { |
| 103 | REGULATOR_SUPPLY("8038_l14", NULL), |
Siddartha Mohanadoss | 6a392d3 | 2012-01-12 11:30:58 -0800 | [diff] [blame] | 104 | REGULATOR_SUPPLY("pa_therm", "pm8xxx-adc"), |
David Collins | 1d4061b | 2011-12-06 15:36:40 -0800 | [diff] [blame] | 105 | }; |
| 106 | VREG_CONSUMERS(L15) = { |
| 107 | REGULATOR_SUPPLY("8038_l15", NULL), |
| 108 | }; |
| 109 | VREG_CONSUMERS(L16) = { |
| 110 | REGULATOR_SUPPLY("8038_l16", NULL), |
Stephen Boyd | 868d899 | 2012-01-06 14:11:02 -0800 | [diff] [blame] | 111 | REGULATOR_SUPPLY("core_vdd", "pil_qdsp6v4.2"), |
David Collins | 1d4061b | 2011-12-06 15:36:40 -0800 | [diff] [blame] | 112 | }; |
| 113 | VREG_CONSUMERS(L17) = { |
| 114 | REGULATOR_SUPPLY("8038_l17", NULL), |
| 115 | }; |
| 116 | VREG_CONSUMERS(L18) = { |
| 117 | REGULATOR_SUPPLY("8038_l18", NULL), |
| 118 | }; |
| 119 | VREG_CONSUMERS(L19) = { |
| 120 | REGULATOR_SUPPLY("8038_l19", NULL), |
Stephen Boyd | 868d899 | 2012-01-06 14:11:02 -0800 | [diff] [blame] | 121 | REGULATOR_SUPPLY("core_vdd", "pil_qdsp6v4.1"), |
David Collins | 1d4061b | 2011-12-06 15:36:40 -0800 | [diff] [blame] | 122 | }; |
| 123 | VREG_CONSUMERS(L20) = { |
| 124 | REGULATOR_SUPPLY("8038_l20", NULL), |
Asish Bhattacharya | cdaa99d | 2012-01-10 06:05:00 +0530 | [diff] [blame] | 125 | REGULATOR_SUPPLY("VDDD_CDC_D", "sitar-slim"), |
| 126 | REGULATOR_SUPPLY("CDC_VDDA_A_1P2V", "sitar-slim"), |
Bhalchandra Gajare | 83c81f6 | 2012-05-18 16:09:05 -0700 | [diff] [blame] | 127 | REGULATOR_SUPPLY("VDDD_CDC_D", "sitar1p1-slim"), |
| 128 | REGULATOR_SUPPLY("CDC_VDDA_A_1P2V", "sitar1p1-slim"), |
Manoj Rao | c6d904c | 2012-06-22 00:32:14 -0700 | [diff] [blame] | 129 | REGULATOR_SUPPLY("mhl_avcc12", "0-0039"), |
David Collins | 1d4061b | 2011-12-06 15:36:40 -0800 | [diff] [blame] | 130 | }; |
| 131 | VREG_CONSUMERS(L21) = { |
| 132 | REGULATOR_SUPPLY("8038_l21", NULL), |
| 133 | }; |
| 134 | VREG_CONSUMERS(L22) = { |
| 135 | REGULATOR_SUPPLY("8038_l22", NULL), |
Subhash Jadavani | 937c750 | 2012-06-01 15:34:46 +0530 | [diff] [blame] | 136 | REGULATOR_SUPPLY("sdc_vdd_io", "msm_sdcc.3"), |
David Collins | 1d4061b | 2011-12-06 15:36:40 -0800 | [diff] [blame] | 137 | }; |
| 138 | VREG_CONSUMERS(L23) = { |
| 139 | REGULATOR_SUPPLY("8038_l23", NULL), |
Chandan Uddaraju | 59894ca | 2011-12-05 17:07:02 -0800 | [diff] [blame] | 140 | REGULATOR_SUPPLY("dsi_vddio", "mipi_dsi.1"), |
| 141 | REGULATOR_SUPPLY("hdmi_avdd", "hdmi_msm.0"), |
| 142 | REGULATOR_SUPPLY("hdmi_vcc", "hdmi_msm.0"), |
Stephen Boyd | 3bbdf6c | 2011-12-21 16:02:26 -0800 | [diff] [blame] | 143 | REGULATOR_SUPPLY("pll_vdd", "pil_riva"), |
Stephen Boyd | cc0f534 | 2011-12-29 17:28:57 -0800 | [diff] [blame] | 144 | REGULATOR_SUPPLY("pll_vdd", "pil_qdsp6v4.1"), |
| 145 | REGULATOR_SUPPLY("pll_vdd", "pil_qdsp6v4.2"), |
David Collins | 1d4061b | 2011-12-06 15:36:40 -0800 | [diff] [blame] | 146 | }; |
| 147 | VREG_CONSUMERS(L24) = { |
| 148 | REGULATOR_SUPPLY("8038_l24", NULL), |
Subramanian Srinivasan | c698a44 | 2012-01-11 13:41:57 -0800 | [diff] [blame] | 149 | REGULATOR_SUPPLY("riva_vddmx", "wcnss_wlan.0"), |
David Collins | 1d4061b | 2011-12-06 15:36:40 -0800 | [diff] [blame] | 150 | }; |
| 151 | VREG_CONSUMERS(L26) = { |
| 152 | REGULATOR_SUPPLY("8038_l26", NULL), |
| 153 | }; |
| 154 | VREG_CONSUMERS(L27) = { |
| 155 | REGULATOR_SUPPLY("8038_l27", NULL), |
Stephen Boyd | 868d899 | 2012-01-06 14:11:02 -0800 | [diff] [blame] | 156 | REGULATOR_SUPPLY("core_vdd", "pil_qdsp6v4.0"), |
David Collins | 1d4061b | 2011-12-06 15:36:40 -0800 | [diff] [blame] | 157 | }; |
| 158 | VREG_CONSUMERS(S1) = { |
| 159 | REGULATOR_SUPPLY("8038_s1", NULL), |
Subramanian Srinivasan | c698a44 | 2012-01-11 13:41:57 -0800 | [diff] [blame] | 160 | REGULATOR_SUPPLY("riva_vddcx", "wcnss_wlan.0"), |
David Collins | 1d4061b | 2011-12-06 15:36:40 -0800 | [diff] [blame] | 161 | }; |
| 162 | VREG_CONSUMERS(S2) = { |
| 163 | REGULATOR_SUPPLY("8038_s2", NULL), |
| 164 | }; |
| 165 | VREG_CONSUMERS(S3) = { |
| 166 | REGULATOR_SUPPLY("8038_s3", NULL), |
| 167 | }; |
| 168 | VREG_CONSUMERS(S4) = { |
| 169 | REGULATOR_SUPPLY("8038_s4", NULL), |
Asish Bhattacharya | cdaa99d | 2012-01-10 06:05:00 +0530 | [diff] [blame] | 170 | REGULATOR_SUPPLY("CDC_VDD_CP", "sitar-slim"), |
Bhalchandra Gajare | 83c81f6 | 2012-05-18 16:09:05 -0700 | [diff] [blame] | 171 | REGULATOR_SUPPLY("CDC_VDD_CP", "sitar1p1-slim"), |
David Collins | 1d4061b | 2011-12-06 15:36:40 -0800 | [diff] [blame] | 172 | }; |
| 173 | VREG_CONSUMERS(S5) = { |
| 174 | REGULATOR_SUPPLY("8038_s5", NULL), |
Matt Wagantall | ab730bd | 2012-06-07 20:13:51 -0700 | [diff] [blame] | 175 | REGULATOR_SUPPLY("krait0", "acpuclk-8627"), |
Matt Wagantall | 6dcfa92 | 2012-06-07 20:13:51 -0700 | [diff] [blame] | 176 | REGULATOR_SUPPLY("krait0", "acpuclk-8930"), |
Tianyi Gou | 12370f1 | 2012-07-23 19:13:57 -0700 | [diff] [blame^] | 177 | REGULATOR_SUPPLY("krait0", "acpuclk-8930aa"), |
David Collins | 1d4061b | 2011-12-06 15:36:40 -0800 | [diff] [blame] | 178 | }; |
| 179 | VREG_CONSUMERS(S6) = { |
| 180 | REGULATOR_SUPPLY("8038_s6", NULL), |
Matt Wagantall | ab730bd | 2012-06-07 20:13:51 -0700 | [diff] [blame] | 181 | REGULATOR_SUPPLY("krait1", "acpuclk-8627"), |
Matt Wagantall | 6dcfa92 | 2012-06-07 20:13:51 -0700 | [diff] [blame] | 182 | REGULATOR_SUPPLY("krait1", "acpuclk-8930"), |
Tianyi Gou | 12370f1 | 2012-07-23 19:13:57 -0700 | [diff] [blame^] | 183 | REGULATOR_SUPPLY("krait1", "acpuclk-8930aa"), |
David Collins | 1d4061b | 2011-12-06 15:36:40 -0800 | [diff] [blame] | 184 | }; |
| 185 | VREG_CONSUMERS(LVS1) = { |
| 186 | REGULATOR_SUPPLY("8038_lvs1", NULL), |
David Collins | f4c3d64 | 2012-03-02 09:04:57 -0800 | [diff] [blame] | 187 | REGULATOR_SUPPLY("cam_vio", "4-001a"), |
| 188 | REGULATOR_SUPPLY("cam_vio", "4-006c"), |
| 189 | REGULATOR_SUPPLY("cam_vio", "4-0048"), |
| 190 | REGULATOR_SUPPLY("cam_vio", "4-0020"), |
David Collins | 1d4061b | 2011-12-06 15:36:40 -0800 | [diff] [blame] | 191 | }; |
| 192 | VREG_CONSUMERS(LVS2) = { |
| 193 | REGULATOR_SUPPLY("8038_lvs2", NULL), |
Anirudh Ghayal | d7ad84c | 2012-01-09 09:17:53 +0530 | [diff] [blame] | 194 | REGULATOR_SUPPLY("vcc_i2c", "3-004a"), |
Amy Maloche | 32a36c3 | 2012-01-11 10:39:11 -0800 | [diff] [blame] | 195 | REGULATOR_SUPPLY("vcc_i2c", "3-0024"), |
Amy Maloche | e8de95d | 2012-02-23 10:40:25 -0800 | [diff] [blame] | 196 | REGULATOR_SUPPLY("vcc_i2c", "0-0048"), |
Wentao Xu | f59ce4e | 2012-05-22 17:30:13 -0400 | [diff] [blame] | 197 | REGULATOR_SUPPLY("vddio", "12-0018"), |
| 198 | REGULATOR_SUPPLY("vlogic", "12-0068"), |
David Collins | 1d4061b | 2011-12-06 15:36:40 -0800 | [diff] [blame] | 199 | }; |
| 200 | VREG_CONSUMERS(EXT_5V) = { |
| 201 | REGULATOR_SUPPLY("ext_5v", NULL), |
Chandan Uddaraju | 59894ca | 2011-12-05 17:07:02 -0800 | [diff] [blame] | 202 | REGULATOR_SUPPLY("hdmi_mvs", "hdmi_msm.0"), |
Manoj Rao | c6d904c | 2012-06-22 00:32:14 -0700 | [diff] [blame] | 203 | REGULATOR_SUPPLY("mhl_usb_hs_switch", "msm_otg"), |
David Collins | 1d4061b | 2011-12-06 15:36:40 -0800 | [diff] [blame] | 204 | }; |
| 205 | VREG_CONSUMERS(EXT_OTG_SW) = { |
| 206 | REGULATOR_SUPPLY("ext_otg_sw", NULL), |
Anirudh Ghayal | 8c15f7f | 2012-01-09 14:04:02 +0530 | [diff] [blame] | 207 | REGULATOR_SUPPLY("vbus_otg", "msm_otg"), |
David Collins | 1d4061b | 2011-12-06 15:36:40 -0800 | [diff] [blame] | 208 | }; |
David Collins | 0490731 | 2012-02-08 14:17:57 -0800 | [diff] [blame] | 209 | VREG_CONSUMERS(VDD_DIG_CORNER) = { |
| 210 | REGULATOR_SUPPLY("vdd_dig_corner", NULL), |
Mayank Rana | 248698c | 2012-04-19 00:03:16 +0530 | [diff] [blame] | 211 | REGULATOR_SUPPLY("hsusb_vdd_dig", "msm_otg"), |
David Collins | 0490731 | 2012-02-08 14:17:57 -0800 | [diff] [blame] | 212 | }; |
David Collins | 1d4061b | 2011-12-06 15:36:40 -0800 | [diff] [blame] | 213 | |
| 214 | #define PM8XXX_VREG_INIT(_id, _name, _min_uV, _max_uV, _modes, _ops, \ |
| 215 | _apply_uV, _pull_down, _always_on, _supply_regulator, \ |
| 216 | _system_uA, _enable_time, _reg_id) \ |
| 217 | { \ |
| 218 | .init_data = { \ |
| 219 | .constraints = { \ |
| 220 | .valid_modes_mask = _modes, \ |
| 221 | .valid_ops_mask = _ops, \ |
| 222 | .min_uV = _min_uV, \ |
| 223 | .max_uV = _max_uV, \ |
| 224 | .input_uV = _max_uV, \ |
| 225 | .apply_uV = _apply_uV, \ |
| 226 | .always_on = _always_on, \ |
| 227 | .name = _name, \ |
| 228 | }, \ |
| 229 | .num_consumer_supplies = \ |
| 230 | ARRAY_SIZE(vreg_consumers_##_id), \ |
| 231 | .consumer_supplies = vreg_consumers_##_id, \ |
| 232 | .supply_regulator = _supply_regulator, \ |
| 233 | }, \ |
| 234 | .id = _reg_id, \ |
| 235 | .pull_down_enable = _pull_down, \ |
| 236 | .system_uA = _system_uA, \ |
| 237 | .enable_time = _enable_time, \ |
| 238 | } |
| 239 | |
| 240 | #define PM8XXX_LDO(_id, _name, _always_on, _pull_down, _min_uV, _max_uV, \ |
| 241 | _enable_time, _supply_regulator, _system_uA, _reg_id) \ |
| 242 | PM8XXX_VREG_INIT(_id, _name, _min_uV, _max_uV, REGULATOR_MODE_NORMAL \ |
| 243 | | REGULATOR_MODE_IDLE, REGULATOR_CHANGE_VOLTAGE | \ |
| 244 | REGULATOR_CHANGE_STATUS | REGULATOR_CHANGE_MODE | \ |
| 245 | REGULATOR_CHANGE_DRMS, 0, _pull_down, _always_on, \ |
| 246 | _supply_regulator, _system_uA, _enable_time, _reg_id) |
| 247 | |
| 248 | #define PM8XXX_NLDO1200(_id, _name, _always_on, _pull_down, _min_uV, \ |
| 249 | _max_uV, _enable_time, _supply_regulator, _system_uA, _reg_id) \ |
| 250 | PM8XXX_VREG_INIT(_id, _name, _min_uV, _max_uV, REGULATOR_MODE_NORMAL \ |
| 251 | | REGULATOR_MODE_IDLE, REGULATOR_CHANGE_VOLTAGE | \ |
| 252 | REGULATOR_CHANGE_STATUS | REGULATOR_CHANGE_MODE | \ |
| 253 | REGULATOR_CHANGE_DRMS, 0, _pull_down, _always_on, \ |
| 254 | _supply_regulator, _system_uA, _enable_time, _reg_id) |
| 255 | |
| 256 | #define PM8XXX_SMPS(_id, _name, _always_on, _pull_down, _min_uV, _max_uV, \ |
| 257 | _enable_time, _supply_regulator, _system_uA, _reg_id) \ |
| 258 | PM8XXX_VREG_INIT(_id, _name, _min_uV, _max_uV, REGULATOR_MODE_NORMAL \ |
| 259 | | REGULATOR_MODE_IDLE, REGULATOR_CHANGE_VOLTAGE | \ |
| 260 | REGULATOR_CHANGE_STATUS | REGULATOR_CHANGE_MODE | \ |
| 261 | REGULATOR_CHANGE_DRMS, 0, _pull_down, _always_on, \ |
| 262 | _supply_regulator, _system_uA, _enable_time, _reg_id) |
| 263 | |
| 264 | #define PM8XXX_FTSMPS(_id, _name, _always_on, _pull_down, _min_uV, _max_uV, \ |
| 265 | _enable_time, _supply_regulator, _system_uA, _reg_id) \ |
| 266 | PM8XXX_VREG_INIT(_id, _name, _min_uV, _max_uV, REGULATOR_MODE_NORMAL, \ |
| 267 | REGULATOR_CHANGE_VOLTAGE | REGULATOR_CHANGE_STATUS \ |
| 268 | | REGULATOR_CHANGE_MODE, 0, _pull_down, _always_on, \ |
| 269 | _supply_regulator, _system_uA, _enable_time, _reg_id) |
| 270 | |
| 271 | #define PM8XXX_VS(_id, _name, _always_on, _pull_down, _enable_time, \ |
| 272 | _supply_regulator, _reg_id) \ |
| 273 | PM8XXX_VREG_INIT(_id, _name, 0, 0, 0, REGULATOR_CHANGE_STATUS, 0, \ |
| 274 | _pull_down, _always_on, _supply_regulator, 0, _enable_time, \ |
| 275 | _reg_id) |
| 276 | |
| 277 | #define PM8XXX_VS300(_id, _name, _always_on, _pull_down, _enable_time, \ |
| 278 | _supply_regulator, _reg_id) \ |
| 279 | PM8XXX_VREG_INIT(_id, _name, 0, 0, 0, REGULATOR_CHANGE_STATUS, 0, \ |
| 280 | _pull_down, _always_on, _supply_regulator, 0, _enable_time, \ |
| 281 | _reg_id) |
| 282 | |
| 283 | #define PM8XXX_NCP(_id, _name, _always_on, _min_uV, _max_uV, _enable_time, \ |
| 284 | _supply_regulator, _reg_id) \ |
| 285 | PM8XXX_VREG_INIT(_id, _name, _min_uV, _max_uV, 0, \ |
| 286 | REGULATOR_CHANGE_VOLTAGE | REGULATOR_CHANGE_STATUS, 0, 0, \ |
| 287 | _always_on, _supply_regulator, 0, _enable_time, _reg_id) |
| 288 | |
| 289 | /* Pin control initialization */ |
| 290 | #define PM8XXX_PC(_id, _name, _always_on, _pin_fn, _pin_ctrl, \ |
| 291 | _supply_regulator, _reg_id) \ |
| 292 | { \ |
| 293 | .init_data = { \ |
| 294 | .constraints = { \ |
| 295 | .valid_ops_mask = REGULATOR_CHANGE_STATUS, \ |
| 296 | .always_on = _always_on, \ |
| 297 | .name = _name, \ |
| 298 | }, \ |
| 299 | .num_consumer_supplies = \ |
| 300 | ARRAY_SIZE(vreg_consumers_##_id##_PC), \ |
| 301 | .consumer_supplies = vreg_consumers_##_id##_PC, \ |
| 302 | .supply_regulator = _supply_regulator, \ |
| 303 | }, \ |
| 304 | .id = _reg_id, \ |
| 305 | .pin_fn = PM8XXX_VREG_PIN_FN_##_pin_fn, \ |
| 306 | .pin_ctrl = _pin_ctrl, \ |
| 307 | } |
| 308 | |
David Collins | 8af872e | 2012-01-06 11:31:56 -0800 | [diff] [blame] | 309 | #define RPM_INIT(_id, _min_uV, _max_uV, _modes, _ops, _apply_uV, _default_uV, \ |
| 310 | _peak_uA, _avg_uA, _pull_down, _pin_ctrl, _freq, _pin_fn, \ |
David Collins | 1578904 | 2012-03-19 10:44:36 -0700 | [diff] [blame] | 311 | _force_mode, _sleep_set_force_mode, _power_mode, _state, \ |
| 312 | _sleep_selectable, _always_on, _supply_regulator, _system_uA) \ |
David Collins | 8af872e | 2012-01-06 11:31:56 -0800 | [diff] [blame] | 313 | { \ |
| 314 | .init_data = { \ |
| 315 | .constraints = { \ |
| 316 | .valid_modes_mask = _modes, \ |
| 317 | .valid_ops_mask = _ops, \ |
| 318 | .min_uV = _min_uV, \ |
| 319 | .max_uV = _max_uV, \ |
| 320 | .input_uV = _min_uV, \ |
| 321 | .apply_uV = _apply_uV, \ |
| 322 | .always_on = _always_on, \ |
| 323 | }, \ |
| 324 | .num_consumer_supplies = \ |
| 325 | ARRAY_SIZE(vreg_consumers_##_id), \ |
| 326 | .consumer_supplies = vreg_consumers_##_id, \ |
| 327 | .supply_regulator = _supply_regulator, \ |
| 328 | }, \ |
| 329 | .id = RPM_VREG_ID_PM8038_##_id, \ |
| 330 | .default_uV = _default_uV, \ |
| 331 | .peak_uA = _peak_uA, \ |
| 332 | .avg_uA = _avg_uA, \ |
| 333 | .pull_down_enable = _pull_down, \ |
| 334 | .pin_ctrl = _pin_ctrl, \ |
| 335 | .freq = RPM_VREG_FREQ_##_freq, \ |
| 336 | .pin_fn = _pin_fn, \ |
| 337 | .force_mode = _force_mode, \ |
David Collins | 1578904 | 2012-03-19 10:44:36 -0700 | [diff] [blame] | 338 | .sleep_set_force_mode = _sleep_set_force_mode, \ |
David Collins | 8af872e | 2012-01-06 11:31:56 -0800 | [diff] [blame] | 339 | .power_mode = _power_mode, \ |
| 340 | .state = _state, \ |
| 341 | .sleep_selectable = _sleep_selectable, \ |
| 342 | .system_uA = _system_uA, \ |
| 343 | } |
| 344 | |
| 345 | #define RPM_LDO(_id, _always_on, _pd, _sleep_selectable, _min_uV, _max_uV, \ |
| 346 | _supply_regulator, _system_uA, _init_peak_uA) \ |
| 347 | RPM_INIT(_id, _min_uV, _max_uV, REGULATOR_MODE_NORMAL \ |
| 348 | | REGULATOR_MODE_IDLE, REGULATOR_CHANGE_VOLTAGE \ |
| 349 | | REGULATOR_CHANGE_STATUS | REGULATOR_CHANGE_MODE \ |
| 350 | | REGULATOR_CHANGE_DRMS, 0, _max_uV, _init_peak_uA, 0, _pd, \ |
| 351 | RPM_VREG_PIN_CTRL_NONE, NONE, RPM_VREG_PIN_FN_8930_NONE, \ |
David Collins | 1578904 | 2012-03-19 10:44:36 -0700 | [diff] [blame] | 352 | RPM_VREG_FORCE_MODE_8930_NONE, \ |
David Collins | 8af872e | 2012-01-06 11:31:56 -0800 | [diff] [blame] | 353 | RPM_VREG_FORCE_MODE_8930_NONE, RPM_VREG_POWER_MODE_8930_PWM, \ |
| 354 | RPM_VREG_STATE_OFF, _sleep_selectable, _always_on, \ |
| 355 | _supply_regulator, _system_uA) |
| 356 | |
| 357 | #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] | 358 | _supply_regulator, _system_uA, _freq, _force_mode, \ |
| 359 | _sleep_set_force_mode) \ |
David Collins | 8af872e | 2012-01-06 11:31:56 -0800 | [diff] [blame] | 360 | RPM_INIT(_id, _min_uV, _max_uV, REGULATOR_MODE_NORMAL \ |
| 361 | | REGULATOR_MODE_IDLE, REGULATOR_CHANGE_VOLTAGE \ |
| 362 | | REGULATOR_CHANGE_STATUS | REGULATOR_CHANGE_MODE \ |
David Collins | 226f251 | 2012-03-19 13:18:39 -0700 | [diff] [blame] | 363 | | REGULATOR_CHANGE_DRMS, 0, _min_uV, _system_uA, 0, _pd, \ |
David Collins | 8af872e | 2012-01-06 11:31:56 -0800 | [diff] [blame] | 364 | RPM_VREG_PIN_CTRL_NONE, _freq, RPM_VREG_PIN_FN_8930_NONE, \ |
David Collins | 3d2b945 | 2012-03-19 11:00:30 -0700 | [diff] [blame] | 365 | RPM_VREG_FORCE_MODE_8930_##_force_mode, \ |
| 366 | RPM_VREG_FORCE_MODE_8930_##_sleep_set_force_mode, \ |
| 367 | RPM_VREG_POWER_MODE_8930_PWM, RPM_VREG_STATE_OFF, \ |
| 368 | _sleep_selectable, _always_on, _supply_regulator, _system_uA) |
David Collins | 8af872e | 2012-01-06 11:31:56 -0800 | [diff] [blame] | 369 | |
| 370 | #define RPM_VS(_id, _always_on, _pd, _sleep_selectable, _supply_regulator) \ |
| 371 | RPM_INIT(_id, 0, 0, 0, REGULATOR_CHANGE_STATUS, 0, 0, 1000, 1000, _pd, \ |
| 372 | RPM_VREG_PIN_CTRL_NONE, NONE, RPM_VREG_PIN_FN_8930_NONE, \ |
David Collins | 1578904 | 2012-03-19 10:44:36 -0700 | [diff] [blame] | 373 | RPM_VREG_FORCE_MODE_8930_NONE, \ |
David Collins | 8af872e | 2012-01-06 11:31:56 -0800 | [diff] [blame] | 374 | RPM_VREG_FORCE_MODE_8930_NONE, RPM_VREG_POWER_MODE_8930_PWM, \ |
| 375 | RPM_VREG_STATE_OFF, _sleep_selectable, _always_on, \ |
| 376 | _supply_regulator, 0) |
| 377 | |
| 378 | #define RPM_NCP(_id, _always_on, _sleep_selectable, _min_uV, _max_uV, \ |
| 379 | _supply_regulator, _freq) \ |
| 380 | RPM_INIT(_id, _min_uV, _max_uV, 0, REGULATOR_CHANGE_VOLTAGE \ |
| 381 | | REGULATOR_CHANGE_STATUS, 0, _max_uV, 1000, 1000, 0, \ |
| 382 | RPM_VREG_PIN_CTRL_NONE, _freq, RPM_VREG_PIN_FN_8930_NONE, \ |
David Collins | 1578904 | 2012-03-19 10:44:36 -0700 | [diff] [blame] | 383 | RPM_VREG_FORCE_MODE_8930_NONE, \ |
David Collins | 8af872e | 2012-01-06 11:31:56 -0800 | [diff] [blame] | 384 | RPM_VREG_FORCE_MODE_8930_NONE, RPM_VREG_POWER_MODE_8930_PWM, \ |
| 385 | RPM_VREG_STATE_OFF, _sleep_selectable, _always_on, \ |
| 386 | _supply_regulator, 0) |
| 387 | |
David Collins | 0490731 | 2012-02-08 14:17:57 -0800 | [diff] [blame] | 388 | #define RPM_CORNER(_id, _always_on, _sleep_selectable, _min_uV, _max_uV, \ |
| 389 | _supply_regulator) \ |
| 390 | RPM_INIT(_id, _min_uV, _max_uV, 0, REGULATOR_CHANGE_VOLTAGE \ |
| 391 | | REGULATOR_CHANGE_STATUS, 0, _max_uV, 0, 0, 0, \ |
| 392 | RPM_VREG_PIN_CTRL_NONE, NONE, RPM_VREG_PIN_FN_8930_NONE, \ |
David Collins | 1578904 | 2012-03-19 10:44:36 -0700 | [diff] [blame] | 393 | RPM_VREG_FORCE_MODE_8930_NONE, \ |
David Collins | 0490731 | 2012-02-08 14:17:57 -0800 | [diff] [blame] | 394 | RPM_VREG_FORCE_MODE_8930_NONE, RPM_VREG_POWER_MODE_8930_PWM, \ |
| 395 | RPM_VREG_STATE_OFF, _sleep_selectable, _always_on, \ |
| 396 | _supply_regulator, 0) |
| 397 | |
David Collins | 8af872e | 2012-01-06 11:31:56 -0800 | [diff] [blame] | 398 | /* Pin control initialization */ |
| 399 | #define RPM_PC_INIT(_id, _always_on, _pin_fn, _pin_ctrl, _supply_regulator) \ |
| 400 | { \ |
| 401 | .init_data = { \ |
| 402 | .constraints = { \ |
| 403 | .valid_ops_mask = REGULATOR_CHANGE_STATUS, \ |
| 404 | .always_on = _always_on, \ |
| 405 | }, \ |
| 406 | .num_consumer_supplies = \ |
| 407 | ARRAY_SIZE(vreg_consumers_##_id##_PC), \ |
| 408 | .consumer_supplies = vreg_consumers_##_id##_PC, \ |
| 409 | .supply_regulator = _supply_regulator, \ |
| 410 | }, \ |
| 411 | .id = RPM_VREG_ID_PM8038_##_id##_PC, \ |
| 412 | .pin_fn = RPM_VREG_PIN_FN_8930_##_pin_fn, \ |
| 413 | .pin_ctrl = _pin_ctrl, \ |
| 414 | } |
| 415 | |
David Collins | 1d4061b | 2011-12-06 15:36:40 -0800 | [diff] [blame] | 416 | #define GPIO_VREG(_id, _reg_name, _gpio_label, _gpio, _supply_regulator) \ |
| 417 | [MSM8930_GPIO_VREG_ID_##_id] = { \ |
| 418 | .init_data = { \ |
| 419 | .constraints = { \ |
| 420 | .valid_ops_mask = REGULATOR_CHANGE_STATUS, \ |
| 421 | }, \ |
| 422 | .num_consumer_supplies = \ |
| 423 | ARRAY_SIZE(vreg_consumers_##_id), \ |
| 424 | .consumer_supplies = vreg_consumers_##_id, \ |
| 425 | .supply_regulator = _supply_regulator, \ |
| 426 | }, \ |
| 427 | .regulator_name = _reg_name, \ |
| 428 | .gpio_label = _gpio_label, \ |
| 429 | .gpio = _gpio, \ |
| 430 | } |
| 431 | |
David Collins | b455842 | 2012-01-05 10:50:49 -0800 | [diff] [blame] | 432 | #define SAW_VREG_INIT(_id, _name, _min_uV, _max_uV) \ |
| 433 | { \ |
| 434 | .constraints = { \ |
| 435 | .name = _name, \ |
| 436 | .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE, \ |
| 437 | .min_uV = _min_uV, \ |
| 438 | .max_uV = _max_uV, \ |
| 439 | }, \ |
| 440 | .num_consumer_supplies = ARRAY_SIZE(vreg_consumers_##_id), \ |
| 441 | .consumer_supplies = vreg_consumers_##_id, \ |
| 442 | } |
| 443 | |
David Collins | 1d4061b | 2011-12-06 15:36:40 -0800 | [diff] [blame] | 444 | /* GPIO regulator constraints */ |
| 445 | struct gpio_regulator_platform_data |
| 446 | msm8930_gpio_regulator_pdata[] __devinitdata = { |
| 447 | /* ID vreg_name gpio_label gpio supply */ |
| 448 | GPIO_VREG(EXT_5V, "ext_5v", "ext_5v_en", 63, NULL), |
| 449 | GPIO_VREG(EXT_OTG_SW, "ext_otg_sw", "ext_otg_sw_en", 97, "ext_5v"), |
| 450 | }; |
| 451 | |
David Collins | b455842 | 2012-01-05 10:50:49 -0800 | [diff] [blame] | 452 | /* SAW regulator constraints */ |
| 453 | struct regulator_init_data msm8930_saw_regulator_core0_pdata = |
| 454 | /* ID vreg_name min_uV max_uV */ |
| 455 | SAW_VREG_INIT(S5, "8038_s5", 850000, 1300000); |
| 456 | struct regulator_init_data msm8930_saw_regulator_core1_pdata = |
| 457 | SAW_VREG_INIT(S6, "8038_s6", 850000, 1300000); |
| 458 | |
David Collins | 1d4061b | 2011-12-06 15:36:40 -0800 | [diff] [blame] | 459 | /* PM8038 regulator constraints */ |
| 460 | struct pm8xxx_regulator_platform_data |
| 461 | msm8930_pm8038_regulator_pdata[] __devinitdata = { |
| 462 | /* |
| 463 | * ID name always_on pd min_uV max_uV en_t supply |
| 464 | * system_uA reg_ID |
| 465 | */ |
Matt Wagantall | ed36d82 | 2012-05-25 18:13:40 -0700 | [diff] [blame] | 466 | PM8XXX_NLDO1200(L16, "8038_l16", 0, 1, 375000, 1050000, 200, "8038_s3", |
David Collins | 8af872e | 2012-01-06 11:31:56 -0800 | [diff] [blame] | 467 | 0, 0), |
Matt Wagantall | ed36d82 | 2012-05-25 18:13:40 -0700 | [diff] [blame] | 468 | PM8XXX_NLDO1200(L19, "8038_l19", 0, 1, 375000, 1050000, 200, "8038_s3", |
David Collins | 8af872e | 2012-01-06 11:31:56 -0800 | [diff] [blame] | 469 | 0, 1), |
Matt Wagantall | ed36d82 | 2012-05-25 18:13:40 -0700 | [diff] [blame] | 470 | PM8XXX_NLDO1200(L27, "8038_l27", 0, 1, 375000, 1050000, 200, "8038_s3", |
David Collins | 8af872e | 2012-01-06 11:31:56 -0800 | [diff] [blame] | 471 | 0, 2), |
| 472 | }; |
David Collins | 1d4061b | 2011-12-06 15:36:40 -0800 | [diff] [blame] | 473 | |
David Collins | 8af872e | 2012-01-06 11:31:56 -0800 | [diff] [blame] | 474 | static struct rpm_regulator_init_data |
| 475 | msm8930_rpm_regulator_init_data[] __devinitdata = { |
David Collins | 3d2b945 | 2012-03-19 11:00:30 -0700 | [diff] [blame] | 476 | /* ID a_on pd ss min_uV max_uV supply sys_uA freq fm ss_fm */ |
David Collins | c4208cc | 2012-03-19 12:53:10 -0700 | [diff] [blame] | 477 | RPM_SMPS(S1, 0, 1, 1, 500000, 1150000, NULL, 100000, 4p80, AUTO, LPM), |
| 478 | RPM_SMPS(S2, 1, 1, 1, 1400000, 1400000, NULL, 100000, 1p60, AUTO, LPM), |
| 479 | RPM_SMPS(S3, 0, 1, 1, 1150000, 1150000, NULL, 100000, 3p20, AUTO, LPM), |
David Collins | 226f251 | 2012-03-19 13:18:39 -0700 | [diff] [blame] | 480 | RPM_SMPS(S4, 1, 1, 1, 1950000, 2200000, NULL, 100000, 1p60, AUTO, LPM), |
David Collins | 1d4061b | 2011-12-06 15:36:40 -0800 | [diff] [blame] | 481 | |
David Collins | 8af872e | 2012-01-06 11:31:56 -0800 | [diff] [blame] | 482 | /* ID a_on pd ss min_uV max_uV supply sys_uA init_ip */ |
| 483 | RPM_LDO(L1, 0, 1, 0, 1300000, 1300000, "8038_s2", 0, 0), |
| 484 | RPM_LDO(L2, 0, 1, 0, 1200000, 1200000, "8038_s2", 0, 0), |
| 485 | RPM_LDO(L3, 0, 1, 0, 3075000, 3075000, NULL, 0, 0), |
| 486 | RPM_LDO(L4, 1, 1, 0, 1800000, 1800000, NULL, 10000, 10000), |
| 487 | RPM_LDO(L5, 0, 1, 0, 2950000, 2950000, NULL, 0, 0), |
| 488 | RPM_LDO(L6, 0, 1, 0, 2950000, 2950000, NULL, 0, 0), |
| 489 | RPM_LDO(L7, 0, 1, 0, 2050000, 2050000, "8038_s4", 0, 0), |
| 490 | RPM_LDO(L8, 0, 1, 0, 2800000, 2800000, NULL, 0, 0), |
| 491 | RPM_LDO(L9, 0, 1, 0, 2850000, 2850000, NULL, 0, 0), |
| 492 | RPM_LDO(L10, 0, 1, 0, 2900000, 2900000, NULL, 0, 0), |
| 493 | RPM_LDO(L11, 1, 1, 0, 1800000, 1800000, "8038_s4", 10000, 10000), |
| 494 | RPM_LDO(L12, 0, 1, 0, 1200000, 1200000, "8038_s2", 0, 0), |
| 495 | RPM_LDO(L14, 0, 1, 0, 1800000, 1800000, NULL, 0, 0), |
| 496 | RPM_LDO(L15, 0, 1, 0, 1800000, 2950000, NULL, 0, 0), |
| 497 | RPM_LDO(L17, 0, 1, 0, 1800000, 2950000, NULL, 0, 0), |
| 498 | RPM_LDO(L18, 0, 1, 0, 1800000, 1800000, NULL, 0, 0), |
David Collins | 19e7881 | 2012-06-04 15:50:09 -0700 | [diff] [blame] | 499 | RPM_LDO(L20, 1, 1, 0, 1250000, 1250000, "8038_s2", 10000, 10000), |
David Collins | 8af872e | 2012-01-06 11:31:56 -0800 | [diff] [blame] | 500 | RPM_LDO(L21, 0, 1, 0, 1900000, 1900000, "8038_s4", 0, 0), |
| 501 | RPM_LDO(L22, 1, 1, 0, 1850000, 2950000, NULL, 10000, 10000), |
| 502 | RPM_LDO(L23, 1, 1, 1, 1800000, 1800000, "8038_s4", 0, 0), |
David Collins | ad96fa3 | 2012-03-02 08:41:38 -0800 | [diff] [blame] | 503 | RPM_LDO(L24, 0, 1, 1, 500000, 1150000, "8038_s2", 10000, 10000), |
David Collins | 8af872e | 2012-01-06 11:31:56 -0800 | [diff] [blame] | 504 | RPM_LDO(L26, 1, 1, 0, 1050000, 1050000, "8038_s2", 10000, 10000), |
| 505 | |
| 506 | /* ID a_on pd ss supply */ |
| 507 | RPM_VS(LVS1, 0, 1, 0, "8038_l11"), |
| 508 | RPM_VS(LVS2, 0, 1, 0, "8038_l11"), |
David Collins | 0490731 | 2012-02-08 14:17:57 -0800 | [diff] [blame] | 509 | |
| 510 | /* ID a_on ss min_corner max_corner supply */ |
| 511 | RPM_CORNER(VDD_DIG_CORNER, 0, 1, RPM_VREG_CORNER_NONE, |
| 512 | RPM_VREG_CORNER_HIGH, NULL), |
David Collins | 1d4061b | 2011-12-06 15:36:40 -0800 | [diff] [blame] | 513 | }; |
| 514 | |
| 515 | int msm8930_pm8038_regulator_pdata_len __devinitdata = |
| 516 | ARRAY_SIZE(msm8930_pm8038_regulator_pdata); |
David Collins | 8af872e | 2012-01-06 11:31:56 -0800 | [diff] [blame] | 517 | |
Matt Wagantall | 6dcfa92 | 2012-06-07 20:13:51 -0700 | [diff] [blame] | 518 | #define RPM_REG_MAP(_id, _sleep_also, _voter, _supply, _dev_name) \ |
| 519 | { \ |
| 520 | .vreg_id = RPM_VREG_ID_PM8038_##_id, \ |
| 521 | .sleep_also = _sleep_also, \ |
| 522 | .voter = _voter, \ |
| 523 | .supply = _supply, \ |
| 524 | .dev_name = _dev_name, \ |
| 525 | } |
| 526 | static struct rpm_regulator_consumer_mapping |
| 527 | msm_rpm_regulator_consumer_mapping[] __devinitdata = { |
| 528 | RPM_REG_MAP(L23, 0, 1, "krait0_hfpll", "acpuclk-8930"), |
| 529 | RPM_REG_MAP(L23, 0, 2, "krait1_hfpll", "acpuclk-8930"), |
| 530 | RPM_REG_MAP(L23, 0, 6, "l2_hfpll", "acpuclk-8930"), |
| 531 | RPM_REG_MAP(L24, 0, 1, "krait0_mem", "acpuclk-8930"), |
| 532 | RPM_REG_MAP(L24, 0, 2, "krait1_mem", "acpuclk-8930"), |
| 533 | RPM_REG_MAP(VDD_DIG_CORNER, 0, 1, "krait0_dig", "acpuclk-8930"), |
| 534 | RPM_REG_MAP(VDD_DIG_CORNER, 0, 2, "krait1_dig", "acpuclk-8930"), |
Matt Wagantall | ab730bd | 2012-06-07 20:13:51 -0700 | [diff] [blame] | 535 | |
| 536 | RPM_REG_MAP(L23, 0, 1, "krait0_hfpll", "acpuclk-8627"), |
| 537 | RPM_REG_MAP(L23, 0, 2, "krait1_hfpll", "acpuclk-8627"), |
| 538 | RPM_REG_MAP(L23, 0, 6, "l2_hfpll", "acpuclk-8627"), |
| 539 | RPM_REG_MAP(L24, 0, 1, "krait0_mem", "acpuclk-8627"), |
| 540 | RPM_REG_MAP(L24, 0, 2, "krait1_mem", "acpuclk-8627"), |
| 541 | RPM_REG_MAP(VDD_DIG_CORNER, 0, 1, "krait0_dig", "acpuclk-8627"), |
| 542 | RPM_REG_MAP(VDD_DIG_CORNER, 0, 2, "krait1_dig", "acpuclk-8627"), |
Tianyi Gou | 12370f1 | 2012-07-23 19:13:57 -0700 | [diff] [blame^] | 543 | |
| 544 | RPM_REG_MAP(L23, 0, 1, "krait0_hfpll", "acpuclk-8930aa"), |
| 545 | RPM_REG_MAP(L23, 0, 2, "krait1_hfpll", "acpuclk-8930aa"), |
| 546 | RPM_REG_MAP(L23, 0, 6, "l2_hfpll", "acpuclk-8930aa"), |
| 547 | RPM_REG_MAP(L24, 0, 1, "krait0_mem", "acpuclk-8930aa"), |
| 548 | RPM_REG_MAP(L24, 0, 2, "krait1_mem", "acpuclk-8930aa"), |
| 549 | RPM_REG_MAP(VDD_DIG_CORNER, 0, 1, "krait0_dig", "acpuclk-8930aa"), |
| 550 | RPM_REG_MAP(VDD_DIG_CORNER, 0, 2, "krait1_dig", "acpuclk-8930aa"), |
Matt Wagantall | 6dcfa92 | 2012-06-07 20:13:51 -0700 | [diff] [blame] | 551 | }; |
| 552 | |
David Collins | 8af872e | 2012-01-06 11:31:56 -0800 | [diff] [blame] | 553 | struct rpm_regulator_platform_data msm8930_rpm_regulator_pdata __devinitdata = { |
| 554 | .init_data = msm8930_rpm_regulator_init_data, |
| 555 | .num_regulators = ARRAY_SIZE(msm8930_rpm_regulator_init_data), |
| 556 | .version = RPM_VREG_VERSION_8930, |
| 557 | .vreg_id_vdd_mem = RPM_VREG_ID_PM8038_L24, |
David Collins | 0490731 | 2012-02-08 14:17:57 -0800 | [diff] [blame] | 558 | .vreg_id_vdd_dig = RPM_VREG_ID_PM8038_VDD_DIG_CORNER, |
Matt Wagantall | 6dcfa92 | 2012-06-07 20:13:51 -0700 | [diff] [blame] | 559 | .consumer_map = msm_rpm_regulator_consumer_mapping, |
| 560 | .consumer_map_len = ARRAY_SIZE(msm_rpm_regulator_consumer_mapping), |
David Collins | 8af872e | 2012-01-06 11:31:56 -0800 | [diff] [blame] | 561 | }; |