[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <aTYEwUU0xkPGSZHF@smile.fi.intel.com>
Date: Mon, 8 Dec 2025 00:50:41 +0200
From: Andy Shevchenko <andriy.shevchenko@...el.com>
To: Jonathan Cameron <jic23@...nel.org>
Cc: Francesco Lavra <flavra@...libre.com>,
Lorenzo Bianconi <lorenzo@...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 v4 5/9] iio: imu: st_lsm6dsx: remove event_threshold
field from hw struct
On Sun, Dec 07, 2025 at 03:31:13PM +0000, Jonathan Cameron wrote:
> On Mon, 1 Dec 2025 11:00:14 +0100
> Francesco Lavra <flavra@...libre.com> wrote:
>
> > This field is used to store the wakeup event detection threshold value.
> > When adding support for more event types, some of which may have different
> > threshold values for different axes, storing all threshold values for all
> > event sources would be cumbersome. Thus, remove this field altogether, and
> > read the currently configured value from the sensor when requested by
> > userspace.
...
> > #define ST_LSM6DSX_SHIFT_VAL(val, mask) (((val) << __ffs(mask)) & (mask))
> > +#define st_lsm6dsx_field_get(mask, reg) ((reg & mask) >> __ffs(mask))
>
> I'm not going to fuss too much about this as expectation is that
> this will be replaced soon anyway with a generic version but convention
> would be to (reg) & (mask) to avoid precedence of operator problems if
> there are any in the parameters passed. The generic version will I guess also deal
> with avoiding multiple evaluation of mask.
>
> Anyhow, doesn't matter here given the simple user.
>
> Applied.
Note, the new API is already in Linus' tree.
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists