Re: [PATCH 3/3] iio: imu: bmi270: add support for motion events
From: Andy Shevchenko
Date: Fri Apr 25 2025 - 01:25:46 EST
On Fri, Apr 25, 2025 at 3:15 AM Gustavo Silva <gustavograzs@xxxxxxxxx> wrote:
>
> Add support for any-motion/no-motion events based on acceleration slope
> on each axis. Threshold and duration can be configured from userspace.
I'm wondering if you are using --histogram diff algo when preparing
the patches. If not, please do so for the next version.
...
> + irq_reg = bmi270_int_map_reg(data->irq_pin);
> + if (irq_reg < 0)
> + return -EINVAL;
Why is the error code shadowed?
...
> + case IIO_EV_INFO_PERIOD:
> + if (!in_range(val, 0, 163))
162 + 1
> + return -EINVAL;
> +
> + raw = BMI270_INT_MICRO_TO_RAW(val, val2,
> + BMI270_MOTION_DURAT_SCALE);
> +
> + return bmi270_update_feature_reg(data, reg,
> + BMI270_FEAT_MOTION_DURATION_MSK,
> + FIELD_PREP(BMI270_FEAT_MOTION_DURATION_MSK,
> + raw));
...
> + case IIO_EV_TYPE_MAG:
> + reg = bmi270_motion_config_reg(dir);
> + if (reg < 0)
> + return -EINVAL;
Shadowed error code, why?
--
With Best Regards,
Andy Shevchenko