Commit 56251d13 authored by Marcin Niestroj's avatar Marcin Niestroj Committed by Greg Kroah-Hartman

iio: st_pressure: Fix data sign

commit 1b211d48 upstream.

Datasheet of each device (lps331ap, lps25h, lps001wp, lps22hb) says that
the pressure and temperature data is a 2's complement.

I'm sending this the slow way, as negative pressures on these are pretty
unusual and the nature of the fixing of multiple device introduction patches
will make it hard to apply to older kernels - Jonathan.

Fixes: 217494e5 ("iio:pressure: Add STMicroelectronics pressures driver")
Fixes: 2f5effcb ("iio: pressure-core: st: Expand and rename LPS331AP's channel descriptor")
Fixes: 7885a8ce ("iio: pressure: st: Add support for new LPS001WP pressure sensor")
Fixes: e039e2f5 ("iio:st_pressure:initial lps22hb sensor support")
Signed-off-by: default avatarMarcin Niestroj <m.niestroj@grinn-global.com>
Reviewed-by: default avatarLinus Walleij <linus.walleij@linaro.org>
Signed-off-by: default avatarJonathan Cameron <jic23@kernel.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent a1d51f7a
......@@ -227,7 +227,7 @@ static const struct iio_chan_spec st_press_1_channels[] = {
.address = ST_PRESS_1_OUT_XL_ADDR,
.scan_index = 0,
.scan_type = {
.sign = 'u',
.sign = 's',
.realbits = 24,
.storagebits = 32,
.endianness = IIO_LE,
......@@ -240,7 +240,7 @@ static const struct iio_chan_spec st_press_1_channels[] = {
.address = ST_TEMP_1_OUT_L_ADDR,
.scan_index = 1,
.scan_type = {
.sign = 'u',
.sign = 's',
.realbits = 16,
.storagebits = 16,
.endianness = IIO_LE,
......@@ -259,7 +259,7 @@ static const struct iio_chan_spec st_press_lps001wp_channels[] = {
.address = ST_PRESS_LPS001WP_OUT_L_ADDR,
.scan_index = 0,
.scan_type = {
.sign = 'u',
.sign = 's',
.realbits = 16,
.storagebits = 16,
.endianness = IIO_LE,
......@@ -273,7 +273,7 @@ static const struct iio_chan_spec st_press_lps001wp_channels[] = {
.address = ST_TEMP_LPS001WP_OUT_L_ADDR,
.scan_index = 1,
.scan_type = {
.sign = 'u',
.sign = 's',
.realbits = 16,
.storagebits = 16,
.endianness = IIO_LE,
......@@ -291,7 +291,7 @@ static const struct iio_chan_spec st_press_lps22hb_channels[] = {
.address = ST_PRESS_1_OUT_XL_ADDR,
.scan_index = 0,
.scan_type = {
.sign = 'u',
.sign = 's',
.realbits = 24,
.storagebits = 32,
.endianness = IIO_LE,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment