public inbox for linux-iio@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] iio: dac: ad3552r: use field_get() for power-down bit read
@ 2026-04-11  5:16 Piyush Patle
  2026-04-11 12:49 ` Nuno Sá
  0 siblings, 1 reply; 4+ messages in thread
From: Piyush Patle @ 2026-04-11  5:16 UTC (permalink / raw)
  To: Nuno Sá, Lars-Peter Clausen, Michael Hennerich,
	Jonathan Cameron, David Lechner, Andy Shevchenko
  Cc: linux-iio, linux-kernel

Use field_get() for the per-channel DAC power-down bit instead of an
open-coded mask-and-shift sequence.

No functional change.

Signed-off-by: Piyush Patle <piyushpatle228@gmail.com>
---
 drivers/iio/dac/ad3552r.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/iio/dac/ad3552r.c b/drivers/iio/dac/ad3552r.c
index 93c33bc3e1be..f206bba3a701 100644
--- a/drivers/iio/dac/ad3552r.c
+++ b/drivers/iio/dac/ad3552r.c
@@ -167,8 +167,7 @@ static int ad3552r_read_raw(struct iio_dev *indio_dev,
 		mutex_unlock(&dac->lock);
 		if (err < 0)
 			return err;
-		*val = !((tmp_val & AD3552R_MASK_CH_DAC_POWERDOWN(ch)) >>
-			  __ffs(AD3552R_MASK_CH_DAC_POWERDOWN(ch)));
+		*val = !field_get(AD3552R_MASK_CH_DAC_POWERDOWN(ch), tmp_val);
 		return IIO_VAL_INT;
 	case IIO_CHAN_INFO_SCALE:
 		*val = dac->ch_data[ch].scale_int;
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] iio: dac: ad3552r: use field_get() for power-down bit read
  2026-04-11  5:16 [PATCH] iio: dac: ad3552r: use field_get() for power-down bit read Piyush Patle
@ 2026-04-11 12:49 ` Nuno Sá
  2026-04-19 16:57   ` Piyush Patle
  0 siblings, 1 reply; 4+ messages in thread
From: Nuno Sá @ 2026-04-11 12:49 UTC (permalink / raw)
  To: Piyush Patle, Nuno Sá, Lars-Peter Clausen, Michael Hennerich,
	Jonathan Cameron, David Lechner, Andy Shevchenko
  Cc: linux-iio, linux-kernel

On Sat, 2026-04-11 at 10:46 +0530, Piyush Patle wrote:
> Use field_get() for the per-channel DAC power-down bit instead of an
> open-coded mask-and-shift sequence.
> 
> No functional change.
> 
> Signed-off-by: Piyush Patle <piyushpatle228@gmail.com>
> ---

Reviewed-by: Nuno Sá <nuno.sa@analog.com>

>  drivers/iio/dac/ad3552r.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/iio/dac/ad3552r.c b/drivers/iio/dac/ad3552r.c
> index 93c33bc3e1be..f206bba3a701 100644
> --- a/drivers/iio/dac/ad3552r.c
> +++ b/drivers/iio/dac/ad3552r.c
> @@ -167,8 +167,7 @@ static int ad3552r_read_raw(struct iio_dev *indio_dev,
>  		mutex_unlock(&dac->lock);
>  		if (err < 0)
>  			return err;
> -		*val = !((tmp_val & AD3552R_MASK_CH_DAC_POWERDOWN(ch)) >>
> -			  __ffs(AD3552R_MASK_CH_DAC_POWERDOWN(ch)));
> +		*val = !field_get(AD3552R_MASK_CH_DAC_POWERDOWN(ch), tmp_val);
>  		return IIO_VAL_INT;
>  	case IIO_CHAN_INFO_SCALE:
>  		*val = dac->ch_data[ch].scale_int;

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] iio: dac: ad3552r: use field_get() for power-down bit read
  2026-04-11 12:49 ` Nuno Sá
@ 2026-04-19 16:57   ` Piyush Patle
  2026-04-20 13:08     ` Jonathan Cameron
  0 siblings, 1 reply; 4+ messages in thread
From: Piyush Patle @ 2026-04-19 16:57 UTC (permalink / raw)
  To: Jonathan Cameron
  Cc: Nuno Sá, Lars-Peter Clausen, Michael Hennerich,
	David Lechner, Andy Shevchenko, linux-iio, linux-kernel

On Sat, Apr 11, 2026 at 7:18 PM Nuno Sá <noname.nuno@gmail.com> wrote:
>
> On Sat, 2026-04-11 at 10:46 +0530, Piyush Patle wrote:
> > Use field_get() for the per-channel DAC power-down bit instead of an
> > open-coded mask-and-shift sequence.
> >
> > No functional change.
> >
> > Signed-off-by: Piyush Patle <piyushpatle228@gmail.com>
> > ---
>
> Reviewed-by: Nuno Sá <nuno.sa@analog.com>
>
> >  drivers/iio/dac/ad3552r.c | 3 +--
> >  1 file changed, 1 insertion(+), 2 deletions(-)
> >
> > diff --git a/drivers/iio/dac/ad3552r.c b/drivers/iio/dac/ad3552r.c
> > index 93c33bc3e1be..f206bba3a701 100644
> > --- a/drivers/iio/dac/ad3552r.c
> > +++ b/drivers/iio/dac/ad3552r.c
> > @@ -167,8 +167,7 @@ static int ad3552r_read_raw(struct iio_dev *indio_dev,
> >               mutex_unlock(&dac->lock);
> >               if (err < 0)
> >                       return err;
> > -             *val = !((tmp_val & AD3552R_MASK_CH_DAC_POWERDOWN(ch)) >>
> > -                       __ffs(AD3552R_MASK_CH_DAC_POWERDOWN(ch)));
> > +             *val = !field_get(AD3552R_MASK_CH_DAC_POWERDOWN(ch), tmp_val);
> >               return IIO_VAL_INT;
> >       case IIO_CHAN_INFO_SCALE:
> >               *val = dac->ch_data[ch].scale_int;

Hi,
Gentle ping on this patch.

I’d appreciate any feedback whenever you get time, or let me know if I
should resend/rework anything.

Regards,
Piyush

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] iio: dac: ad3552r: use field_get() for power-down bit read
  2026-04-19 16:57   ` Piyush Patle
@ 2026-04-20 13:08     ` Jonathan Cameron
  0 siblings, 0 replies; 4+ messages in thread
From: Jonathan Cameron @ 2026-04-20 13:08 UTC (permalink / raw)
  To: Piyush Patle
  Cc: Nuno Sá, Lars-Peter Clausen, Michael Hennerich,
	David Lechner, Andy Shevchenko, linux-iio, linux-kernel

On Sun, 19 Apr 2026 22:27:29 +0530
Piyush Patle <piyushpatle228@gmail.com> wrote:

> On Sat, Apr 11, 2026 at 7:18 PM Nuno Sá <noname.nuno@gmail.com> wrote:
> >
> > On Sat, 2026-04-11 at 10:46 +0530, Piyush Patle wrote:  
> > > Use field_get() for the per-channel DAC power-down bit instead of an
> > > open-coded mask-and-shift sequence.
> > >
> > > No functional change.
> > >
> > > Signed-off-by: Piyush Patle <piyushpatle228@gmail.com>
> > > ---  
> >
> > Reviewed-by: Nuno Sá <nuno.sa@analog.com>
> >  
> > >  drivers/iio/dac/ad3552r.c | 3 +--
> > >  1 file changed, 1 insertion(+), 2 deletions(-)
> > >
> > > diff --git a/drivers/iio/dac/ad3552r.c b/drivers/iio/dac/ad3552r.c
> > > index 93c33bc3e1be..f206bba3a701 100644
> > > --- a/drivers/iio/dac/ad3552r.c
> > > +++ b/drivers/iio/dac/ad3552r.c
> > > @@ -167,8 +167,7 @@ static int ad3552r_read_raw(struct iio_dev *indio_dev,
> > >               mutex_unlock(&dac->lock);
> > >               if (err < 0)
> > >                       return err;
> > > -             *val = !((tmp_val & AD3552R_MASK_CH_DAC_POWERDOWN(ch)) >>
> > > -                       __ffs(AD3552R_MASK_CH_DAC_POWERDOWN(ch)));
> > > +             *val = !field_get(AD3552R_MASK_CH_DAC_POWERDOWN(ch), tmp_val);
> > >               return IIO_VAL_INT;
> > >       case IIO_CHAN_INFO_SCALE:
> > >               *val = dac->ch_data[ch].scale_int;  
> 
> Hi,
> Gentle ping on this patch.
> 
> I’d appreciate any feedback whenever you get time, or let me know if I
> should resend/rework anything.

General rule is wait 2 weeks before this sort of email.
You can also check status in patchwork to see if I've gotten to it yet.
https://patchwork.kernel.org/project/linux-iio/list/?

On this particular occasion life got unusually busy so I'm a few weeks
behind and  working backwards through my backlog to catch up.

Applied to the testing branch of iio.git.

Jonathan

> 
> Regards,
> Piyush
> 


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-04-20 13:09 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-11  5:16 [PATCH] iio: dac: ad3552r: use field_get() for power-down bit read Piyush Patle
2026-04-11 12:49 ` Nuno Sá
2026-04-19 16:57   ` Piyush Patle
2026-04-20 13:08     ` Jonathan Cameron

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox