diff options
author | Mark Brown <broonie@kernel.org> | 2021-02-12 15:00:06 +0100 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2021-02-12 15:00:06 +0100 |
commit | 8571bdc21388826a6feecbee2ce432839ba17d24 (patch) | |
tree | fba685021ec2a22e736d410e82e7eaae72771c8f | |
parent | Linux 5.11-rc7 (diff) | |
parent | regulator: bd718x7, bd71828, Fix dvs voltage levels (diff) | |
download | linux-8571bdc21388826a6feecbee2ce432839ba17d24.tar.xz linux-8571bdc21388826a6feecbee2ce432839ba17d24.zip |
Merge remote-tracking branch 'regulator/for-5.11' into regulator-linus
-rw-r--r-- | drivers/regulator/pf8x00-regulator.c | 2 | ||||
-rw-r--r-- | drivers/regulator/qcom-rpmh-regulator.c | 2 | ||||
-rw-r--r-- | drivers/regulator/rohm-regulator.c | 9 | ||||
-rw-r--r-- | include/linux/mfd/rohm-generic.h | 14 |
4 files changed, 14 insertions, 13 deletions
diff --git a/drivers/regulator/pf8x00-regulator.c b/drivers/regulator/pf8x00-regulator.c index af9918cd27aa..e1dba70fb78f 100644 --- a/drivers/regulator/pf8x00-regulator.c +++ b/drivers/regulator/pf8x00-regulator.c @@ -399,7 +399,7 @@ static int pf8x00_identify(struct pf8x00_chip *chip) name = "PF8121A"; break; case PF8200: - name = "PF8100"; + name = "PF8200"; break; default: dev_err(chip->dev, "Unknown pf8x00 device id 0x%x\n", dev_id); diff --git a/drivers/regulator/qcom-rpmh-regulator.c b/drivers/regulator/qcom-rpmh-regulator.c index c395a8dda6f7..38dae4813f3b 100644 --- a/drivers/regulator/qcom-rpmh-regulator.c +++ b/drivers/regulator/qcom-rpmh-regulator.c @@ -928,7 +928,7 @@ static const struct rpmh_vreg_init_data pm8009_vreg_data[] = { RPMH_VREG("ldo4", "ldo%s4", &pmic5_nldo, "vdd-l4"), RPMH_VREG("ldo5", "ldo%s5", &pmic5_pldo, "vdd-l5-l6"), RPMH_VREG("ldo6", "ldo%s6", &pmic5_pldo, "vdd-l5-l6"), - RPMH_VREG("ldo7", "ldo%s6", &pmic5_pldo_lv, "vdd-l7"), + RPMH_VREG("ldo7", "ldo%s7", &pmic5_pldo_lv, "vdd-l7"), {}, }; diff --git a/drivers/regulator/rohm-regulator.c b/drivers/regulator/rohm-regulator.c index 399002383b28..5c558b153d55 100644 --- a/drivers/regulator/rohm-regulator.c +++ b/drivers/regulator/rohm-regulator.c @@ -52,9 +52,12 @@ int rohm_regulator_set_dvs_levels(const struct rohm_dvs_config *dvs, char *prop; unsigned int reg, mask, omask, oreg = desc->enable_reg; - for (i = 0; i < ROHM_DVS_LEVEL_MAX && !ret; i++) { - if (dvs->level_map & (1 << i)) { - switch (i + 1) { + for (i = 0; i < ROHM_DVS_LEVEL_VALID_AMOUNT && !ret; i++) { + int bit; + + bit = BIT(i); + if (dvs->level_map & bit) { + switch (bit) { case ROHM_DVS_LEVEL_RUN: prop = "rohm,dvs-run-voltage"; reg = dvs->run_reg; diff --git a/include/linux/mfd/rohm-generic.h b/include/linux/mfd/rohm-generic.h index 4283b5b33e04..2b85b9deb03a 100644 --- a/include/linux/mfd/rohm-generic.h +++ b/include/linux/mfd/rohm-generic.h @@ -20,14 +20,12 @@ struct rohm_regmap_dev { struct regmap *regmap; }; -enum { - ROHM_DVS_LEVEL_UNKNOWN, - ROHM_DVS_LEVEL_RUN, - ROHM_DVS_LEVEL_IDLE, - ROHM_DVS_LEVEL_SUSPEND, - ROHM_DVS_LEVEL_LPSR, - ROHM_DVS_LEVEL_MAX = ROHM_DVS_LEVEL_LPSR, -}; +#define ROHM_DVS_LEVEL_RUN BIT(0) +#define ROHM_DVS_LEVEL_IDLE BIT(1) +#define ROHM_DVS_LEVEL_SUSPEND BIT(2) +#define ROHM_DVS_LEVEL_LPSR BIT(3) +#define ROHM_DVS_LEVEL_VALID_AMOUNT 4 +#define ROHM_DVS_LEVEL_UNKNOWN 0 /** * struct rohm_dvs_config - dynamic voltage scaling register descriptions |