public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: "Nuno Sá" <noname.nuno@gmail.com>
Cc: "David Lechner" <dlechner@baylibre.com>,
	linux-iio@vger.kernel.org,
	"Michael Hennerich" <Michael.Hennerich@analog.com>,
	"Rob Herring" <robh+dt@kernel.org>,
	"Krzysztof Kozlowski" <krzysztof.kozlowski+dt@linaro.org>,
	"Conor Dooley" <conor+dt@kernel.org>,
	"Nuno Sá" <nuno.sa@analog.com>,
	"Liam Girdwood" <lgirdwood@gmail.com>,
	"Mark Brown" <broonie@kernel.org>,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] iio: adc: ad7944: add driver for AD7944/AD7985/AD7986
Date: Sat, 10 Feb 2024 17:42:39 +0000	[thread overview]
Message-ID: <20240210174239.550c5d64@jic23-huawei> (raw)
In-Reply-To: <06a2a5618058909df52b685f461e668b259ff42a.camel@gmail.com>


> > >   
> > > > +     if (chan->scan_type.sign == 's')
> > > > +             *val = sign_extend32(*val, chan->scan_type.realbits - 1);
> > > > +
> > > > +     return IIO_VAL_INT;
> > > > +}
> > > > +
> > > > +static int ad7944_read_raw(struct iio_dev *indio_dev,
> > > > +                        const struct iio_chan_spec *chan,
> > > > +                        int *val, int *val2, long info)
> > > > +{
> > > > +     struct ad7944_adc *adc = iio_priv(indio_dev);
> > > > +     int ret;
> > > > +
> > > > +     switch (info) {
> > > > +     case IIO_CHAN_INFO_RAW:
> > > > +             ret = iio_device_claim_direct_mode(indio_dev);
> > > > +             if (ret)
> > > > +                     return ret;
> > > > +  
> > > 
> > > I'm not totally sure but I think Jonathan already merged his series for the
> > > cleanup stuff for the claim direct mode. Maybe take a look and use it? Not a
> > > big
> > > win in here but I guess we could still reduce some LOC.  
> > 
> > Yes, if it is merged already, happy to make use of it here.
It is in my tree, but I'd rather maintain some separation between
patch sets (incase I need to pull it out again for some reason).
Given the saving here is minor, we can just follow up with a patch
making the conversion after both are in place.

> >   
> > >   
> > > > +             ret = ad7944_single_conversion(adc, chan, val);
> > > > +             iio_device_release_direct_mode(indio_dev);

  reply	other threads:[~2024-02-10 17:42 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-06 17:25 [PATCH 0/2] iio: adc: ad7944: new driver David Lechner
2024-02-06 17:25 ` [PATCH 1/2] dt-bindings: iio: adc: add ad7944 ADCs David Lechner
2024-02-06 17:34   ` David Lechner
2024-02-07 17:27     ` Conor Dooley
2024-02-15 13:23     ` Rob Herring
2024-02-15 21:49       ` David Lechner
2024-02-10 17:40   ` Jonathan Cameron
2024-02-11 17:49     ` David Lechner
2024-02-16 14:08       ` Jonathan Cameron
2024-02-06 17:26 ` [PATCH 2/2] iio: adc: ad7944: add driver for AD7944/AD7985/AD7986 David Lechner
2024-02-07 10:10   ` Nuno Sá
2024-02-07 14:19     ` David Lechner
2024-02-08  8:17       ` Nuno Sá
2024-02-10 17:42         ` Jonathan Cameron [this message]
2024-02-10 17:47   ` Jonathan Cameron
2024-02-11 17:03     ` David Lechner
2024-02-14 16:13       ` Jonathan Cameron

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240210174239.550c5d64@jic23-huawei \
    --to=jic23@kernel.org \
    --cc=Michael.Hennerich@analog.com \
    --cc=broonie@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dlechner@baylibre.com \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=noname.nuno@gmail.com \
    --cc=nuno.sa@analog.com \
    --cc=robh+dt@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox