diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2022-05-24 15:09:47 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2022-05-24 15:09:47 -0700 |
commit | 9b18d07ba3ae75fcb7a191fafe4e2954f07271be (patch) | |
tree | b3f3d995a9a8a746fd66fb769154c016dbc8c19e /drivers/regulator/stm32-vrefbuf.c | |
parent | 5d23bb5f25ed9cbf530b99640f4f17f59b79de9e (diff) | |
parent | a5b8e4a5ceec0ab6453176bc7f5eceafa78bf8a9 (diff) |
Merge tag 'regulator-v5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator
Pull regulator updates from Mark Brown:
"This is mostly a drivers update including a couple of new drivers but
we do have some fixes and improvements to the core as well.
- Make sure we don't log spuriously about uncontrollable regulators.
- Don't use delays when we should use sleeps for regulators with
larger ramp times.
- Support for MediaTek MT6358 and MT6366, Richtek RT5759 and Silicon
Mitus SM5703"
* tag 'regulator-v5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator: (36 commits)
regulator: scmi: Fix refcount leak in scmi_regulator_probe
regulator: pfuze100: Fix refcount leak in pfuze_parse_regulators_dt
regulator: qcom_smd: Fix up PM8950 regulator configuration
regulator: core: Fix enable_count imbalance with EXCLUSIVE_GET
regulator: core: Add error flags to sysfs attributes
regulator: dt-bindings: qcom,rpmh: document vdd-l7-bob-supply on PMR735A
regulator: dt-bindings: qcom,rpmh: document supplies per variant
regulator: dt-bindings: qcom,rpmh: update maintainers
regulator: mt6315: Enforce regulator-compatible, not name
regulator: pca9450: Enable DVS control via PMIC_STBY_REQ
regulator: pca9450: Make warm reset on WDOG_B assertion
regulator: Add property for WDOG_B warm reset
regulator: pca9450: Make I2C Level Translator configurable
regulator: Add property for I2C level shifter
regulator: sm5703: Correct reference to the common regulator schema
regulator: sm5703-regulator: Add regulators support for SM5703 MFD
dt-bindings: regulator: Add bindings for Silicon Mitus SM5703 regulators
regulator: richtek,rt4801: parse GPIOs per regulator
regulator: dt-bindings: richtek,rt4801: use existing ena_gpiod feature
regulator: core: Sleep (not delay) in set_voltage()
...
Diffstat (limited to 'drivers/regulator/stm32-vrefbuf.c')
-rw-r--r-- | drivers/regulator/stm32-vrefbuf.c | 30 |
1 files changed, 10 insertions, 20 deletions
diff --git a/drivers/regulator/stm32-vrefbuf.c b/drivers/regulator/stm32-vrefbuf.c index 161622ea72592..30ea3bc8ca192 100644 --- a/drivers/regulator/stm32-vrefbuf.c +++ b/drivers/regulator/stm32-vrefbuf.c @@ -44,11 +44,9 @@ static int stm32_vrefbuf_enable(struct regulator_dev *rdev) u32 val; int ret; - ret = pm_runtime_get_sync(priv->dev); - if (ret < 0) { - pm_runtime_put_noidle(priv->dev); + ret = pm_runtime_resume_and_get(priv->dev); + if (ret < 0) return ret; - } val = readl_relaxed(priv->base + STM32_VREFBUF_CSR); val = (val & ~STM32_HIZ) | STM32_ENVR; @@ -81,11 +79,9 @@ static int stm32_vrefbuf_disable(struct regulator_dev *rdev) u32 val; int ret; - ret = pm_runtime_get_sync(priv->dev); - if (ret < 0) { - pm_runtime_put_noidle(priv->dev); + ret = pm_runtime_resume_and_get(priv->dev); + if (ret < 0) return ret; - } val = readl_relaxed(priv->base + STM32_VREFBUF_CSR); val &= ~STM32_ENVR; @@ -102,11 +98,9 @@ static int stm32_vrefbuf_is_enabled(struct regulator_dev *rdev) struct stm32_vrefbuf *priv = rdev_get_drvdata(rdev); int ret; - ret = pm_runtime_get_sync(priv->dev); - if (ret < 0) { - pm_runtime_put_noidle(priv->dev); + ret = pm_runtime_resume_and_get(priv->dev); + if (ret < 0) return ret; - } ret = readl_relaxed(priv->base + STM32_VREFBUF_CSR) & STM32_ENVR; @@ -123,11 +117,9 @@ static int stm32_vrefbuf_set_voltage_sel(struct regulator_dev *rdev, u32 val; int ret; - ret = pm_runtime_get_sync(priv->dev); - if (ret < 0) { - pm_runtime_put_noidle(priv->dev); + ret = pm_runtime_resume_and_get(priv->dev); + if (ret < 0) return ret; - } val = readl_relaxed(priv->base + STM32_VREFBUF_CSR); val = (val & ~STM32_VRS) | FIELD_PREP(STM32_VRS, sel); @@ -145,11 +137,9 @@ static int stm32_vrefbuf_get_voltage_sel(struct regulator_dev *rdev) u32 val; int ret; - ret = pm_runtime_get_sync(priv->dev); - if (ret < 0) { - pm_runtime_put_noidle(priv->dev); + ret = pm_runtime_resume_and_get(priv->dev); + if (ret < 0) return ret; - } val = readl_relaxed(priv->base + STM32_VREFBUF_CSR); ret = FIELD_GET(STM32_VRS, val); |