summaryrefslogtreecommitdiff
path: root/drivers/iio/proximity
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/proximity
parentbdc10d57f236b534fb675a4bbefd10017aeb2b26 (diff)
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/proximity')
-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;
}