Skip to content

Commit

Permalink
mfd: ab8500-gpadc: Reread on failure
Browse files Browse the repository at this point in the history
Reread the gpadc once upon failure.

Signed-off-by: Jonas Aaberg <jonas.aberg@stericsson.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Reviewed-by: Mattias WALLIN <mattias.wallin@stericsson.com>
Acked-by: Samuel Ortiz <sameo@linux.intel.com>
  • Loading branch information
Jonas Aaberg authored and Lee Jones committed Mar 7, 2013
1 parent 774c50a commit d89cc5a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions drivers/mfd/ab8500-gpadc.c
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,11 @@ int ab8500_gpadc_convert(struct ab8500_gpadc *gpadc, u8 channel)
int voltage;

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) {
dev_err(gpadc->dev, "GPADC raw value failed ch: %d\n", channel);
return ad_value;
Expand Down

0 comments on commit d89cc5a

Please sign in to comment.