diff options
author | Ahmad Fatoum <ahmad@a3f.at> | 2020-12-21 01:32:51 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2021-01-06 11:04:01 +0100 |
commit | e93d7d696e9675056775a0314ad1b57f81dd33d2 (patch) | |
tree | 90e81fccd03019c09b776cedfad86bf77df28a6e | |
parent | deaacdd87bb314ffc69d6820b01cc4c50a5acf38 (diff) | |
download | barebox-e93d7d696e9675056775a0314ad1b57f81dd33d2.tar.gz barebox-e93d7d696e9675056775a0314ad1b57f81dd33d2.tar.xz |
regulator: stm32-pwr: don't propagate regulator turn-off to supply
Linux walks up the regulator supply chain in the core code, which we
don't do in barebox. Instead the stm32-pwr driver did enable/disable its
parent manually. This is problematic, because it doesn't respect
the regulator-always-on flag the parent supply may have, leading to
prohibited disabling of regulators. Work around this by dropping the
regulator disable altogether and just enable the parent supply
unconditionally.
When we gain proper regulator supply chain handling, this patch can be
reverted.
Signed-off-by: Ahmad Fatoum <ahmad@a3f.at>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r-- | drivers/regulator/stm32-pwr.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/regulator/stm32-pwr.c b/drivers/regulator/stm32-pwr.c index 7df8074ba7..4cb46b081a 100644 --- a/drivers/regulator/stm32-pwr.c +++ b/drivers/regulator/stm32-pwr.c @@ -86,8 +86,6 @@ static int stm32_pwr_reg_enable(struct regulator_dev *rdev) int ret; u32 val; - regulator_enable(priv->supply); - val = readl(priv->base + REG_PWR_CR3); val |= rdev->desc->enable_mask; writel(val, priv->base + REG_PWR_CR3); @@ -120,8 +118,6 @@ static int stm32_pwr_reg_disable(struct regulator_dev *rdev) dev_err(rdev->dev, "%s: regulator disable timed out!\n", desc->name); - regulator_disable(priv->supply); - return ret; } @@ -194,6 +190,8 @@ static int stm32_pwr_regulator_probe(struct device_d *dev) desc->name, ret); goto release_region; } + + regulator_enable(priv->supply); } return 0; |