From: Daniel Baluta Date: Thu, 11 Jun 2015 15:49:34 +0000 (+0300) Subject: iio: proximity: sx9500: Fix proximity value X-Git-Tag: firefly_0821_release~176^2~1363^2^2~28 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=86d24f04f9a0a7bad8e1719e5aa464eb5779e678;p=firefly-linux-kernel-4.4.55.git iio: proximity: sx9500: Fix proximity value Because of the ABI confusion proximity value exposed by SX9500 was inverted. Signed-off-by: Daniel Baluta Reviewed-by: Vlad Dogaru Cc: Signed-off-by: Jonathan Cameron --- diff --git a/drivers/iio/proximity/sx9500.c b/drivers/iio/proximity/sx9500.c index 2042e375f835..01494cd6fa32 100644 --- a/drivers/iio/proximity/sx9500.c +++ b/drivers/iio/proximity/sx9500.c @@ -281,7 +281,7 @@ static int sx9500_read_prox_data(struct sx9500_data *data, if (ret < 0) return ret; - *val = 32767 - (s16)be16_to_cpu(regval); + *val = be16_to_cpu(regval); return IIO_VAL_INT; }