Skip to content

Commit a5f4a38

Browse files
ggrsgregkh
authored andcommitted
iio: imu: bmi270: fix initial sampling frequency configuration
[ Upstream commit 6d03811 ] 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> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent ecae580 commit a5f4a38

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
@@ -654,17 +654,15 @@ static int bmi270_configure_imu(struct bmi270_data *bmi270_device)
654654
FIELD_PREP(BMI270_ACC_CONF_ODR_MSK,
655655
BMI270_ACC_CONF_ODR_100HZ) |
656656
FIELD_PREP(BMI270_ACC_CONF_BWP_MSK,
657-
BMI270_ACC_CONF_BWP_NORMAL_MODE) |
658-
BMI270_PWR_CONF_ADV_PWR_SAVE_MSK);
657+
BMI270_ACC_CONF_BWP_NORMAL_MODE));
659658
if (ret)
660659
return dev_err_probe(dev, ret, "Failed to configure accelerometer");
661660

662661
ret = regmap_set_bits(regmap, BMI270_GYR_CONF_REG,
663662
FIELD_PREP(BMI270_GYR_CONF_ODR_MSK,
664663
BMI270_GYR_CONF_ODR_200HZ) |
665664
FIELD_PREP(BMI270_GYR_CONF_BWP_MSK,
666-
BMI270_GYR_CONF_BWP_NORMAL_MODE) |
667-
BMI270_PWR_CONF_ADV_PWR_SAVE_MSK);
665+
BMI270_GYR_CONF_BWP_NORMAL_MODE));
668666
if (ret)
669667
return dev_err_probe(dev, ret, "Failed to configure gyroscope");
670668

0 commit comments

Comments
 (0)