summaryrefslogtreecommitdiffstats
path: root/drivers/iio
diff options
context:
space:
mode:
authorDaniel Baluta <daniel.baluta@intel.com>2015-06-11 18:49:34 +0300
committerJonathan Cameron <jic23@kernel.org>2015-07-19 11:48:04 +0100
commit86d24f04f9a0a7bad8e1719e5aa464eb5779e678 (patch)
treed509cfe735bb18c46333a0262802f46898d378cb /drivers/iio
parent63fc444967591c3849438aa0f21d5de96a928311 (diff)
downloadop-kernel-dev-86d24f04f9a0a7bad8e1719e5aa464eb5779e678.zip
op-kernel-dev-86d24f04f9a0a7bad8e1719e5aa464eb5779e678.tar.gz
iio: proximity: sx9500: Fix proximity value
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> Cc: <Stable@vger.kernel.org> Signed-off-by: Jonathan Cameron <jic23@kernel.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 2042e37..01494cd 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;
}
OpenPOWER on IntegriCloud