David Collins | 00b31e6 | 2011-08-31 20:00:10 -0700 | [diff] [blame] | 1 | /* |
Chandra Ramachandran | 39f7d6f | 2012-01-06 09:35:32 -0800 | [diff] [blame] | 2 | * Copyright (c) 2011-2012, Code Aurora Forum. All rights reserved. |
David Collins | 00b31e6 | 2011-08-31 20:00:10 -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 | 8c695c5 | 2011-12-12 15:46:02 -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 | bea297a | 2011-09-28 13:11:14 -0700 | [diff] [blame] | 16 | #include <mach/rpm-regulator.h> |
David Collins | 00b31e6 | 2011-08-31 20:00:10 -0700 | [diff] [blame] | 17 | |
| 18 | #include "board-9615.h" |
| 19 | |
| 20 | #define VREG_CONSUMERS(_id) \ |
| 21 | static struct regulator_consumer_supply vreg_consumers_##_id[] |
| 22 | |
| 23 | /* |
| 24 | * Consumer specific regulator names: |
| 25 | * regulator name consumer dev_name |
| 26 | */ |
| 27 | VREG_CONSUMERS(L2) = { |
| 28 | REGULATOR_SUPPLY("8018_l2", NULL), |
Amit Blay | f8b609e | 2011-09-02 20:42:53 +0300 | [diff] [blame] | 29 | REGULATOR_SUPPLY("HSUSB_1p8", "msm_otg"), |
David Collins | 00b31e6 | 2011-08-31 20:00:10 -0700 | [diff] [blame] | 30 | }; |
| 31 | VREG_CONSUMERS(L3) = { |
| 32 | REGULATOR_SUPPLY("8018_l3", NULL), |
| 33 | }; |
| 34 | VREG_CONSUMERS(L4) = { |
| 35 | REGULATOR_SUPPLY("8018_l4", NULL), |
Amit Blay | f8b609e | 2011-09-02 20:42:53 +0300 | [diff] [blame] | 36 | REGULATOR_SUPPLY("HSUSB_3p3", "msm_otg"), |
David Collins | 00b31e6 | 2011-08-31 20:00:10 -0700 | [diff] [blame] | 37 | }; |
| 38 | VREG_CONSUMERS(L5) = { |
| 39 | REGULATOR_SUPPLY("8018_l5", NULL), |
| 40 | }; |
| 41 | VREG_CONSUMERS(L6) = { |
| 42 | REGULATOR_SUPPLY("8018_l6", NULL), |
| 43 | }; |
| 44 | VREG_CONSUMERS(L7) = { |
| 45 | REGULATOR_SUPPLY("8018_l7", NULL), |
| 46 | }; |
| 47 | VREG_CONSUMERS(L8) = { |
| 48 | REGULATOR_SUPPLY("8018_l8", NULL), |
| 49 | }; |
| 50 | VREG_CONSUMERS(L9) = { |
| 51 | REGULATOR_SUPPLY("8018_l9", NULL), |
| 52 | }; |
| 53 | VREG_CONSUMERS(L10) = { |
| 54 | REGULATOR_SUPPLY("8018_l10", NULL), |
| 55 | }; |
| 56 | VREG_CONSUMERS(L11) = { |
| 57 | REGULATOR_SUPPLY("8018_l11", NULL), |
| 58 | }; |
| 59 | VREG_CONSUMERS(L12) = { |
| 60 | REGULATOR_SUPPLY("8018_l12", NULL), |
| 61 | }; |
| 62 | VREG_CONSUMERS(L13) = { |
| 63 | REGULATOR_SUPPLY("8018_l13", NULL), |
Krishna Konda | fea6018 | 2011-11-01 16:01:34 -0700 | [diff] [blame] | 64 | REGULATOR_SUPPLY("sdc_vddp", "msm_sdcc.1"), |
David Collins | 00b31e6 | 2011-08-31 20:00:10 -0700 | [diff] [blame] | 65 | }; |
| 66 | VREG_CONSUMERS(L14) = { |
| 67 | REGULATOR_SUPPLY("8018_l14", NULL), |
Zhang Chang Ken | a48794b | 2012-03-31 17:45:21 -0400 | [diff] [blame] | 68 | REGULATOR_SUPPLY("VDDI2", "ebi2_lcd.0"), |
David Collins | 00b31e6 | 2011-08-31 20:00:10 -0700 | [diff] [blame] | 69 | }; |
| 70 | VREG_CONSUMERS(S1) = { |
| 71 | REGULATOR_SUPPLY("8018_s1", NULL), |
Amit Blay | f8b609e | 2011-09-02 20:42:53 +0300 | [diff] [blame] | 72 | REGULATOR_SUPPLY("HSUSB_VDDCX", "msm_otg"), |
Ofir Cohen | 06789f1 | 2012-01-16 09:43:13 +0200 | [diff] [blame] | 73 | REGULATOR_SUPPLY("HSIC_VDDCX", "msm_hsic_peripheral"), |
Lena Salman | 65bcf37 | 2012-02-14 15:33:32 +0200 | [diff] [blame] | 74 | REGULATOR_SUPPLY("HSIC_VDDCX", "msm_hsic_host"), |
David Collins | 00b31e6 | 2011-08-31 20:00:10 -0700 | [diff] [blame] | 75 | }; |
| 76 | VREG_CONSUMERS(S2) = { |
| 77 | REGULATOR_SUPPLY("8018_s2", NULL), |
Shiv Maliyappanahalli | 9ec55e9 | 2012-01-09 14:44:59 -0800 | [diff] [blame] | 78 | REGULATOR_SUPPLY("CDC_VDDA_A_1P2V", "tabla-slim"), |
| 79 | REGULATOR_SUPPLY("CDC_VDDA_A_1P2V", "tabla2x-slim"), |
| 80 | REGULATOR_SUPPLY("VDDD_CDC_D", "tabla-slim"), |
| 81 | REGULATOR_SUPPLY("VDDD_CDC_D", "tabla2x-slim"), |
Venkat Sudhir | 5efc491 | 2012-05-15 17:10:35 -0700 | [diff] [blame] | 82 | REGULATOR_SUPPLY("VDDD_CDC_D", "0-000d"), |
| 83 | REGULATOR_SUPPLY("CDC_VDDA_A_1P2V", "0-000d"), |
| 84 | REGULATOR_SUPPLY("VDDD_CDC_D", "tabla top level"), |
| 85 | REGULATOR_SUPPLY("CDC_VDDA_A_1P2V", "tabla top level"), |
David Collins | 00b31e6 | 2011-08-31 20:00:10 -0700 | [diff] [blame] | 86 | }; |
| 87 | VREG_CONSUMERS(S3) = { |
| 88 | REGULATOR_SUPPLY("8018_s3", NULL), |
Rohit Vaswani | 2caf2f5 | 2011-12-12 20:13:37 -0800 | [diff] [blame] | 89 | REGULATOR_SUPPLY("wlan_vreg", "wlan_ar6000_pm_dev"), |
Shiv Maliyappanahalli | 9ec55e9 | 2012-01-09 14:44:59 -0800 | [diff] [blame] | 90 | REGULATOR_SUPPLY("CDC_VDD_CP", "tabla-slim"), |
| 91 | REGULATOR_SUPPLY("CDC_VDD_CP", "tabla2x-slim"), |
| 92 | REGULATOR_SUPPLY("CDC_VDDA_RX", "tabla-slim"), |
| 93 | REGULATOR_SUPPLY("CDC_VDDA_RX", "tabla2x-slim"), |
| 94 | REGULATOR_SUPPLY("CDC_VDDA_TX", "tabla-slim"), |
| 95 | REGULATOR_SUPPLY("CDC_VDDA_TX", "tabla2x-slim"), |
| 96 | REGULATOR_SUPPLY("VDDIO_CDC", "tabla-slim"), |
| 97 | REGULATOR_SUPPLY("VDDIO_CDC", "tabla2x-slim"), |
Venkat Sudhir | 5efc491 | 2012-05-15 17:10:35 -0700 | [diff] [blame] | 98 | REGULATOR_SUPPLY("VDDIO_CDC", "tabla top level"), |
| 99 | REGULATOR_SUPPLY("CDC_VDD_CP", "tabla top level"), |
| 100 | REGULATOR_SUPPLY("CDC_VDDA_TX", "tabla top level"), |
| 101 | REGULATOR_SUPPLY("CDC_VDDA_RX", "tabla top level"), |
| 102 | REGULATOR_SUPPLY("VDDIO_CDC", "0-000d"), |
| 103 | REGULATOR_SUPPLY("CDC_VDD_CP", "0-000d"), |
| 104 | REGULATOR_SUPPLY("CDC_VDDA_TX", "0-000d"), |
| 105 | REGULATOR_SUPPLY("CDC_VDDA_RX", "0-000d"), |
David Collins | 00b31e6 | 2011-08-31 20:00:10 -0700 | [diff] [blame] | 106 | }; |
| 107 | VREG_CONSUMERS(S4) = { |
| 108 | REGULATOR_SUPPLY("8018_s4", NULL), |
| 109 | }; |
| 110 | VREG_CONSUMERS(S5) = { |
| 111 | REGULATOR_SUPPLY("8018_s5", NULL), |
| 112 | }; |
| 113 | VREG_CONSUMERS(LVS1) = { |
| 114 | REGULATOR_SUPPLY("8018_lvs1", NULL), |
| 115 | }; |
David Collins | 0f9942a | 2011-10-31 09:47:34 -0700 | [diff] [blame] | 116 | VREG_CONSUMERS(EXT_2P95V) = { |
| 117 | REGULATOR_SUPPLY("ext_2p95v", NULL), |
Krishna Konda | fea6018 | 2011-11-01 16:01:34 -0700 | [diff] [blame] | 118 | REGULATOR_SUPPLY("sdc_vdd", "msm_sdcc.1"), |
David Collins | 0f9942a | 2011-10-31 09:47:34 -0700 | [diff] [blame] | 119 | }; |
David Collins | 00b31e6 | 2011-08-31 20:00:10 -0700 | [diff] [blame] | 120 | |
David Collins | 8c695c5 | 2011-12-12 15:46:02 -0800 | [diff] [blame] | 121 | #define PM8XXX_VREG_INIT(_id, _name, _min_uV, _max_uV, _modes, _ops, \ |
| 122 | _apply_uV, _pull_down, _always_on, _supply_regulator, \ |
| 123 | _system_uA, _enable_time, _reg_id) \ |
David Collins | 00b31e6 | 2011-08-31 20:00:10 -0700 | [diff] [blame] | 124 | { \ |
| 125 | .init_data = { \ |
| 126 | .constraints = { \ |
| 127 | .valid_modes_mask = _modes, \ |
| 128 | .valid_ops_mask = _ops, \ |
| 129 | .min_uV = _min_uV, \ |
| 130 | .max_uV = _max_uV, \ |
| 131 | .input_uV = _max_uV, \ |
| 132 | .apply_uV = _apply_uV, \ |
| 133 | .always_on = _always_on, \ |
David Collins | 8c695c5 | 2011-12-12 15:46:02 -0800 | [diff] [blame] | 134 | .name = _name, \ |
David Collins | 00b31e6 | 2011-08-31 20:00:10 -0700 | [diff] [blame] | 135 | }, \ |
| 136 | .num_consumer_supplies = \ |
| 137 | ARRAY_SIZE(vreg_consumers_##_id), \ |
| 138 | .consumer_supplies = vreg_consumers_##_id, \ |
| 139 | .supply_regulator = _supply_regulator, \ |
| 140 | }, \ |
David Collins | 8c695c5 | 2011-12-12 15:46:02 -0800 | [diff] [blame] | 141 | .id = _reg_id, \ |
David Collins | 00b31e6 | 2011-08-31 20:00:10 -0700 | [diff] [blame] | 142 | .pull_down_enable = _pull_down, \ |
| 143 | .system_uA = _system_uA, \ |
| 144 | .enable_time = _enable_time, \ |
| 145 | } |
| 146 | |
David Collins | 8c695c5 | 2011-12-12 15:46:02 -0800 | [diff] [blame] | 147 | #define PM8XXX_LDO(_id, _name, _always_on, _pull_down, _min_uV, _max_uV, \ |
| 148 | _enable_time, _supply_regulator, _system_uA, _reg_id) \ |
| 149 | PM8XXX_VREG_INIT(_id, _name, _min_uV, _max_uV, REGULATOR_MODE_NORMAL \ |
David Collins | 00b31e6 | 2011-08-31 20:00:10 -0700 | [diff] [blame] | 150 | | REGULATOR_MODE_IDLE, REGULATOR_CHANGE_VOLTAGE | \ |
| 151 | REGULATOR_CHANGE_STATUS | REGULATOR_CHANGE_MODE | \ |
| 152 | REGULATOR_CHANGE_DRMS, 0, _pull_down, _always_on, \ |
David Collins | 8c695c5 | 2011-12-12 15:46:02 -0800 | [diff] [blame] | 153 | _supply_regulator, _system_uA, _enable_time, _reg_id) |
David Collins | 00b31e6 | 2011-08-31 20:00:10 -0700 | [diff] [blame] | 154 | |
David Collins | 8c695c5 | 2011-12-12 15:46:02 -0800 | [diff] [blame] | 155 | #define PM8XXX_NLDO1200(_id, _name, _always_on, _pull_down, _min_uV, \ |
| 156 | _max_uV, _enable_time, _supply_regulator, _system_uA, _reg_id) \ |
| 157 | PM8XXX_VREG_INIT(_id, _name, _min_uV, _max_uV, REGULATOR_MODE_NORMAL \ |
David Collins | 00b31e6 | 2011-08-31 20:00:10 -0700 | [diff] [blame] | 158 | | REGULATOR_MODE_IDLE, REGULATOR_CHANGE_VOLTAGE | \ |
| 159 | REGULATOR_CHANGE_STATUS | REGULATOR_CHANGE_MODE | \ |
| 160 | REGULATOR_CHANGE_DRMS, 0, _pull_down, _always_on, \ |
David Collins | 8c695c5 | 2011-12-12 15:46:02 -0800 | [diff] [blame] | 161 | _supply_regulator, _system_uA, _enable_time, _reg_id) |
David Collins | 00b31e6 | 2011-08-31 20:00:10 -0700 | [diff] [blame] | 162 | |
David Collins | 8c695c5 | 2011-12-12 15:46:02 -0800 | [diff] [blame] | 163 | #define PM8XXX_SMPS(_id, _name, _always_on, _pull_down, _min_uV, _max_uV, \ |
| 164 | _enable_time, _supply_regulator, _system_uA, _reg_id) \ |
| 165 | PM8XXX_VREG_INIT(_id, _name, _min_uV, _max_uV, REGULATOR_MODE_NORMAL \ |
David Collins | 00b31e6 | 2011-08-31 20:00:10 -0700 | [diff] [blame] | 166 | | REGULATOR_MODE_IDLE, REGULATOR_CHANGE_VOLTAGE | \ |
| 167 | REGULATOR_CHANGE_STATUS | REGULATOR_CHANGE_MODE | \ |
| 168 | REGULATOR_CHANGE_DRMS, 0, _pull_down, _always_on, \ |
David Collins | 8c695c5 | 2011-12-12 15:46:02 -0800 | [diff] [blame] | 169 | _supply_regulator, _system_uA, _enable_time, _reg_id) |
David Collins | 00b31e6 | 2011-08-31 20:00:10 -0700 | [diff] [blame] | 170 | |
David Collins | 8c695c5 | 2011-12-12 15:46:02 -0800 | [diff] [blame] | 171 | #define PM8XXX_VS(_id, _name, _always_on, _pull_down, _enable_time, \ |
| 172 | _supply_regulator, _reg_id) \ |
| 173 | PM8XXX_VREG_INIT(_id, _name, 0, 0, 0, REGULATOR_CHANGE_STATUS, 0, \ |
| 174 | _pull_down, _always_on, _supply_regulator, 0, _enable_time, \ |
| 175 | _reg_id) |
David Collins | 00b31e6 | 2011-08-31 20:00:10 -0700 | [diff] [blame] | 176 | |
| 177 | /* Pin control initialization */ |
David Collins | 8c695c5 | 2011-12-12 15:46:02 -0800 | [diff] [blame] | 178 | #define PM8XXX_PC(_id, _name, _always_on, _pin_fn, _pin_ctrl, \ |
| 179 | _supply_regulator, _reg_id) \ |
David Collins | 00b31e6 | 2011-08-31 20:00:10 -0700 | [diff] [blame] | 180 | { \ |
| 181 | .init_data = { \ |
| 182 | .constraints = { \ |
| 183 | .valid_ops_mask = REGULATOR_CHANGE_STATUS, \ |
| 184 | .always_on = _always_on, \ |
David Collins | 8c695c5 | 2011-12-12 15:46:02 -0800 | [diff] [blame] | 185 | .name = _name, \ |
David Collins | 00b31e6 | 2011-08-31 20:00:10 -0700 | [diff] [blame] | 186 | }, \ |
| 187 | .num_consumer_supplies = \ |
| 188 | ARRAY_SIZE(vreg_consumers_##_id##_PC), \ |
| 189 | .consumer_supplies = vreg_consumers_##_id##_PC, \ |
| 190 | .supply_regulator = _supply_regulator, \ |
| 191 | }, \ |
David Collins | 8c695c5 | 2011-12-12 15:46:02 -0800 | [diff] [blame] | 192 | .id = _reg_id, \ |
| 193 | .pin_fn = PM8XXX_VREG_PIN_FN_##_pin_fn, \ |
| 194 | .pin_ctrl = _pin_ctrl, \ |
David Collins | 00b31e6 | 2011-08-31 20:00:10 -0700 | [diff] [blame] | 195 | } |
| 196 | |
David Collins | bea297a | 2011-09-28 13:11:14 -0700 | [diff] [blame] | 197 | #define RPM_INIT(_id, _min_uV, _max_uV, _modes, _ops, _apply_uV, _default_uV, \ |
| 198 | _peak_uA, _avg_uA, _pull_down, _pin_ctrl, _freq, _pin_fn, \ |
David Collins | 1578904 | 2012-03-19 10:44:36 -0700 | [diff] [blame] | 199 | _force_mode, _sleep_set_force_mode, _power_mode, _state, \ |
| 200 | _sleep_selectable, _always_on, _supply_regulator, _system_uA) \ |
David Collins | bea297a | 2011-09-28 13:11:14 -0700 | [diff] [blame] | 201 | { \ |
| 202 | .init_data = { \ |
| 203 | .constraints = { \ |
| 204 | .valid_modes_mask = _modes, \ |
| 205 | .valid_ops_mask = _ops, \ |
| 206 | .min_uV = _min_uV, \ |
| 207 | .max_uV = _max_uV, \ |
| 208 | .input_uV = _min_uV, \ |
| 209 | .apply_uV = _apply_uV, \ |
| 210 | .always_on = _always_on, \ |
| 211 | }, \ |
| 212 | .num_consumer_supplies = \ |
| 213 | ARRAY_SIZE(vreg_consumers_##_id), \ |
| 214 | .consumer_supplies = vreg_consumers_##_id, \ |
| 215 | .supply_regulator = _supply_regulator, \ |
| 216 | }, \ |
| 217 | .id = RPM_VREG_ID_PM8018_##_id, \ |
| 218 | .default_uV = _default_uV, \ |
| 219 | .peak_uA = _peak_uA, \ |
| 220 | .avg_uA = _avg_uA, \ |
| 221 | .pull_down_enable = _pull_down, \ |
| 222 | .pin_ctrl = _pin_ctrl, \ |
| 223 | .freq = RPM_VREG_FREQ_##_freq, \ |
| 224 | .pin_fn = _pin_fn, \ |
| 225 | .force_mode = _force_mode, \ |
David Collins | 1578904 | 2012-03-19 10:44:36 -0700 | [diff] [blame] | 226 | .sleep_set_force_mode = _sleep_set_force_mode, \ |
David Collins | bea297a | 2011-09-28 13:11:14 -0700 | [diff] [blame] | 227 | .power_mode = _power_mode, \ |
| 228 | .state = _state, \ |
| 229 | .sleep_selectable = _sleep_selectable, \ |
| 230 | .system_uA = _system_uA, \ |
| 231 | } |
| 232 | |
| 233 | #define RPM_LDO(_id, _always_on, _pd, _sleep_selectable, _min_uV, _max_uV, \ |
| 234 | _supply_regulator, _system_uA, _init_peak_uA) \ |
| 235 | RPM_INIT(_id, _min_uV, _max_uV, REGULATOR_MODE_NORMAL \ |
| 236 | | REGULATOR_MODE_IDLE, REGULATOR_CHANGE_VOLTAGE \ |
| 237 | | REGULATOR_CHANGE_STATUS | REGULATOR_CHANGE_MODE \ |
| 238 | | REGULATOR_CHANGE_DRMS, 0, _max_uV, _init_peak_uA, 0, _pd, \ |
| 239 | RPM_VREG_PIN_CTRL_NONE, NONE, RPM_VREG_PIN_FN_9615_NONE, \ |
David Collins | 1578904 | 2012-03-19 10:44:36 -0700 | [diff] [blame] | 240 | RPM_VREG_FORCE_MODE_9615_NONE, \ |
David Collins | bea297a | 2011-09-28 13:11:14 -0700 | [diff] [blame] | 241 | RPM_VREG_FORCE_MODE_9615_NONE, RPM_VREG_POWER_MODE_9615_PWM, \ |
| 242 | RPM_VREG_STATE_OFF, _sleep_selectable, _always_on, \ |
| 243 | _supply_regulator, _system_uA) |
| 244 | |
| 245 | #define RPM_SMPS(_id, _always_on, _pd, _sleep_selectable, _min_uV, _max_uV, \ |
| 246 | _supply_regulator, _system_uA, _freq) \ |
| 247 | RPM_INIT(_id, _min_uV, _max_uV, REGULATOR_MODE_NORMAL \ |
| 248 | | REGULATOR_MODE_IDLE, REGULATOR_CHANGE_VOLTAGE \ |
| 249 | | REGULATOR_CHANGE_STATUS | REGULATOR_CHANGE_MODE \ |
| 250 | | REGULATOR_CHANGE_DRMS, 0, _max_uV, _system_uA, 0, _pd, \ |
| 251 | RPM_VREG_PIN_CTRL_NONE, _freq, RPM_VREG_PIN_FN_9615_NONE, \ |
David Collins | 1578904 | 2012-03-19 10:44:36 -0700 | [diff] [blame] | 252 | RPM_VREG_FORCE_MODE_9615_NONE, \ |
David Collins | bea297a | 2011-09-28 13:11:14 -0700 | [diff] [blame] | 253 | RPM_VREG_FORCE_MODE_9615_NONE, RPM_VREG_POWER_MODE_9615_PWM, \ |
| 254 | RPM_VREG_STATE_OFF, _sleep_selectable, _always_on, \ |
| 255 | _supply_regulator, _system_uA) |
| 256 | |
| 257 | #define RPM_VS(_id, _always_on, _pd, _sleep_selectable, _supply_regulator) \ |
| 258 | RPM_INIT(_id, 0, 0, 0, REGULATOR_CHANGE_STATUS, 0, 0, 1000, 1000, _pd, \ |
| 259 | RPM_VREG_PIN_CTRL_NONE, NONE, RPM_VREG_PIN_FN_9615_NONE, \ |
David Collins | 1578904 | 2012-03-19 10:44:36 -0700 | [diff] [blame] | 260 | RPM_VREG_FORCE_MODE_9615_NONE, \ |
David Collins | bea297a | 2011-09-28 13:11:14 -0700 | [diff] [blame] | 261 | RPM_VREG_FORCE_MODE_9615_NONE, RPM_VREG_POWER_MODE_9615_PWM, \ |
| 262 | RPM_VREG_STATE_OFF, _sleep_selectable, _always_on, \ |
| 263 | _supply_regulator, 0) |
| 264 | |
| 265 | /* Pin control initialization */ |
| 266 | #define RPM_PC_INIT(_id, _always_on, _pin_fn, _pin_ctrl, _supply_regulator) \ |
| 267 | { \ |
| 268 | .init_data = { \ |
| 269 | .constraints = { \ |
| 270 | .valid_ops_mask = REGULATOR_CHANGE_STATUS, \ |
| 271 | .always_on = _always_on, \ |
| 272 | }, \ |
| 273 | .num_consumer_supplies = \ |
| 274 | ARRAY_SIZE(vreg_consumers_##_id##_PC), \ |
| 275 | .consumer_supplies = vreg_consumers_##_id##_PC, \ |
| 276 | .supply_regulator = _supply_regulator, \ |
| 277 | }, \ |
| 278 | .id = RPM_VREG_ID_PM8018_##_id##_PC, \ |
| 279 | .pin_fn = RPM_VREG_PIN_FN_9615_##_pin_fn, \ |
| 280 | .pin_ctrl = _pin_ctrl, \ |
| 281 | } |
| 282 | |
David Collins | 0f9942a | 2011-10-31 09:47:34 -0700 | [diff] [blame] | 283 | #define GPIO_VREG_INIT(_id, _reg_name, _gpio_label, _gpio) \ |
| 284 | [GPIO_VREG_ID_##_id] = { \ |
| 285 | .init_data = { \ |
| 286 | .constraints = { \ |
| 287 | .valid_ops_mask = REGULATOR_CHANGE_STATUS, \ |
| 288 | }, \ |
| 289 | .num_consumer_supplies = \ |
| 290 | ARRAY_SIZE(vreg_consumers_##_id), \ |
| 291 | .consumer_supplies = vreg_consumers_##_id, \ |
| 292 | }, \ |
| 293 | .regulator_name = _reg_name, \ |
| 294 | .gpio_label = _gpio_label, \ |
| 295 | .gpio = _gpio, \ |
| 296 | } |
| 297 | |
| 298 | /* GPIO regulator constraints */ |
| 299 | struct gpio_regulator_platform_data msm_gpio_regulator_pdata[] = { |
| 300 | GPIO_VREG_INIT(EXT_2P95V, "ext_2p95v", "ext_2p95_en", 18), |
| 301 | }; |
David Collins | bea297a | 2011-09-28 13:11:14 -0700 | [diff] [blame] | 302 | |
David Collins | 00b31e6 | 2011-08-31 20:00:10 -0700 | [diff] [blame] | 303 | /* PM8018 regulator constraints */ |
David Collins | 8c695c5 | 2011-12-12 15:46:02 -0800 | [diff] [blame] | 304 | struct pm8xxx_regulator_platform_data |
David Collins | 00b31e6 | 2011-08-31 20:00:10 -0700 | [diff] [blame] | 305 | msm_pm8018_regulator_pdata[] __devinitdata = { |
David Collins | bea297a | 2011-09-28 13:11:14 -0700 | [diff] [blame] | 306 | }; |
David Collins | 00b31e6 | 2011-08-31 20:00:10 -0700 | [diff] [blame] | 307 | |
David Collins | bea297a | 2011-09-28 13:11:14 -0700 | [diff] [blame] | 308 | static struct rpm_regulator_init_data |
| 309 | msm_rpm_regulator_init_data[] __devinitdata = { |
| 310 | /* ID a_on pd ss min_uV max_uV supply sys_uA freq */ |
Chandra Ramachandran | 39f7d6f | 2012-01-06 09:35:32 -0800 | [diff] [blame] | 311 | RPM_SMPS(S1, 0, 1, 1, 500000, 1150000, NULL, 100000, 1p60), |
David Collins | bea297a | 2011-09-28 13:11:14 -0700 | [diff] [blame] | 312 | RPM_SMPS(S2, 0, 1, 0, 1225000, 1300000, NULL, 0, 1p60), |
| 313 | RPM_SMPS(S3, 1, 1, 0, 1800000, 1800000, NULL, 100000, 1p60), |
| 314 | RPM_SMPS(S4, 0, 1, 0, 2100000, 2200000, NULL, 0, 1p60), |
| 315 | RPM_SMPS(S5, 1, 1, 0, 1350000, 1350000, NULL, 100000, 1p60), |
David Collins | 00b31e6 | 2011-08-31 20:00:10 -0700 | [diff] [blame] | 316 | |
David Collins | bea297a | 2011-09-28 13:11:14 -0700 | [diff] [blame] | 317 | /* ID a_on pd ss min_uV max_uV supply sys_uA init_ip */ |
| 318 | RPM_LDO(L2, 1, 1, 0, 1800000, 1800000, NULL, 0, 10000), |
| 319 | RPM_LDO(L3, 0, 1, 0, 1800000, 1800000, NULL, 0, 0), |
| 320 | RPM_LDO(L4, 0, 1, 0, 3075000, 3075000, NULL, 0, 0), |
| 321 | RPM_LDO(L5, 0, 1, 0, 2850000, 2850000, NULL, 0, 0), |
| 322 | RPM_LDO(L6, 0, 1, 0, 1800000, 2850000, NULL, 0, 0), |
| 323 | RPM_LDO(L7, 0, 1, 0, 1850000, 1900000, "8018_s4", 0, 0), |
| 324 | RPM_LDO(L8, 0, 1, 0, 1200000, 1200000, "8018_s3", 0, 0), |
Chandra Ramachandran | 39f7d6f | 2012-01-06 09:35:32 -0800 | [diff] [blame] | 325 | RPM_LDO(L9, 0, 1, 1, 750000, 1150000, "8018_s5", 10000, 10000), |
David Collins | bea297a | 2011-09-28 13:11:14 -0700 | [diff] [blame] | 326 | RPM_LDO(L10, 0, 1, 0, 1050000, 1050000, "8018_s5", 0, 0), |
| 327 | RPM_LDO(L11, 0, 1, 0, 1050000, 1050000, "8018_s5", 0, 0), |
| 328 | RPM_LDO(L12, 0, 1, 0, 1050000, 1050000, "8018_s5", 0, 0), |
Krishna Konda | d56fa07 | 2011-11-01 16:18:41 -0700 | [diff] [blame] | 329 | RPM_LDO(L13, 0, 1, 0, 1850000, 2950000, NULL, 0, 0), |
David Collins | bea297a | 2011-09-28 13:11:14 -0700 | [diff] [blame] | 330 | RPM_LDO(L14, 0, 1, 0, 2850000, 2850000, NULL, 0, 0), |
| 331 | |
| 332 | /* ID a_on pd ss supply */ |
| 333 | RPM_VS(LVS1, 0, 1, 0, "8018_s3"), |
David Collins | 00b31e6 | 2011-08-31 20:00:10 -0700 | [diff] [blame] | 334 | }; |
| 335 | |
| 336 | int msm_pm8018_regulator_pdata_len __devinitdata = |
| 337 | ARRAY_SIZE(msm_pm8018_regulator_pdata); |
David Collins | bea297a | 2011-09-28 13:11:14 -0700 | [diff] [blame] | 338 | |
| 339 | struct rpm_regulator_platform_data |
| 340 | msm_rpm_regulator_9615_pdata __devinitdata = { |
| 341 | .init_data = msm_rpm_regulator_init_data, |
| 342 | .num_regulators = ARRAY_SIZE(msm_rpm_regulator_init_data), |
| 343 | .version = RPM_VREG_VERSION_9615, |
| 344 | .vreg_id_vdd_mem = RPM_VREG_ID_PM8018_L9, |
| 345 | .vreg_id_vdd_dig = RPM_VREG_ID_PM8018_S1, |
| 346 | }; |