From: Marcelo Schmitt <marcelo.schmitt1@gmail.com>
To: David Lechner <dlechner@baylibre.com>
Cc: Marcelo Schmitt <marcelo.schmitt@analog.com>,
lars@metafoo.de, Michael.Hennerich@analog.com, jic23@kernel.org,
robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org,
conor+dt@kernel.org, linux-iio@vger.kernel.org,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 2/2] iio: adc: Add support for AD4000
Date: Tue, 9 Apr 2024 15:12:10 -0300 [thread overview]
Message-ID: <ZhWE-hQkRZ4JcJA6@debian-BULLSEYE-live-builder-AMD64> (raw)
In-Reply-To: <CAMknhBGVkv9sP0pjmmdFngKmGVu+G4Y3MUDG199az1wOUtwasw@mail.gmail.com>
On 04/09, David Lechner wrote:
> On Tue, Apr 9, 2024 at 11:09 AM Marcelo Schmitt
> <marcelo.schmitt1@gmail.com> wrote:
> >
> > On 04/08, David Lechner wrote:
> > > On Mon, Apr 8, 2024 at 9:32 AM Marcelo Schmitt
> > > <marcelo.schmitt@analog.com> wrote:
> > > >
>
...
>
>
> > > > +static void ad4000_config(struct ad4000_state *st)
> > > > +{
> > > > + unsigned int reg_val;
> > > > + int ret;
> > > > +
> > > > + reg_val = FIELD_PREP(AD4000_TURBO, 1);
> > >
> > > Since the driver in it's current state can get anywhere near the max
> > > sample rate of ~1MSPS, I don't think it makes sense to enable turbo at
> > > this point.
> > >
> >
> > This is just enabling turbo at start up. If not enabling turbo during probe,
> > we would want(need?) to provide some interface for that, which might not be
> > much desired.
> >
>
> TURBO is only needed to achieve the max sample rate of 500k/1M/2MSPS
> on the various chips by skipping powering down some circuitry between
> samples. We can't get anywhere close to that in Linux without some
> sort of SPI offloading. So, for now, we might as well leave it
> disabled and save some power.
>
Humm, ad4000 datasheets don't really mention power usage differences for turbo
mode like ad7944 datasheet do. Though, they should be similar.
Yeah, will leave turbo disabled until providing offload support.
>
> > > > +
> > > > + st->pin_gain = AD4000_1_GAIN;
> > > > + if (device_property_present(&spi->dev, "adi,gain-milli")) {
> > > > + u32 val;
> > >
> > > Should it be an error if adi,gain-milli is set on non-adaq chips?
> >
> > Maybe. We should not change the scale if it's a chip that don't have the
> > amplifier in front of the ADC. I think the best handling would be to just
> > ignore adi,gain-milli if it's not an ADAQ device. Maybe better add a DT
> > constraint,
> > - if:
> > properties:
> > compatible:
> > contains:
> > enum:
> > - adi,adaq4001
> > - adi,adaq4003
> > then:
> > properties:
> > adi,gain-milli: false
> > ?
>
> I think this is missing a not:, but otherwise yes this should be in
> the DT bindings.
Oops, yeap, was missing the not:.
>
> Even with that though, I would still be helpful to readers of the
> driver to at least have a comment here pointing out that this property
> and related gain scaling only applies to ADAQ chips.
ok, will add a comment.
next prev parent reply other threads:[~2024-04-09 18:11 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-08 14:30 [PATCH v2 0/2] Add support for AD4000 series Marcelo Schmitt
2024-04-08 14:31 ` [PATCH v2 1/2] dt-bindings: iio: adc: Add AD4000 Marcelo Schmitt
2024-04-09 2:57 ` David Lechner
2024-04-09 15:30 ` Marcelo Schmitt
2024-04-13 16:14 ` Jonathan Cameron
2024-04-13 17:33 ` David Lechner
2024-04-14 18:09 ` Jonathan Cameron
2024-04-16 21:46 ` Marcelo Schmitt
2024-04-20 14:17 ` Jonathan Cameron
2024-04-21 22:38 ` Marcelo Schmitt
2024-04-08 14:31 ` [PATCH v2 2/2] iio: adc: Add support for AD4000 Marcelo Schmitt
2024-04-09 3:05 ` David Lechner
2024-04-09 16:09 ` Marcelo Schmitt
2024-04-09 16:44 ` David Lechner
2024-04-09 18:12 ` Marcelo Schmitt [this message]
2024-04-13 16:34 ` Jonathan Cameron
2024-04-13 16:19 ` Jonathan Cameron
2024-04-13 16:39 ` Jonathan Cameron
2024-04-09 2:54 ` [PATCH v2 0/2] Add support for AD4000 series David Lechner
2024-04-09 14:59 ` Marcelo Schmitt
2024-04-09 16:31 ` David Lechner
2024-04-13 16:07 ` 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=ZhWE-hQkRZ4JcJA6@debian-BULLSEYE-live-builder-AMD64 \
--to=marcelo.schmitt1@gmail.com \
--cc=Michael.Hennerich@analog.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=dlechner@baylibre.com \
--cc=jic23@kernel.org \
--cc=krzysztof.kozlowski+dt@linaro.org \
--cc=lars@metafoo.de \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=marcelo.schmitt@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