diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2018-06-08 13:08:57 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2018-06-08 13:08:57 -0700 |
commit | 68cc38ff33f38424d0456f9a1ecfec4683226a7e (patch) | |
tree | fa96b657dca1893ee8da5e858a0b6692f038fad1 /drivers/regulator/ltc3676.c | |
parent | 410feb75de245664d66bc05ab2e2412751d10acf (diff) | |
parent | 13ed4964057e5ad183da9f7f8160841d261e9517 (diff) | |
download | op-kernel-dev-68cc38ff33f38424d0456f9a1ecfec4683226a7e.zip op-kernel-dev-68cc38ff33f38424d0456f9a1ecfec4683226a7e.tar.gz |
Merge tag 'regulator-v4.18' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator
Pull regulator updates from Mark Brown:
"Quite a lot of core work this time around, though not 100% successful.
We gained support for runtime mode changes thanks to David Collins and
improved support for write only regulators (ones where we can't read
back the configuration) from Douglas Anderson.
There's been quite a bit of work from Linus Walleij on converting from
specfying GPIOs by numbers to descriptors. Sadly the testing turned
out to be less good than we had hoped and so a lot of this had to be
reverted.
We also have the start of updates to use coupled regulators from
Maciej Purski, unfortunately there are further problems there so the
last couple of patches have been reverted.
We also have new drivers for BD71837 and SY8106A devices, SAW
regulators on Qualcomm SPMI and dropped support for some preproduction
chips that never made it to market from the AB8500 driver"
* tag 'regulator-v4.18' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator: (57 commits)
regulator: gpio: Revert
ARM: pxa, regulator: fix building ezx e680
regulator: Revert coupled regulator support again
regulator: wm8994: Fix shared GPIOs
regulator: max77686: Fix shared GPIOs
regulator: bd71837: BD71837 PMIC regulator driver
regulator: bd71837: Devicetree bindings for BD71837 regulators
regulator: gpio: Get enable GPIO using GPIO descriptor
regulator: fixed: Convert to use GPIO descriptor only
regulator: s2mps11: Fix boot on Odroid XU3
dt-bindings: qcom_spmi: Document SAW support
regulator: qcom_spmi: Add support for SAW
regulator: tps65090: Pass descriptor instead of GPIO number
regulator: s5m8767: Pass descriptor instead of GPIO number
regulator: pfuze100: Delete reference to ena_gpio
regulator: max8952: Pass descriptor instead of GPIO number
regulator: lp8788-ldo: Pass descriptor instead of GPIO number
regulator: lm363x: Pass descriptor instead of GPIO number
regulator: max8973: Pass descriptor instead of GPIO number
regulator: mc13xxx-core: Switch to SPDX identifier
...
Diffstat (limited to 'drivers/regulator/ltc3676.c')
-rw-r--r-- | drivers/regulator/ltc3676.c | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/drivers/regulator/ltc3676.c b/drivers/regulator/ltc3676.c index 662ee05..9dec160 100644 --- a/drivers/regulator/ltc3676.c +++ b/drivers/regulator/ltc3676.c @@ -52,6 +52,7 @@ #define LTC3676_CLIRQ 0x1F #define LTC3676_DVBxA_REF_SELECT BIT(5) +#define LTC3676_DVBxB_PGOOD_MASK BIT(5) #define LTC3676_IRQSTAT_PGOOD_TIMEOUT BIT(3) #define LTC3676_IRQSTAT_UNDERVOLT_WARN BIT(4) @@ -123,6 +124,23 @@ static int ltc3676_set_suspend_mode(struct regulator_dev *rdev, mask, val); } +static int ltc3676_set_voltage_sel(struct regulator_dev *rdev, unsigned selector) +{ + struct ltc3676 *ltc3676 = rdev_get_drvdata(rdev); + struct device *dev = ltc3676->dev; + int ret, dcdc = rdev_get_id(rdev); + + dev_dbg(dev, "%s id=%d selector=%d\n", __func__, dcdc, selector); + + ret = regmap_update_bits(ltc3676->regmap, rdev->desc->vsel_reg + 1, + LTC3676_DVBxB_PGOOD_MASK, + LTC3676_DVBxB_PGOOD_MASK); + if (ret) + return ret; + + return regulator_set_voltage_sel_regmap(rdev, selector); +} + static inline unsigned int ltc3676_scale(unsigned int uV, u32 r1, u32 r2) { uint64_t tmp; @@ -166,7 +184,7 @@ static const struct regulator_ops ltc3676_linear_regulator_ops = { .disable = regulator_disable_regmap, .is_enabled = regulator_is_enabled_regmap, .list_voltage = regulator_list_voltage_linear, - .set_voltage_sel = regulator_set_voltage_sel_regmap, + .set_voltage_sel = ltc3676_set_voltage_sel, .get_voltage_sel = regulator_get_voltage_sel_regmap, .set_suspend_voltage = ltc3676_set_suspend_voltage, .set_suspend_mode = ltc3676_set_suspend_mode, |