Skip to content

Commit 6d03811

Browse files
ggrsjic23
authored andcommitted
iio: imu: bmi270: fix initial sampling frequency configuration
In the bmi270_configure_imu() function, the accelerometer and gyroscope configuration registers are incorrectly written with the mask BMI270_PWR_CONF_ADV_PWR_SAVE_MSK, which is unrelated to these registers. As a result, the accelerometer's sampling frequency is set to 200 Hz instead of the intended 100 Hz. Remove the mask to ensure the correct bits are set in the configuration registers. Fixes: 3ea5154 ("iio: imu: Add i2c driver for bmi270 imu") Signed-off-by: Gustavo Silva <gustavograzs@gmail.com> Reviewed-by: Alex Lanzano <lanzano.alex@gmail.com> Link: https://patch.msgid.link/20250304-bmi270-odr-fix-v1-1-384dbcd699fb@gmail.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
1 parent 0af2f6b commit 6d03811

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

drivers/iio/imu/bmi270/bmi270_core.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -918,17 +918,15 @@ static int bmi270_configure_imu(struct bmi270_data *data)
918918
FIELD_PREP(BMI270_ACC_CONF_ODR_MSK,
919919
BMI270_ACC_CONF_ODR_100HZ) |
920920
FIELD_PREP(BMI270_ACC_CONF_BWP_MSK,
921-
BMI270_ACC_CONF_BWP_NORMAL_MODE) |
922-
BMI270_PWR_CONF_ADV_PWR_SAVE_MSK);
921+
BMI270_ACC_CONF_BWP_NORMAL_MODE));
923922
if (ret)
924923
return dev_err_probe(dev, ret, "Failed to configure accelerometer");
925924

926925
ret = regmap_set_bits(regmap, BMI270_GYR_CONF_REG,
927926
FIELD_PREP(BMI270_GYR_CONF_ODR_MSK,
928927
BMI270_GYR_CONF_ODR_200HZ) |
929928
FIELD_PREP(BMI270_GYR_CONF_BWP_MSK,
930-
BMI270_GYR_CONF_BWP_NORMAL_MODE) |
931-
BMI270_PWR_CONF_ADV_PWR_SAVE_MSK);
929+
BMI270_GYR_CONF_BWP_NORMAL_MODE));
932930
if (ret)
933931
return dev_err_probe(dev, ret, "Failed to configure gyroscope");
934932

0 commit comments

Comments
 (0)