Re: [PATCH v3] iio: adc: spear_adc: mask SPEAR_ADC_STATUS channel and avg sample before setting register

From: Jonathan Cameron
Date: Thu Jul 24 2025 - 08:48:24 EST


On Wed, 23 Jul 2025 16:49:24 +0300
Andy Shevchenko <andriy.shevchenko@xxxxxxxxx> wrote:

> On Thu, Jul 17, 2025 at 07:13:49PM -0300, Rodrigo Gobbi wrote:
> > avg sample info is a bit field coded inside the following
> > bits: 5,6,7 and 8 of a device status register.
> >
> > channel num info the same, but over bits: 1, 2 and 3.
> >
> > mask both values in order to avoid touching other register bits,
> > since the first info (avg sample), came from dt.
>
> Is there any issue with a Shift key?
Sprinkled some capitals.
>
> > Signed-off-by: Rodrigo Gobbi <rodrigo.gobbi.7@xxxxxxxxx>
>
> ...
>
> > #include <linux/clk.h>
> > #include <linux/err.h>
> > #include <linux/completion.h>
> > +#include <linux/bitfield.h>
>
> While it looks unordered, it's still better to squeeze a new header to the
> place which organises a longest (but sparse) group of ordered headers. This
> will reduce churn in the future for the ordering changes.

The full set is currently:

#include <linux/mod_devicetable.h>
#include <linux/module.h>
#include <linux/platform_device.h>
#include <linux/property.h>
#include <linux/interrupt.h>
#include <linux/device.h>
#include <linux/kernel.h>
#include <linux/slab.h>
#include <linux/io.h>
#include <linux/clk.h>
#include <linux/err.h>
#include <linux/completion.h>
#include <linux/bitfield.h>

I'll move it to before clk, but that's only a really minor improvement!


>
> > #include <linux/iio/iio.h>
> > #include <linux/iio/sysfs.h>
>