driver: lsm6dsm: Allow roundup to work below 13Hz
Recalculate ODR properly after rounding up the requested rate.
TEST=Check ODR is set properly
BRANCH=none
@@ -444,7 +444,7 @@ static int set_data_rate(const struct motion_sensor_t *s, int rate, int rnd)
if (rnd && (normalized_rate < rate)) {
reg_val++;
- normalized_rate *= 2;
+ normalized_rate = LSM6DSM_REG_TO_ODR(reg_val);
}
if (normalized_rate == 0)
return EC_RES_INVALID_PARAM;
