[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <tksgr4m2bl2pppeyhoqobwtqes5kgjueo6yflps6ib3au2itpv@nh3i5yvvn53u>
Date: Sat, 26 Apr 2025 20:06:01 -0300
From: Gustavo Silva <gustavograzs@...il.com>
To: Andy Shevchenko <andy.shevchenko@...il.com>
Cc: Alex Lanzano <lanzano.alex@...il.com>,
Jonathan Cameron <jic23@...nel.org>, David Lechner <dlechner@...libre.com>,
Nuno Sá <nuno.sa@...log.com>, Andy Shevchenko <andy@...nel.org>, linux-iio@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH 3/3] iio: imu: bmi270: add support for motion events
On Fri, Apr 25, 2025 at 08:25:00AM +0300, Andy Shevchenko wrote:
> On Fri, Apr 25, 2025 at 3:15 AM Gustavo Silva <gustavograzs@...il.com> 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.
>
Yeah, I am indeed using the histogram algorithm.
> ...
>
> > + irq_reg = bmi270_int_map_reg(data->irq_pin);
> > + if (irq_reg < 0)
> > + return -EINVAL;
>
> Why is the error code shadowed?
>
I might have forgotten to update this line. Will fix it in v2.
> ...
>
> > + case IIO_EV_INFO_PERIOD:
> > + if (!in_range(val, 0, 163))
>
> 162 + 1
>
Ack.
> > + 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?
>
Same as above. Will fix in v2.
> --
> With Best Regards,
> Andy Shevchenko
Powered by blists - more mailing lists