summaryrefslogtreecommitdiff
path: root/drivers/iio
diff options
context:
space:
mode:
authorDaniel Baluta <daniel.baluta@intel.com>2015-06-11 18:49:34 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-08-03 09:29:02 -0700
commit2f69632bdd525e69893f029c528b4d6dc8e123a1 (patch)
tree200dd29f34a6e834e00a42e7a641922ec53b219a /drivers/iio
parentf3a389420f672f820de69fb583fcab4502aa494e (diff)
downloadlinux-rt-2f69632bdd525e69893f029c528b4d6dc8e123a1.tar.gz
iio: proximity: sx9500: Fix proximity value
commit fd1883f07cb434707e50c4c9a16e3ed4b3a5e74f upstream. Because of the ABI confusion proximity value exposed by SX9500 was inverted. Signed-off-by: Daniel Baluta <daniel.baluta@intel.com> Reviewed-by: Vlad Dogaru <vlad.dogaru@intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/iio')
-rw-r--r--drivers/iio/proximity/sx9500.c2
1 files changed, 1 insertions, 1 deletions
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;
}