mirror of
https://github.com/brain-hackers/u-boot-brain
synced 2024-06-09 23:36:03 +09:00
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>
This commit is contained in:
parent
220992bde8
commit
81b1c47596
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user