Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

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
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -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;