diff options
author | Marek Szyprowski <m.szyprowski@samsung.com> | 2020-12-14 11:18:42 +0100 |
---|---|---|
committer | Marek Szyprowski <m.szyprowski@samsung.com> | 2020-12-14 11:35:57 +0100 |
commit | ec165fc0fbbca713111b32e030fa06ee160318f0 (patch) | |
tree | 7577ea6458cf5abbf5827fb439940b915b528a32 | |
parent | 3681a4632c4f12e072ae75cdba5dea38924836af (diff) | |
download | u-boot-ec165fc0fbbca713111b32e030fa06ee160318f0.tar.gz u-boot-ec165fc0fbbca713111b32e030fa06ee160318f0.tar.bz2 u-boot-ec165fc0fbbca713111b32e030fa06ee160318f0.zip |
adc: meson-saradc: skip hardware init only if ADC is enabled
The driver skips hardware initialization if it is already configured by
the earlier bootloader stage (BL30). Skip the initialization only if the
hardware is really initialized and enabled.
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Change-Id: I3e2e2d270ad3e7e7f38e2bc3ce2a924a47b164af
-rw-r--r-- | drivers/adc/meson-saradc.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/adc/meson-saradc.c b/drivers/adc/meson-saradc.c index 998cef24d8..ce7ae990ad 100644 --- a/drivers/adc/meson-saradc.c +++ b/drivers/adc/meson-saradc.c @@ -512,8 +512,11 @@ static int meson_saradc_init(struct meson_saradc_priv *priv) * reading the temperature sensor. */ regmap_read(priv->regmap, MESON_SAR_ADC_REG3, ®val); - if (regval & MESON_SAR_ADC_REG3_BL30_INITIALIZED) - return 0; + if (regval & MESON_SAR_ADC_REG3_BL30_INITIALIZED) { + regmap_read(priv->regmap, MESON_SAR_ADC_REG3, ®val); + if (regval & MESON_SAR_ADC_REG3_ADC_EN) + return 0; + } meson_saradc_stop_sample_engine(priv); |