FAILED: patch "[PATCH] regulator: stm32-vrefbuf: fix a possible overshoot when" failed to apply to 4.14-stable tree
Subsystems (3)
[email protected]
maintainerThe patch below does not apply to the 4.14-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 02fbabd5f4ed182d2c616e49309f5a3efd9ec671 Mon Sep 17 00:00:00 2001
From: Fabrice Gasnier <[email protected]>
Date: Wed, 4 Mar 2020 09:55:32 +0100
Subject: [PATCH] regulator: stm32-vrefbuf: fix a possible overshoot when
re-enabling
There maybe an overshoot, when disabling, then re-enabling vrefbuf too quickly. VREFBUF is used by ADC/DAC on some boards. When re-enabling too quickly, an overshoot on the reference voltage make the conversions inaccurate for a short period of time.
- Don't put the VREFBUF in HiZ when disabling, to force an active discharge.
- Enforce a 1ms OFF/ON delay
Message-Id: <[email protected]>
drivers/regulator/stm32-vrefbuf.c +2 -1
@@ -88,7 +88,7 @@ static int stm32_vrefbuf_disable(struct regulator_dev *rdev) } val =readl_relaxed (priv->base +STM32_VREFBUF_CSR ); - val = (val & ~STM32_ENVR ) |STM32_HIZ ; + val &= ~STM32_ENVR ;writel_relaxed (val, priv->base +STM32_VREFBUF_CSR );pm_runtime_mark_last_busy (priv->dev);
@@ -175,6 +175,7 @@ static const struct regulator_desc stm32_vrefbuf_regu = { .volt_table = stm32_vrefbuf_voltages, .n_voltages = ARRAY_SIZE(stm32_vrefbuf_voltages), .ops = &stm32_vrefbuf_volt_ops, + .off_on_delay = 1000, .type = REGULATOR_VOLTAGE, .owner = THIS_MODULE, };