[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240824111806.GC9644@vamoiridPC>
Date: Sat, 24 Aug 2024 13:18:06 +0200
From: Vasileios Amoiridis <vassilisamir@...il.com>
To: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Cc: Vasileios Amoiridis <vassilisamir@...il.com>, jic23@...nel.org,
lars@...afoo.de, robh@...nel.org, krzk+dt@...nel.org,
conor+dt@...nel.org, ang.iglesiasg@...il.com,
linus.walleij@...aro.org, biju.das.jz@...renesas.com,
javier.carrasco.cruz@...il.com, semen.protsenko@...aro.org,
579lpy@...il.com, ak@...klinger.de, linux-iio@...r.kernel.org,
devicetree@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v3 3/7] iio: pressure: bmp280: Remove config error check
for IIR filter updates
On Fri, Aug 23, 2024 at 10:15:29PM +0300, Andy Shevchenko wrote:
> On Fri, Aug 23, 2024 at 08:17:10PM +0200, Vasileios Amoiridis wrote:
> > When there is a change in the configuration of the BMP3xx device, several
> > steps take place. These steps include:
> >
> > 1) Update the OSR settings and check if there was an update
> > 2) Update the ODR settings and check if there was an update
> > 3) Update the IIR settings and check if there was an update
> > 4) Check if there was an update with the following procedure:
> > a) Set sensor to SLEEP mode and after to NORMAL mode to trigger
> > a new measurement.
> > b) Wait the maximum amount possible depending on the OSR settings
> > c) Check the configuration error register if there was an error
> > during the configuration of the sensor.
> >
> > This check is necessary, because there could be a case where the OSR is
> > too high for the requested ODR so either the ODR needs to be slower or the
> > OSR needs to be less. This is something that is checked internally by the
> > sensor when it runs in NORMAL mode.
> >
> > In the BMP58x devices the previous steps are done internally by the sensor.
> >
> > The IIR filter settings do not depend on the OSR or ODR settings, and there
> > is no need to run a check in case they change.
>
> ...
>
> > + ret = regmap_update_bits(data->regmap, BMP580_REG_DSP_IIR,
> > + BMP580_DSP_IIR_PRESS_MASK |
> > + BMP580_DSP_IIR_TEMP_MASK, reg_val);
>
> Better to split on logical bounds
>
> ret = regmap_update_bits(data->regmap, BMP580_REG_DSP_IIR,
> BMP580_DSP_IIR_PRESS_MASK | BMP580_DSP_IIR_TEMP_MASK,
> reg_val);
>
> --
> With Best Regards,
> Andy Shevchenko
>
>
This goes beyond the 80 char limit. I know that there is the relaxed
limit of 100 chars but I didn't feel it was more readable like this.
I could definitely use it though, thanks!
Cheers,
Vasilis
Powered by blists - more mailing lists