Commit d89cc5aa authored by Jonas Aaberg's avatar Jonas Aaberg Committed by Lee Jones

mfd: ab8500-gpadc: Reread on failure

Reread the gpadc once upon failure.
Signed-off-by: default avatarJonas Aaberg <jonas.aberg@stericsson.com>
Signed-off-by: default avatarLee Jones <lee.jones@linaro.org>
Reviewed-by: default avatarMattias WALLIN <mattias.wallin@stericsson.com>
Acked-by: default avatarSamuel Ortiz <sameo@linux.intel.com>
parent 774c50ab
...@@ -256,6 +256,11 @@ int ab8500_gpadc_convert(struct ab8500_gpadc *gpadc, u8 channel) ...@@ -256,6 +256,11 @@ int ab8500_gpadc_convert(struct ab8500_gpadc *gpadc, u8 channel)
int voltage; int voltage;
ad_value = ab8500_gpadc_read_raw(gpadc, channel); ad_value = ab8500_gpadc_read_raw(gpadc, channel);
/* On failure retry a second time */
if (ad_value < 0)
ad_value = ab8500_gpadc_read_raw(gpadc, channel);
if (ad_value < 0) { if (ad_value < 0) {
dev_err(gpadc->dev, "GPADC raw value failed ch: %d\n", channel); dev_err(gpadc->dev, "GPADC raw value failed ch: %d\n", channel);
return ad_value; return ad_value;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment