summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarek Szyprowski <m.szyprowski@samsung.com>2020-12-16 08:51:55 +0100
committerNeil Armstrong <narmstrong@baylibre.com>2021-01-11 14:59:54 +0100
commit81b1c4759619777b55ad810cd89ccb421e02d33d (patch)
treea52723726b682c97717830cbde743ceed4a6c2b7
parent220992bde8995b3de0d094cf2eb0545a031e7992 (diff)
downloadu-boot-81b1c4759619777b55ad810cd89ccb421e02d33d.tar.gz
u-boot-81b1c4759619777b55ad810cd89ccb421e02d33d.tar.xz
u-boot-81b1c4759619777b55ad810cd89ccb421e02d33d.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> Reviewed-by: Neil Armstrong <narmstrong@baylibre.com> Tested-by: Jaehoon Chung <jh80.chung@samsung.com> Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com> Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
-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);