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> |
Sundar Iyer | 4f724be | 2010-09-15 10:50:59 +0100 | [diff] [blame] | 8 | * |
| 9 | * MOP500 board specific initialization for regulators |
| 10 | */ |
| 11 | #include <linux/kernel.h> |
| 12 | #include <linux/regulator/machine.h> |
Bengt Jonsson | a1e516e | 2010-12-10 11:08:48 +0100 | [diff] [blame] | 13 | #include <linux/regulator/ab8500.h> |
Linus Walleij | d1de85a | 2010-12-02 17:10:14 +0100 | [diff] [blame] | 14 | #include "board-mop500-regulators.h" |
| 15 | |
Lee Jones | 0b5ea1e | 2012-09-03 14:33:39 +0100 | [diff] [blame] | 16 | static struct regulator_consumer_supply gpio_en_3v3_consumers[] = { |
| 17 | REGULATOR_SUPPLY("vdd33a", "smsc911x.0"), |
| 18 | }; |
| 19 | |
| 20 | struct regulator_init_data gpio_en_3v3_regulator = { |
| 21 | .constraints = { |
| 22 | .name = "EN-3V3", |
| 23 | .min_uV = 3300000, |
| 24 | .max_uV = 3300000, |
| 25 | .valid_ops_mask = REGULATOR_CHANGE_STATUS, |
| 26 | }, |
| 27 | .num_consumer_supplies = ARRAY_SIZE(gpio_en_3v3_consumers), |
| 28 | .consumer_supplies = gpio_en_3v3_consumers, |
| 29 | }; |
| 30 | |
Linus Walleij | fe67dfc | 2011-03-07 11:48:15 +0100 | [diff] [blame] | 31 | /* |
| 32 | * TPS61052 regulator |
| 33 | */ |
| 34 | static struct regulator_consumer_supply tps61052_vaudio_consumers[] = { |
| 35 | /* |
| 36 | * Boost converter supply to raise voltage on audio speaker, this |
| 37 | * is actually connected to three pins, VInVhfL (left amplifier) |
| 38 | * VInVhfR (right amplifier) and VIntDClassInt - all three must |
| 39 | * be connected to the same voltage. |
| 40 | */ |
| 41 | REGULATOR_SUPPLY("vintdclassint", "ab8500-codec.0"), |
| 42 | }; |
| 43 | |
| 44 | struct regulator_init_data tps61052_regulator = { |
| 45 | .constraints = { |
| 46 | .name = "vaudio-hf", |
| 47 | .min_uV = 4500000, |
| 48 | .max_uV = 4500000, |
| 49 | .valid_ops_mask = REGULATOR_CHANGE_STATUS, |
| 50 | }, |
| 51 | .num_consumer_supplies = ARRAY_SIZE(tps61052_vaudio_consumers), |
| 52 | .consumer_supplies = tps61052_vaudio_consumers, |
| 53 | }; |
| 54 | |
Linus Walleij | d1de85a | 2010-12-02 17:10:14 +0100 | [diff] [blame] | 55 | static struct regulator_consumer_supply ab8500_vaux1_consumers[] = { |
Lee Jones | 27f26de | 2013-03-21 15:59:05 +0000 | [diff] [blame] | 56 | /* Main display, u8500 R3 uib */ |
| 57 | REGULATOR_SUPPLY("vddi", "mcde_disp_sony_acx424akp.0"), |
| 58 | /* Main display, u8500 uib and ST uib */ |
| 59 | REGULATOR_SUPPLY("vdd1", "samsung_s6d16d0.0"), |
| 60 | /* Secondary display, ST uib */ |
| 61 | REGULATOR_SUPPLY("vdd1", "samsung_s6d16d0.1"), |
Linus Walleij | d1de85a | 2010-12-02 17:10:14 +0100 | [diff] [blame] | 62 | /* SFH7741 proximity sensor */ |
| 63 | REGULATOR_SUPPLY("vcc", "gpio-keys.0"), |
| 64 | /* BH1780GLS ambient light sensor */ |
| 65 | REGULATOR_SUPPLY("vcc", "2-0029"), |
| 66 | /* lsm303dlh accelerometer */ |
| 67 | REGULATOR_SUPPLY("vdd", "3-0018"), |
| 68 | /* lsm303dlh magnetometer */ |
| 69 | REGULATOR_SUPPLY("vdd", "3-001e"), |
| 70 | /* Rohm BU21013 Touchscreen devices */ |
| 71 | REGULATOR_SUPPLY("avdd", "3-005c"), |
| 72 | REGULATOR_SUPPLY("avdd", "3-005d"), |
| 73 | /* Synaptics RMI4 Touchscreen device */ |
| 74 | REGULATOR_SUPPLY("vdd", "3-004b"), |
Lee Jones | efb34d2 | 2013-03-21 15:59:10 +0000 | [diff] [blame^] | 75 | /* L3G4200D Gyroscope device */ |
| 76 | REGULATOR_SUPPLY("vdd", "2-0068"), |
Linus Walleij | d1de85a | 2010-12-02 17:10:14 +0100 | [diff] [blame] | 77 | }; |
| 78 | |
| 79 | static struct regulator_consumer_supply ab8500_vaux2_consumers[] = { |
| 80 | /* On-board eMMC power */ |
| 81 | REGULATOR_SUPPLY("vmmc", "sdi4"), |
| 82 | /* AB8500 audio codec */ |
| 83 | REGULATOR_SUPPLY("vcc-N2158", "ab8500-codec.0"), |
| 84 | }; |
| 85 | |
| 86 | static struct regulator_consumer_supply ab8500_vaux3_consumers[] = { |
| 87 | /* External MMC slot power */ |
| 88 | REGULATOR_SUPPLY("vmmc", "sdi0"), |
| 89 | }; |
| 90 | |
| 91 | static struct regulator_consumer_supply ab8500_vtvout_consumers[] = { |
| 92 | /* TV-out DENC supply */ |
| 93 | REGULATOR_SUPPLY("vtvout", "ab8500-denc.0"), |
| 94 | /* Internal general-purpose ADC */ |
| 95 | REGULATOR_SUPPLY("vddadc", "ab8500-gpadc.0"), |
| 96 | }; |
| 97 | |
Ola Lilja | 29bd2ab | 2012-02-01 14:18:10 +0100 | [diff] [blame] | 98 | static struct regulator_consumer_supply ab8500_vaud_consumers[] = { |
| 99 | /* AB8500 audio-codec main supply */ |
| 100 | REGULATOR_SUPPLY("vaud", "ab8500-codec.0"), |
| 101 | }; |
| 102 | |
| 103 | static struct regulator_consumer_supply ab8500_vamic1_consumers[] = { |
| 104 | /* AB8500 audio-codec Mic1 supply */ |
| 105 | REGULATOR_SUPPLY("vamic1", "ab8500-codec.0"), |
| 106 | }; |
| 107 | |
| 108 | static struct regulator_consumer_supply ab8500_vamic2_consumers[] = { |
| 109 | /* AB8500 audio-codec Mic2 supply */ |
| 110 | REGULATOR_SUPPLY("vamic2", "ab8500-codec.0"), |
| 111 | }; |
| 112 | |
| 113 | static struct regulator_consumer_supply ab8500_vdmic_consumers[] = { |
| 114 | /* AB8500 audio-codec DMic supply */ |
| 115 | REGULATOR_SUPPLY("vdmic", "ab8500-codec.0"), |
| 116 | }; |
| 117 | |
Linus Walleij | d1de85a | 2010-12-02 17:10:14 +0100 | [diff] [blame] | 118 | static struct regulator_consumer_supply ab8500_vintcore_consumers[] = { |
| 119 | /* SoC core supply, no device */ |
| 120 | REGULATOR_SUPPLY("v-intcore", NULL), |
Joe Perches | 7c9d440 | 2011-06-23 11:39:20 -0700 | [diff] [blame] | 121 | /* USB Transceiver */ |
Linus Walleij | d1de85a | 2010-12-02 17:10:14 +0100 | [diff] [blame] | 122 | REGULATOR_SUPPLY("vddulpivio18", "ab8500-usb.0"), |
| 123 | }; |
| 124 | |
| 125 | static struct regulator_consumer_supply ab8500_vana_consumers[] = { |
| 126 | /* External displays, connector on board, 1v8 power supply */ |
| 127 | REGULATOR_SUPPLY("vsmps2", "mcde.0"), |
| 128 | }; |
Sundar Iyer | 4f724be | 2010-09-15 10:50:59 +0100 | [diff] [blame] | 129 | |
Bengt Jonsson | dfa3a82 | 2011-03-09 13:34:17 +0100 | [diff] [blame] | 130 | /* ab8500 regulator register initialization */ |
Bengt Jonsson | 732805a | 2013-03-21 15:59:03 +0000 | [diff] [blame] | 131 | static struct ab8500_regulator_reg_init ab8500_reg_init[] = { |
Bengt Jonsson | dfa3a82 | 2011-03-09 13:34:17 +0100 | [diff] [blame] | 132 | /* |
| 133 | * VanaRequestCtrl = HP/LP depending on VxRequest |
Lee Jones | d79df32 | 2013-03-21 15:58:58 +0000 | [diff] [blame] | 134 | * VpllRequestCtrl = HP/LP depending on VxRequest |
Bengt Jonsson | dfa3a82 | 2011-03-09 13:34:17 +0100 | [diff] [blame] | 135 | * VextSupply1RequestCtrl = HP/LP depending on VxRequest |
| 136 | */ |
Lee Jones | 3c1b843 | 2013-03-21 15:59:01 +0000 | [diff] [blame] | 137 | INIT_REGULATOR_REGISTER(AB8500_REGUREQUESTCTRL2, 0xfc, 0x00), |
Bengt Jonsson | dfa3a82 | 2011-03-09 13:34:17 +0100 | [diff] [blame] | 138 | /* |
| 139 | * VextSupply2RequestCtrl = HP/LP depending on VxRequest |
| 140 | * VextSupply3RequestCtrl = HP/LP depending on VxRequest |
| 141 | * Vaux1RequestCtrl = HP/LP depending on VxRequest |
| 142 | * Vaux2RequestCtrl = HP/LP depending on VxRequest |
| 143 | */ |
Lee Jones | 3c1b843 | 2013-03-21 15:59:01 +0000 | [diff] [blame] | 144 | INIT_REGULATOR_REGISTER(AB8500_REGUREQUESTCTRL3, 0xff, 0x00), |
Bengt Jonsson | dfa3a82 | 2011-03-09 13:34:17 +0100 | [diff] [blame] | 145 | /* |
| 146 | * Vaux3RequestCtrl = HP/LP depending on VxRequest |
| 147 | * SwHPReq = Control through SWValid disabled |
| 148 | */ |
Lee Jones | 3c1b843 | 2013-03-21 15:59:01 +0000 | [diff] [blame] | 149 | INIT_REGULATOR_REGISTER(AB8500_REGUREQUESTCTRL4, 0x07, 0x00), |
Bengt Jonsson | dfa3a82 | 2011-03-09 13:34:17 +0100 | [diff] [blame] | 150 | /* |
Lee Jones | d79df32 | 2013-03-21 15:58:58 +0000 | [diff] [blame] | 151 | * Vsmps1SysClkReq1HPValid = enabled |
| 152 | * Vsmps2SysClkReq1HPValid = enabled |
| 153 | * Vsmps3SysClkReq1HPValid = enabled |
Bengt Jonsson | dfa3a82 | 2011-03-09 13:34:17 +0100 | [diff] [blame] | 154 | * VanaSysClkReq1HPValid = disabled |
Lee Jones | d79df32 | 2013-03-21 15:58:58 +0000 | [diff] [blame] | 155 | * VpllSysClkReq1HPValid = enabled |
Bengt Jonsson | dfa3a82 | 2011-03-09 13:34:17 +0100 | [diff] [blame] | 156 | * Vaux1SysClkReq1HPValid = disabled |
| 157 | * Vaux2SysClkReq1HPValid = disabled |
| 158 | * Vaux3SysClkReq1HPValid = disabled |
| 159 | */ |
Lee Jones | 3c1b843 | 2013-03-21 15:59:01 +0000 | [diff] [blame] | 160 | INIT_REGULATOR_REGISTER(AB8500_REGUSYSCLKREQ1HPVALID1, 0xff, 0x17), |
Bengt Jonsson | dfa3a82 | 2011-03-09 13:34:17 +0100 | [diff] [blame] | 161 | /* |
| 162 | * VextSupply1SysClkReq1HPValid = disabled |
| 163 | * VextSupply2SysClkReq1HPValid = disabled |
| 164 | * VextSupply3SysClkReq1HPValid = SysClkReq1 controlled |
| 165 | */ |
Lee Jones | 3c1b843 | 2013-03-21 15:59:01 +0000 | [diff] [blame] | 166 | INIT_REGULATOR_REGISTER(AB8500_REGUSYSCLKREQ1HPVALID2, 0x70, 0x40), |
Bengt Jonsson | dfa3a82 | 2011-03-09 13:34:17 +0100 | [diff] [blame] | 167 | /* |
| 168 | * VanaHwHPReq1Valid = disabled |
| 169 | * Vaux1HwHPreq1Valid = disabled |
| 170 | * Vaux2HwHPReq1Valid = disabled |
| 171 | * Vaux3HwHPReqValid = disabled |
| 172 | */ |
Lee Jones | 3c1b843 | 2013-03-21 15:59:01 +0000 | [diff] [blame] | 173 | INIT_REGULATOR_REGISTER(AB8500_REGUHWHPREQ1VALID1, 0xe8, 0x00), |
Bengt Jonsson | dfa3a82 | 2011-03-09 13:34:17 +0100 | [diff] [blame] | 174 | /* |
| 175 | * VextSupply1HwHPReq1Valid = disabled |
| 176 | * VextSupply2HwHPReq1Valid = disabled |
| 177 | * VextSupply3HwHPReq1Valid = disabled |
| 178 | */ |
Lee Jones | 3c1b843 | 2013-03-21 15:59:01 +0000 | [diff] [blame] | 179 | INIT_REGULATOR_REGISTER(AB8500_REGUHWHPREQ1VALID2, 0x07, 0x00), |
Bengt Jonsson | dfa3a82 | 2011-03-09 13:34:17 +0100 | [diff] [blame] | 180 | /* |
| 181 | * VanaHwHPReq2Valid = disabled |
| 182 | * Vaux1HwHPReq2Valid = disabled |
| 183 | * Vaux2HwHPReq2Valid = disabled |
| 184 | * Vaux3HwHPReq2Valid = disabled |
| 185 | */ |
Lee Jones | 3c1b843 | 2013-03-21 15:59:01 +0000 | [diff] [blame] | 186 | INIT_REGULATOR_REGISTER(AB8500_REGUHWHPREQ2VALID1, 0xe8, 0x00), |
Bengt Jonsson | dfa3a82 | 2011-03-09 13:34:17 +0100 | [diff] [blame] | 187 | /* |
| 188 | * VextSupply1HwHPReq2Valid = disabled |
| 189 | * VextSupply2HwHPReq2Valid = disabled |
| 190 | * VextSupply3HwHPReq2Valid = HWReq2 controlled |
| 191 | */ |
Lee Jones | 3c1b843 | 2013-03-21 15:59:01 +0000 | [diff] [blame] | 192 | INIT_REGULATOR_REGISTER(AB8500_REGUHWHPREQ2VALID2, 0x07, 0x04), |
Bengt Jonsson | dfa3a82 | 2011-03-09 13:34:17 +0100 | [diff] [blame] | 193 | /* |
| 194 | * VanaSwHPReqValid = disabled |
| 195 | * Vaux1SwHPReqValid = disabled |
| 196 | */ |
Lee Jones | 3c1b843 | 2013-03-21 15:59:01 +0000 | [diff] [blame] | 197 | INIT_REGULATOR_REGISTER(AB8500_REGUSWHPREQVALID1, 0xa0, 0x00), |
Bengt Jonsson | dfa3a82 | 2011-03-09 13:34:17 +0100 | [diff] [blame] | 198 | /* |
| 199 | * Vaux2SwHPReqValid = disabled |
| 200 | * Vaux3SwHPReqValid = disabled |
| 201 | * VextSupply1SwHPReqValid = disabled |
| 202 | * VextSupply2SwHPReqValid = disabled |
| 203 | * VextSupply3SwHPReqValid = disabled |
| 204 | */ |
Lee Jones | 3c1b843 | 2013-03-21 15:59:01 +0000 | [diff] [blame] | 205 | INIT_REGULATOR_REGISTER(AB8500_REGUSWHPREQVALID2, 0x1f, 0x00), |
Bengt Jonsson | dfa3a82 | 2011-03-09 13:34:17 +0100 | [diff] [blame] | 206 | /* |
| 207 | * SysClkReq2Valid1 = SysClkReq2 controlled |
| 208 | * SysClkReq3Valid1 = disabled |
| 209 | * SysClkReq4Valid1 = SysClkReq4 controlled |
| 210 | * SysClkReq5Valid1 = disabled |
| 211 | * SysClkReq6Valid1 = SysClkReq6 controlled |
| 212 | * SysClkReq7Valid1 = disabled |
| 213 | * SysClkReq8Valid1 = disabled |
| 214 | */ |
Lee Jones | 3c1b843 | 2013-03-21 15:59:01 +0000 | [diff] [blame] | 215 | INIT_REGULATOR_REGISTER(AB8500_REGUSYSCLKREQVALID1, 0xfe, 0x2a), |
Bengt Jonsson | dfa3a82 | 2011-03-09 13:34:17 +0100 | [diff] [blame] | 216 | /* |
| 217 | * SysClkReq2Valid2 = disabled |
| 218 | * SysClkReq3Valid2 = disabled |
| 219 | * SysClkReq4Valid2 = disabled |
| 220 | * SysClkReq5Valid2 = disabled |
| 221 | * SysClkReq6Valid2 = SysClkReq6 controlled |
| 222 | * SysClkReq7Valid2 = disabled |
| 223 | * SysClkReq8Valid2 = disabled |
| 224 | */ |
Lee Jones | 3c1b843 | 2013-03-21 15:59:01 +0000 | [diff] [blame] | 225 | INIT_REGULATOR_REGISTER(AB8500_REGUSYSCLKREQVALID2, 0xfe, 0x20), |
Bengt Jonsson | dfa3a82 | 2011-03-09 13:34:17 +0100 | [diff] [blame] | 226 | /* |
| 227 | * VTVoutEna = disabled |
| 228 | * Vintcore12Ena = disabled |
| 229 | * Vintcore12Sel = 1.25 V |
| 230 | * Vintcore12LP = inactive (HP) |
| 231 | * VTVoutLP = inactive (HP) |
| 232 | */ |
Lee Jones | 3c1b843 | 2013-03-21 15:59:01 +0000 | [diff] [blame] | 233 | INIT_REGULATOR_REGISTER(AB8500_REGUMISC1, 0xfe, 0x10), |
Bengt Jonsson | dfa3a82 | 2011-03-09 13:34:17 +0100 | [diff] [blame] | 234 | /* |
| 235 | * VaudioEna = disabled |
| 236 | * VdmicEna = disabled |
| 237 | * Vamic1Ena = disabled |
| 238 | * Vamic2Ena = disabled |
| 239 | */ |
Lee Jones | 3c1b843 | 2013-03-21 15:59:01 +0000 | [diff] [blame] | 240 | INIT_REGULATOR_REGISTER(AB8500_VAUDIOSUPPLY, 0x1e, 0x00), |
Bengt Jonsson | dfa3a82 | 2011-03-09 13:34:17 +0100 | [diff] [blame] | 241 | /* |
| 242 | * Vamic1_dzout = high-Z when Vamic1 is disabled |
| 243 | * Vamic2_dzout = high-Z when Vamic2 is disabled |
| 244 | */ |
Lee Jones | 3c1b843 | 2013-03-21 15:59:01 +0000 | [diff] [blame] | 245 | INIT_REGULATOR_REGISTER(AB8500_REGUCTRL1VAMIC, 0x03, 0x00), |
Bengt Jonsson | dfa3a82 | 2011-03-09 13:34:17 +0100 | [diff] [blame] | 246 | /* |
Lee Jones | d79df32 | 2013-03-21 15:58:58 +0000 | [diff] [blame] | 247 | * Vsmps1Regu = HW control |
| 248 | * Vsmps1SelCtrl = Vsmps1 voltage defined by Vsmsp1Sel2 |
| 249 | */ |
Lee Jones | 3c1b843 | 2013-03-21 15:59:01 +0000 | [diff] [blame] | 250 | INIT_REGULATOR_REGISTER(AB8500_VSMPS1REGU, 0x0f, 0x06), |
Lee Jones | d79df32 | 2013-03-21 15:58:58 +0000 | [diff] [blame] | 251 | /* |
| 252 | * Vsmps2Regu = HW control |
| 253 | * Vsmps2SelCtrl = Vsmps2 voltage defined by Vsmsp2Sel2 |
| 254 | */ |
Lee Jones | 3c1b843 | 2013-03-21 15:59:01 +0000 | [diff] [blame] | 255 | INIT_REGULATOR_REGISTER(AB8500_VSMPS2REGU, 0x0f, 0x06), |
Lee Jones | d79df32 | 2013-03-21 15:58:58 +0000 | [diff] [blame] | 256 | /* |
Bengt Jonsson | dfa3a82 | 2011-03-09 13:34:17 +0100 | [diff] [blame] | 257 | * VPll = Hw controlled |
| 258 | * VanaRegu = force off |
| 259 | */ |
Lee Jones | 3c1b843 | 2013-03-21 15:59:01 +0000 | [diff] [blame] | 260 | INIT_REGULATOR_REGISTER(AB8500_VPLLVANAREGU, 0x0f, 0x02), |
Bengt Jonsson | dfa3a82 | 2011-03-09 13:34:17 +0100 | [diff] [blame] | 261 | /* |
| 262 | * VrefDDREna = disabled |
| 263 | * VrefDDRSleepMode = inactive (no pulldown) |
| 264 | */ |
Lee Jones | 3c1b843 | 2013-03-21 15:59:01 +0000 | [diff] [blame] | 265 | INIT_REGULATOR_REGISTER(AB8500_VREFDDR, 0x03, 0x00), |
Bengt Jonsson | dfa3a82 | 2011-03-09 13:34:17 +0100 | [diff] [blame] | 266 | /* |
| 267 | * VextSupply1Regu = HW control |
| 268 | * VextSupply2Regu = HW control |
| 269 | * VextSupply3Regu = HW control |
| 270 | * ExtSupply2Bypass = ExtSupply12LPn ball is 0 when Ena is 0 |
| 271 | * ExtSupply3Bypass = ExtSupply3LPn ball is 0 when Ena is 0 |
| 272 | */ |
Lee Jones | 3c1b843 | 2013-03-21 15:59:01 +0000 | [diff] [blame] | 273 | INIT_REGULATOR_REGISTER(AB8500_EXTSUPPLYREGU, 0xff, 0x1a), |
Bengt Jonsson | dfa3a82 | 2011-03-09 13:34:17 +0100 | [diff] [blame] | 274 | /* |
| 275 | * Vaux1Regu = force HP |
| 276 | * Vaux2Regu = force off |
| 277 | */ |
Lee Jones | 3c1b843 | 2013-03-21 15:59:01 +0000 | [diff] [blame] | 278 | INIT_REGULATOR_REGISTER(AB8500_VAUX12REGU, 0x0f, 0x01), |
Bengt Jonsson | dfa3a82 | 2011-03-09 13:34:17 +0100 | [diff] [blame] | 279 | /* |
Lee Jones | d79df32 | 2013-03-21 15:58:58 +0000 | [diff] [blame] | 280 | * Vrf1Regu = HW control |
| 281 | * Vaux3Regu = force off |
Bengt Jonsson | dfa3a82 | 2011-03-09 13:34:17 +0100 | [diff] [blame] | 282 | */ |
Lee Jones | 3c1b843 | 2013-03-21 15:59:01 +0000 | [diff] [blame] | 283 | INIT_REGULATOR_REGISTER(AB8500_VRF1VAUX3REGU, 0x0f, 0x08), |
Bengt Jonsson | dfa3a82 | 2011-03-09 13:34:17 +0100 | [diff] [blame] | 284 | /* |
| 285 | * Vsmps1 = 1.15V |
| 286 | */ |
Lee Jones | 3c1b843 | 2013-03-21 15:59:01 +0000 | [diff] [blame] | 287 | INIT_REGULATOR_REGISTER(AB8500_VSMPS1SEL1, 0x3f, 0x24), |
Bengt Jonsson | dfa3a82 | 2011-03-09 13:34:17 +0100 | [diff] [blame] | 288 | /* |
| 289 | * Vaux1Sel = 2.5 V |
| 290 | */ |
Lee Jones | 3c1b843 | 2013-03-21 15:59:01 +0000 | [diff] [blame] | 291 | INIT_REGULATOR_REGISTER(AB8500_VAUX1SEL, 0x0f, 0x08), |
Bengt Jonsson | dfa3a82 | 2011-03-09 13:34:17 +0100 | [diff] [blame] | 292 | /* |
| 293 | * Vaux2Sel = 2.9 V |
| 294 | */ |
Lee Jones | 3c1b843 | 2013-03-21 15:59:01 +0000 | [diff] [blame] | 295 | INIT_REGULATOR_REGISTER(AB8500_VAUX2SEL, 0x0f, 0x0d), |
Bengt Jonsson | dfa3a82 | 2011-03-09 13:34:17 +0100 | [diff] [blame] | 296 | /* |
| 297 | * Vaux3Sel = 2.91 V |
| 298 | */ |
Lee Jones | 3c1b843 | 2013-03-21 15:59:01 +0000 | [diff] [blame] | 299 | INIT_REGULATOR_REGISTER(AB8500_VRF1VAUX3SEL, 0x07, 0x07), |
Bengt Jonsson | dfa3a82 | 2011-03-09 13:34:17 +0100 | [diff] [blame] | 300 | /* |
| 301 | * VextSupply12LP = disabled (no LP) |
| 302 | */ |
Lee Jones | 3c1b843 | 2013-03-21 15:59:01 +0000 | [diff] [blame] | 303 | INIT_REGULATOR_REGISTER(AB8500_REGUCTRL2SPARE, 0x01, 0x00), |
Bengt Jonsson | dfa3a82 | 2011-03-09 13:34:17 +0100 | [diff] [blame] | 304 | /* |
| 305 | * Vaux1Disch = short discharge time |
| 306 | * Vaux2Disch = short discharge time |
| 307 | * Vaux3Disch = short discharge time |
| 308 | * Vintcore12Disch = short discharge time |
| 309 | * VTVoutDisch = short discharge time |
| 310 | * VaudioDisch = short discharge time |
| 311 | */ |
Lee Jones | 3c1b843 | 2013-03-21 15:59:01 +0000 | [diff] [blame] | 312 | INIT_REGULATOR_REGISTER(AB8500_REGUCTRLDISCH, 0xfc, 0x00), |
Bengt Jonsson | dfa3a82 | 2011-03-09 13:34:17 +0100 | [diff] [blame] | 313 | /* |
| 314 | * VanaDisch = short discharge time |
| 315 | * VdmicPullDownEna = pulldown disabled when Vdmic is disabled |
| 316 | * VdmicDisch = short discharge time |
| 317 | */ |
Lee Jones | 3c1b843 | 2013-03-21 15:59:01 +0000 | [diff] [blame] | 318 | INIT_REGULATOR_REGISTER(AB8500_REGUCTRLDISCH2, 0x16, 0x00), |
Bengt Jonsson | dfa3a82 | 2011-03-09 13:34:17 +0100 | [diff] [blame] | 319 | }; |
| 320 | |
Bengt Jonsson | a1e516e | 2010-12-10 11:08:48 +0100 | [diff] [blame] | 321 | /* AB8500 regulators */ |
Bengt Jonsson | 732805a | 2013-03-21 15:59:03 +0000 | [diff] [blame] | 322 | static struct regulator_init_data ab8500_regulators[AB8500_NUM_REGULATORS] = { |
Bengt Jonsson | a1e516e | 2010-12-10 11:08:48 +0100 | [diff] [blame] | 323 | /* supplies to the display/camera */ |
| 324 | [AB8500_LDO_AUX1] = { |
| 325 | .constraints = { |
| 326 | .name = "V-DISPLAY", |
| 327 | .min_uV = 2500000, |
| 328 | .max_uV = 2900000, |
| 329 | .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE | |
| 330 | REGULATOR_CHANGE_STATUS, |
Linus Walleij | db24520 | 2011-04-04 10:44:51 +0200 | [diff] [blame] | 331 | .boot_on = 1, /* display is on at boot */ |
| 332 | /* |
| 333 | * This voltage cannot be disabled right now because |
| 334 | * it is somehow affecting the external MMC |
| 335 | * functionality, though that typically will use |
| 336 | * AUX3. |
| 337 | */ |
| 338 | .always_on = 1, |
Bengt Jonsson | a1e516e | 2010-12-10 11:08:48 +0100 | [diff] [blame] | 339 | }, |
Linus Walleij | d1de85a | 2010-12-02 17:10:14 +0100 | [diff] [blame] | 340 | .num_consumer_supplies = ARRAY_SIZE(ab8500_vaux1_consumers), |
| 341 | .consumer_supplies = ab8500_vaux1_consumers, |
Bengt Jonsson | a1e516e | 2010-12-10 11:08:48 +0100 | [diff] [blame] | 342 | }, |
| 343 | /* supplies to the on-board eMMC */ |
| 344 | [AB8500_LDO_AUX2] = { |
| 345 | .constraints = { |
| 346 | .name = "V-eMMC1", |
| 347 | .min_uV = 1100000, |
| 348 | .max_uV = 3300000, |
| 349 | .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE | |
| 350 | REGULATOR_CHANGE_STATUS, |
| 351 | }, |
Linus Walleij | d1de85a | 2010-12-02 17:10:14 +0100 | [diff] [blame] | 352 | .num_consumer_supplies = ARRAY_SIZE(ab8500_vaux2_consumers), |
| 353 | .consumer_supplies = ab8500_vaux2_consumers, |
Bengt Jonsson | a1e516e | 2010-12-10 11:08:48 +0100 | [diff] [blame] | 354 | }, |
| 355 | /* supply for VAUX3, supplies to SDcard slots */ |
| 356 | [AB8500_LDO_AUX3] = { |
| 357 | .constraints = { |
| 358 | .name = "V-MMC-SD", |
| 359 | .min_uV = 1100000, |
| 360 | .max_uV = 3300000, |
| 361 | .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE | |
| 362 | REGULATOR_CHANGE_STATUS, |
| 363 | }, |
Linus Walleij | d1de85a | 2010-12-02 17:10:14 +0100 | [diff] [blame] | 364 | .num_consumer_supplies = ARRAY_SIZE(ab8500_vaux3_consumers), |
| 365 | .consumer_supplies = ab8500_vaux3_consumers, |
Bengt Jonsson | a1e516e | 2010-12-10 11:08:48 +0100 | [diff] [blame] | 366 | }, |
| 367 | /* supply for tvout, gpadc, TVOUT LDO */ |
| 368 | [AB8500_LDO_TVOUT] = { |
| 369 | .constraints = { |
| 370 | .name = "V-TVOUT", |
| 371 | .valid_ops_mask = REGULATOR_CHANGE_STATUS, |
| 372 | }, |
Linus Walleij | d1de85a | 2010-12-02 17:10:14 +0100 | [diff] [blame] | 373 | .num_consumer_supplies = ARRAY_SIZE(ab8500_vtvout_consumers), |
| 374 | .consumer_supplies = ab8500_vtvout_consumers, |
Bengt Jonsson | a1e516e | 2010-12-10 11:08:48 +0100 | [diff] [blame] | 375 | }, |
| 376 | /* supply for ab8500-vaudio, VAUDIO LDO */ |
| 377 | [AB8500_LDO_AUDIO] = { |
| 378 | .constraints = { |
| 379 | .name = "V-AUD", |
| 380 | .valid_ops_mask = REGULATOR_CHANGE_STATUS, |
| 381 | }, |
Ola Lilja | 29bd2ab | 2012-02-01 14:18:10 +0100 | [diff] [blame] | 382 | .num_consumer_supplies = ARRAY_SIZE(ab8500_vaud_consumers), |
| 383 | .consumer_supplies = ab8500_vaud_consumers, |
Bengt Jonsson | a1e516e | 2010-12-10 11:08:48 +0100 | [diff] [blame] | 384 | }, |
| 385 | /* supply for v-anamic1 VAMic1-LDO */ |
| 386 | [AB8500_LDO_ANAMIC1] = { |
| 387 | .constraints = { |
| 388 | .name = "V-AMIC1", |
| 389 | .valid_ops_mask = REGULATOR_CHANGE_STATUS, |
| 390 | }, |
Ola Lilja | 29bd2ab | 2012-02-01 14:18:10 +0100 | [diff] [blame] | 391 | .num_consumer_supplies = ARRAY_SIZE(ab8500_vamic1_consumers), |
| 392 | .consumer_supplies = ab8500_vamic1_consumers, |
Bengt Jonsson | a1e516e | 2010-12-10 11:08:48 +0100 | [diff] [blame] | 393 | }, |
| 394 | /* supply for v-amic2, VAMIC2 LDO, reuse constants for AMIC1 */ |
| 395 | [AB8500_LDO_ANAMIC2] = { |
| 396 | .constraints = { |
| 397 | .name = "V-AMIC2", |
| 398 | .valid_ops_mask = REGULATOR_CHANGE_STATUS, |
| 399 | }, |
Ola Lilja | 29bd2ab | 2012-02-01 14:18:10 +0100 | [diff] [blame] | 400 | .num_consumer_supplies = ARRAY_SIZE(ab8500_vamic2_consumers), |
| 401 | .consumer_supplies = ab8500_vamic2_consumers, |
Bengt Jonsson | a1e516e | 2010-12-10 11:08:48 +0100 | [diff] [blame] | 402 | }, |
| 403 | /* supply for v-dmic, VDMIC LDO */ |
| 404 | [AB8500_LDO_DMIC] = { |
| 405 | .constraints = { |
| 406 | .name = "V-DMIC", |
| 407 | .valid_ops_mask = REGULATOR_CHANGE_STATUS, |
| 408 | }, |
Ola Lilja | 29bd2ab | 2012-02-01 14:18:10 +0100 | [diff] [blame] | 409 | .num_consumer_supplies = ARRAY_SIZE(ab8500_vdmic_consumers), |
| 410 | .consumer_supplies = ab8500_vdmic_consumers, |
Bengt Jonsson | a1e516e | 2010-12-10 11:08:48 +0100 | [diff] [blame] | 411 | }, |
| 412 | /* supply for v-intcore12, VINTCORE12 LDO */ |
| 413 | [AB8500_LDO_INTCORE] = { |
| 414 | .constraints = { |
| 415 | .name = "V-INTCORE", |
| 416 | .valid_ops_mask = REGULATOR_CHANGE_STATUS, |
| 417 | }, |
Linus Walleij | d1de85a | 2010-12-02 17:10:14 +0100 | [diff] [blame] | 418 | .num_consumer_supplies = ARRAY_SIZE(ab8500_vintcore_consumers), |
| 419 | .consumer_supplies = ab8500_vintcore_consumers, |
Bengt Jonsson | a1e516e | 2010-12-10 11:08:48 +0100 | [diff] [blame] | 420 | }, |
| 421 | /* supply for U8500 CSI/DSI, VANA LDO */ |
| 422 | [AB8500_LDO_ANA] = { |
| 423 | .constraints = { |
| 424 | .name = "V-CSI/DSI", |
| 425 | .valid_ops_mask = REGULATOR_CHANGE_STATUS, |
| 426 | }, |
Linus Walleij | d1de85a | 2010-12-02 17:10:14 +0100 | [diff] [blame] | 427 | .num_consumer_supplies = ARRAY_SIZE(ab8500_vana_consumers), |
| 428 | .consumer_supplies = ab8500_vana_consumers, |
Sundar Iyer | 4f724be | 2010-09-15 10:50:59 +0100 | [diff] [blame] | 429 | }, |
| 430 | }; |
Bengt Jonsson | 732805a | 2013-03-21 15:59:03 +0000 | [diff] [blame] | 431 | |
| 432 | struct ab8500_regulator_platform_data ab8500_regulator_plat_data = { |
| 433 | .reg_init = ab8500_reg_init, |
| 434 | .num_reg_init = ARRAY_SIZE(ab8500_reg_init), |
| 435 | .regulator = ab8500_regulators, |
| 436 | .num_regulator = ARRAY_SIZE(ab8500_regulators), |
| 437 | }; |