linux_dsm_epyc7002/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 <stephan@gerhold.net>
Reviewed-by: Linus Waleij <linus.walleij@linaro.org>
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2020-02-21 11:59:46 +00:00
..
ak8974.c iio: magnetometer: ak8974: Fix negative raw values in sysfs 2020-02-21 11:59:46 +00:00
ak8975.c iio: magnetometer: ak8975: Convert to use device_get_match_data() 2020-01-18 11:43:17 +00:00
bmc150_magn_i2c.c
bmc150_magn_spi.c
bmc150_magn.c
bmc150_magn.h
hid-sensor-magn-3d.c
hmc5843_core.c
hmc5843_i2c.c
hmc5843_spi.c
hmc5843.h
Kconfig
mag3110.c
Makefile
mmc35240.c
rm3100-core.c
rm3100-i2c.c
rm3100-spi.c
rm3100.h
st_magn_buffer.c
st_magn_core.c
st_magn_i2c.c iio: st_sensors: Make use of device properties 2020-01-13 21:53:39 +00:00
st_magn_spi.c iio: st_sensors: Make use of device properties 2020-01-13 21:53:39 +00:00
st_magn.h