diff options
Diffstat (limited to 'drivers/regulator/s2mps11.c')
-rw-r--r-- | drivers/regulator/s2mps11.c | 61 |
1 files changed, 50 insertions, 11 deletions
diff --git a/drivers/regulator/s2mps11.c b/drivers/regulator/s2mps11.c index c1444c3d84c2..ff828117798f 100644 --- a/drivers/regulator/s2mps11.c +++ b/drivers/regulator/s2mps11.c | |||
@@ -405,6 +405,40 @@ static struct regulator_ops s2mps14_reg_ops; | |||
405 | .enable_mask = S2MPS14_ENABLE_MASK \ | 405 | .enable_mask = S2MPS14_ENABLE_MASK \ |
406 | } | 406 | } |
407 | 407 | ||
408 | #define regulator_desc_s2mps13_buck7(num, min, step, min_sel) { \ | ||
409 | .name = "BUCK"#num, \ | ||
410 | .id = S2MPS13_BUCK##num, \ | ||
411 | .ops = &s2mps14_reg_ops, \ | ||
412 | .type = REGULATOR_VOLTAGE, \ | ||
413 | .owner = THIS_MODULE, \ | ||
414 | .min_uV = min, \ | ||
415 | .uV_step = step, \ | ||
416 | .linear_min_sel = min_sel, \ | ||
417 | .n_voltages = S2MPS14_BUCK_N_VOLTAGES, \ | ||
418 | .ramp_delay = S2MPS13_BUCK_RAMP_DELAY, \ | ||
419 | .vsel_reg = S2MPS13_REG_B1OUT + (num) * 2 - 1, \ | ||
420 | .vsel_mask = S2MPS14_BUCK_VSEL_MASK, \ | ||
421 | .enable_reg = S2MPS13_REG_B1CTRL + (num - 1) * 2, \ | ||
422 | .enable_mask = S2MPS14_ENABLE_MASK \ | ||
423 | } | ||
424 | |||
425 | #define regulator_desc_s2mps13_buck8_10(num, min, step, min_sel) { \ | ||
426 | .name = "BUCK"#num, \ | ||
427 | .id = S2MPS13_BUCK##num, \ | ||
428 | .ops = &s2mps14_reg_ops, \ | ||
429 | .type = REGULATOR_VOLTAGE, \ | ||
430 | .owner = THIS_MODULE, \ | ||
431 | .min_uV = min, \ | ||
432 | .uV_step = step, \ | ||
433 | .linear_min_sel = min_sel, \ | ||
434 | .n_voltages = S2MPS14_BUCK_N_VOLTAGES, \ | ||
435 | .ramp_delay = S2MPS13_BUCK_RAMP_DELAY, \ | ||
436 | .vsel_reg = S2MPS13_REG_B1OUT + (num) * 2 - 1, \ | ||
437 | .vsel_mask = S2MPS14_BUCK_VSEL_MASK, \ | ||
438 | .enable_reg = S2MPS13_REG_B1CTRL + (num) * 2 - 1, \ | ||
439 | .enable_mask = S2MPS14_ENABLE_MASK \ | ||
440 | } | ||
441 | |||
408 | static const struct regulator_desc s2mps13_regulators[] = { | 442 | static const struct regulator_desc s2mps13_regulators[] = { |
409 | regulator_desc_s2mps13_ldo(1, MIN_800_MV, STEP_12_5_MV, 0x00), | 443 | regulator_desc_s2mps13_ldo(1, MIN_800_MV, STEP_12_5_MV, 0x00), |
410 | regulator_desc_s2mps13_ldo(2, MIN_1400_MV, STEP_50_MV, 0x0C), | 444 | regulator_desc_s2mps13_ldo(2, MIN_1400_MV, STEP_50_MV, 0x0C), |
@@ -452,10 +486,10 @@ static const struct regulator_desc s2mps13_regulators[] = { | |||
452 | regulator_desc_s2mps13_buck(4, MIN_500_MV, STEP_6_25_MV, 0x10), | 486 | regulator_desc_s2mps13_buck(4, MIN_500_MV, STEP_6_25_MV, 0x10), |
453 | regulator_desc_s2mps13_buck(5, MIN_500_MV, STEP_6_25_MV, 0x10), | 487 | regulator_desc_s2mps13_buck(5, MIN_500_MV, STEP_6_25_MV, 0x10), |
454 | regulator_desc_s2mps13_buck(6, MIN_500_MV, STEP_6_25_MV, 0x10), | 488 | regulator_desc_s2mps13_buck(6, MIN_500_MV, STEP_6_25_MV, 0x10), |
455 | regulator_desc_s2mps13_buck(7, MIN_500_MV, STEP_6_25_MV, 0x10), | 489 | regulator_desc_s2mps13_buck7(7, MIN_500_MV, STEP_6_25_MV, 0x10), |
456 | regulator_desc_s2mps13_buck(8, MIN_1000_MV, STEP_12_5_MV, 0x20), | 490 | regulator_desc_s2mps13_buck8_10(8, MIN_1000_MV, STEP_12_5_MV, 0x20), |
457 | regulator_desc_s2mps13_buck(9, MIN_1000_MV, STEP_12_5_MV, 0x20), | 491 | regulator_desc_s2mps13_buck8_10(9, MIN_1000_MV, STEP_12_5_MV, 0x20), |
458 | regulator_desc_s2mps13_buck(10, MIN_500_MV, STEP_6_25_MV, 0x10), | 492 | regulator_desc_s2mps13_buck8_10(10, MIN_500_MV, STEP_6_25_MV, 0x10), |
459 | }; | 493 | }; |
460 | 494 | ||
461 | static int s2mps14_regulator_enable(struct regulator_dev *rdev) | 495 | static int s2mps14_regulator_enable(struct regulator_dev *rdev) |
@@ -570,7 +604,7 @@ static struct regulator_ops s2mps14_reg_ops = { | |||
570 | .enable_mask = S2MPS14_ENABLE_MASK \ | 604 | .enable_mask = S2MPS14_ENABLE_MASK \ |
571 | } | 605 | } |
572 | 606 | ||
573 | #define regulator_desc_s2mps14_buck(num, min, step) { \ | 607 | #define regulator_desc_s2mps14_buck(num, min, step, min_sel) { \ |
574 | .name = "BUCK"#num, \ | 608 | .name = "BUCK"#num, \ |
575 | .id = S2MPS14_BUCK##num, \ | 609 | .id = S2MPS14_BUCK##num, \ |
576 | .ops = &s2mps14_reg_ops, \ | 610 | .ops = &s2mps14_reg_ops, \ |
@@ -579,7 +613,7 @@ static struct regulator_ops s2mps14_reg_ops = { | |||
579 | .min_uV = min, \ | 613 | .min_uV = min, \ |
580 | .uV_step = step, \ | 614 | .uV_step = step, \ |
581 | .n_voltages = S2MPS14_BUCK_N_VOLTAGES, \ | 615 | .n_voltages = S2MPS14_BUCK_N_VOLTAGES, \ |
582 | .linear_min_sel = S2MPS14_BUCK1235_START_SEL, \ | 616 | .linear_min_sel = min_sel, \ |
583 | .ramp_delay = S2MPS14_BUCK_RAMP_DELAY, \ | 617 | .ramp_delay = S2MPS14_BUCK_RAMP_DELAY, \ |
584 | .vsel_reg = S2MPS14_REG_B1CTRL2 + (num - 1) * 2, \ | 618 | .vsel_reg = S2MPS14_REG_B1CTRL2 + (num - 1) * 2, \ |
585 | .vsel_mask = S2MPS14_BUCK_VSEL_MASK, \ | 619 | .vsel_mask = S2MPS14_BUCK_VSEL_MASK, \ |
@@ -613,11 +647,16 @@ static const struct regulator_desc s2mps14_regulators[] = { | |||
613 | regulator_desc_s2mps14_ldo(23, MIN_800_MV, STEP_25_MV), | 647 | regulator_desc_s2mps14_ldo(23, MIN_800_MV, STEP_25_MV), |
614 | regulator_desc_s2mps14_ldo(24, MIN_1800_MV, STEP_25_MV), | 648 | regulator_desc_s2mps14_ldo(24, MIN_1800_MV, STEP_25_MV), |
615 | regulator_desc_s2mps14_ldo(25, MIN_1800_MV, STEP_25_MV), | 649 | regulator_desc_s2mps14_ldo(25, MIN_1800_MV, STEP_25_MV), |
616 | regulator_desc_s2mps14_buck(1, MIN_600_MV, STEP_6_25_MV), | 650 | regulator_desc_s2mps14_buck(1, MIN_600_MV, STEP_6_25_MV, |
617 | regulator_desc_s2mps14_buck(2, MIN_600_MV, STEP_6_25_MV), | 651 | S2MPS14_BUCK1235_START_SEL), |
618 | regulator_desc_s2mps14_buck(3, MIN_600_MV, STEP_6_25_MV), | 652 | regulator_desc_s2mps14_buck(2, MIN_600_MV, STEP_6_25_MV, |
619 | regulator_desc_s2mps14_buck(4, MIN_1400_MV, STEP_12_5_MV), | 653 | S2MPS14_BUCK1235_START_SEL), |
620 | regulator_desc_s2mps14_buck(5, MIN_600_MV, STEP_6_25_MV), | 654 | regulator_desc_s2mps14_buck(3, MIN_600_MV, STEP_6_25_MV, |
655 | S2MPS14_BUCK1235_START_SEL), | ||
656 | regulator_desc_s2mps14_buck(4, MIN_1400_MV, STEP_12_5_MV, | ||
657 | S2MPS14_BUCK4_START_SEL), | ||
658 | regulator_desc_s2mps14_buck(5, MIN_600_MV, STEP_6_25_MV, | ||
659 | S2MPS14_BUCK1235_START_SEL), | ||
621 | }; | 660 | }; |
622 | 661 | ||
623 | static int s2mps14_pmic_enable_ext_control(struct s2mps11_info *s2mps11, | 662 | static int s2mps14_pmic_enable_ext_control(struct s2mps11_info *s2mps11, |