]> Git Repo - linux.git/commitdiff
iio: proximity: sx9500: Fix proximity value
authorDaniel Baluta <[email protected]>
Thu, 11 Jun 2015 15:49:34 +0000 (18:49 +0300)
committerJonathan Cameron <[email protected]>
Sat, 13 Jun 2015 18:19:27 +0000 (19:19 +0100)
Because of the ABI confusion proximity value exposed by SX9500
was inverted.

Signed-off-by: Daniel Baluta <[email protected]>
Reviewed-by: Vlad Dogaru <[email protected]>
Cc: <[email protected]>
Signed-off-by: Jonathan Cameron <[email protected]>
drivers/iio/proximity/sx9500.c

index fa40f6d0ca394f0ae41f6509d6f6c3079062b77e..bd26a484abcc3ce265400821b28b12564975a76c 100644 (file)
@@ -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;
 }
This page took 0.065285 seconds and 4 git commands to generate.