[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <c665ae5fed9fb42e0312f000a2d3e784360a8d01.camel@baylibre.com>
Date: Fri, 21 Nov 2025 09:43:28 +0100
From: Francesco Lavra <flavra@...libre.com>
To: Lorenzo Bianconi <lorenzo@...nel.org>
Cc: 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 v2 5/9] iio: imu: st_lsm6dsx: remove event_threshold
field from hw struct
On Fri, 2025-11-21 at 09:14 +0100, Lorenzo Bianconi 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.
> >
> > Signed-off-by: Francesco Lavra <flavra@...libre.com>
>
> Just a nit inline, fixing it:
>
> Acked-by: Lorenzo Bianconi <lorenzo@...nel.org>
>
> > ---
> > drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h | 3 +--
> > drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c | 12 +++++++++---
> > 2 files changed, 10 insertions(+), 5 deletions(-)
> >
> > diff --git a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h
> > b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h
> > index bbb967b2754b..e727a87413e5 100644
> > --- a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h
> > +++ b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h
> > @@ -79,6 +79,7 @@ enum st_lsm6dsx_hw_id {
> > #define ST_LSM6DSX_MAX_TAGGED_WORD_LEN ((32 /
> > ST_LSM6DSX_TAGGED_SAMPLE_SIZE) \
> > *
> > ST_LSM6DSX_TAGGED_SAMPLE_SIZE)
> > #define ST_LSM6DSX_SHIFT_VAL(val, mask) (((val) << __ffs(mask))
> > & (mask))
> > +#define st_lsm6dsx_field_get(mask, reg) ((reg & mask) >>
> > __ffs(mask))
>
> To be aligned with the rest of the code, I guess we could use capital
> letters
> here:
>
> #define ST_LSM6DSX_FIELD_GET(mask, reg)▸ ((reg & mask) >>
> __ffs(mask))
That's what I proposed initially, but Andy suggested [1] using small
letters instead.
https://lore.kernel.org/linux-iio/aQh4m25uVBV8A09F@smile.fi.intel.com/
Download attachment "signature.asc" of type "application/pgp-signature" (660 bytes)
Powered by blists - more mailing lists