Commit 9abaccf3bf1b356d4e4d7f681518e5981f284502

Authored by Krzysztof Kozlowski
Committed by Greg Kroah-Hartman
1 parent cc01e9c0c8

regulator: s2mps11: Fix dw_mmc failure on Gear 2

commit 1222d8fe578cd28a6c7f5e4e6c6b664c56abfdc0 upstream.

Invalid buck4 configuration for linear mapping of voltage in S2MPS14
regulators caused boot failure on Gear 2 (dw_mmc-exynos):

[    3.569137] EXT4-fs (mmcblk0p15): mounted filesystem with ordered data mode. Opts: (null)
[    3.571716] VFS: Mounted root (ext4 filesystem) readonly on device 179:15.
[    3.629842] mmcblk0: error -110 sending status command, retrying
[    3.630244] mmcblk0: error -110 sending status command, retrying
[    3.636292] mmcblk0: error -110 sending status command, aborting

Buck4 voltage regulator has different minimal voltage value than other
bucks. Commit merging multiple regulator description macros caused to
use linear_min_sel from buck[1235] regulators as value for buck4. This
lead to lower voltage of buck4 than required.

Output of the buck4 is used internally as power source for
LDO{3,4,7,11,19,20,21,23}. On Gear 2 board LDO11 is used as MMC
regulator (V_EMMC_1.8V).

Fixes: 5a867cf28893 ("regulator: s2mps11: Optimize the regulator description macro")
Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Showing 1 changed file with 12 additions and 7 deletions Side-by-side Diff

drivers/regulator/s2mps11.c
... ... @@ -479,7 +479,7 @@
479 479 .enable_mask = S2MPS14_ENABLE_MASK \
480 480 }
481 481  
482   -#define regulator_desc_s2mps14_buck(num, min, step) { \
  482 +#define regulator_desc_s2mps14_buck(num, min, step, min_sel) { \
483 483 .name = "BUCK"#num, \
484 484 .id = S2MPS14_BUCK##num, \
485 485 .ops = &s2mps14_reg_ops, \
... ... @@ -488,7 +488,7 @@
488 488 .min_uV = min, \
489 489 .uV_step = step, \
490 490 .n_voltages = S2MPS14_BUCK_N_VOLTAGES, \
491   - .linear_min_sel = S2MPS14_BUCK1235_START_SEL, \
  491 + .linear_min_sel = min_sel, \
492 492 .ramp_delay = S2MPS14_BUCK_RAMP_DELAY, \
493 493 .vsel_reg = S2MPS14_REG_B1CTRL2 + (num - 1) * 2, \
494 494 .vsel_mask = S2MPS14_BUCK_VSEL_MASK, \
... ... @@ -522,11 +522,16 @@
522 522 regulator_desc_s2mps14_ldo(23, MIN_800_MV, STEP_25_MV),
523 523 regulator_desc_s2mps14_ldo(24, MIN_1800_MV, STEP_25_MV),
524 524 regulator_desc_s2mps14_ldo(25, MIN_1800_MV, STEP_25_MV),
525   - regulator_desc_s2mps14_buck(1, MIN_600_MV, STEP_6_25_MV),
526   - regulator_desc_s2mps14_buck(2, MIN_600_MV, STEP_6_25_MV),
527   - regulator_desc_s2mps14_buck(3, MIN_600_MV, STEP_6_25_MV),
528   - regulator_desc_s2mps14_buck(4, MIN_1400_MV, STEP_12_5_MV),
529   - regulator_desc_s2mps14_buck(5, MIN_600_MV, STEP_6_25_MV),
  525 + regulator_desc_s2mps14_buck(1, MIN_600_MV, STEP_6_25_MV,
  526 + S2MPS14_BUCK1235_START_SEL),
  527 + regulator_desc_s2mps14_buck(2, MIN_600_MV, STEP_6_25_MV,
  528 + S2MPS14_BUCK1235_START_SEL),
  529 + regulator_desc_s2mps14_buck(3, MIN_600_MV, STEP_6_25_MV,
  530 + S2MPS14_BUCK1235_START_SEL),
  531 + regulator_desc_s2mps14_buck(4, MIN_1400_MV, STEP_12_5_MV,
  532 + S2MPS14_BUCK4_START_SEL),
  533 + regulator_desc_s2mps14_buck(5, MIN_600_MV, STEP_6_25_MV,
  534 + S2MPS14_BUCK1235_START_SEL),
530 535 };
531 536  
532 537 static int s2mps14_pmic_enable_ext_control(struct s2mps11_info *s2mps11,