]> git.baikalelectronics.ru Git - kernel.git/commit
iio: imu: fxos8700: fix ACCEL measurement range selection
authorCarlos Song <carlos.song@nxp.com>
Thu, 8 Dec 2022 07:19:09 +0000 (15:19 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 9 Feb 2023 10:28:18 +0000 (11:28 +0100)
commit25d68cbf985118dd827956088ae647a24abae95e
treeedcdb00aff0095069d56eb2f4b71b6311a5b07e8
parent421c349737ac51f1053fa82eb6ffa3b94179140e
iio: imu: fxos8700: fix ACCEL measurement range selection

commit deb163bd5a2fb86d7694a489960dcd41eda4e91b upstream.

When device is in active mode, it fails to set an ACCEL full-scale
range(2g/4g/8g) in FXOS8700_XYZ_DATA_CFG. This is not align with the
datasheet, but it is a fxos8700 chip behavior.

Keep the device in standby mode before setting ACCEL full-scale range
into FXOS8700_XYZ_DATA_CFG in chip initialization phase and setting
scale phase.

Fixes: 566d166b3663 ("iio: imu: Add support for the FXOS8700 IMU")
Signed-off-by: Carlos Song <carlos.song@nxp.com>
Link: https://lore.kernel.org/r/20221208071911.2405922-6-carlos.song@nxp.com
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/iio/imu/fxos8700_core.c