aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/regulator/mc13783-regulator.c
diff options
context:
space:
mode:
authorYong Shen <yong.shen@linaro.org>2010-12-14 01:00:54 -0500
committerLiam Girdwood <lrg@slimlogic.co.uk>2011-01-12 09:33:03 -0500
commit167e3d8af98a111994c4d6b3c5cbc589aedbbc2a (patch)
tree16b54e06e33b949a0ca98542131610926d483bae /drivers/regulator/mc13783-regulator.c
parent57c78e359a35c69eca4c88f107500f74ef7f0acf (diff)
make mc13783 regulator code generic
move some common functions and micros of mc13783 regulaor driver to a seperate file, which makes it possible for mc13892 to share code. Signed-off-by: Yong Shen <yong.shen@linaro.org> Acked-by: Sascha Hauer <s.hauer@pengutronix.de> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
Diffstat (limited to 'drivers/regulator/mc13783-regulator.c')
-rw-r--r--drivers/regulator/mc13783-regulator.c325
1 files changed, 43 insertions, 282 deletions
diff --git a/drivers/regulator/mc13783-regulator.c b/drivers/regulator/mc13783-regulator.c
index 6a6e1d63d86f..3e5d0c3b4e53 100644
--- a/drivers/regulator/mc13783-regulator.c
+++ b/drivers/regulator/mc13783-regulator.c
@@ -1,6 +1,7 @@
1/* 1/*
2 * Regulator Driver for Freescale MC13783 PMIC 2 * Regulator Driver for Freescale MC13783 PMIC
3 * 3 *
4 * Copyright 2010 Yong Shen <yong.shen@linaro.org>
4 * Copyright (C) 2008 Sascha Hauer, Pengutronix <s.hauer@pengutronix.de> 5 * Copyright (C) 2008 Sascha Hauer, Pengutronix <s.hauer@pengutronix.de>
5 * Copyright 2009 Alberto Panizzo <maramaopercheseimorto@gmail.com> 6 * Copyright 2009 Alberto Panizzo <maramaopercheseimorto@gmail.com>
6 * 7 *
@@ -17,6 +18,7 @@
17#include <linux/slab.h> 18#include <linux/slab.h>
18#include <linux/init.h> 19#include <linux/init.h>
19#include <linux/err.h> 20#include <linux/err.h>
21#include "mc13xxx.h"
20 22
21#define MC13783_REG_SWITCHERS5 29 23#define MC13783_REG_SWITCHERS5 29
22#define MC13783_REG_SWITCHERS5_SW3EN (1 << 20) 24#define MC13783_REG_SWITCHERS5_SW3EN (1 << 20)
@@ -89,16 +91,6 @@
89#define MC13783_REG_POWERMISC_PWGTSPI_M (3 << 15) 91#define MC13783_REG_POWERMISC_PWGTSPI_M (3 << 15)
90 92
91 93
92struct mc13783_regulator {
93 struct regulator_desc desc;
94 int reg;
95 int enable_bit;
96 int vsel_reg;
97 int vsel_shift;
98 int vsel_mask;
99 int const *voltages;
100};
101
102/* Voltage Values */ 94/* Voltage Values */
103static const int mc13783_sw3_val[] = { 95static const int mc13783_sw3_val[] = {
104 5000000, 5000000, 5000000, 5500000, 96 5000000, 5000000, 5000000, 5500000,
@@ -175,64 +167,26 @@ static const int mc13783_pwgtdrv_val[] = {
175 5500000, 167 5500000,
176}; 168};
177 169
178static struct regulator_ops mc13783_regulator_ops;
179static struct regulator_ops mc13783_fixed_regulator_ops;
180static struct regulator_ops mc13783_gpo_regulator_ops; 170static struct regulator_ops mc13783_gpo_regulator_ops;
181 171
182#define MC13783_DEFINE(prefix, _name, _reg, _vsel_reg, _voltages) \ 172#define MC13783_DEFINE(prefix, name, reg, vsel_reg, voltages) \
183 [MC13783_ ## prefix ## _ ## _name] = { \ 173 MC13xxx_DEFINE(MC13783_REG_, name, reg, vsel_reg, voltages, \
184 .desc = { \ 174 mc13xxx_regulator_ops)
185 .name = #prefix "_" #_name, \
186 .n_voltages = ARRAY_SIZE(_voltages), \
187 .ops = &mc13783_regulator_ops, \
188 .type = REGULATOR_VOLTAGE, \
189 .id = MC13783_ ## prefix ## _ ## _name, \
190 .owner = THIS_MODULE, \
191 }, \
192 .reg = MC13783_REG_ ## _reg, \
193 .enable_bit = MC13783_REG_ ## _reg ## _ ## _name ## EN, \
194 .vsel_reg = MC13783_REG_ ## _vsel_reg, \
195 .vsel_shift = MC13783_REG_ ## _vsel_reg ## _ ## _name ## VSEL,\
196 .vsel_mask = MC13783_REG_ ## _vsel_reg ## _ ## _name ## VSEL_M,\
197 .voltages = _voltages, \
198 }
199 175
200#define MC13783_FIXED_DEFINE(prefix, _name, _reg, _voltages) \ 176#define MC13783_FIXED_DEFINE(prefix, name, reg, voltages) \
201 [MC13783_ ## prefix ## _ ## _name] = { \ 177 MC13xxx_FIXED_DEFINE(MC13783_REG_, name, reg, voltages, \
202 .desc = { \ 178 mc13xxx_fixed_regulator_ops)
203 .name = #prefix "_" #_name, \
204 .n_voltages = ARRAY_SIZE(_voltages), \
205 .ops = &mc13783_fixed_regulator_ops, \
206 .type = REGULATOR_VOLTAGE, \
207 .id = MC13783_ ## prefix ## _ ## _name, \
208 .owner = THIS_MODULE, \
209 }, \
210 .reg = MC13783_REG_ ## _reg, \
211 .enable_bit = MC13783_REG_ ## _reg ## _ ## _name ## EN, \
212 .voltages = _voltages, \
213 }
214 179
215#define MC13783_GPO_DEFINE(prefix, _name, _reg, _voltages) \ 180#define MC13783_GPO_DEFINE(prefix, name, reg, voltages) \
216 [MC13783_ ## prefix ## _ ## _name] = { \ 181 MC13xxx_GPO_DEFINE(MC13783_REG_, name, reg, voltages, \
217 .desc = { \ 182 mc13783_gpo_regulator_ops)
218 .name = #prefix "_" #_name, \
219 .n_voltages = ARRAY_SIZE(_voltages), \
220 .ops = &mc13783_gpo_regulator_ops, \
221 .type = REGULATOR_VOLTAGE, \
222 .id = MC13783_ ## prefix ## _ ## _name, \
223 .owner = THIS_MODULE, \
224 }, \
225 .reg = MC13783_REG_ ## _reg, \
226 .enable_bit = MC13783_REG_ ## _reg ## _ ## _name ## EN, \
227 .voltages = _voltages, \
228 }
229 183
230#define MC13783_DEFINE_SW(_name, _reg, _vsel_reg, _voltages) \ 184#define MC13783_DEFINE_SW(_name, _reg, _vsel_reg, _voltages) \
231 MC13783_DEFINE(REG, _name, _reg, _vsel_reg, _voltages) 185 MC13783_DEFINE(REG, _name, _reg, _vsel_reg, _voltages)
232#define MC13783_DEFINE_REGU(_name, _reg, _vsel_reg, _voltages) \ 186#define MC13783_DEFINE_REGU(_name, _reg, _vsel_reg, _voltages) \
233 MC13783_DEFINE(REG, _name, _reg, _vsel_reg, _voltages) 187 MC13783_DEFINE(REG, _name, _reg, _vsel_reg, _voltages)
234 188
235static struct mc13783_regulator mc13783_regulators[] = { 189static struct mc13xxx_regulator mc13783_regulators[] = {
236 MC13783_DEFINE_SW(SW3, SWITCHERS5, SWITCHERS5, mc13783_sw3_val), 190 MC13783_DEFINE_SW(SW3, SWITCHERS5, SWITCHERS5, mc13783_sw3_val),
237 191
238 MC13783_FIXED_DEFINE(REG, VAUDIO, REGULATORMODE0, mc13783_vaudio_val), 192 MC13783_FIXED_DEFINE(REG, VAUDIO, REGULATORMODE0, mc13783_vaudio_val),
@@ -274,213 +228,16 @@ static struct mc13783_regulator mc13783_regulators[] = {
274 MC13783_GPO_DEFINE(REG, PWGT2SPI, POWERMISC, mc13783_pwgtdrv_val), 228 MC13783_GPO_DEFINE(REG, PWGT2SPI, POWERMISC, mc13783_pwgtdrv_val),
275}; 229};
276 230
277struct mc13783_regulator_priv { 231static int mc13783_powermisc_rmw(struct mc13xxx_regulator_priv *priv, u32 mask,
278 struct mc13783 *mc13783; 232 u32 val)
279 u32 powermisc_pwgt_state;
280 struct regulator_dev *regulators[];
281};
282
283static int mc13783_regulator_enable(struct regulator_dev *rdev)
284{
285 struct mc13783_regulator_priv *priv = rdev_get_drvdata(rdev);
286 int id = rdev_get_id(rdev);
287 int ret;
288
289 dev_dbg(rdev_get_dev(rdev), "%s id: %d\n", __func__, id);
290
291 mc13783_lock(priv->mc13783);
292 ret = mc13783_reg_rmw(priv->mc13783, mc13783_regulators[id].reg,
293 mc13783_regulators[id].enable_bit,
294 mc13783_regulators[id].enable_bit);
295 mc13783_unlock(priv->mc13783);
296
297 return ret;
298}
299
300static int mc13783_regulator_disable(struct regulator_dev *rdev)
301{
302 struct mc13783_regulator_priv *priv = rdev_get_drvdata(rdev);
303 int id = rdev_get_id(rdev);
304 int ret;
305
306 dev_dbg(rdev_get_dev(rdev), "%s id: %d\n", __func__, id);
307
308 mc13783_lock(priv->mc13783);
309 ret = mc13783_reg_rmw(priv->mc13783, mc13783_regulators[id].reg,
310 mc13783_regulators[id].enable_bit, 0);
311 mc13783_unlock(priv->mc13783);
312
313 return ret;
314}
315
316static int mc13783_regulator_is_enabled(struct regulator_dev *rdev)
317{
318 struct mc13783_regulator_priv *priv = rdev_get_drvdata(rdev);
319 int ret, id = rdev_get_id(rdev);
320 unsigned int val;
321
322 mc13783_lock(priv->mc13783);
323 ret = mc13783_reg_read(priv->mc13783, mc13783_regulators[id].reg, &val);
324 mc13783_unlock(priv->mc13783);
325
326 if (ret)
327 return ret;
328
329 return (val & mc13783_regulators[id].enable_bit) != 0;
330}
331
332static int mc13783_regulator_list_voltage(struct regulator_dev *rdev,
333 unsigned selector)
334{
335 int id = rdev_get_id(rdev);
336
337 if (selector >= mc13783_regulators[id].desc.n_voltages)
338 return -EINVAL;
339
340 return mc13783_regulators[id].voltages[selector];
341}
342
343static int mc13783_get_best_voltage_index(struct regulator_dev *rdev,
344 int min_uV, int max_uV)
345{
346 int reg_id = rdev_get_id(rdev);
347 int i;
348 int bestmatch;
349 int bestindex;
350
351 /*
352 * Locate the minimum voltage fitting the criteria on
353 * this regulator. The switchable voltages are not
354 * in strict falling order so we need to check them
355 * all for the best match.
356 */
357 bestmatch = INT_MAX;
358 bestindex = -1;
359 for (i = 0; i < mc13783_regulators[reg_id].desc.n_voltages; i++) {
360 if (mc13783_regulators[reg_id].voltages[i] >= min_uV &&
361 mc13783_regulators[reg_id].voltages[i] < bestmatch) {
362 bestmatch = mc13783_regulators[reg_id].voltages[i];
363 bestindex = i;
364 }
365 }
366
367 if (bestindex < 0 || bestmatch > max_uV) {
368 dev_warn(&rdev->dev, "no possible value for %d<=x<=%d uV\n",
369 min_uV, max_uV);
370 return -EINVAL;
371 }
372 return bestindex;
373}
374
375static int mc13783_regulator_set_voltage(struct regulator_dev *rdev,
376 int min_uV, int max_uV,
377 unsigned *selector)
378{
379 struct mc13783_regulator_priv *priv = rdev_get_drvdata(rdev);
380 int value, id = rdev_get_id(rdev);
381 int ret;
382
383 dev_dbg(rdev_get_dev(rdev), "%s id: %d min_uV: %d max_uV: %d\n",
384 __func__, id, min_uV, max_uV);
385
386 /* Find the best index */
387 value = mc13783_get_best_voltage_index(rdev, min_uV, max_uV);
388 dev_dbg(rdev_get_dev(rdev), "%s best value: %d \n", __func__, value);
389 if (value < 0)
390 return value;
391
392 *selector = value;
393
394 mc13783_lock(priv->mc13783);
395 ret = mc13783_reg_rmw(priv->mc13783, mc13783_regulators[id].vsel_reg,
396 mc13783_regulators[id].vsel_mask,
397 value << mc13783_regulators[id].vsel_shift);
398 mc13783_unlock(priv->mc13783);
399
400 return ret;
401}
402
403static int mc13783_regulator_get_voltage(struct regulator_dev *rdev)
404{
405 struct mc13783_regulator_priv *priv = rdev_get_drvdata(rdev);
406 int ret, id = rdev_get_id(rdev);
407 unsigned int val;
408
409 dev_dbg(rdev_get_dev(rdev), "%s id: %d\n", __func__, id);
410
411 mc13783_lock(priv->mc13783);
412 ret = mc13783_reg_read(priv->mc13783,
413 mc13783_regulators[id].vsel_reg, &val);
414 mc13783_unlock(priv->mc13783);
415
416 if (ret)
417 return ret;
418
419 val = (val & mc13783_regulators[id].vsel_mask)
420 >> mc13783_regulators[id].vsel_shift;
421
422 dev_dbg(rdev_get_dev(rdev), "%s id: %d val: %d\n", __func__, id, val);
423
424 BUG_ON(val < 0 || val > mc13783_regulators[id].desc.n_voltages);
425
426 return mc13783_regulators[id].voltages[val];
427}
428
429static struct regulator_ops mc13783_regulator_ops = {
430 .enable = mc13783_regulator_enable,
431 .disable = mc13783_regulator_disable,
432 .is_enabled = mc13783_regulator_is_enabled,
433 .list_voltage = mc13783_regulator_list_voltage,
434 .set_voltage = mc13783_regulator_set_voltage,
435 .get_voltage = mc13783_regulator_get_voltage,
436};
437
438static int mc13783_fixed_regulator_set_voltage(struct regulator_dev *rdev,
439 int min_uV, int max_uV,
440 unsigned int *selector)
441{
442 int id = rdev_get_id(rdev);
443
444 dev_dbg(rdev_get_dev(rdev), "%s id: %d min_uV: %d max_uV: %d\n",
445 __func__, id, min_uV, max_uV);
446
447 *selector = 0;
448
449 if (min_uV >= mc13783_regulators[id].voltages[0] &&
450 max_uV <= mc13783_regulators[id].voltages[0])
451 return 0;
452 else
453 return -EINVAL;
454}
455
456static int mc13783_fixed_regulator_get_voltage(struct regulator_dev *rdev)
457{
458 int id = rdev_get_id(rdev);
459
460 dev_dbg(rdev_get_dev(rdev), "%s id: %d\n", __func__, id);
461
462 return mc13783_regulators[id].voltages[0];
463}
464
465static struct regulator_ops mc13783_fixed_regulator_ops = {
466 .enable = mc13783_regulator_enable,
467 .disable = mc13783_regulator_disable,
468 .is_enabled = mc13783_regulator_is_enabled,
469 .list_voltage = mc13783_regulator_list_voltage,
470 .set_voltage = mc13783_fixed_regulator_set_voltage,
471 .get_voltage = mc13783_fixed_regulator_get_voltage,
472};
473
474static int mc13783_powermisc_rmw(struct mc13783_regulator_priv *priv, u32 mask,
475 u32 val)
476{ 233{
477 struct mc13783 *mc13783 = priv->mc13783; 234 struct mc13xxx *mc13783 = priv->mc13xxx;
478 int ret; 235 int ret;
479 u32 valread; 236 u32 valread;
480 237
481 BUG_ON(val & ~mask); 238 BUG_ON(val & ~mask);
482 239
483 ret = mc13783_reg_read(mc13783, MC13783_REG_POWERMISC, &valread); 240 ret = mc13xxx_reg_read(mc13783, MC13783_REG_POWERMISC, &valread);
484 if (ret) 241 if (ret)
485 return ret; 242 return ret;
486 243
@@ -495,15 +252,16 @@ static int mc13783_powermisc_rmw(struct mc13783_regulator_priv *priv, u32 mask,
495 valread = (valread & ~MC13783_REG_POWERMISC_PWGTSPI_M) | 252 valread = (valread & ~MC13783_REG_POWERMISC_PWGTSPI_M) |
496 priv->powermisc_pwgt_state; 253 priv->powermisc_pwgt_state;
497 254
498 return mc13783_reg_write(mc13783, MC13783_REG_POWERMISC, valread); 255 return mc13xxx_reg_write(mc13783, MC13783_REG_POWERMISC, valread);
499} 256}
500 257
501static int mc13783_gpo_regulator_enable(struct regulator_dev *rdev) 258static int mc13783_gpo_regulator_enable(struct regulator_dev *rdev)
502{ 259{
503 struct mc13783_regulator_priv *priv = rdev_get_drvdata(rdev); 260 struct mc13xxx_regulator_priv *priv = rdev_get_drvdata(rdev);
261 struct mc13xxx_regulator *mc13xxx_regulators = priv->mc13xxx_regulators;
504 int id = rdev_get_id(rdev); 262 int id = rdev_get_id(rdev);
505 int ret; 263 int ret;
506 u32 en_val = mc13783_regulators[id].enable_bit; 264 u32 en_val = mc13xxx_regulators[id].enable_bit;
507 265
508 dev_dbg(rdev_get_dev(rdev), "%s id: %d\n", __func__, id); 266 dev_dbg(rdev_get_dev(rdev), "%s id: %d\n", __func__, id);
509 267
@@ -512,17 +270,18 @@ static int mc13783_gpo_regulator_enable(struct regulator_dev *rdev)
512 id == MC13783_REG_PWGT2SPI) 270 id == MC13783_REG_PWGT2SPI)
513 en_val = 0; 271 en_val = 0;
514 272
515 mc13783_lock(priv->mc13783); 273 mc13xxx_lock(priv->mc13xxx);
516 ret = mc13783_powermisc_rmw(priv, mc13783_regulators[id].enable_bit, 274 ret = mc13783_powermisc_rmw(priv, mc13xxx_regulators[id].enable_bit,
517 en_val); 275 en_val);
518 mc13783_unlock(priv->mc13783); 276 mc13xxx_unlock(priv->mc13xxx);
519 277
520 return ret; 278 return ret;
521} 279}
522 280
523static int mc13783_gpo_regulator_disable(struct regulator_dev *rdev) 281static int mc13783_gpo_regulator_disable(struct regulator_dev *rdev)
524{ 282{
525 struct mc13783_regulator_priv *priv = rdev_get_drvdata(rdev); 283 struct mc13xxx_regulator_priv *priv = rdev_get_drvdata(rdev);
284 struct mc13xxx_regulator *mc13xxx_regulators = priv->mc13xxx_regulators;
526 int id = rdev_get_id(rdev); 285 int id = rdev_get_id(rdev);
527 int ret; 286 int ret;
528 u32 dis_val = 0; 287 u32 dis_val = 0;
@@ -532,25 +291,26 @@ static int mc13783_gpo_regulator_disable(struct regulator_dev *rdev)
532 /* Power Gate disable value is 1 */ 291 /* Power Gate disable value is 1 */
533 if (id == MC13783_REG_PWGT1SPI || 292 if (id == MC13783_REG_PWGT1SPI ||
534 id == MC13783_REG_PWGT2SPI) 293 id == MC13783_REG_PWGT2SPI)
535 dis_val = mc13783_regulators[id].enable_bit; 294 dis_val = mc13xxx_regulators[id].enable_bit;
536 295
537 mc13783_lock(priv->mc13783); 296 mc13xxx_lock(priv->mc13xxx);
538 ret = mc13783_powermisc_rmw(priv, mc13783_regulators[id].enable_bit, 297 ret = mc13783_powermisc_rmw(priv, mc13xxx_regulators[id].enable_bit,
539 dis_val); 298 dis_val);
540 mc13783_unlock(priv->mc13783); 299 mc13xxx_unlock(priv->mc13xxx);
541 300
542 return ret; 301 return ret;
543} 302}
544 303
545static int mc13783_gpo_regulator_is_enabled(struct regulator_dev *rdev) 304static int mc13783_gpo_regulator_is_enabled(struct regulator_dev *rdev)
546{ 305{
547 struct mc13783_regulator_priv *priv = rdev_get_drvdata(rdev); 306 struct mc13xxx_regulator_priv *priv = rdev_get_drvdata(rdev);
307 struct mc13xxx_regulator *mc13xxx_regulators = priv->mc13xxx_regulators;
548 int ret, id = rdev_get_id(rdev); 308 int ret, id = rdev_get_id(rdev);
549 unsigned int val; 309 unsigned int val;
550 310
551 mc13783_lock(priv->mc13783); 311 mc13xxx_lock(priv->mc13xxx);
552 ret = mc13783_reg_read(priv->mc13783, mc13783_regulators[id].reg, &val); 312 ret = mc13xxx_reg_read(priv->mc13xxx, mc13xxx_regulators[id].reg, &val);
553 mc13783_unlock(priv->mc13783); 313 mc13xxx_unlock(priv->mc13xxx);
554 314
555 if (ret) 315 if (ret)
556 return ret; 316 return ret;
@@ -560,22 +320,22 @@ static int mc13783_gpo_regulator_is_enabled(struct regulator_dev *rdev)
560 val = (val & ~MC13783_REG_POWERMISC_PWGTSPI_M) | 320 val = (val & ~MC13783_REG_POWERMISC_PWGTSPI_M) |
561 (priv->powermisc_pwgt_state ^ MC13783_REG_POWERMISC_PWGTSPI_M); 321 (priv->powermisc_pwgt_state ^ MC13783_REG_POWERMISC_PWGTSPI_M);
562 322
563 return (val & mc13783_regulators[id].enable_bit) != 0; 323 return (val & mc13xxx_regulators[id].enable_bit) != 0;
564} 324}
565 325
566static struct regulator_ops mc13783_gpo_regulator_ops = { 326static struct regulator_ops mc13783_gpo_regulator_ops = {
567 .enable = mc13783_gpo_regulator_enable, 327 .enable = mc13783_gpo_regulator_enable,
568 .disable = mc13783_gpo_regulator_disable, 328 .disable = mc13783_gpo_regulator_disable,
569 .is_enabled = mc13783_gpo_regulator_is_enabled, 329 .is_enabled = mc13783_gpo_regulator_is_enabled,
570 .list_voltage = mc13783_regulator_list_voltage, 330 .list_voltage = mc13xxx_regulator_list_voltage,
571 .set_voltage = mc13783_fixed_regulator_set_voltage, 331 .set_voltage = mc13xxx_fixed_regulator_set_voltage,
572 .get_voltage = mc13783_fixed_regulator_get_voltage, 332 .get_voltage = mc13xxx_fixed_regulator_get_voltage,
573}; 333};
574 334
575static int __devinit mc13783_regulator_probe(struct platform_device *pdev) 335static int __devinit mc13783_regulator_probe(struct platform_device *pdev)
576{ 336{
577 struct mc13783_regulator_priv *priv; 337 struct mc13xxx_regulator_priv *priv;
578 struct mc13783 *mc13783 = dev_get_drvdata(pdev->dev.parent); 338 struct mc13xxx *mc13783 = dev_get_drvdata(pdev->dev.parent);
579 struct mc13783_regulator_platform_data *pdata = 339 struct mc13783_regulator_platform_data *pdata =
580 dev_get_platdata(&pdev->dev); 340 dev_get_platdata(&pdev->dev);
581 struct mc13783_regulator_init_data *init_data; 341 struct mc13783_regulator_init_data *init_data;
@@ -589,7 +349,8 @@ static int __devinit mc13783_regulator_probe(struct platform_device *pdev)
589 if (!priv) 349 if (!priv)
590 return -ENOMEM; 350 return -ENOMEM;
591 351
592 priv->mc13783 = mc13783; 352 priv->mc13xxx_regulators = mc13783_regulators;
353 priv->mc13xxx = mc13783;
593 354
594 for (i = 0; i < pdata->num_regulators; i++) { 355 for (i = 0; i < pdata->num_regulators; i++) {
595 init_data = &pdata->regulators[i]; 356 init_data = &pdata->regulators[i];
@@ -619,7 +380,7 @@ err:
619 380
620static int __devexit mc13783_regulator_remove(struct platform_device *pdev) 381static int __devexit mc13783_regulator_remove(struct platform_device *pdev)
621{ 382{
622 struct mc13783_regulator_priv *priv = platform_get_drvdata(pdev); 383 struct mc13xxx_regulator_priv *priv = platform_get_drvdata(pdev);
623 struct mc13783_regulator_platform_data *pdata = 384 struct mc13783_regulator_platform_data *pdata =
624 dev_get_platdata(&pdev->dev); 385 dev_get_platdata(&pdev->dev);
625 int i; 386 int i;