Commit 0f7e1728 authored by Lorenzo Bianconi's avatar Lorenzo Bianconi Committed by Jonathan Cameron

iio: imu: st_lsm6dsx: remove invalid gain value for LSM9DS1

Get rid of invalid sensitivity value for LSM9DS1 gyro sensor

Fixes: 52f4b1f1 ("iio: imu: st_lsm6dsx: add support for accel/gyro unit of lsm9ds1")
Signed-off-by: default avatarLorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
parent 22087c85
...@@ -151,10 +151,9 @@ static const struct st_lsm6dsx_settings st_lsm6dsx_sensor_settings[] = { ...@@ -151,10 +151,9 @@ static const struct st_lsm6dsx_settings st_lsm6dsx_sensor_settings[] = {
.addr = 0x10, .addr = 0x10,
.mask = GENMASK(4, 3), .mask = GENMASK(4, 3),
}, },
.fs_avl[0] = { IIO_DEGREE_TO_RAD(245), 0x0 }, .fs_avl[0] = { IIO_DEGREE_TO_RAD(245), 0x0 },
.fs_avl[1] = { IIO_DEGREE_TO_RAD(500), 0x1 }, .fs_avl[1] = { IIO_DEGREE_TO_RAD(500), 0x1 },
.fs_avl[2] = { IIO_DEGREE_TO_RAD(0), 0x2 }, .fs_avl[2] = { IIO_DEGREE_TO_RAD(2000), 0x3 },
.fs_avl[3] = { IIO_DEGREE_TO_RAD(2000), 0x3 },
}, },
}, },
}, },
...@@ -1196,13 +1195,19 @@ static ssize_t st_lsm6dsx_sysfs_scale_avail(struct device *dev, ...@@ -1196,13 +1195,19 @@ static ssize_t st_lsm6dsx_sysfs_scale_avail(struct device *dev,
char *buf) char *buf)
{ {
struct st_lsm6dsx_sensor *sensor = iio_priv(dev_get_drvdata(dev)); struct st_lsm6dsx_sensor *sensor = iio_priv(dev_get_drvdata(dev));
const struct st_lsm6dsx_fs_table_entry *fs_table;
enum st_lsm6dsx_sensor_id id = sensor->id; enum st_lsm6dsx_sensor_id id = sensor->id;
struct st_lsm6dsx_hw *hw = sensor->hw; struct st_lsm6dsx_hw *hw = sensor->hw;
int i, len = 0; int i, len = 0;
for (i = 0; i < ST_LSM6DSX_FS_LIST_SIZE; i++) fs_table = &hw->settings->fs_table[id];
for (i = 0; i < ST_LSM6DSX_FS_LIST_SIZE; i++) {
if (!fs_table->fs_avl[i].gain)
break;
len += scnprintf(buf + len, PAGE_SIZE - len, "0.%06u ", len += scnprintf(buf + len, PAGE_SIZE - len, "0.%06u ",
hw->settings->fs_table[id].fs_avl[i].gain); fs_table->fs_avl[i].gain);
}
buf[len - 1] = '\n'; buf[len - 1] = '\n';
return len; return len;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment