From: Lorenzo Bianconi Date: Tue, 27 Aug 2019 08:29:06 +0000 (+0200) Subject: iio: imu: st_lsm6dsx: rely on IIO_G_TO_M_S_2 for gain definition for LSM9DS1 X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=6fa029486b74c266c39b718b8643ed42d24f977a;p=linux.git iio: imu: st_lsm6dsx: rely on IIO_G_TO_M_S_2 for gain definition for LSM9DS1 Rely on IIO_G_TO_M_S_2 macro for LSM9DS1 accelerometer gain definitions Signed-off-by: Lorenzo Bianconi Signed-off-by: Jonathan Cameron --- diff --git a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c index c85c8be3a024f..2d34955601368 100644 --- a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c +++ b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c @@ -141,10 +141,10 @@ static const struct st_lsm6dsx_settings st_lsm6dsx_sensor_settings[] = { .addr = 0x20, .mask = GENMASK(4, 3), }, - .fs_avl[0] = { 599, 0x0 }, - .fs_avl[1] = { 1197, 0x2 }, - .fs_avl[2] = { 2394, 0x3 }, - .fs_avl[3] = { 4788, 0x1 }, + .fs_avl[0] = { IIO_G_TO_M_S_2(61), 0x0 }, + .fs_avl[1] = { IIO_G_TO_M_S_2(122), 0x2 }, + .fs_avl[2] = { IIO_G_TO_M_S_2(244), 0x3 }, + .fs_avl[3] = { IIO_G_TO_M_S_2(732), 0x1 }, }, [ST_LSM6DSX_ID_GYRO] = { .reg = {