From: Marek Szyprowski Date: Mon, 14 Dec 2020 10:18:42 +0000 (+0100) Subject: adc: meson-saradc: skip hardware init only if ADC is enabled X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=20449139cd1c03815b0e503441562489c48e8cd7;p=platform%2Fkernel%2Fu-boot.git 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 Change-Id: I3e2e2d270ad3e7e7f38e2bc3ce2a924a47b164af --- diff --git a/drivers/adc/meson-saradc.c b/drivers/adc/meson-saradc.c index 998cef2..ce7ae99 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);