iio: accel: fxls8962af: Fix temperature scan element sign

commit 9c78317b42e7c32523c91099859bc4721e9f75dd upstream.

Mark the temperature element signed, data read from the TEMP_OUT register
is in two's complement format.
This will avoid the temperature being mishandled and miss displayed.

Fixes: a3e0b51884 ("iio: accel: add support for FXLS8962AF/FXLS8964AF accelerometers")
Suggested-by: Marcelo Schmitt <marcelo.schmitt1@gmail.com>
Cc: stable@vger.kernel.org
Reviewed-by: Marcelo Schmitt <marcelo.schmitt1@gmail.com>
Signed-off-by: Sean Nyekjaer <sean@geanix.com>
Link: https://patch.msgid.link/20250505-fxls-v4-2-a38652e21738@geanix.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Sean Nyekjaer
2025-05-05 21:20:08 +02:00
committed by Greg Kroah-Hartman
parent a9f6c1ad6c
commit 6a86053630

View File

@@ -737,6 +737,7 @@ static const struct iio_event_spec fxls8962af_event[] = {
BIT(IIO_CHAN_INFO_OFFSET),\ BIT(IIO_CHAN_INFO_OFFSET),\
.scan_index = -1, \ .scan_index = -1, \
.scan_type = { \ .scan_type = { \
.sign = 's', \
.realbits = 8, \ .realbits = 8, \
.storagebits = 8, \ .storagebits = 8, \
}, \ }, \