regulator: stm32-vrefbuf: fix a possible overshoot when re-enabling
authorFabrice Gasnier <fabrice.gasnier@st.com>
Wed, 4 Mar 2020 08:55:32 +0000 (09:55 +0100)
committerMark Brown <broonie@kernel.org>
Wed, 4 Mar 2020 13:57:28 +0000 (13:57 +0000)
commit02fbabd5f4ed182d2c616e49309f5a3efd9ec671
tree50bae0825dfaca838567cea2d6cec1f24107e9b3
parenta5b0cda136f4f420a8e24e50d19dfcef2f81df2e
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

Fixes: 0cdbf481e927 ("regulator: Add support for stm32-vrefbuf")
Signed-off-by: Fabrice Gasnier <fabrice.gasnier@st.com>
Message-Id: <1583312132-20932-1-git-send-email-fabrice.gasnier@st.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/regulator/stm32-vrefbuf.c