Sundar Iyer | 4f724be | 2010-09-15 10:50:59 +0100 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) ST-Ericsson SA 2010 |
| 3 | * |
| 4 | * License Terms: GNU General Public License v2 |
| 5 | * |
Bengt Jonsson | a1e516e | 2010-12-10 11:08:48 +0100 | [diff] [blame] | 6 | * Authors: Sundar Iyer <sundar.iyer@stericsson.com> |
| 7 | * Bengt Jonsson <bengt.g.jonsson@stericsson.com> |
Lee Jones | 547f384 | 2013-03-28 16:11:14 +0000 | [diff] [blame] | 8 | * Daniel Willerud <daniel.willerud@stericsson.com> |
Sundar Iyer | 4f724be | 2010-09-15 10:50:59 +0100 | [diff] [blame] | 9 | * |
| 10 | * MOP500 board specific initialization for regulators |
| 11 | */ |
| 12 | #include <linux/kernel.h> |
| 13 | #include <linux/regulator/machine.h> |
Bengt Jonsson | a1e516e | 2010-12-10 11:08:48 +0100 | [diff] [blame] | 14 | #include <linux/regulator/ab8500.h> |
Linus Walleij | d1de85a | 2010-12-02 17:10:14 +0100 | [diff] [blame] | 15 | #include "board-mop500-regulators.h" |
Lee Jones | 0fbc800 | 2013-04-02 13:24:04 +0100 | [diff] [blame] | 16 | #include "id.h" |
Linus Walleij | d1de85a | 2010-12-02 17:10:14 +0100 | [diff] [blame] | 17 | |
Lee Jones | 0b5ea1e | 2012-09-03 14:33:39 +0100 | [diff] [blame] | 18 | static struct regulator_consumer_supply gpio_en_3v3_consumers[] = { |
| 19 | REGULATOR_SUPPLY("vdd33a", "smsc911x.0"), |
| 20 | }; |
| 21 | |
| 22 | struct regulator_init_data gpio_en_3v3_regulator = { |
| 23 | .constraints = { |
| 24 | .name = "EN-3V3", |
| 25 | .min_uV = 3300000, |
| 26 | .max_uV = 3300000, |
| 27 | .valid_ops_mask = REGULATOR_CHANGE_STATUS, |
| 28 | }, |
| 29 | .num_consumer_supplies = ARRAY_SIZE(gpio_en_3v3_consumers), |
| 30 | .consumer_supplies = gpio_en_3v3_consumers, |
| 31 | }; |
| 32 | |
Linus Walleij | fe67dfc | 2011-03-07 11:48:15 +0100 | [diff] [blame] | 33 | /* |
| 34 | * TPS61052 regulator |
| 35 | */ |
| 36 | static struct regulator_consumer_supply tps61052_vaudio_consumers[] = { |
| 37 | /* |
| 38 | * Boost converter supply to raise voltage on audio speaker, this |
| 39 | * is actually connected to three pins, VInVhfL (left amplifier) |
| 40 | * VInVhfR (right amplifier) and VIntDClassInt - all three must |
| 41 | * be connected to the same voltage. |
| 42 | */ |
| 43 | REGULATOR_SUPPLY("vintdclassint", "ab8500-codec.0"), |
| 44 | }; |
| 45 | |
| 46 | struct regulator_init_data tps61052_regulator = { |
| 47 | .constraints = { |
| 48 | .name = "vaudio-hf", |
| 49 | .min_uV = 4500000, |
| 50 | .max_uV = 4500000, |
| 51 | .valid_ops_mask = REGULATOR_CHANGE_STATUS, |
| 52 | }, |
| 53 | .num_consumer_supplies = ARRAY_SIZE(tps61052_vaudio_consumers), |
| 54 | .consumer_supplies = tps61052_vaudio_consumers, |
| 55 | }; |
| 56 | |
Linus Walleij | d1de85a | 2010-12-02 17:10:14 +0100 | [diff] [blame] | 57 | static struct regulator_consumer_supply ab8500_vaux1_consumers[] = { |
Lee Jones | 27f26de | 2013-03-21 15:59:05 +0000 | [diff] [blame] | 58 | /* Main display, u8500 R3 uib */ |
| 59 | REGULATOR_SUPPLY("vddi", "mcde_disp_sony_acx424akp.0"), |
| 60 | /* Main display, u8500 uib and ST uib */ |
| 61 | REGULATOR_SUPPLY("vdd1", "samsung_s6d16d0.0"), |
| 62 | /* Secondary display, ST uib */ |
| 63 | REGULATOR_SUPPLY("vdd1", "samsung_s6d16d0.1"), |
Linus Walleij | d1de85a | 2010-12-02 17:10:14 +0100 | [diff] [blame] | 64 | /* SFH7741 proximity sensor */ |
| 65 | REGULATOR_SUPPLY("vcc", "gpio-keys.0"), |
| 66 | /* BH1780GLS ambient light sensor */ |
| 67 | REGULATOR_SUPPLY("vcc", "2-0029"), |
| 68 | /* lsm303dlh accelerometer */ |
Lee Jones | a652f3d | 2013-04-02 13:24:21 +0100 | [diff] [blame] | 69 | REGULATOR_SUPPLY("vdd", "2-0018"), |
Lee Jones | cb6795a | 2013-03-21 15:59:21 +0000 | [diff] [blame] | 70 | /* lsm303dlhc accelerometer */ |
| 71 | REGULATOR_SUPPLY("vdd", "2-0019"), |
Linus Walleij | d1de85a | 2010-12-02 17:10:14 +0100 | [diff] [blame] | 72 | /* lsm303dlh magnetometer */ |
Lee Jones | cb6795a | 2013-03-21 15:59:21 +0000 | [diff] [blame] | 73 | REGULATOR_SUPPLY("vdd", "2-001e"), |
Linus Walleij | d1de85a | 2010-12-02 17:10:14 +0100 | [diff] [blame] | 74 | /* Rohm BU21013 Touchscreen devices */ |
| 75 | REGULATOR_SUPPLY("avdd", "3-005c"), |
| 76 | REGULATOR_SUPPLY("avdd", "3-005d"), |
| 77 | /* Synaptics RMI4 Touchscreen device */ |
| 78 | REGULATOR_SUPPLY("vdd", "3-004b"), |
Lee Jones | efb34d2 | 2013-03-21 15:59:10 +0000 | [diff] [blame] | 79 | /* L3G4200D Gyroscope device */ |
| 80 | REGULATOR_SUPPLY("vdd", "2-0068"), |
Lee Jones | 2d0266a | 2013-03-21 15:59:11 +0000 | [diff] [blame] | 81 | /* Ambient light sensor device */ |
| 82 | REGULATOR_SUPPLY("vdd", "3-0029"), |
Lee Jones | 4336c1d | 2013-03-21 15:59:12 +0000 | [diff] [blame] | 83 | /* Pressure sensor device */ |
| 84 | REGULATOR_SUPPLY("vdd", "2-005c"), |
Lee Jones | 5379f02 | 2013-03-21 15:59:13 +0000 | [diff] [blame] | 85 | /* Cypress TrueTouch Touchscreen device */ |
| 86 | REGULATOR_SUPPLY("vcpin", "spi8.0"), |
Lee Jones | fa67952 | 2013-03-21 15:59:14 +0000 | [diff] [blame] | 87 | /* Camera device */ |
| 88 | REGULATOR_SUPPLY("vaux12v5", "mmio_camera"), |
Linus Walleij | d1de85a | 2010-12-02 17:10:14 +0100 | [diff] [blame] | 89 | }; |
| 90 | |
| 91 | static struct regulator_consumer_supply ab8500_vaux2_consumers[] = { |
| 92 | /* On-board eMMC power */ |
| 93 | REGULATOR_SUPPLY("vmmc", "sdi4"), |
| 94 | /* AB8500 audio codec */ |
| 95 | REGULATOR_SUPPLY("vcc-N2158", "ab8500-codec.0"), |
Lee Jones | a652f3d | 2013-04-02 13:24:21 +0100 | [diff] [blame] | 96 | /* AB8500 accessory detect 1 */ |
| 97 | REGULATOR_SUPPLY("vcc-N2158", "ab8500-acc-det.0"), |
| 98 | /* AB8500 Tv-out device */ |
| 99 | REGULATOR_SUPPLY("vcc-N2158", "mcde_tv_ab8500.4"), |
| 100 | /* AV8100 HDMI device */ |
| 101 | REGULATOR_SUPPLY("vcc-N2158", "av8100_hdmi.3"), |
Linus Walleij | d1de85a | 2010-12-02 17:10:14 +0100 | [diff] [blame] | 102 | }; |
| 103 | |
| 104 | static struct regulator_consumer_supply ab8500_vaux3_consumers[] = { |
Lee Jones | a652f3d | 2013-04-02 13:24:21 +0100 | [diff] [blame] | 105 | REGULATOR_SUPPLY("v-SD-STM", "stm"), |
Linus Walleij | d1de85a | 2010-12-02 17:10:14 +0100 | [diff] [blame] | 106 | /* External MMC slot power */ |
| 107 | REGULATOR_SUPPLY("vmmc", "sdi0"), |
| 108 | }; |
| 109 | |
Lee Jones | 547f384 | 2013-03-28 16:11:14 +0000 | [diff] [blame] | 110 | static struct regulator_consumer_supply ab8505_vaux4_consumers[] = { |
| 111 | }; |
| 112 | |
| 113 | static struct regulator_consumer_supply ab8505_vaux5_consumers[] = { |
| 114 | }; |
| 115 | |
| 116 | static struct regulator_consumer_supply ab8505_vaux6_consumers[] = { |
| 117 | }; |
| 118 | |
| 119 | static struct regulator_consumer_supply ab8505_vaux8_consumers[] = { |
| 120 | /* AB8500 audio codec device */ |
| 121 | REGULATOR_SUPPLY("v-aux8", NULL), |
| 122 | }; |
| 123 | |
| 124 | static struct regulator_consumer_supply ab8505_vadc_consumers[] = { |
| 125 | /* Internal general-purpose ADC */ |
| 126 | REGULATOR_SUPPLY("vddadc", "ab8500-gpadc.0"), |
| 127 | /* ADC for charger */ |
| 128 | REGULATOR_SUPPLY("vddadc", "ab8500-charger.0"), |
| 129 | }; |
| 130 | |
Linus Walleij | d1de85a | 2010-12-02 17:10:14 +0100 | [diff] [blame] | 131 | static struct regulator_consumer_supply ab8500_vtvout_consumers[] = { |
| 132 | /* TV-out DENC supply */ |
| 133 | REGULATOR_SUPPLY("vtvout", "ab8500-denc.0"), |
| 134 | /* Internal general-purpose ADC */ |
| 135 | REGULATOR_SUPPLY("vddadc", "ab8500-gpadc.0"), |
Lee Jones | a652f3d | 2013-04-02 13:24:21 +0100 | [diff] [blame] | 136 | /* ADC for charger */ |
| 137 | REGULATOR_SUPPLY("vddadc", "ab8500-charger.0"), |
| 138 | /* AB8500 Tv-out device */ |
| 139 | REGULATOR_SUPPLY("vtvout", "mcde_tv_ab8500.4"), |
Linus Walleij | d1de85a | 2010-12-02 17:10:14 +0100 | [diff] [blame] | 140 | }; |
| 141 | |
Ola Lilja | 29bd2ab | 2012-02-01 14:18:10 +0100 | [diff] [blame] | 142 | static struct regulator_consumer_supply ab8500_vaud_consumers[] = { |
| 143 | /* AB8500 audio-codec main supply */ |
| 144 | REGULATOR_SUPPLY("vaud", "ab8500-codec.0"), |
| 145 | }; |
| 146 | |
| 147 | static struct regulator_consumer_supply ab8500_vamic1_consumers[] = { |
| 148 | /* AB8500 audio-codec Mic1 supply */ |
| 149 | REGULATOR_SUPPLY("vamic1", "ab8500-codec.0"), |
| 150 | }; |
| 151 | |
| 152 | static struct regulator_consumer_supply ab8500_vamic2_consumers[] = { |
| 153 | /* AB8500 audio-codec Mic2 supply */ |
| 154 | REGULATOR_SUPPLY("vamic2", "ab8500-codec.0"), |
| 155 | }; |
| 156 | |
| 157 | static struct regulator_consumer_supply ab8500_vdmic_consumers[] = { |
| 158 | /* AB8500 audio-codec DMic supply */ |
| 159 | REGULATOR_SUPPLY("vdmic", "ab8500-codec.0"), |
| 160 | }; |
| 161 | |
Linus Walleij | d1de85a | 2010-12-02 17:10:14 +0100 | [diff] [blame] | 162 | static struct regulator_consumer_supply ab8500_vintcore_consumers[] = { |
| 163 | /* SoC core supply, no device */ |
| 164 | REGULATOR_SUPPLY("v-intcore", NULL), |
Joe Perches | 7c9d440 | 2011-06-23 11:39:20 -0700 | [diff] [blame] | 165 | /* USB Transceiver */ |
Linus Walleij | d1de85a | 2010-12-02 17:10:14 +0100 | [diff] [blame] | 166 | REGULATOR_SUPPLY("vddulpivio18", "ab8500-usb.0"), |
Lee Jones | a652f3d | 2013-04-02 13:24:21 +0100 | [diff] [blame] | 167 | /* Handled by abx500 clk driver */ |
| 168 | REGULATOR_SUPPLY("v-intcore", "abx500-clk.0"), |
Linus Walleij | d1de85a | 2010-12-02 17:10:14 +0100 | [diff] [blame] | 169 | }; |
| 170 | |
Lee Jones | 547f384 | 2013-03-28 16:11:14 +0000 | [diff] [blame] | 171 | static struct regulator_consumer_supply ab8505_usb_consumers[] = { |
| 172 | /* HS USB OTG physical interface */ |
| 173 | REGULATOR_SUPPLY("v-ape", NULL), |
| 174 | }; |
| 175 | |
Linus Walleij | d1de85a | 2010-12-02 17:10:14 +0100 | [diff] [blame] | 176 | static struct regulator_consumer_supply ab8500_vana_consumers[] = { |
Lee Jones | a652f3d | 2013-04-02 13:24:21 +0100 | [diff] [blame] | 177 | /* DB8500 DSI */ |
| 178 | REGULATOR_SUPPLY("vdddsi1v2", "mcde"), |
| 179 | REGULATOR_SUPPLY("vdddsi1v2", "b2r2_core"), |
| 180 | REGULATOR_SUPPLY("vdddsi1v2", "b2r2_1_core"), |
| 181 | REGULATOR_SUPPLY("vdddsi1v2", "dsilink.0"), |
| 182 | REGULATOR_SUPPLY("vdddsi1v2", "dsilink.1"), |
| 183 | REGULATOR_SUPPLY("vdddsi1v2", "dsilink.2"), |
| 184 | /* DB8500 CSI */ |
| 185 | REGULATOR_SUPPLY("vddcsi1v2", "mmio_camera"), |
Linus Walleij | d1de85a | 2010-12-02 17:10:14 +0100 | [diff] [blame] | 186 | }; |
Sundar Iyer | 4f724be | 2010-09-15 10:50:59 +0100 | [diff] [blame] | 187 | |
Bengt Jonsson | dfa3a82 | 2011-03-09 13:34:17 +0100 | [diff] [blame] | 188 | /* ab8500 regulator register initialization */ |
Bengt Jonsson | 732805a | 2013-03-21 15:59:03 +0000 | [diff] [blame] | 189 | static struct ab8500_regulator_reg_init ab8500_reg_init[] = { |
Bengt Jonsson | dfa3a82 | 2011-03-09 13:34:17 +0100 | [diff] [blame] | 190 | /* |
| 191 | * VanaRequestCtrl = HP/LP depending on VxRequest |
| 192 | * VextSupply1RequestCtrl = HP/LP depending on VxRequest |
| 193 | */ |
Lee Jones | 43a5911 | 2013-03-21 15:59:15 +0000 | [diff] [blame] | 194 | INIT_REGULATOR_REGISTER(AB8500_REGUREQUESTCTRL2, 0xf0, 0x00), |
Bengt Jonsson | dfa3a82 | 2011-03-09 13:34:17 +0100 | [diff] [blame] | 195 | /* |
| 196 | * VextSupply2RequestCtrl = HP/LP depending on VxRequest |
| 197 | * VextSupply3RequestCtrl = HP/LP depending on VxRequest |
| 198 | * Vaux1RequestCtrl = HP/LP depending on VxRequest |
| 199 | * Vaux2RequestCtrl = HP/LP depending on VxRequest |
| 200 | */ |
Lee Jones | 3c1b843 | 2013-03-21 15:59:01 +0000 | [diff] [blame] | 201 | INIT_REGULATOR_REGISTER(AB8500_REGUREQUESTCTRL3, 0xff, 0x00), |
Bengt Jonsson | dfa3a82 | 2011-03-09 13:34:17 +0100 | [diff] [blame] | 202 | /* |
| 203 | * Vaux3RequestCtrl = HP/LP depending on VxRequest |
| 204 | * SwHPReq = Control through SWValid disabled |
| 205 | */ |
Lee Jones | 3c1b843 | 2013-03-21 15:59:01 +0000 | [diff] [blame] | 206 | INIT_REGULATOR_REGISTER(AB8500_REGUREQUESTCTRL4, 0x07, 0x00), |
Bengt Jonsson | dfa3a82 | 2011-03-09 13:34:17 +0100 | [diff] [blame] | 207 | /* |
| 208 | * VanaSysClkReq1HPValid = disabled |
| 209 | * Vaux1SysClkReq1HPValid = disabled |
| 210 | * Vaux2SysClkReq1HPValid = disabled |
| 211 | * Vaux3SysClkReq1HPValid = disabled |
| 212 | */ |
Lee Jones | 43a5911 | 2013-03-21 15:59:15 +0000 | [diff] [blame] | 213 | INIT_REGULATOR_REGISTER(AB8500_REGUSYSCLKREQ1HPVALID1, 0xe8, 0x00), |
Bengt Jonsson | dfa3a82 | 2011-03-09 13:34:17 +0100 | [diff] [blame] | 214 | /* |
| 215 | * VextSupply1SysClkReq1HPValid = disabled |
| 216 | * VextSupply2SysClkReq1HPValid = disabled |
| 217 | * VextSupply3SysClkReq1HPValid = SysClkReq1 controlled |
| 218 | */ |
Lee Jones | 3c1b843 | 2013-03-21 15:59:01 +0000 | [diff] [blame] | 219 | INIT_REGULATOR_REGISTER(AB8500_REGUSYSCLKREQ1HPVALID2, 0x70, 0x40), |
Bengt Jonsson | dfa3a82 | 2011-03-09 13:34:17 +0100 | [diff] [blame] | 220 | /* |
| 221 | * VanaHwHPReq1Valid = disabled |
| 222 | * Vaux1HwHPreq1Valid = disabled |
| 223 | * Vaux2HwHPReq1Valid = disabled |
| 224 | * Vaux3HwHPReqValid = disabled |
| 225 | */ |
Lee Jones | 3c1b843 | 2013-03-21 15:59:01 +0000 | [diff] [blame] | 226 | INIT_REGULATOR_REGISTER(AB8500_REGUHWHPREQ1VALID1, 0xe8, 0x00), |
Bengt Jonsson | dfa3a82 | 2011-03-09 13:34:17 +0100 | [diff] [blame] | 227 | /* |
| 228 | * VextSupply1HwHPReq1Valid = disabled |
| 229 | * VextSupply2HwHPReq1Valid = disabled |
| 230 | * VextSupply3HwHPReq1Valid = disabled |
| 231 | */ |
Lee Jones | 3c1b843 | 2013-03-21 15:59:01 +0000 | [diff] [blame] | 232 | INIT_REGULATOR_REGISTER(AB8500_REGUHWHPREQ1VALID2, 0x07, 0x00), |
Bengt Jonsson | dfa3a82 | 2011-03-09 13:34:17 +0100 | [diff] [blame] | 233 | /* |
| 234 | * VanaHwHPReq2Valid = disabled |
| 235 | * Vaux1HwHPReq2Valid = disabled |
| 236 | * Vaux2HwHPReq2Valid = disabled |
| 237 | * Vaux3HwHPReq2Valid = disabled |
| 238 | */ |
Lee Jones | 3c1b843 | 2013-03-21 15:59:01 +0000 | [diff] [blame] | 239 | INIT_REGULATOR_REGISTER(AB8500_REGUHWHPREQ2VALID1, 0xe8, 0x00), |
Bengt Jonsson | dfa3a82 | 2011-03-09 13:34:17 +0100 | [diff] [blame] | 240 | /* |
| 241 | * VextSupply1HwHPReq2Valid = disabled |
| 242 | * VextSupply2HwHPReq2Valid = disabled |
| 243 | * VextSupply3HwHPReq2Valid = HWReq2 controlled |
| 244 | */ |
Lee Jones | 3c1b843 | 2013-03-21 15:59:01 +0000 | [diff] [blame] | 245 | INIT_REGULATOR_REGISTER(AB8500_REGUHWHPREQ2VALID2, 0x07, 0x04), |
Bengt Jonsson | dfa3a82 | 2011-03-09 13:34:17 +0100 | [diff] [blame] | 246 | /* |
| 247 | * VanaSwHPReqValid = disabled |
| 248 | * Vaux1SwHPReqValid = disabled |
| 249 | */ |
Lee Jones | 3c1b843 | 2013-03-21 15:59:01 +0000 | [diff] [blame] | 250 | INIT_REGULATOR_REGISTER(AB8500_REGUSWHPREQVALID1, 0xa0, 0x00), |
Bengt Jonsson | dfa3a82 | 2011-03-09 13:34:17 +0100 | [diff] [blame] | 251 | /* |
| 252 | * Vaux2SwHPReqValid = disabled |
| 253 | * Vaux3SwHPReqValid = disabled |
| 254 | * VextSupply1SwHPReqValid = disabled |
| 255 | * VextSupply2SwHPReqValid = disabled |
| 256 | * VextSupply3SwHPReqValid = disabled |
| 257 | */ |
Lee Jones | 3c1b843 | 2013-03-21 15:59:01 +0000 | [diff] [blame] | 258 | INIT_REGULATOR_REGISTER(AB8500_REGUSWHPREQVALID2, 0x1f, 0x00), |
Bengt Jonsson | dfa3a82 | 2011-03-09 13:34:17 +0100 | [diff] [blame] | 259 | /* |
| 260 | * SysClkReq2Valid1 = SysClkReq2 controlled |
| 261 | * SysClkReq3Valid1 = disabled |
| 262 | * SysClkReq4Valid1 = SysClkReq4 controlled |
| 263 | * SysClkReq5Valid1 = disabled |
| 264 | * SysClkReq6Valid1 = SysClkReq6 controlled |
| 265 | * SysClkReq7Valid1 = disabled |
| 266 | * SysClkReq8Valid1 = disabled |
| 267 | */ |
Lee Jones | 3c1b843 | 2013-03-21 15:59:01 +0000 | [diff] [blame] | 268 | INIT_REGULATOR_REGISTER(AB8500_REGUSYSCLKREQVALID1, 0xfe, 0x2a), |
Bengt Jonsson | dfa3a82 | 2011-03-09 13:34:17 +0100 | [diff] [blame] | 269 | /* |
| 270 | * SysClkReq2Valid2 = disabled |
| 271 | * SysClkReq3Valid2 = disabled |
| 272 | * SysClkReq4Valid2 = disabled |
| 273 | * SysClkReq5Valid2 = disabled |
| 274 | * SysClkReq6Valid2 = SysClkReq6 controlled |
| 275 | * SysClkReq7Valid2 = disabled |
| 276 | * SysClkReq8Valid2 = disabled |
| 277 | */ |
Lee Jones | 3c1b843 | 2013-03-21 15:59:01 +0000 | [diff] [blame] | 278 | INIT_REGULATOR_REGISTER(AB8500_REGUSYSCLKREQVALID2, 0xfe, 0x20), |
Bengt Jonsson | dfa3a82 | 2011-03-09 13:34:17 +0100 | [diff] [blame] | 279 | /* |
| 280 | * VTVoutEna = disabled |
| 281 | * Vintcore12Ena = disabled |
| 282 | * Vintcore12Sel = 1.25 V |
| 283 | * Vintcore12LP = inactive (HP) |
| 284 | * VTVoutLP = inactive (HP) |
| 285 | */ |
Lee Jones | 3c1b843 | 2013-03-21 15:59:01 +0000 | [diff] [blame] | 286 | INIT_REGULATOR_REGISTER(AB8500_REGUMISC1, 0xfe, 0x10), |
Bengt Jonsson | dfa3a82 | 2011-03-09 13:34:17 +0100 | [diff] [blame] | 287 | /* |
| 288 | * VaudioEna = disabled |
| 289 | * VdmicEna = disabled |
| 290 | * Vamic1Ena = disabled |
| 291 | * Vamic2Ena = disabled |
| 292 | */ |
Lee Jones | 3c1b843 | 2013-03-21 15:59:01 +0000 | [diff] [blame] | 293 | INIT_REGULATOR_REGISTER(AB8500_VAUDIOSUPPLY, 0x1e, 0x00), |
Bengt Jonsson | dfa3a82 | 2011-03-09 13:34:17 +0100 | [diff] [blame] | 294 | /* |
| 295 | * Vamic1_dzout = high-Z when Vamic1 is disabled |
| 296 | * Vamic2_dzout = high-Z when Vamic2 is disabled |
| 297 | */ |
Lee Jones | 3c1b843 | 2013-03-21 15:59:01 +0000 | [diff] [blame] | 298 | INIT_REGULATOR_REGISTER(AB8500_REGUCTRL1VAMIC, 0x03, 0x00), |
Bengt Jonsson | dfa3a82 | 2011-03-09 13:34:17 +0100 | [diff] [blame] | 299 | /* |
Lee Jones | 43a5911 | 2013-03-21 15:59:15 +0000 | [diff] [blame] | 300 | * VPll = Hw controlled (NOTE! PRCMU bits) |
Bengt Jonsson | dfa3a82 | 2011-03-09 13:34:17 +0100 | [diff] [blame] | 301 | * VanaRegu = force off |
| 302 | */ |
Lee Jones | 3c1b843 | 2013-03-21 15:59:01 +0000 | [diff] [blame] | 303 | INIT_REGULATOR_REGISTER(AB8500_VPLLVANAREGU, 0x0f, 0x02), |
Bengt Jonsson | dfa3a82 | 2011-03-09 13:34:17 +0100 | [diff] [blame] | 304 | /* |
| 305 | * VrefDDREna = disabled |
| 306 | * VrefDDRSleepMode = inactive (no pulldown) |
| 307 | */ |
Lee Jones | 3c1b843 | 2013-03-21 15:59:01 +0000 | [diff] [blame] | 308 | INIT_REGULATOR_REGISTER(AB8500_VREFDDR, 0x03, 0x00), |
Bengt Jonsson | dfa3a82 | 2011-03-09 13:34:17 +0100 | [diff] [blame] | 309 | /* |
Lee Jones | a387ac5 | 2013-03-28 16:11:02 +0000 | [diff] [blame] | 310 | * VextSupply1Regu = force LP |
| 311 | * VextSupply2Regu = force OFF |
| 312 | * VextSupply3Regu = force HP (-> STBB2=LP and TPS=LP) |
Bengt Jonsson | dfa3a82 | 2011-03-09 13:34:17 +0100 | [diff] [blame] | 313 | * ExtSupply2Bypass = ExtSupply12LPn ball is 0 when Ena is 0 |
| 314 | * ExtSupply3Bypass = ExtSupply3LPn ball is 0 when Ena is 0 |
| 315 | */ |
Lee Jones | a387ac5 | 2013-03-28 16:11:02 +0000 | [diff] [blame] | 316 | INIT_REGULATOR_REGISTER(AB8500_EXTSUPPLYREGU, 0xff, 0x13), |
Bengt Jonsson | dfa3a82 | 2011-03-09 13:34:17 +0100 | [diff] [blame] | 317 | /* |
| 318 | * Vaux1Regu = force HP |
| 319 | * Vaux2Regu = force off |
| 320 | */ |
Lee Jones | 3c1b843 | 2013-03-21 15:59:01 +0000 | [diff] [blame] | 321 | INIT_REGULATOR_REGISTER(AB8500_VAUX12REGU, 0x0f, 0x01), |
Bengt Jonsson | dfa3a82 | 2011-03-09 13:34:17 +0100 | [diff] [blame] | 322 | /* |
Lee Jones | d79df32 | 2013-03-21 15:58:58 +0000 | [diff] [blame] | 323 | * Vaux3Regu = force off |
Bengt Jonsson | dfa3a82 | 2011-03-09 13:34:17 +0100 | [diff] [blame] | 324 | */ |
Lee Jones | 43a5911 | 2013-03-21 15:59:15 +0000 | [diff] [blame] | 325 | INIT_REGULATOR_REGISTER(AB8500_VRF1VAUX3REGU, 0x03, 0x00), |
Bengt Jonsson | dfa3a82 | 2011-03-09 13:34:17 +0100 | [diff] [blame] | 326 | /* |
Lee Jones | a652f3d | 2013-04-02 13:24:21 +0100 | [diff] [blame] | 327 | * Vaux1Sel = 2.8 V |
Bengt Jonsson | dfa3a82 | 2011-03-09 13:34:17 +0100 | [diff] [blame] | 328 | */ |
Lee Jones | a652f3d | 2013-04-02 13:24:21 +0100 | [diff] [blame] | 329 | INIT_REGULATOR_REGISTER(AB8500_VAUX1SEL, 0x0f, 0x0C), |
Bengt Jonsson | dfa3a82 | 2011-03-09 13:34:17 +0100 | [diff] [blame] | 330 | /* |
| 331 | * Vaux2Sel = 2.9 V |
| 332 | */ |
Lee Jones | 3c1b843 | 2013-03-21 15:59:01 +0000 | [diff] [blame] | 333 | INIT_REGULATOR_REGISTER(AB8500_VAUX2SEL, 0x0f, 0x0d), |
Bengt Jonsson | dfa3a82 | 2011-03-09 13:34:17 +0100 | [diff] [blame] | 334 | /* |
| 335 | * Vaux3Sel = 2.91 V |
| 336 | */ |
Lee Jones | 3c1b843 | 2013-03-21 15:59:01 +0000 | [diff] [blame] | 337 | INIT_REGULATOR_REGISTER(AB8500_VRF1VAUX3SEL, 0x07, 0x07), |
Bengt Jonsson | dfa3a82 | 2011-03-09 13:34:17 +0100 | [diff] [blame] | 338 | /* |
| 339 | * VextSupply12LP = disabled (no LP) |
| 340 | */ |
Lee Jones | 3c1b843 | 2013-03-21 15:59:01 +0000 | [diff] [blame] | 341 | INIT_REGULATOR_REGISTER(AB8500_REGUCTRL2SPARE, 0x01, 0x00), |
Bengt Jonsson | dfa3a82 | 2011-03-09 13:34:17 +0100 | [diff] [blame] | 342 | /* |
| 343 | * Vaux1Disch = short discharge time |
| 344 | * Vaux2Disch = short discharge time |
| 345 | * Vaux3Disch = short discharge time |
| 346 | * Vintcore12Disch = short discharge time |
| 347 | * VTVoutDisch = short discharge time |
| 348 | * VaudioDisch = short discharge time |
| 349 | */ |
Lee Jones | 3c1b843 | 2013-03-21 15:59:01 +0000 | [diff] [blame] | 350 | INIT_REGULATOR_REGISTER(AB8500_REGUCTRLDISCH, 0xfc, 0x00), |
Bengt Jonsson | dfa3a82 | 2011-03-09 13:34:17 +0100 | [diff] [blame] | 351 | /* |
| 352 | * VanaDisch = short discharge time |
| 353 | * VdmicPullDownEna = pulldown disabled when Vdmic is disabled |
| 354 | * VdmicDisch = short discharge time |
| 355 | */ |
Lee Jones | 3c1b843 | 2013-03-21 15:59:01 +0000 | [diff] [blame] | 356 | INIT_REGULATOR_REGISTER(AB8500_REGUCTRLDISCH2, 0x16, 0x00), |
Bengt Jonsson | dfa3a82 | 2011-03-09 13:34:17 +0100 | [diff] [blame] | 357 | }; |
| 358 | |
Bengt Jonsson | a1e516e | 2010-12-10 11:08:48 +0100 | [diff] [blame] | 359 | /* AB8500 regulators */ |
Bengt Jonsson | 732805a | 2013-03-21 15:59:03 +0000 | [diff] [blame] | 360 | static struct regulator_init_data ab8500_regulators[AB8500_NUM_REGULATORS] = { |
Bengt Jonsson | a1e516e | 2010-12-10 11:08:48 +0100 | [diff] [blame] | 361 | /* supplies to the display/camera */ |
| 362 | [AB8500_LDO_AUX1] = { |
Lee Jones | 67b7c75e | 2013-05-24 12:22:19 +0100 | [diff] [blame] | 363 | .supply_regulator = "ab8500-ext-supply3", |
Bengt Jonsson | a1e516e | 2010-12-10 11:08:48 +0100 | [diff] [blame] | 364 | .constraints = { |
| 365 | .name = "V-DISPLAY", |
Lee Jones | a652f3d | 2013-04-02 13:24:21 +0100 | [diff] [blame] | 366 | .min_uV = 2800000, |
| 367 | .max_uV = 3300000, |
Bengt Jonsson | a1e516e | 2010-12-10 11:08:48 +0100 | [diff] [blame] | 368 | .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE | |
| 369 | REGULATOR_CHANGE_STATUS, |
Linus Walleij | db24520 | 2011-04-04 10:44:51 +0200 | [diff] [blame] | 370 | .boot_on = 1, /* display is on at boot */ |
Bengt Jonsson | a1e516e | 2010-12-10 11:08:48 +0100 | [diff] [blame] | 371 | }, |
Linus Walleij | d1de85a | 2010-12-02 17:10:14 +0100 | [diff] [blame] | 372 | .num_consumer_supplies = ARRAY_SIZE(ab8500_vaux1_consumers), |
| 373 | .consumer_supplies = ab8500_vaux1_consumers, |
Bengt Jonsson | a1e516e | 2010-12-10 11:08:48 +0100 | [diff] [blame] | 374 | }, |
| 375 | /* supplies to the on-board eMMC */ |
| 376 | [AB8500_LDO_AUX2] = { |
Lee Jones | 67b7c75e | 2013-05-24 12:22:19 +0100 | [diff] [blame] | 377 | .supply_regulator = "ab8500-ext-supply3", |
Bengt Jonsson | a1e516e | 2010-12-10 11:08:48 +0100 | [diff] [blame] | 378 | .constraints = { |
| 379 | .name = "V-eMMC1", |
| 380 | .min_uV = 1100000, |
| 381 | .max_uV = 3300000, |
| 382 | .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE | |
Lee Jones | a652f3d | 2013-04-02 13:24:21 +0100 | [diff] [blame] | 383 | REGULATOR_CHANGE_STATUS | |
| 384 | REGULATOR_CHANGE_MODE, |
| 385 | .valid_modes_mask = REGULATOR_MODE_NORMAL | |
| 386 | REGULATOR_MODE_IDLE, |
Bengt Jonsson | a1e516e | 2010-12-10 11:08:48 +0100 | [diff] [blame] | 387 | }, |
Linus Walleij | d1de85a | 2010-12-02 17:10:14 +0100 | [diff] [blame] | 388 | .num_consumer_supplies = ARRAY_SIZE(ab8500_vaux2_consumers), |
| 389 | .consumer_supplies = ab8500_vaux2_consumers, |
Bengt Jonsson | a1e516e | 2010-12-10 11:08:48 +0100 | [diff] [blame] | 390 | }, |
| 391 | /* supply for VAUX3, supplies to SDcard slots */ |
| 392 | [AB8500_LDO_AUX3] = { |
Lee Jones | 67b7c75e | 2013-05-24 12:22:19 +0100 | [diff] [blame] | 393 | .supply_regulator = "ab8500-ext-supply3", |
Bengt Jonsson | a1e516e | 2010-12-10 11:08:48 +0100 | [diff] [blame] | 394 | .constraints = { |
| 395 | .name = "V-MMC-SD", |
| 396 | .min_uV = 1100000, |
| 397 | .max_uV = 3300000, |
| 398 | .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE | |
Lee Jones | a652f3d | 2013-04-02 13:24:21 +0100 | [diff] [blame] | 399 | REGULATOR_CHANGE_STATUS | |
| 400 | REGULATOR_CHANGE_MODE, |
| 401 | .valid_modes_mask = REGULATOR_MODE_NORMAL | |
| 402 | REGULATOR_MODE_IDLE, |
Bengt Jonsson | a1e516e | 2010-12-10 11:08:48 +0100 | [diff] [blame] | 403 | }, |
Linus Walleij | d1de85a | 2010-12-02 17:10:14 +0100 | [diff] [blame] | 404 | .num_consumer_supplies = ARRAY_SIZE(ab8500_vaux3_consumers), |
| 405 | .consumer_supplies = ab8500_vaux3_consumers, |
Bengt Jonsson | a1e516e | 2010-12-10 11:08:48 +0100 | [diff] [blame] | 406 | }, |
| 407 | /* supply for tvout, gpadc, TVOUT LDO */ |
| 408 | [AB8500_LDO_TVOUT] = { |
| 409 | .constraints = { |
| 410 | .name = "V-TVOUT", |
| 411 | .valid_ops_mask = REGULATOR_CHANGE_STATUS, |
| 412 | }, |
Linus Walleij | d1de85a | 2010-12-02 17:10:14 +0100 | [diff] [blame] | 413 | .num_consumer_supplies = ARRAY_SIZE(ab8500_vtvout_consumers), |
| 414 | .consumer_supplies = ab8500_vtvout_consumers, |
Bengt Jonsson | a1e516e | 2010-12-10 11:08:48 +0100 | [diff] [blame] | 415 | }, |
| 416 | /* supply for ab8500-vaudio, VAUDIO LDO */ |
| 417 | [AB8500_LDO_AUDIO] = { |
| 418 | .constraints = { |
| 419 | .name = "V-AUD", |
| 420 | .valid_ops_mask = REGULATOR_CHANGE_STATUS, |
| 421 | }, |
Ola Lilja | 29bd2ab | 2012-02-01 14:18:10 +0100 | [diff] [blame] | 422 | .num_consumer_supplies = ARRAY_SIZE(ab8500_vaud_consumers), |
| 423 | .consumer_supplies = ab8500_vaud_consumers, |
Bengt Jonsson | a1e516e | 2010-12-10 11:08:48 +0100 | [diff] [blame] | 424 | }, |
| 425 | /* supply for v-anamic1 VAMic1-LDO */ |
| 426 | [AB8500_LDO_ANAMIC1] = { |
| 427 | .constraints = { |
| 428 | .name = "V-AMIC1", |
| 429 | .valid_ops_mask = REGULATOR_CHANGE_STATUS, |
| 430 | }, |
Ola Lilja | 29bd2ab | 2012-02-01 14:18:10 +0100 | [diff] [blame] | 431 | .num_consumer_supplies = ARRAY_SIZE(ab8500_vamic1_consumers), |
| 432 | .consumer_supplies = ab8500_vamic1_consumers, |
Bengt Jonsson | a1e516e | 2010-12-10 11:08:48 +0100 | [diff] [blame] | 433 | }, |
| 434 | /* supply for v-amic2, VAMIC2 LDO, reuse constants for AMIC1 */ |
| 435 | [AB8500_LDO_ANAMIC2] = { |
| 436 | .constraints = { |
| 437 | .name = "V-AMIC2", |
| 438 | .valid_ops_mask = REGULATOR_CHANGE_STATUS, |
| 439 | }, |
Ola Lilja | 29bd2ab | 2012-02-01 14:18:10 +0100 | [diff] [blame] | 440 | .num_consumer_supplies = ARRAY_SIZE(ab8500_vamic2_consumers), |
| 441 | .consumer_supplies = ab8500_vamic2_consumers, |
Bengt Jonsson | a1e516e | 2010-12-10 11:08:48 +0100 | [diff] [blame] | 442 | }, |
| 443 | /* supply for v-dmic, VDMIC LDO */ |
| 444 | [AB8500_LDO_DMIC] = { |
| 445 | .constraints = { |
| 446 | .name = "V-DMIC", |
| 447 | .valid_ops_mask = REGULATOR_CHANGE_STATUS, |
| 448 | }, |
Ola Lilja | 29bd2ab | 2012-02-01 14:18:10 +0100 | [diff] [blame] | 449 | .num_consumer_supplies = ARRAY_SIZE(ab8500_vdmic_consumers), |
| 450 | .consumer_supplies = ab8500_vdmic_consumers, |
Bengt Jonsson | a1e516e | 2010-12-10 11:08:48 +0100 | [diff] [blame] | 451 | }, |
| 452 | /* supply for v-intcore12, VINTCORE12 LDO */ |
| 453 | [AB8500_LDO_INTCORE] = { |
| 454 | .constraints = { |
| 455 | .name = "V-INTCORE", |
Lee Jones | a652f3d | 2013-04-02 13:24:21 +0100 | [diff] [blame] | 456 | .min_uV = 1250000, |
| 457 | .max_uV = 1350000, |
| 458 | .input_uV = 1800000, |
| 459 | .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE | |
| 460 | REGULATOR_CHANGE_STATUS | |
| 461 | REGULATOR_CHANGE_MODE | |
| 462 | REGULATOR_CHANGE_DRMS, |
| 463 | .valid_modes_mask = REGULATOR_MODE_NORMAL | |
| 464 | REGULATOR_MODE_IDLE, |
Bengt Jonsson | a1e516e | 2010-12-10 11:08:48 +0100 | [diff] [blame] | 465 | }, |
Linus Walleij | d1de85a | 2010-12-02 17:10:14 +0100 | [diff] [blame] | 466 | .num_consumer_supplies = ARRAY_SIZE(ab8500_vintcore_consumers), |
| 467 | .consumer_supplies = ab8500_vintcore_consumers, |
Bengt Jonsson | a1e516e | 2010-12-10 11:08:48 +0100 | [diff] [blame] | 468 | }, |
Lee Jones | a652f3d | 2013-04-02 13:24:21 +0100 | [diff] [blame] | 469 | /* supply for U8500 CSI-DSI, VANA LDO */ |
Bengt Jonsson | a1e516e | 2010-12-10 11:08:48 +0100 | [diff] [blame] | 470 | [AB8500_LDO_ANA] = { |
| 471 | .constraints = { |
Lee Jones | a652f3d | 2013-04-02 13:24:21 +0100 | [diff] [blame] | 472 | .name = "V-CSI-DSI", |
Bengt Jonsson | a1e516e | 2010-12-10 11:08:48 +0100 | [diff] [blame] | 473 | .valid_ops_mask = REGULATOR_CHANGE_STATUS, |
| 474 | }, |
Linus Walleij | d1de85a | 2010-12-02 17:10:14 +0100 | [diff] [blame] | 475 | .num_consumer_supplies = ARRAY_SIZE(ab8500_vana_consumers), |
| 476 | .consumer_supplies = ab8500_vana_consumers, |
Sundar Iyer | 4f724be | 2010-09-15 10:50:59 +0100 | [diff] [blame] | 477 | }, |
| 478 | }; |
Bengt Jonsson | 732805a | 2013-03-21 15:59:03 +0000 | [diff] [blame] | 479 | |
Lee Jones | a387ac5 | 2013-03-28 16:11:02 +0000 | [diff] [blame] | 480 | /* supply for VextSupply3 */ |
| 481 | static struct regulator_consumer_supply ab8500_ext_supply3_consumers[] = { |
| 482 | /* SIM supply for 3 V SIM cards */ |
| 483 | REGULATOR_SUPPLY("vinvsim", "sim-detect.0"), |
| 484 | }; |
| 485 | |
| 486 | /* extended configuration for VextSupply2, only used for HREFP_V20 boards */ |
| 487 | static struct ab8500_ext_regulator_cfg ab8500_ext_supply2 = { |
| 488 | .hwreq = true, |
| 489 | }; |
| 490 | |
| 491 | /* |
| 492 | * AB8500 external regulators |
| 493 | */ |
| 494 | static struct regulator_init_data ab8500_ext_regulators[] = { |
| 495 | /* fixed Vbat supplies VSMPS1_EXT_1V8 */ |
| 496 | [AB8500_EXT_SUPPLY1] = { |
| 497 | .constraints = { |
| 498 | .name = "ab8500-ext-supply1", |
| 499 | .min_uV = 1800000, |
| 500 | .max_uV = 1800000, |
| 501 | .initial_mode = REGULATOR_MODE_IDLE, |
| 502 | .boot_on = 1, |
| 503 | .always_on = 1, |
| 504 | }, |
| 505 | }, |
| 506 | /* fixed Vbat supplies VSMPS2_EXT_1V36 and VSMPS5_EXT_1V15 */ |
| 507 | [AB8500_EXT_SUPPLY2] = { |
| 508 | .constraints = { |
| 509 | .name = "ab8500-ext-supply2", |
| 510 | .min_uV = 1360000, |
| 511 | .max_uV = 1360000, |
| 512 | }, |
| 513 | }, |
| 514 | /* fixed Vbat supplies VSMPS3_EXT_3V4 and VSMPS4_EXT_3V4 */ |
| 515 | [AB8500_EXT_SUPPLY3] = { |
| 516 | .constraints = { |
| 517 | .name = "ab8500-ext-supply3", |
| 518 | .min_uV = 3400000, |
| 519 | .max_uV = 3400000, |
| 520 | .valid_ops_mask = REGULATOR_CHANGE_STATUS, |
| 521 | .boot_on = 1, |
| 522 | }, |
| 523 | .num_consumer_supplies = |
| 524 | ARRAY_SIZE(ab8500_ext_supply3_consumers), |
| 525 | .consumer_supplies = ab8500_ext_supply3_consumers, |
| 526 | }, |
| 527 | }; |
| 528 | |
Lee Jones | 547f384 | 2013-03-28 16:11:14 +0000 | [diff] [blame] | 529 | /* ab8505 regulator register initialization */ |
| 530 | static struct ab8500_regulator_reg_init ab8505_reg_init[] = { |
| 531 | /* |
| 532 | * VarmRequestCtrl |
| 533 | * VsmpsCRequestCtrl |
| 534 | * VsmpsARequestCtrl |
| 535 | * VsmpsBRequestCtrl |
| 536 | */ |
| 537 | INIT_REGULATOR_REGISTER(AB8505_REGUREQUESTCTRL1, 0x00, 0x00), |
| 538 | /* |
| 539 | * VsafeRequestCtrl |
| 540 | * VpllRequestCtrl |
| 541 | * VanaRequestCtrl = HP/LP depending on VxRequest |
| 542 | */ |
| 543 | INIT_REGULATOR_REGISTER(AB8505_REGUREQUESTCTRL2, 0x30, 0x00), |
| 544 | /* |
| 545 | * Vaux1RequestCtrl = HP/LP depending on VxRequest |
| 546 | * Vaux2RequestCtrl = HP/LP depending on VxRequest |
| 547 | */ |
| 548 | INIT_REGULATOR_REGISTER(AB8505_REGUREQUESTCTRL3, 0xf0, 0x00), |
| 549 | /* |
| 550 | * Vaux3RequestCtrl = HP/LP depending on VxRequest |
| 551 | * SwHPReq = Control through SWValid disabled |
| 552 | */ |
| 553 | INIT_REGULATOR_REGISTER(AB8505_REGUREQUESTCTRL4, 0x07, 0x00), |
| 554 | /* |
| 555 | * VsmpsASysClkReq1HPValid |
| 556 | * VsmpsBSysClkReq1HPValid |
| 557 | * VsafeSysClkReq1HPValid |
| 558 | * VanaSysClkReq1HPValid = disabled |
| 559 | * VpllSysClkReq1HPValid |
| 560 | * Vaux1SysClkReq1HPValid = disabled |
| 561 | * Vaux2SysClkReq1HPValid = disabled |
| 562 | * Vaux3SysClkReq1HPValid = disabled |
| 563 | */ |
| 564 | INIT_REGULATOR_REGISTER(AB8505_REGUSYSCLKREQ1HPVALID1, 0xe8, 0x00), |
| 565 | /* |
| 566 | * VsmpsCSysClkReq1HPValid |
| 567 | * VarmSysClkReq1HPValid |
| 568 | * VbbSysClkReq1HPValid |
| 569 | * VsmpsMSysClkReq1HPValid |
| 570 | */ |
| 571 | INIT_REGULATOR_REGISTER(AB8505_REGUSYSCLKREQ1HPVALID2, 0x00, 0x00), |
| 572 | /* |
| 573 | * VsmpsAHwHPReq1Valid |
| 574 | * VsmpsBHwHPReq1Valid |
| 575 | * VsafeHwHPReq1Valid |
| 576 | * VanaHwHPReq1Valid = disabled |
| 577 | * VpllHwHPReq1Valid |
| 578 | * Vaux1HwHPreq1Valid = disabled |
| 579 | * Vaux2HwHPReq1Valid = disabled |
| 580 | * Vaux3HwHPReqValid = disabled |
| 581 | */ |
| 582 | INIT_REGULATOR_REGISTER(AB8505_REGUHWHPREQ1VALID1, 0xe8, 0x00), |
| 583 | /* |
| 584 | * VsmpsMHwHPReq1Valid |
| 585 | */ |
| 586 | INIT_REGULATOR_REGISTER(AB8505_REGUHWHPREQ1VALID2, 0x00, 0x00), |
| 587 | /* |
| 588 | * VsmpsAHwHPReq2Valid |
| 589 | * VsmpsBHwHPReq2Valid |
| 590 | * VsafeHwHPReq2Valid |
| 591 | * VanaHwHPReq2Valid = disabled |
| 592 | * VpllHwHPReq2Valid |
| 593 | * Vaux1HwHPReq2Valid = disabled |
| 594 | * Vaux2HwHPReq2Valid = disabled |
| 595 | * Vaux3HwHPReq2Valid = disabled |
| 596 | */ |
| 597 | INIT_REGULATOR_REGISTER(AB8505_REGUHWHPREQ2VALID1, 0xe8, 0x00), |
| 598 | /* |
| 599 | * VsmpsMHwHPReq2Valid |
| 600 | */ |
| 601 | INIT_REGULATOR_REGISTER(AB8505_REGUHWHPREQ2VALID2, 0x00, 0x00), |
| 602 | /** |
| 603 | * VsmpsCSwHPReqValid |
| 604 | * VarmSwHPReqValid |
| 605 | * VsmpsASwHPReqValid |
| 606 | * VsmpsBSwHPReqValid |
| 607 | * VsafeSwHPReqValid |
| 608 | * VanaSwHPReqValid |
| 609 | * VanaSwHPReqValid = disabled |
| 610 | * VpllSwHPReqValid |
| 611 | * Vaux1SwHPReqValid = disabled |
| 612 | */ |
| 613 | INIT_REGULATOR_REGISTER(AB8505_REGUSWHPREQVALID1, 0xa0, 0x00), |
| 614 | /* |
| 615 | * Vaux2SwHPReqValid = disabled |
| 616 | * Vaux3SwHPReqValid = disabled |
| 617 | * VsmpsMSwHPReqValid |
| 618 | */ |
| 619 | INIT_REGULATOR_REGISTER(AB8505_REGUSWHPREQVALID2, 0x03, 0x00), |
| 620 | /* |
| 621 | * SysClkReq2Valid1 = SysClkReq2 controlled |
| 622 | * SysClkReq3Valid1 = disabled |
| 623 | * SysClkReq4Valid1 = SysClkReq4 controlled |
| 624 | */ |
| 625 | INIT_REGULATOR_REGISTER(AB8505_REGUSYSCLKREQVALID1, 0x0e, 0x0a), |
| 626 | /* |
| 627 | * SysClkReq2Valid2 = disabled |
| 628 | * SysClkReq3Valid2 = disabled |
| 629 | * SysClkReq4Valid2 = disabled |
| 630 | */ |
| 631 | INIT_REGULATOR_REGISTER(AB8505_REGUSYSCLKREQVALID2, 0x0e, 0x00), |
| 632 | /* |
| 633 | * Vaux4SwHPReqValid |
| 634 | * Vaux4HwHPReq2Valid |
| 635 | * Vaux4HwHPReq1Valid |
| 636 | * Vaux4SysClkReq1HPValid |
| 637 | */ |
| 638 | INIT_REGULATOR_REGISTER(AB8505_REGUVAUX4REQVALID, 0x00, 0x00), |
| 639 | /* |
| 640 | * VadcEna = disabled |
| 641 | * VintCore12Ena = disabled |
| 642 | * VintCore12Sel = 1.25 V |
| 643 | * VintCore12LP = inactive (HP) |
| 644 | * VadcLP = inactive (HP) |
| 645 | */ |
| 646 | INIT_REGULATOR_REGISTER(AB8505_REGUMISC1, 0xfe, 0x10), |
| 647 | /* |
| 648 | * VaudioEna = disabled |
| 649 | * Vaux8Ena = disabled |
| 650 | * Vamic1Ena = disabled |
| 651 | * Vamic2Ena = disabled |
| 652 | */ |
| 653 | INIT_REGULATOR_REGISTER(AB8505_VAUDIOSUPPLY, 0x1e, 0x00), |
| 654 | /* |
| 655 | * Vamic1_dzout = high-Z when Vamic1 is disabled |
| 656 | * Vamic2_dzout = high-Z when Vamic2 is disabled |
| 657 | */ |
| 658 | INIT_REGULATOR_REGISTER(AB8505_REGUCTRL1VAMIC, 0x03, 0x00), |
| 659 | /* |
| 660 | * VsmpsARegu |
| 661 | * VsmpsASelCtrl |
| 662 | * VsmpsAAutoMode |
| 663 | * VsmpsAPWMMode |
| 664 | */ |
| 665 | INIT_REGULATOR_REGISTER(AB8505_VSMPSAREGU, 0x00, 0x00), |
| 666 | /* |
| 667 | * VsmpsBRegu |
| 668 | * VsmpsBSelCtrl |
| 669 | * VsmpsBAutoMode |
| 670 | * VsmpsBPWMMode |
| 671 | */ |
| 672 | INIT_REGULATOR_REGISTER(AB8505_VSMPSBREGU, 0x00, 0x00), |
| 673 | /* |
| 674 | * VsafeRegu |
| 675 | * VsafeSelCtrl |
| 676 | * VsafeAutoMode |
| 677 | * VsafePWMMode |
| 678 | */ |
| 679 | INIT_REGULATOR_REGISTER(AB8505_VSAFEREGU, 0x00, 0x00), |
| 680 | /* |
| 681 | * VPll = Hw controlled (NOTE! PRCMU bits) |
| 682 | * VanaRegu = force off |
| 683 | */ |
| 684 | INIT_REGULATOR_REGISTER(AB8505_VPLLVANAREGU, 0x0f, 0x02), |
| 685 | /* |
| 686 | * VextSupply1Regu = force OFF (OTP_ExtSupply12LPnPolarity 1) |
| 687 | * VextSupply2Regu = force OFF (OTP_ExtSupply12LPnPolarity 1) |
| 688 | * VextSupply3Regu = force OFF (OTP_ExtSupply3LPnPolarity 0) |
| 689 | * ExtSupply2Bypass = ExtSupply12LPn ball is 0 when Ena is 0 |
| 690 | * ExtSupply3Bypass = ExtSupply3LPn ball is 0 when Ena is 0 |
| 691 | */ |
| 692 | INIT_REGULATOR_REGISTER(AB8505_EXTSUPPLYREGU, 0xff, 0x30), |
| 693 | /* |
| 694 | * Vaux1Regu = force HP |
| 695 | * Vaux2Regu = force off |
| 696 | */ |
| 697 | INIT_REGULATOR_REGISTER(AB8505_VAUX12REGU, 0x0f, 0x01), |
| 698 | /* |
| 699 | * Vaux3Regu = force off |
| 700 | */ |
| 701 | INIT_REGULATOR_REGISTER(AB8505_VRF1VAUX3REGU, 0x03, 0x00), |
| 702 | /* |
| 703 | * VsmpsASel1 |
| 704 | */ |
| 705 | INIT_REGULATOR_REGISTER(AB8505_VSMPSASEL1, 0x00, 0x00), |
| 706 | /* |
| 707 | * VsmpsASel2 |
| 708 | */ |
| 709 | INIT_REGULATOR_REGISTER(AB8505_VSMPSASEL2, 0x00, 0x00), |
| 710 | /* |
| 711 | * VsmpsASel3 |
| 712 | */ |
| 713 | INIT_REGULATOR_REGISTER(AB8505_VSMPSASEL3, 0x00, 0x00), |
| 714 | /* |
| 715 | * VsmpsBSel1 |
| 716 | */ |
| 717 | INIT_REGULATOR_REGISTER(AB8505_VSMPSBSEL1, 0x00, 0x00), |
| 718 | /* |
| 719 | * VsmpsBSel2 |
| 720 | */ |
| 721 | INIT_REGULATOR_REGISTER(AB8505_VSMPSBSEL2, 0x00, 0x00), |
| 722 | /* |
| 723 | * VsmpsBSel3 |
| 724 | */ |
| 725 | INIT_REGULATOR_REGISTER(AB8505_VSMPSBSEL3, 0x00, 0x00), |
| 726 | /* |
| 727 | * VsafeSel1 |
| 728 | */ |
| 729 | INIT_REGULATOR_REGISTER(AB8505_VSAFESEL1, 0x00, 0x00), |
| 730 | /* |
| 731 | * VsafeSel2 |
| 732 | */ |
| 733 | INIT_REGULATOR_REGISTER(AB8505_VSAFESEL2, 0x00, 0x00), |
| 734 | /* |
| 735 | * VsafeSel3 |
| 736 | */ |
| 737 | INIT_REGULATOR_REGISTER(AB8505_VSAFESEL3, 0x00, 0x00), |
| 738 | /* |
| 739 | * Vaux1Sel = 2.8 V |
| 740 | */ |
| 741 | INIT_REGULATOR_REGISTER(AB8505_VAUX1SEL, 0x0f, 0x0C), |
| 742 | /* |
| 743 | * Vaux2Sel = 2.9 V |
| 744 | */ |
| 745 | INIT_REGULATOR_REGISTER(AB8505_VAUX2SEL, 0x0f, 0x0d), |
| 746 | /* |
| 747 | * Vaux3Sel = 2.91 V |
| 748 | */ |
| 749 | INIT_REGULATOR_REGISTER(AB8505_VRF1VAUX3SEL, 0x07, 0x07), |
| 750 | /* |
| 751 | * Vaux4RequestCtrl |
| 752 | */ |
| 753 | INIT_REGULATOR_REGISTER(AB8505_VAUX4REQCTRL, 0x00, 0x00), |
| 754 | /* |
| 755 | * Vaux4Regu |
| 756 | */ |
| 757 | INIT_REGULATOR_REGISTER(AB8505_VAUX4REGU, 0x00, 0x00), |
| 758 | /* |
| 759 | * Vaux4Sel |
| 760 | */ |
| 761 | INIT_REGULATOR_REGISTER(AB8505_VAUX4SEL, 0x00, 0x00), |
| 762 | /* |
| 763 | * Vaux1Disch = short discharge time |
| 764 | * Vaux2Disch = short discharge time |
| 765 | * Vaux3Disch = short discharge time |
| 766 | * Vintcore12Disch = short discharge time |
| 767 | * VTVoutDisch = short discharge time |
| 768 | * VaudioDisch = short discharge time |
| 769 | */ |
| 770 | INIT_REGULATOR_REGISTER(AB8505_REGUCTRLDISCH, 0xfc, 0x00), |
| 771 | /* |
| 772 | * VanaDisch = short discharge time |
| 773 | * Vaux8PullDownEna = pulldown disabled when Vaux8 is disabled |
| 774 | * Vaux8Disch = short discharge time |
| 775 | */ |
| 776 | INIT_REGULATOR_REGISTER(AB8505_REGUCTRLDISCH2, 0x16, 0x00), |
| 777 | /* |
| 778 | * Vaux4Disch = short discharge time |
| 779 | */ |
| 780 | INIT_REGULATOR_REGISTER(AB8505_REGUCTRLDISCH3, 0x01, 0x00), |
| 781 | /* |
| 782 | * Vaux5Sel |
| 783 | * Vaux5LP |
| 784 | * Vaux5Ena |
| 785 | * Vaux5Disch |
| 786 | * Vaux5DisSfst |
| 787 | * Vaux5DisPulld |
| 788 | */ |
| 789 | INIT_REGULATOR_REGISTER(AB8505_CTRLVAUX5, 0x00, 0x00), |
| 790 | /* |
| 791 | * Vaux6Sel |
| 792 | * Vaux6LP |
| 793 | * Vaux6Ena |
| 794 | * Vaux6DisPulld |
| 795 | */ |
| 796 | INIT_REGULATOR_REGISTER(AB8505_CTRLVAUX6, 0x00, 0x00), |
| 797 | }; |
| 798 | |
Sachin Kamat | aaebafb | 2014-05-28 14:56:05 +0530 | [diff] [blame] | 799 | static struct regulator_init_data ab8505_regulators[AB8505_NUM_REGULATORS] = { |
Lee Jones | 547f384 | 2013-03-28 16:11:14 +0000 | [diff] [blame] | 800 | /* supplies to the display/camera */ |
| 801 | [AB8505_LDO_AUX1] = { |
| 802 | .constraints = { |
| 803 | .name = "V-DISPLAY", |
| 804 | .min_uV = 2800000, |
| 805 | .max_uV = 3300000, |
| 806 | .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE | |
| 807 | REGULATOR_CHANGE_STATUS, |
| 808 | .boot_on = 1, /* display is on at boot */ |
| 809 | }, |
| 810 | .num_consumer_supplies = ARRAY_SIZE(ab8500_vaux1_consumers), |
| 811 | .consumer_supplies = ab8500_vaux1_consumers, |
| 812 | }, |
| 813 | /* supplies to the on-board eMMC */ |
| 814 | [AB8505_LDO_AUX2] = { |
| 815 | .constraints = { |
| 816 | .name = "V-eMMC1", |
| 817 | .min_uV = 1100000, |
| 818 | .max_uV = 3300000, |
| 819 | .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE | |
| 820 | REGULATOR_CHANGE_STATUS | |
| 821 | REGULATOR_CHANGE_MODE, |
| 822 | .valid_modes_mask = REGULATOR_MODE_NORMAL | |
| 823 | REGULATOR_MODE_IDLE, |
| 824 | }, |
| 825 | .num_consumer_supplies = ARRAY_SIZE(ab8500_vaux2_consumers), |
| 826 | .consumer_supplies = ab8500_vaux2_consumers, |
| 827 | }, |
| 828 | /* supply for VAUX3, supplies to SDcard slots */ |
| 829 | [AB8505_LDO_AUX3] = { |
| 830 | .constraints = { |
| 831 | .name = "V-MMC-SD", |
| 832 | .min_uV = 1100000, |
| 833 | .max_uV = 3300000, |
| 834 | .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE | |
| 835 | REGULATOR_CHANGE_STATUS | |
| 836 | REGULATOR_CHANGE_MODE, |
| 837 | .valid_modes_mask = REGULATOR_MODE_NORMAL | |
| 838 | REGULATOR_MODE_IDLE, |
| 839 | }, |
| 840 | .num_consumer_supplies = ARRAY_SIZE(ab8500_vaux3_consumers), |
| 841 | .consumer_supplies = ab8500_vaux3_consumers, |
| 842 | }, |
| 843 | /* supply for VAUX4, supplies to NFC and standalone secure element */ |
| 844 | [AB8505_LDO_AUX4] = { |
| 845 | .constraints = { |
| 846 | .name = "V-NFC-SE", |
| 847 | .min_uV = 1100000, |
| 848 | .max_uV = 3300000, |
| 849 | .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE | |
| 850 | REGULATOR_CHANGE_STATUS | |
| 851 | REGULATOR_CHANGE_MODE, |
| 852 | .valid_modes_mask = REGULATOR_MODE_NORMAL | |
| 853 | REGULATOR_MODE_IDLE, |
| 854 | }, |
| 855 | .num_consumer_supplies = ARRAY_SIZE(ab8505_vaux4_consumers), |
| 856 | .consumer_supplies = ab8505_vaux4_consumers, |
| 857 | }, |
| 858 | /* supply for VAUX5, supplies to TBD */ |
| 859 | [AB8505_LDO_AUX5] = { |
| 860 | .constraints = { |
| 861 | .name = "V-AUX5", |
| 862 | .min_uV = 1050000, |
| 863 | .max_uV = 2790000, |
| 864 | .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE | |
| 865 | REGULATOR_CHANGE_STATUS | |
| 866 | REGULATOR_CHANGE_MODE, |
| 867 | .valid_modes_mask = REGULATOR_MODE_NORMAL | |
| 868 | REGULATOR_MODE_IDLE, |
| 869 | }, |
| 870 | .num_consumer_supplies = ARRAY_SIZE(ab8505_vaux5_consumers), |
| 871 | .consumer_supplies = ab8505_vaux5_consumers, |
| 872 | }, |
| 873 | /* supply for VAUX6, supplies to TBD */ |
| 874 | [AB8505_LDO_AUX6] = { |
| 875 | .constraints = { |
| 876 | .name = "V-AUX6", |
| 877 | .min_uV = 1050000, |
| 878 | .max_uV = 2790000, |
| 879 | .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE | |
| 880 | REGULATOR_CHANGE_STATUS | |
| 881 | REGULATOR_CHANGE_MODE, |
| 882 | .valid_modes_mask = REGULATOR_MODE_NORMAL | |
| 883 | REGULATOR_MODE_IDLE, |
| 884 | }, |
| 885 | .num_consumer_supplies = ARRAY_SIZE(ab8505_vaux6_consumers), |
| 886 | .consumer_supplies = ab8505_vaux6_consumers, |
| 887 | }, |
| 888 | /* supply for gpadc, ADC LDO */ |
| 889 | [AB8505_LDO_ADC] = { |
| 890 | .constraints = { |
| 891 | .name = "V-ADC", |
| 892 | .valid_ops_mask = REGULATOR_CHANGE_STATUS, |
| 893 | }, |
| 894 | .num_consumer_supplies = ARRAY_SIZE(ab8505_vadc_consumers), |
| 895 | .consumer_supplies = ab8505_vadc_consumers, |
| 896 | }, |
| 897 | /* supply for ab8500-vaudio, VAUDIO LDO */ |
| 898 | [AB8505_LDO_AUDIO] = { |
| 899 | .constraints = { |
| 900 | .name = "V-AUD", |
| 901 | .valid_ops_mask = REGULATOR_CHANGE_STATUS, |
| 902 | }, |
| 903 | .num_consumer_supplies = ARRAY_SIZE(ab8500_vaud_consumers), |
| 904 | .consumer_supplies = ab8500_vaud_consumers, |
| 905 | }, |
| 906 | /* supply for v-anamic1 VAMic1-LDO */ |
| 907 | [AB8505_LDO_ANAMIC1] = { |
| 908 | .constraints = { |
| 909 | .name = "V-AMIC1", |
Lee Jones | 3fe5228 | 2013-04-02 13:24:12 +0100 | [diff] [blame] | 910 | .valid_ops_mask = REGULATOR_CHANGE_STATUS | |
| 911 | REGULATOR_CHANGE_MODE, |
| 912 | .valid_modes_mask = REGULATOR_MODE_NORMAL | |
| 913 | REGULATOR_MODE_IDLE, |
Lee Jones | 547f384 | 2013-03-28 16:11:14 +0000 | [diff] [blame] | 914 | }, |
| 915 | .num_consumer_supplies = ARRAY_SIZE(ab8500_vamic1_consumers), |
| 916 | .consumer_supplies = ab8500_vamic1_consumers, |
| 917 | }, |
| 918 | /* supply for v-amic2, VAMIC2 LDO, reuse constants for AMIC1 */ |
| 919 | [AB8505_LDO_ANAMIC2] = { |
| 920 | .constraints = { |
| 921 | .name = "V-AMIC2", |
Lee Jones | 3fe5228 | 2013-04-02 13:24:12 +0100 | [diff] [blame] | 922 | .valid_ops_mask = REGULATOR_CHANGE_STATUS | |
| 923 | REGULATOR_CHANGE_MODE, |
| 924 | .valid_modes_mask = REGULATOR_MODE_NORMAL | |
| 925 | REGULATOR_MODE_IDLE, |
Lee Jones | 547f384 | 2013-03-28 16:11:14 +0000 | [diff] [blame] | 926 | }, |
| 927 | .num_consumer_supplies = ARRAY_SIZE(ab8500_vamic2_consumers), |
| 928 | .consumer_supplies = ab8500_vamic2_consumers, |
| 929 | }, |
| 930 | /* supply for v-aux8, VAUX8 LDO */ |
| 931 | [AB8505_LDO_AUX8] = { |
| 932 | .constraints = { |
| 933 | .name = "V-AUX8", |
| 934 | .valid_ops_mask = REGULATOR_CHANGE_STATUS, |
| 935 | }, |
| 936 | .num_consumer_supplies = ARRAY_SIZE(ab8505_vaux8_consumers), |
| 937 | .consumer_supplies = ab8505_vaux8_consumers, |
| 938 | }, |
| 939 | /* supply for v-intcore12, VINTCORE12 LDO */ |
| 940 | [AB8505_LDO_INTCORE] = { |
| 941 | .constraints = { |
| 942 | .name = "V-INTCORE", |
| 943 | .min_uV = 1250000, |
| 944 | .max_uV = 1350000, |
| 945 | .input_uV = 1800000, |
| 946 | .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE | |
| 947 | REGULATOR_CHANGE_STATUS | |
| 948 | REGULATOR_CHANGE_MODE | |
| 949 | REGULATOR_CHANGE_DRMS, |
| 950 | .valid_modes_mask = REGULATOR_MODE_NORMAL | |
| 951 | REGULATOR_MODE_IDLE, |
| 952 | }, |
| 953 | .num_consumer_supplies = ARRAY_SIZE(ab8500_vintcore_consumers), |
| 954 | .consumer_supplies = ab8500_vintcore_consumers, |
| 955 | }, |
| 956 | /* supply for LDO USB */ |
| 957 | [AB8505_LDO_USB] = { |
| 958 | .constraints = { |
| 959 | .name = "V-USB", |
| 960 | .valid_ops_mask = REGULATOR_CHANGE_STATUS | |
| 961 | REGULATOR_CHANGE_MODE, |
| 962 | .valid_modes_mask = REGULATOR_MODE_NORMAL | |
| 963 | REGULATOR_MODE_IDLE, |
| 964 | }, |
| 965 | .num_consumer_supplies = ARRAY_SIZE(ab8505_usb_consumers), |
| 966 | .consumer_supplies = ab8505_usb_consumers, |
| 967 | }, |
| 968 | /* supply for U8500 CSI-DSI, VANA LDO */ |
| 969 | [AB8505_LDO_ANA] = { |
| 970 | .constraints = { |
| 971 | .name = "V-CSI-DSI", |
| 972 | .valid_ops_mask = REGULATOR_CHANGE_STATUS, |
| 973 | }, |
| 974 | .num_consumer_supplies = ARRAY_SIZE(ab8500_vana_consumers), |
| 975 | .consumer_supplies = ab8500_vana_consumers, |
| 976 | }, |
| 977 | }; |
| 978 | |
Bengt Jonsson | 732805a | 2013-03-21 15:59:03 +0000 | [diff] [blame] | 979 | struct ab8500_regulator_platform_data ab8500_regulator_plat_data = { |
| 980 | .reg_init = ab8500_reg_init, |
| 981 | .num_reg_init = ARRAY_SIZE(ab8500_reg_init), |
| 982 | .regulator = ab8500_regulators, |
| 983 | .num_regulator = ARRAY_SIZE(ab8500_regulators), |
Lee Jones | a387ac5 | 2013-03-28 16:11:02 +0000 | [diff] [blame] | 984 | .ext_regulator = ab8500_ext_regulators, |
| 985 | .num_ext_regulator = ARRAY_SIZE(ab8500_ext_regulators), |
Bengt Jonsson | 732805a | 2013-03-21 15:59:03 +0000 | [diff] [blame] | 986 | }; |
Lee Jones | a1d4948 | 2013-03-28 16:11:03 +0000 | [diff] [blame] | 987 | |
Lee Jones | 547f384 | 2013-03-28 16:11:14 +0000 | [diff] [blame] | 988 | struct ab8500_regulator_platform_data ab8505_regulator_plat_data = { |
| 989 | .reg_init = ab8505_reg_init, |
| 990 | .num_reg_init = ARRAY_SIZE(ab8505_reg_init), |
| 991 | .regulator = ab8505_regulators, |
| 992 | .num_regulator = ARRAY_SIZE(ab8505_regulators), |
| 993 | }; |
| 994 | |
Lee Jones | a1d4948 | 2013-03-28 16:11:03 +0000 | [diff] [blame] | 995 | static void ab8500_modify_reg_init(int id, u8 mask, u8 value) |
| 996 | { |
| 997 | int i; |
| 998 | |
Lee Jones | 547f384 | 2013-03-28 16:11:14 +0000 | [diff] [blame] | 999 | if (cpu_is_u8520()) { |
| 1000 | for (i = ARRAY_SIZE(ab8505_reg_init) - 1; i >= 0; i--) { |
| 1001 | if (ab8505_reg_init[i].id == id) { |
| 1002 | u8 initval = ab8505_reg_init[i].value; |
| 1003 | initval = (initval & ~mask) | (value & mask); |
| 1004 | ab8505_reg_init[i].value = initval; |
Lee Jones | a1d4948 | 2013-03-28 16:11:03 +0000 | [diff] [blame] | 1005 | |
Lee Jones | 547f384 | 2013-03-28 16:11:14 +0000 | [diff] [blame] | 1006 | BUG_ON(mask & ~ab8505_reg_init[i].mask); |
| 1007 | return; |
| 1008 | } |
| 1009 | } |
| 1010 | } else { |
| 1011 | for (i = ARRAY_SIZE(ab8500_reg_init) - 1; i >= 0; i--) { |
| 1012 | if (ab8500_reg_init[i].id == id) { |
| 1013 | u8 initval = ab8500_reg_init[i].value; |
| 1014 | initval = (initval & ~mask) | (value & mask); |
| 1015 | ab8500_reg_init[i].value = initval; |
| 1016 | |
| 1017 | BUG_ON(mask & ~ab8500_reg_init[i].mask); |
| 1018 | return; |
| 1019 | } |
Lee Jones | a1d4948 | 2013-03-28 16:11:03 +0000 | [diff] [blame] | 1020 | } |
| 1021 | } |
| 1022 | |
| 1023 | BUG_ON(1); |
| 1024 | } |
Lee Jones | 422d765 | 2013-03-28 16:11:04 +0000 | [diff] [blame] | 1025 | |
| 1026 | void mop500_regulator_init(void) |
| 1027 | { |
| 1028 | struct regulator_init_data *regulator; |
| 1029 | |
| 1030 | /* |
Lee Jones | a652f3d | 2013-04-02 13:24:21 +0100 | [diff] [blame] | 1031 | * Temporarily turn on Vaux2 on 8520 machine |
Lee Jones | 422d765 | 2013-03-28 16:11:04 +0000 | [diff] [blame] | 1032 | */ |
Lee Jones | 547f384 | 2013-03-28 16:11:14 +0000 | [diff] [blame] | 1033 | if (cpu_is_u8520()) { |
| 1034 | /* Vaux2 initialized to be on */ |
| 1035 | ab8500_modify_reg_init(AB8505_VAUX12REGU, 0x0f, 0x05); |
| 1036 | } |
| 1037 | |
Lee Jones | e0c4468 | 2013-03-28 16:11:05 +0000 | [diff] [blame] | 1038 | /* |
| 1039 | * Handle AB8500_EXT_SUPPLY2 on HREFP_V20_V50 boards (do it for |
| 1040 | * all HREFP_V20 boards) |
| 1041 | */ |
| 1042 | if (cpu_is_u8500v20()) { |
| 1043 | /* VextSupply2RequestCtrl = HP/OFF depending on VxRequest */ |
| 1044 | ab8500_modify_reg_init(AB8500_REGUREQUESTCTRL3, 0x01, 0x01); |
| 1045 | |
| 1046 | /* VextSupply2SysClkReq1HPValid = SysClkReq1 controlled */ |
| 1047 | ab8500_modify_reg_init(AB8500_REGUSYSCLKREQ1HPVALID2, |
| 1048 | 0x20, 0x20); |
| 1049 | |
| 1050 | /* VextSupply2 = force HP at initialization */ |
| 1051 | ab8500_modify_reg_init(AB8500_EXTSUPPLYREGU, 0x0c, 0x04); |
| 1052 | |
| 1053 | /* enable VextSupply2 during platform active */ |
| 1054 | regulator = &ab8500_ext_regulators[AB8500_EXT_SUPPLY2]; |
| 1055 | regulator->constraints.always_on = 1; |
| 1056 | |
| 1057 | /* disable VextSupply2 in suspend */ |
| 1058 | regulator = &ab8500_ext_regulators[AB8500_EXT_SUPPLY2]; |
| 1059 | regulator->constraints.state_mem.disabled = 1; |
| 1060 | regulator->constraints.state_standby.disabled = 1; |
| 1061 | |
| 1062 | /* enable VextSupply2 HW control (used in suspend) */ |
| 1063 | regulator->driver_data = (void *)&ab8500_ext_supply2; |
| 1064 | } |
Lee Jones | 422d765 | 2013-03-28 16:11:04 +0000 | [diff] [blame] | 1065 | } |