Explorar o código

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>
Daniel Baluta %!s(int64=10) %!d(string=hai) anos
pai
achega
fd1883f07c
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      drivers/iio/proximity/sx9500.c

+ 1 - 1
drivers/iio/proximity/sx9500.c

@@ -206,7 +206,7 @@ static int sx9500_read_proximity(struct sx9500_data *data,
 	if (ret < 0)
 	if (ret < 0)
 		return ret;
 		return ret;
 
 
-	*val = 32767 - (s16)be16_to_cpu(regval);
+	*val = be16_to_cpu(regval);
 
 
 	return IIO_VAL_INT;
 	return IIO_VAL_INT;
 }
 }