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-06-13 19:19:27 +0100
commitfd1883f07cb434707e50c4c9a16e3ed4b3a5e74f (patch)
tree5fa0ae40d7cdd3c770b8d67fa36237900b9d23cb /drivers/iio
parentbdc10d57f236b534fb675a4bbefd10017aeb2b26 (diff)
downloadop-kernel-dev-fd1883f07cb434707e50c4c9a16e3ed4b3a5e74f.zip
op-kernel-dev-fd1883f07cb434707e50c4c9a16e3ed4b3a5e74f.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 fa40f6d..bd26a48 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;
}
OpenPOWER on IntegriCloud