diff options
-rw-r--r-- | arch/arm/mach-ux500/board-mop500-regulators.c | 66 | ||||
-rw-r--r-- | drivers/regulator/ab8500.c | 36 | ||||
-rw-r--r-- | include/linux/regulator/ab8500.h | 10 |
3 files changed, 53 insertions, 59 deletions
diff --git a/arch/arm/mach-ux500/board-mop500-regulators.c b/arch/arm/mach-ux500/board-mop500-regulators.c index 4b3c51905071..96dd17490bea 100644 --- a/arch/arm/mach-ux500/board-mop500-regulators.c +++ b/arch/arm/mach-ux500/board-mop500-regulators.c | |||
@@ -129,19 +129,19 @@ ab8500_regulator_reg_init[AB8500_NUM_REGULATOR_REGISTERS] = { | |||
129 | * VpllRequestCtrl = HP/LP depending on VxRequest | 129 | * VpllRequestCtrl = HP/LP depending on VxRequest |
130 | * VextSupply1RequestCtrl = HP/LP depending on VxRequest | 130 | * VextSupply1RequestCtrl = HP/LP depending on VxRequest |
131 | */ | 131 | */ |
132 | INIT_REGULATOR_REGISTER(AB8500_REGUREQUESTCTRL2, 0x00), | 132 | INIT_REGULATOR_REGISTER(AB8500_REGUREQUESTCTRL2, 0xfc, 0x00), |
133 | /* | 133 | /* |
134 | * VextSupply2RequestCtrl = HP/LP depending on VxRequest | 134 | * VextSupply2RequestCtrl = HP/LP depending on VxRequest |
135 | * VextSupply3RequestCtrl = HP/LP depending on VxRequest | 135 | * VextSupply3RequestCtrl = HP/LP depending on VxRequest |
136 | * Vaux1RequestCtrl = HP/LP depending on VxRequest | 136 | * Vaux1RequestCtrl = HP/LP depending on VxRequest |
137 | * Vaux2RequestCtrl = HP/LP depending on VxRequest | 137 | * Vaux2RequestCtrl = HP/LP depending on VxRequest |
138 | */ | 138 | */ |
139 | INIT_REGULATOR_REGISTER(AB8500_REGUREQUESTCTRL3, 0x00), | 139 | INIT_REGULATOR_REGISTER(AB8500_REGUREQUESTCTRL3, 0xff, 0x00), |
140 | /* | 140 | /* |
141 | * Vaux3RequestCtrl = HP/LP depending on VxRequest | 141 | * Vaux3RequestCtrl = HP/LP depending on VxRequest |
142 | * SwHPReq = Control through SWValid disabled | 142 | * SwHPReq = Control through SWValid disabled |
143 | */ | 143 | */ |
144 | INIT_REGULATOR_REGISTER(AB8500_REGUREQUESTCTRL4, 0x00), | 144 | INIT_REGULATOR_REGISTER(AB8500_REGUREQUESTCTRL4, 0x07, 0x00), |
145 | /* | 145 | /* |
146 | * Vsmps1SysClkReq1HPValid = enabled | 146 | * Vsmps1SysClkReq1HPValid = enabled |
147 | * Vsmps2SysClkReq1HPValid = enabled | 147 | * Vsmps2SysClkReq1HPValid = enabled |
@@ -152,44 +152,44 @@ ab8500_regulator_reg_init[AB8500_NUM_REGULATOR_REGISTERS] = { | |||
152 | * Vaux2SysClkReq1HPValid = disabled | 152 | * Vaux2SysClkReq1HPValid = disabled |
153 | * Vaux3SysClkReq1HPValid = disabled | 153 | * Vaux3SysClkReq1HPValid = disabled |
154 | */ | 154 | */ |
155 | INIT_REGULATOR_REGISTER(AB8500_REGUSYSCLKREQ1HPVALID1, 0x17), | 155 | INIT_REGULATOR_REGISTER(AB8500_REGUSYSCLKREQ1HPVALID1, 0xff, 0x17), |
156 | /* | 156 | /* |
157 | * VextSupply1SysClkReq1HPValid = disabled | 157 | * VextSupply1SysClkReq1HPValid = disabled |
158 | * VextSupply2SysClkReq1HPValid = disabled | 158 | * VextSupply2SysClkReq1HPValid = disabled |
159 | * VextSupply3SysClkReq1HPValid = SysClkReq1 controlled | 159 | * VextSupply3SysClkReq1HPValid = SysClkReq1 controlled |
160 | */ | 160 | */ |
161 | INIT_REGULATOR_REGISTER(AB8500_REGUSYSCLKREQ1HPVALID2, 0x40), | 161 | INIT_REGULATOR_REGISTER(AB8500_REGUSYSCLKREQ1HPVALID2, 0x70, 0x40), |
162 | /* | 162 | /* |
163 | * VanaHwHPReq1Valid = disabled | 163 | * VanaHwHPReq1Valid = disabled |
164 | * Vaux1HwHPreq1Valid = disabled | 164 | * Vaux1HwHPreq1Valid = disabled |
165 | * Vaux2HwHPReq1Valid = disabled | 165 | * Vaux2HwHPReq1Valid = disabled |
166 | * Vaux3HwHPReqValid = disabled | 166 | * Vaux3HwHPReqValid = disabled |
167 | */ | 167 | */ |
168 | INIT_REGULATOR_REGISTER(AB8500_REGUHWHPREQ1VALID1, 0x00), | 168 | INIT_REGULATOR_REGISTER(AB8500_REGUHWHPREQ1VALID1, 0xe8, 0x00), |
169 | /* | 169 | /* |
170 | * VextSupply1HwHPReq1Valid = disabled | 170 | * VextSupply1HwHPReq1Valid = disabled |
171 | * VextSupply2HwHPReq1Valid = disabled | 171 | * VextSupply2HwHPReq1Valid = disabled |
172 | * VextSupply3HwHPReq1Valid = disabled | 172 | * VextSupply3HwHPReq1Valid = disabled |
173 | */ | 173 | */ |
174 | INIT_REGULATOR_REGISTER(AB8500_REGUHWHPREQ1VALID2, 0x00), | 174 | INIT_REGULATOR_REGISTER(AB8500_REGUHWHPREQ1VALID2, 0x07, 0x00), |
175 | /* | 175 | /* |
176 | * VanaHwHPReq2Valid = disabled | 176 | * VanaHwHPReq2Valid = disabled |
177 | * Vaux1HwHPReq2Valid = disabled | 177 | * Vaux1HwHPReq2Valid = disabled |
178 | * Vaux2HwHPReq2Valid = disabled | 178 | * Vaux2HwHPReq2Valid = disabled |
179 | * Vaux3HwHPReq2Valid = disabled | 179 | * Vaux3HwHPReq2Valid = disabled |
180 | */ | 180 | */ |
181 | INIT_REGULATOR_REGISTER(AB8500_REGUHWHPREQ2VALID1, 0x00), | 181 | INIT_REGULATOR_REGISTER(AB8500_REGUHWHPREQ2VALID1, 0xe8, 0x00), |
182 | /* | 182 | /* |
183 | * VextSupply1HwHPReq2Valid = disabled | 183 | * VextSupply1HwHPReq2Valid = disabled |
184 | * VextSupply2HwHPReq2Valid = disabled | 184 | * VextSupply2HwHPReq2Valid = disabled |
185 | * VextSupply3HwHPReq2Valid = HWReq2 controlled | 185 | * VextSupply3HwHPReq2Valid = HWReq2 controlled |
186 | */ | 186 | */ |
187 | INIT_REGULATOR_REGISTER(AB8500_REGUHWHPREQ2VALID2, 0x04), | 187 | INIT_REGULATOR_REGISTER(AB8500_REGUHWHPREQ2VALID2, 0x07, 0x04), |
188 | /* | 188 | /* |
189 | * VanaSwHPReqValid = disabled | 189 | * VanaSwHPReqValid = disabled |
190 | * Vaux1SwHPReqValid = disabled | 190 | * Vaux1SwHPReqValid = disabled |
191 | */ | 191 | */ |
192 | INIT_REGULATOR_REGISTER(AB8500_REGUSWHPREQVALID1, 0x00), | 192 | INIT_REGULATOR_REGISTER(AB8500_REGUSWHPREQVALID1, 0xa0, 0x00), |
193 | /* | 193 | /* |
194 | * Vaux2SwHPReqValid = disabled | 194 | * Vaux2SwHPReqValid = disabled |
195 | * Vaux3SwHPReqValid = disabled | 195 | * Vaux3SwHPReqValid = disabled |
@@ -197,7 +197,7 @@ ab8500_regulator_reg_init[AB8500_NUM_REGULATOR_REGISTERS] = { | |||
197 | * VextSupply2SwHPReqValid = disabled | 197 | * VextSupply2SwHPReqValid = disabled |
198 | * VextSupply3SwHPReqValid = disabled | 198 | * VextSupply3SwHPReqValid = disabled |
199 | */ | 199 | */ |
200 | INIT_REGULATOR_REGISTER(AB8500_REGUSWHPREQVALID2, 0x00), | 200 | INIT_REGULATOR_REGISTER(AB8500_REGUSWHPREQVALID2, 0x1f, 0x00), |
201 | /* | 201 | /* |
202 | * SysClkReq2Valid1 = SysClkReq2 controlled | 202 | * SysClkReq2Valid1 = SysClkReq2 controlled |
203 | * SysClkReq3Valid1 = disabled | 203 | * SysClkReq3Valid1 = disabled |
@@ -207,7 +207,7 @@ ab8500_regulator_reg_init[AB8500_NUM_REGULATOR_REGISTERS] = { | |||
207 | * SysClkReq7Valid1 = disabled | 207 | * SysClkReq7Valid1 = disabled |
208 | * SysClkReq8Valid1 = disabled | 208 | * SysClkReq8Valid1 = disabled |
209 | */ | 209 | */ |
210 | INIT_REGULATOR_REGISTER(AB8500_REGUSYSCLKREQVALID1, 0x2a), | 210 | INIT_REGULATOR_REGISTER(AB8500_REGUSYSCLKREQVALID1, 0xfe, 0x2a), |
211 | /* | 211 | /* |
212 | * SysClkReq2Valid2 = disabled | 212 | * SysClkReq2Valid2 = disabled |
213 | * SysClkReq3Valid2 = disabled | 213 | * SysClkReq3Valid2 = disabled |
@@ -217,7 +217,7 @@ ab8500_regulator_reg_init[AB8500_NUM_REGULATOR_REGISTERS] = { | |||
217 | * SysClkReq7Valid2 = disabled | 217 | * SysClkReq7Valid2 = disabled |
218 | * SysClkReq8Valid2 = disabled | 218 | * SysClkReq8Valid2 = disabled |
219 | */ | 219 | */ |
220 | INIT_REGULATOR_REGISTER(AB8500_REGUSYSCLKREQVALID2, 0x20), | 220 | INIT_REGULATOR_REGISTER(AB8500_REGUSYSCLKREQVALID2, 0xfe, 0x20), |
221 | /* | 221 | /* |
222 | * VTVoutEna = disabled | 222 | * VTVoutEna = disabled |
223 | * Vintcore12Ena = disabled | 223 | * Vintcore12Ena = disabled |
@@ -225,57 +225,57 @@ ab8500_regulator_reg_init[AB8500_NUM_REGULATOR_REGISTERS] = { | |||
225 | * Vintcore12LP = inactive (HP) | 225 | * Vintcore12LP = inactive (HP) |
226 | * VTVoutLP = inactive (HP) | 226 | * VTVoutLP = inactive (HP) |
227 | */ | 227 | */ |
228 | INIT_REGULATOR_REGISTER(AB8500_REGUMISC1, 0x10), | 228 | INIT_REGULATOR_REGISTER(AB8500_REGUMISC1, 0xfe, 0x10), |
229 | /* | 229 | /* |
230 | * VaudioEna = disabled | 230 | * VaudioEna = disabled |
231 | * VdmicEna = disabled | 231 | * VdmicEna = disabled |
232 | * Vamic1Ena = disabled | 232 | * Vamic1Ena = disabled |
233 | * Vamic2Ena = disabled | 233 | * Vamic2Ena = disabled |
234 | */ | 234 | */ |
235 | INIT_REGULATOR_REGISTER(AB8500_VAUDIOSUPPLY, 0x00), | 235 | INIT_REGULATOR_REGISTER(AB8500_VAUDIOSUPPLY, 0x1e, 0x00), |
236 | /* | 236 | /* |
237 | * Vamic1_dzout = high-Z when Vamic1 is disabled | 237 | * Vamic1_dzout = high-Z when Vamic1 is disabled |
238 | * Vamic2_dzout = high-Z when Vamic2 is disabled | 238 | * Vamic2_dzout = high-Z when Vamic2 is disabled |
239 | */ | 239 | */ |
240 | INIT_REGULATOR_REGISTER(AB8500_REGUCTRL1VAMIC, 0x00), | 240 | INIT_REGULATOR_REGISTER(AB8500_REGUCTRL1VAMIC, 0x03, 0x00), |
241 | /* | 241 | /* |
242 | * VBBN = force OFF | 242 | * VBBN = force OFF |
243 | * VBBP = force OFF | 243 | * VBBP = force OFF |
244 | * NOTE! PRCMU register | 244 | * NOTE! PRCMU register |
245 | */ | 245 | */ |
246 | INIT_REGULATOR_REGISTER(AB8500_ARMREGU2, 0x00), | 246 | INIT_REGULATOR_REGISTER(AB8500_ARMREGU2, 0x0f, 0x00), |
247 | /* | 247 | /* |
248 | * VBBNSel1 = VBBP = VBBPFB | 248 | * VBBNSel1 = VBBP = VBBPFB |
249 | * VBBPSel1 = 0 V | 249 | * VBBPSel1 = 0 V |
250 | * NOTE! PRCMU register | 250 | * NOTE! PRCMU register |
251 | */ | 251 | */ |
252 | INIT_REGULATOR_REGISTER(AB8500_VBBSEL1, 0x00), | 252 | INIT_REGULATOR_REGISTER(AB8500_VBBSEL1, 0x0f, 0x00), |
253 | /* | 253 | /* |
254 | * VBBNSel2 = VBBP = VBBPFB | 254 | * VBBNSel2 = VBBP = VBBPFB |
255 | * VBBPSel2 = 0 V | 255 | * VBBPSel2 = 0 V |
256 | * NOTE! PRCMU register | 256 | * NOTE! PRCMU register |
257 | */ | 257 | */ |
258 | INIT_REGULATOR_REGISTER(AB8500_VBBSEL2, 0x00), | 258 | INIT_REGULATOR_REGISTER(AB8500_VBBSEL2, 0x0f, 0x00), |
259 | /* | 259 | /* |
260 | * Vsmps1Regu = HW control | 260 | * Vsmps1Regu = HW control |
261 | * Vsmps1SelCtrl = Vsmps1 voltage defined by Vsmsp1Sel2 | 261 | * Vsmps1SelCtrl = Vsmps1 voltage defined by Vsmsp1Sel2 |
262 | */ | 262 | */ |
263 | INIT_REGULATOR_REGISTER(AB8500_VSMPS1REGU, 0x06), | 263 | INIT_REGULATOR_REGISTER(AB8500_VSMPS1REGU, 0x0f, 0x06), |
264 | /* | 264 | /* |
265 | * Vsmps2Regu = HW control | 265 | * Vsmps2Regu = HW control |
266 | * Vsmps2SelCtrl = Vsmps2 voltage defined by Vsmsp2Sel2 | 266 | * Vsmps2SelCtrl = Vsmps2 voltage defined by Vsmsp2Sel2 |
267 | */ | 267 | */ |
268 | INIT_REGULATOR_REGISTER(AB8500_VSMPS2REGU, 0x06), | 268 | INIT_REGULATOR_REGISTER(AB8500_VSMPS2REGU, 0x0f, 0x06), |
269 | /* | 269 | /* |
270 | * VPll = Hw controlled | 270 | * VPll = Hw controlled |
271 | * VanaRegu = force off | 271 | * VanaRegu = force off |
272 | */ | 272 | */ |
273 | INIT_REGULATOR_REGISTER(AB8500_VPLLVANAREGU, 0x02), | 273 | INIT_REGULATOR_REGISTER(AB8500_VPLLVANAREGU, 0x0f, 0x02), |
274 | /* | 274 | /* |
275 | * VrefDDREna = disabled | 275 | * VrefDDREna = disabled |
276 | * VrefDDRSleepMode = inactive (no pulldown) | 276 | * VrefDDRSleepMode = inactive (no pulldown) |
277 | */ | 277 | */ |
278 | INIT_REGULATOR_REGISTER(AB8500_VREFDDR, 0x00), | 278 | INIT_REGULATOR_REGISTER(AB8500_VREFDDR, 0x03, 0x00), |
279 | /* | 279 | /* |
280 | * VextSupply1Regu = HW control | 280 | * VextSupply1Regu = HW control |
281 | * VextSupply2Regu = HW control | 281 | * VextSupply2Regu = HW control |
@@ -283,37 +283,37 @@ ab8500_regulator_reg_init[AB8500_NUM_REGULATOR_REGISTERS] = { | |||
283 | * ExtSupply2Bypass = ExtSupply12LPn ball is 0 when Ena is 0 | 283 | * ExtSupply2Bypass = ExtSupply12LPn ball is 0 when Ena is 0 |
284 | * ExtSupply3Bypass = ExtSupply3LPn ball is 0 when Ena is 0 | 284 | * ExtSupply3Bypass = ExtSupply3LPn ball is 0 when Ena is 0 |
285 | */ | 285 | */ |
286 | INIT_REGULATOR_REGISTER(AB8500_EXTSUPPLYREGU, 0x2a), | 286 | INIT_REGULATOR_REGISTER(AB8500_EXTSUPPLYREGU, 0xff, 0x1a), |
287 | /* | 287 | /* |
288 | * Vaux1Regu = force HP | 288 | * Vaux1Regu = force HP |
289 | * Vaux2Regu = force off | 289 | * Vaux2Regu = force off |
290 | */ | 290 | */ |
291 | INIT_REGULATOR_REGISTER(AB8500_VAUX12REGU, 0x01), | 291 | INIT_REGULATOR_REGISTER(AB8500_VAUX12REGU, 0x0f, 0x01), |
292 | /* | 292 | /* |
293 | * Vrf1Regu = HW control | 293 | * Vrf1Regu = HW control |
294 | * Vaux3Regu = force off | 294 | * Vaux3Regu = force off |
295 | */ | 295 | */ |
296 | INIT_REGULATOR_REGISTER(AB8500_VRF1VAUX3REGU, 0x08), | 296 | INIT_REGULATOR_REGISTER(AB8500_VRF1VAUX3REGU, 0x0f, 0x08), |
297 | /* | 297 | /* |
298 | * Vsmps1 = 1.15V | 298 | * Vsmps1 = 1.15V |
299 | */ | 299 | */ |
300 | INIT_REGULATOR_REGISTER(AB8500_VSMPS1SEL1, 0x24), | 300 | INIT_REGULATOR_REGISTER(AB8500_VSMPS1SEL1, 0x3f, 0x24), |
301 | /* | 301 | /* |
302 | * Vaux1Sel = 2.5 V | 302 | * Vaux1Sel = 2.5 V |
303 | */ | 303 | */ |
304 | INIT_REGULATOR_REGISTER(AB8500_VAUX1SEL, 0x08), | 304 | INIT_REGULATOR_REGISTER(AB8500_VAUX1SEL, 0x0f, 0x08), |
305 | /* | 305 | /* |
306 | * Vaux2Sel = 2.9 V | 306 | * Vaux2Sel = 2.9 V |
307 | */ | 307 | */ |
308 | INIT_REGULATOR_REGISTER(AB8500_VAUX2SEL, 0x0d), | 308 | INIT_REGULATOR_REGISTER(AB8500_VAUX2SEL, 0x0f, 0x0d), |
309 | /* | 309 | /* |
310 | * Vaux3Sel = 2.91 V | 310 | * Vaux3Sel = 2.91 V |
311 | */ | 311 | */ |
312 | INIT_REGULATOR_REGISTER(AB8500_VRF1VAUX3SEL, 0x07), | 312 | INIT_REGULATOR_REGISTER(AB8500_VRF1VAUX3SEL, 0x07, 0x07), |
313 | /* | 313 | /* |
314 | * VextSupply12LP = disabled (no LP) | 314 | * VextSupply12LP = disabled (no LP) |
315 | */ | 315 | */ |
316 | INIT_REGULATOR_REGISTER(AB8500_REGUCTRL2SPARE, 0x00), | 316 | INIT_REGULATOR_REGISTER(AB8500_REGUCTRL2SPARE, 0x01, 0x00), |
317 | /* | 317 | /* |
318 | * Vaux1Disch = short discharge time | 318 | * Vaux1Disch = short discharge time |
319 | * Vaux2Disch = short discharge time | 319 | * Vaux2Disch = short discharge time |
@@ -322,13 +322,13 @@ ab8500_regulator_reg_init[AB8500_NUM_REGULATOR_REGISTERS] = { | |||
322 | * VTVoutDisch = short discharge time | 322 | * VTVoutDisch = short discharge time |
323 | * VaudioDisch = short discharge time | 323 | * VaudioDisch = short discharge time |
324 | */ | 324 | */ |
325 | INIT_REGULATOR_REGISTER(AB8500_REGUCTRLDISCH, 0x00), | 325 | INIT_REGULATOR_REGISTER(AB8500_REGUCTRLDISCH, 0xfc, 0x00), |
326 | /* | 326 | /* |
327 | * VanaDisch = short discharge time | 327 | * VanaDisch = short discharge time |
328 | * VdmicPullDownEna = pulldown disabled when Vdmic is disabled | 328 | * VdmicPullDownEna = pulldown disabled when Vdmic is disabled |
329 | * VdmicDisch = short discharge time | 329 | * VdmicDisch = short discharge time |
330 | */ | 330 | */ |
331 | INIT_REGULATOR_REGISTER(AB8500_REGUCTRLDISCH2, 0x00), | 331 | INIT_REGULATOR_REGISTER(AB8500_REGUCTRLDISCH2, 0x16, 0x00), |
332 | }; | 332 | }; |
333 | 333 | ||
334 | /* AB8500 regulators */ | 334 | /* AB8500 regulators */ |
diff --git a/drivers/regulator/ab8500.c b/drivers/regulator/ab8500.c index 3465ac38bffe..a847744f8c20 100644 --- a/drivers/regulator/ab8500.c +++ b/drivers/regulator/ab8500.c | |||
@@ -811,23 +811,20 @@ static struct ab8500_reg_init ab8500_reg_init[] = { | |||
811 | REG_INIT(AB8500_REGUCTRLDISCH2, 0x04, 0x44, 0x16), | 811 | REG_INIT(AB8500_REGUCTRLDISCH2, 0x04, 0x44, 0x16), |
812 | }; | 812 | }; |
813 | 813 | ||
814 | static int | 814 | static int ab8500_regulator_init_registers(struct platform_device *pdev, |
815 | ab8500_regulator_init_registers(struct platform_device *pdev, int id, int value) | 815 | int id, int mask, int value) |
816 | { | 816 | { |
817 | int err; | 817 | int err; |
818 | 818 | ||
819 | if (value & ~ab8500_reg_init[id].mask) { | 819 | BUG_ON(value & ~mask); |
820 | dev_err(&pdev->dev, | 820 | BUG_ON(mask & ~ab8500_reg_init[id].mask); |
821 | "Configuration error: value outside mask.\n"); | ||
822 | return -EINVAL; | ||
823 | } | ||
824 | 821 | ||
822 | /* initialize register */ | ||
825 | err = abx500_mask_and_set_register_interruptible( | 823 | err = abx500_mask_and_set_register_interruptible( |
826 | &pdev->dev, | 824 | &pdev->dev, |
827 | ab8500_reg_init[id].bank, | 825 | ab8500_reg_init[id].bank, |
828 | ab8500_reg_init[id].addr, | 826 | ab8500_reg_init[id].addr, |
829 | ab8500_reg_init[id].mask, | 827 | mask, value); |
830 | value); | ||
831 | if (err < 0) { | 828 | if (err < 0) { |
832 | dev_err(&pdev->dev, | 829 | dev_err(&pdev->dev, |
833 | "Failed to initialize 0x%02x, 0x%02x.\n", | 830 | "Failed to initialize 0x%02x, 0x%02x.\n", |
@@ -835,13 +832,11 @@ ab8500_regulator_init_registers(struct platform_device *pdev, int id, int value) | |||
835 | ab8500_reg_init[id].addr); | 832 | ab8500_reg_init[id].addr); |
836 | return err; | 833 | return err; |
837 | } | 834 | } |
838 | |||
839 | dev_vdbg(&pdev->dev, | 835 | dev_vdbg(&pdev->dev, |
840 | "init: 0x%02x, 0x%02x, 0x%02x, 0x%02x\n", | 836 | " init: 0x%02x, 0x%02x, 0x%02x, 0x%02x\n", |
841 | ab8500_reg_init[id].bank, | 837 | ab8500_reg_init[id].bank, |
842 | ab8500_reg_init[id].addr, | 838 | ab8500_reg_init[id].addr, |
843 | ab8500_reg_init[id].mask, | 839 | mask, value); |
844 | value); | ||
845 | 840 | ||
846 | return 0; | 841 | return 0; |
847 | } | 842 | } |
@@ -960,19 +955,16 @@ static int ab8500_regulator_probe(struct platform_device *pdev) | |||
960 | 955 | ||
961 | /* initialize registers */ | 956 | /* initialize registers */ |
962 | for (i = 0; i < pdata->num_regulator_reg_init; i++) { | 957 | for (i = 0; i < pdata->num_regulator_reg_init; i++) { |
963 | int id, value; | 958 | int id, mask, value; |
964 | 959 | ||
965 | id = pdata->regulator_reg_init[i].id; | 960 | id = pdata->regulator_reg_init[i].id; |
961 | mask = pdata->regulator_reg_init[i].mask; | ||
966 | value = pdata->regulator_reg_init[i].value; | 962 | value = pdata->regulator_reg_init[i].value; |
967 | 963 | ||
968 | /* check for configuration errors */ | 964 | /* check for configuration errors */ |
969 | if (id >= AB8500_NUM_REGULATOR_REGISTERS) { | 965 | BUG_ON(id >= AB8500_NUM_REGULATOR_REGISTERS); |
970 | dev_err(&pdev->dev, | ||
971 | "Configuration error: id outside range.\n"); | ||
972 | return -EINVAL; | ||
973 | } | ||
974 | 966 | ||
975 | err = ab8500_regulator_init_registers(pdev, id, value); | 967 | err = ab8500_regulator_init_registers(pdev, id, mask, value); |
976 | if (err < 0) | 968 | if (err < 0) |
977 | return err; | 969 | return err; |
978 | } | 970 | } |
diff --git a/include/linux/regulator/ab8500.h b/include/linux/regulator/ab8500.h index 2c6c9625013c..a1d245f13d9c 100644 --- a/include/linux/regulator/ab8500.h +++ b/include/linux/regulator/ab8500.h | |||
@@ -48,13 +48,15 @@ enum ab9540_regulator_id { | |||
48 | /* AB8500 and AB9540 register initialization */ | 48 | /* AB8500 and AB9540 register initialization */ |
49 | struct ab8500_regulator_reg_init { | 49 | struct ab8500_regulator_reg_init { |
50 | int id; | 50 | int id; |
51 | u8 mask; | ||
51 | u8 value; | 52 | u8 value; |
52 | }; | 53 | }; |
53 | 54 | ||
54 | #define INIT_REGULATOR_REGISTER(_id, _value) \ | 55 | #define INIT_REGULATOR_REGISTER(_id, _mask, _value) \ |
55 | { \ | 56 | { \ |
56 | .id = _id, \ | 57 | .id = _id, \ |
57 | .value = _value, \ | 58 | .mask = _mask, \ |
59 | .value = _value, \ | ||
58 | } | 60 | } |
59 | 61 | ||
60 | /* AB8500 registers */ | 62 | /* AB8500 registers */ |