Driver was written to mimic existing stpmic1 regulator driver, which had the implicit assumption of a 1:1 relationship between of_match_data and regulator configuration with same indices. Yet DCDC_REG5 was not at the same place it was in the rk_regulator_cfg due to likely a copy-paste mistake, leading to possibly the wrong regulators being controlled. Fix this. Reported-by: Michael Riesch <michael.riesch@xxxxxxxxxxxxxx> Suggested-by: Michael Riesch <michael.riesch@xxxxxxxxxxxxxx> Signed-off-by: Ahmad Fatoum <a.fatoum@xxxxxxxxxxxxxx> --- move entry in rk809_reg, not rk809_reg_matches to keep same numbering as enum rk809_reg_id. --- drivers/regulator/rk808-regulator.c | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/drivers/regulator/rk808-regulator.c b/drivers/regulator/rk808-regulator.c index 39eadbd3ebe5..f8bc31f354e2 100644 --- a/ drivers/regulator/rk808-regulator.c +++ b/drivers/regulator/rk808-regulator.c @@ -526,19 +526,6 @@ static struct rk_regulator_cfg rk809_reg[] = { .enable_mask = ENABLE_MASK(RK817_ID_DCDC4), .enable_val = ENABLE_MASK(RK817_ID_DCDC4), .disable_val = DISABLE_VAL(RK817_ID_DCDC4), - }}, {{ - /* .name = "DCDC_REG5", */ - .supply_name = "vcc9", - .ops = &rk809_buck5_ops_range, - .n_voltages = RK809_BUCK5_SEL_CNT, - .linear_ranges = rk809_buck5_voltage_ranges, - .n_linear_ranges = ARRAY_SIZE(rk809_buck5_voltage_ranges), - .vsel_reg = RK809_BUCK5_CONFIG(0), - .vsel_mask = RK809_BUCK5_VSEL_MASK, - .enable_reg = RK817_POWER_EN_REG(3), - .enable_mask = ENABLE_MASK(1), - .enable_val = ENABLE_MASK(1), - .disable_val = DISABLE_VAL(1), }}, RK817_DESC(/* "LDO_REG1", */ "vcc5", 600, 3400, 25, RK817_LDO_ON_VSEL_REG(0), RK817_LDO_VSEL_MASK, @@ -576,6 +563,20 @@ static struct rk_regulator_cfg rk809_reg[] = { RK817_LDO_ON_VSEL_REG(8), RK817_LDO_VSEL_MASK, RK817_POWER_EN_REG(3), ENABLE_MASK(0), DISABLE_VAL(0), 400), + {{ + /* .name = "DCDC_REG5", */ + .supply_name = "vcc9", + .ops = &rk809_buck5_ops_range, + .n_voltages = RK809_BUCK5_SEL_CNT, + .linear_ranges = rk809_buck5_voltage_ranges, + .n_linear_ranges = ARRAY_SIZE(rk809_buck5_voltage_ranges), + .vsel_reg = RK809_BUCK5_CONFIG(0), + .vsel_mask = RK809_BUCK5_VSEL_MASK, + .enable_reg = RK817_POWER_EN_REG(3), + .enable_mask = ENABLE_MASK(1), + .enable_val = ENABLE_MASK(1), + .disable_val = DISABLE_VAL(1), + }}, RK817_DESC_SWITCH(/* "SWITCH_REG1", */ "vcc9", RK817_POWER_EN_REG(3), ENABLE_MASK(2), DISABLE_VAL(2)), RK817_DESC_SWITCH(/* "SWITCH_REG2", */ "vcc8", -- 2.30.2