Files
linux/drivers/iio/magnetometer
Stephan Gerhold b500c086e4 iio: magnetometer: ak8974: Fix negative raw values in sysfs
At the moment, reading from in_magn_*_raw in sysfs tends to return
large values around 65000, even though the output of ak8974 is actually
limited to ±32768. This happens because the value is never converted
to the signed 16-bit integer variant.

Add an explicit cast to s16 to fix this.

Fixes: 7c94a8b2ee ("iio: magn: add a driver for AK8974")
Signed-off-by: Stephan Gerhold <[email protected]>
Reviewed-by: Linus Waleij <[email protected]>
Cc: <[email protected]>
Signed-off-by: Jonathan Cameron <[email protected]>
2020-02-21 11:59:46 +00:00
..
2019-10-27 15:55:45 +00:00