From: Daniel Baluta Date: Thu, 11 Jun 2015 15:49:34 +0000 (+0300) Subject: iio: proximity: sx9500: Fix proximity value X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=fd1883f07cb434707e50c4c9a16e3ed4b3a5e74f;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.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 fa40f6d0ca39..bd26a484abcc 100644 --- a/drivers/iio/proximity/sx9500.c +++ b/drivers/iio/proximity/sx9500.c @@ -206,7 +206,7 @@ static int sx9500_read_proximity(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; }