lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CA+GgBR8H1TP1Ux8Fgohx0SkctxdvmtBZfqW+-k4cZsram5yScA@mail.gmail.com>
Date: Fri, 6 Sep 2024 08:10:44 +0300
From: Alexandru Ardelean <aardelean@...libre.com>
To: David Lechner <dlechner@...libre.com>
Cc: linux-iio@...r.kernel.org, linux-kernel@...r.kernel.org, 
	devicetree@...r.kernel.org, jic23@...nel.org, krzk+dt@...nel.org, 
	robh@...nel.org, lars@...afoo.de, michael.hennerich@...log.com, 
	gstols@...libre.com
Subject: Re: [PATCH v4 1/8] iio: adc: ad7606: add 'bits' parameter to channels macros

On Fri, Sep 6, 2024 at 12:25 AM David Lechner <dlechner@...libre.com> wrote:
>
> On 9/5/24 3:23 AM, Alexandru Ardelean wrote:
> > There are some newer additions to the AD7606 family, which support 18 bit
> > precision.
> > Up until now, all chips were 16 bit.
> >
> > This change adds a 'bits' parameter to the AD760X_CHANNEL macro and renames
> > 'ad7606_channels' -> 'ad7606_channels_16bit' for the current devices.
> >
> > The AD7606_SW_CHANNEL() macro is also introduced, as a short-hand for IIO
> > channels in SW mode.
> >
> > Signed-off-by: Alexandru Ardelean <aardelean@...libre.com>
> > ---
>
> ...
>
> > diff --git a/drivers/iio/adc/ad7606.h b/drivers/iio/adc/ad7606.h
> > index 0c6a88cc4695..771121350f98 100644
> > --- a/drivers/iio/adc/ad7606.h
> > +++ b/drivers/iio/adc/ad7606.h
> > @@ -8,7 +8,7 @@
> >  #ifndef IIO_ADC_AD7606_H_
> >  #define IIO_ADC_AD7606_H_
> >
> > -#define AD760X_CHANNEL(num, mask_sep, mask_type, mask_all) { \
> > +#define AD760X_CHANNEL(num, mask_sep, mask_type, mask_all, bits) {   \
> >               .type = IIO_VOLTAGE,                            \
> >               .indexed = 1,                                   \
> >               .channel = num,                                 \
> > @@ -19,24 +19,26 @@
> >               .scan_index = num,                              \
> >               .scan_type = {                                  \
> >                       .sign = 's',                            \
> > -                     .realbits = 16,                         \
> > -                     .storagebits = 16,                      \
> > +                     .realbits = (bits),                     \
> > +                     .storagebits = (bits),                  \
>
> Technically OK in this patch since bits is still always 16 but we
> can avoid changing the same line again later to:
>
>         (bits) > 16 ? 32 : 16
>
> if we just do that in this patch.

sure
will update

>
>
> >                       .endianness = IIO_CPU,                  \
> >               },                                              \
> >  }

Powered by blists - more mailing lists