diff options
author | Mike Rapoport <mike@compulab.co.il> | 2009-07-26 06:33:04 -0400 |
---|---|---|
committer | Liam Girdwood <lrg@slimlogic.co.uk> | 2009-09-22 08:32:39 -0400 |
commit | c6db182822e292575b5beb56c003e95f616407f4 (patch) | |
tree | e966f7819af36ce2c06665995a3fb5b3008edbaa /drivers/regulator/da903x.c | |
parent | 72b86876d437a33253a47373579787b6dcc3bd36 (diff) |
regulator: da903x: consolidate DA903[045]_DVC macros
Signed-off-by: Mike Rapoport <mike@compulab.co.il>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
Diffstat (limited to 'drivers/regulator/da903x.c')
-rw-r--r-- | drivers/regulator/da903x.c | 66 |
1 files changed, 17 insertions, 49 deletions
diff --git a/drivers/regulator/da903x.c b/drivers/regulator/da903x.c index 236de1134397..7d9c2506d215 100644 --- a/drivers/regulator/da903x.c +++ b/drivers/regulator/da903x.c | |||
@@ -404,69 +404,25 @@ static struct regulator_ops da9034_regulator_ldo12_ops = { | |||
404 | .enable_bit = (ebit), \ | 404 | .enable_bit = (ebit), \ |
405 | } | 405 | } |
406 | 406 | ||
407 | #define DA9030_DVC(_id, min, max, step, vreg, nbits, ureg, ubit, ereg, ebit) \ | 407 | #define DA903x_DVC(_pmic, _id, min, max, step, vreg, nbits, ureg, ubit, ereg, ebit) \ |
408 | { \ | 408 | { \ |
409 | .desc = { \ | 409 | .desc = { \ |
410 | .name = #_id, \ | 410 | .name = #_id, \ |
411 | .ops = &da9034_regulator_dvc_ops, \ | 411 | .ops = &da9034_regulator_dvc_ops, \ |
412 | .type = REGULATOR_VOLTAGE, \ | 412 | .type = REGULATOR_VOLTAGE, \ |
413 | .id = DA9030_ID_##_id, \ | 413 | .id = _pmic##_ID_##_id, \ |
414 | .n_voltages = (step) ? ((max - min) / step + 1) : 1, \ | 414 | .n_voltages = (step) ? ((max - min) / step + 1) : 1, \ |
415 | .owner = THIS_MODULE, \ | 415 | .owner = THIS_MODULE, \ |
416 | }, \ | 416 | }, \ |
417 | .min_uV = (min) * 1000, \ | 417 | .min_uV = (min) * 1000, \ |
418 | .max_uV = (max) * 1000, \ | 418 | .max_uV = (max) * 1000, \ |
419 | .step_uV = (step) * 1000, \ | 419 | .step_uV = (step) * 1000, \ |
420 | .vol_reg = DA9030_##vreg, \ | 420 | .vol_reg = _pmic##_##vreg, \ |
421 | .vol_shift = (0), \ | ||
422 | .vol_nbits = (nbits), \ | ||
423 | .update_reg = DA9030_##ureg, \ | ||
424 | .update_bit = (ubit), \ | ||
425 | .enable_reg = DA9030_##ereg, \ | ||
426 | .enable_bit = (ebit), \ | ||
427 | } | ||
428 | |||
429 | #define DA9034_DVC(_id, min, max, step, vreg, nbits, ureg, ubit, ereg, ebit) \ | ||
430 | { \ | ||
431 | .desc = { \ | ||
432 | .name = #_id, \ | ||
433 | .ops = &da9034_regulator_dvc_ops, \ | ||
434 | .type = REGULATOR_VOLTAGE, \ | ||
435 | .id = DA9034_ID_##_id, \ | ||
436 | .n_voltages = (step) ? ((max - min) / step + 1) : 1, \ | ||
437 | .owner = THIS_MODULE, \ | ||
438 | }, \ | ||
439 | .min_uV = (min) * 1000, \ | ||
440 | .max_uV = (max) * 1000, \ | ||
441 | .step_uV = (step) * 1000, \ | ||
442 | .vol_reg = DA9034_##vreg, \ | ||
443 | .vol_shift = (0), \ | ||
444 | .vol_nbits = (nbits), \ | ||
445 | .update_reg = DA9034_##ureg, \ | ||
446 | .update_bit = (ubit), \ | ||
447 | .enable_reg = DA9034_##ereg, \ | ||
448 | .enable_bit = (ebit), \ | ||
449 | } | ||
450 | |||
451 | #define DA9035_DVC(_id, min, max, step, vreg, nbits, ureg, ubit, ereg, ebit) \ | ||
452 | { \ | ||
453 | .desc = { \ | ||
454 | .name = #_id, \ | ||
455 | .ops = &da9034_regulator_dvc_ops, \ | ||
456 | .type = REGULATOR_VOLTAGE, \ | ||
457 | .id = DA9035_ID_##_id, \ | ||
458 | .n_voltages = (step) ? ((max - min) / step + 1) : 1, \ | ||
459 | .owner = THIS_MODULE, \ | ||
460 | }, \ | ||
461 | .min_uV = (min) * 1000, \ | ||
462 | .max_uV = (max) * 1000, \ | ||
463 | .step_uV = (step) * 1000, \ | ||
464 | .vol_reg = DA9035_##vreg, \ | ||
465 | .vol_shift = (0), \ | 421 | .vol_shift = (0), \ |
466 | .vol_nbits = (nbits), \ | 422 | .vol_nbits = (nbits), \ |
467 | .update_reg = DA9035_##ureg, \ | 423 | .update_reg = _pmic##_##ureg, \ |
468 | .update_bit = (ubit), \ | 424 | .update_bit = (ubit), \ |
469 | .enable_reg = DA9035_##ereg, \ | 425 | .enable_reg = _pmic##_##ereg, \ |
470 | .enable_bit = (ebit), \ | 426 | .enable_bit = (ebit), \ |
471 | } | 427 | } |
472 | 428 | ||
@@ -476,6 +432,18 @@ static struct regulator_ops da9034_regulator_ldo12_ops = { | |||
476 | #define DA9030_LDO(_id, min, max, step, vreg, shift, nbits, ereg, ebit) \ | 432 | #define DA9030_LDO(_id, min, max, step, vreg, shift, nbits, ereg, ebit) \ |
477 | DA903x_LDO(DA9030, _id, min, max, step, vreg, shift, nbits, ereg, ebit) | 433 | DA903x_LDO(DA9030, _id, min, max, step, vreg, shift, nbits, ereg, ebit) |
478 | 434 | ||
435 | #define DA9030_DVC(_id, min, max, step, vreg, nbits, ureg, ubit, ereg, ebit) \ | ||
436 | DA903x_DVC(DA9030, _id, min, max, step, vreg, nbits, ureg, ubit, \ | ||
437 | ereg, ebit) | ||
438 | |||
439 | #define DA9034_DVC(_id, min, max, step, vreg, nbits, ureg, ubit, ereg, ebit) \ | ||
440 | DA903x_DVC(DA9034, _id, min, max, step, vreg, nbits, ureg, ubit, \ | ||
441 | ereg, ebit) | ||
442 | |||
443 | #define DA9035_DVC(_id, min, max, step, vreg, nbits, ureg, ubit, ereg, ebit) \ | ||
444 | DA903x_DVC(DA9035, _id, min, max, step, vreg, nbits, ureg, ubit, \ | ||
445 | ereg, ebit) | ||
446 | |||
479 | static struct da903x_regulator_info da903x_regulator_info[] = { | 447 | static struct da903x_regulator_info da903x_regulator_info[] = { |
480 | /* DA9030 */ | 448 | /* DA9030 */ |
481 | DA9030_DVC(BUCK2, 850, 1625, 25, BUCK2DVM1, 5, BUCK2DVM1, 7, RCTL11, 0), | 449 | DA9030_DVC(BUCK2, 850, 1625, 25, BUCK2DVM1, 5, BUCK2DVM1, 7, RCTL11, 0), |