summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarek Szyprowski <m.szyprowski@samsung.com>2020-12-14 11:18:42 +0100
committerMarek Szyprowski <m.szyprowski@samsung.com>2020-12-14 11:35:57 +0100
commitec165fc0fbbca713111b32e030fa06ee160318f0 (patch)
tree7577ea6458cf5abbf5827fb439940b915b528a32
parent3681a4632c4f12e072ae75cdba5dea38924836af (diff)
downloadu-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.c7
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, &regval);
- 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, &regval);
+ if (regval & MESON_SAR_ADC_REG3_ADC_EN)
+ return 0;
+ }
meson_saradc_stop_sample_engine(priv);