From: Marcelo Schmitt <marcelo.schmitt1@gmail.com>
To: Andy Shevchenko <andy@kernel.org>
Cc: Marcelo Schmitt <marcelo.schmitt@analog.com>,
linux-iio@vger.kernel.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org,
Ana-Maria Cusco <ana-maria.cusco@analog.com>,
jic23@kernel.org, lars@metafoo.de, Michael.Hennerich@analog.com,
dlechner@baylibre.com, nuno.sa@analog.com, robh@kernel.org,
krzk+dt@kernel.org, conor+dt@kernel.org
Subject: Re: [PATCH v2 2/7] iio: adc: Add basic support for AD4170
Date: Mon, 12 May 2025 10:23:55 -0300 [thread overview]
Message-ID: <aCH2a53ClLnhPDrG@debian-BULLSEYE-live-builder-AMD64> (raw)
In-Reply-To: <aBSsa-QnloxBbBN8@smile.fi.intel.com>
...
>
> > +#define AD4170_EXT_CLOCK_MHZ_MIN (1 * MEGA)
> > +#define AD4170_EXT_CLOCK_MHZ_MAX (17 * MEGA)
>
> Ditto. But are you sure that it's 17 and not 16?
The maximum external clock rates shown in the datasheet are 17 MHz.
The minimum clock low/high times are 27.6 ns, resulting in roughly 18 MHz.
So, the specifications indicate that 17 MHz clock would be okay to operate AD4170.
...
> ...
>
> > + nv = (u64)chan_info->input_range_uv * NANO;
> > + lshift = (pga >> 3 & 1); /* handle cases 8 and 9 */
>
> lshift = !!(pga & BIT(3));
>
> ?
>
> > + rshift = precision_bits - bipolar + (pga & 0x7) - lshift;
>
> GENMASK() ?
rshift = precision_bits - bipolar + (pga & GENMASK(2, 0)) - lshift;
?
> ...
>
> This was really hard to review and I am sure I missed something.
>
> Please, split this to 3+ patches (basic + feature1 + feature2 + ...).
Sorry about that. This part is so flexible that even basic ADC channel support
becomes quite complex due to the dynamic setup configurations and possible
combinations of input type (differential / pseudo-diff) and PGA. For v3, I split
calib gain, offset, and samp freq into separate patches. The PGA, though, is
harder to disentangle from the rest of the base driver.
Thanks,
Marcelo
next prev parent reply other threads:[~2025-05-12 13:22 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-28 12:27 [PATCH v2 0/7] iio: adc: Add support for AD4170 series of ADCs Marcelo Schmitt
2025-04-28 12:27 ` [PATCH v2 1/7] dt-bindings: iio: adc: Add AD4170 Marcelo Schmitt
2025-05-09 18:56 ` Rob Herring
2025-05-11 15:27 ` Marcelo Schmitt
2025-04-28 12:28 ` [PATCH v2 2/7] iio: adc: Add basic support for AD4170 Marcelo Schmitt
2025-05-02 11:28 ` Andy Shevchenko
2025-05-12 13:23 ` Marcelo Schmitt [this message]
2025-05-04 18:21 ` Jonathan Cameron
2025-04-28 12:28 ` [PATCH v2 3/7] iio: adc: ad4170: Add support for buffered data capture Marcelo Schmitt
2025-04-29 22:00 ` Andy Shevchenko
2025-04-30 13:40 ` Marcelo Schmitt
2025-05-02 8:56 ` Andy Shevchenko
2025-05-04 17:27 ` Jonathan Cameron
2025-05-04 17:57 ` Jonathan Cameron
2025-04-28 12:28 ` [PATCH v2 4/7] iio: adc: ad4170: Add clock provider support Marcelo Schmitt
2025-04-29 22:10 ` Andy Shevchenko
2025-05-06 8:21 ` kernel test robot
2025-04-28 12:28 ` [PATCH v2 5/7] iio: adc: ad4170: Add GPIO controller support Marcelo Schmitt
2025-04-29 22:14 ` Andy Shevchenko
2025-05-04 17:50 ` Jonathan Cameron
2025-04-28 12:29 ` [PATCH v2 6/7] iio: adc: ad4170: Add support for internal temperature sensor Marcelo Schmitt
2025-04-29 22:16 ` Andy Shevchenko
2025-05-04 17:44 ` Jonathan Cameron
2025-04-28 12:29 ` [PATCH v2 7/7] iio: adc: ad4170: Add support for weigh scale and RTD sensors Marcelo Schmitt
2025-04-29 22:26 ` Andy Shevchenko
2025-05-01 19:50 ` kernel test robot
2025-05-04 17:42 ` 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=aCH2a53ClLnhPDrG@debian-BULLSEYE-live-builder-AMD64 \
--to=marcelo.schmitt1@gmail.com \
--cc=Michael.Hennerich@analog.com \
--cc=ana-maria.cusco@analog.com \
--cc=andy@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=dlechner@baylibre.com \
--cc=jic23@kernel.org \
--cc=krzk+dt@kernel.org \
--cc=lars@metafoo.de \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=marcelo.schmitt@analog.com \
--cc=nuno.sa@analog.com \
--cc=robh@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