From: Ajith Anandhan <ajithanandhan0406@gmail.com>
To: David Lechner <dlechner@baylibre.com>, linux-iio@vger.kernel.org
Cc: jic23@kernel.org, nuno.sa@analog.com, andy@kernel.org,
robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [RFC PATCH 2/3] iio: adc: Add support for TI ADS1120
Date: Sun, 9 Nov 2025 14:15:57 +0530 [thread overview]
Message-ID: <59ef14bb-0576-4660-8de1-be9cdd1a400d@gmail.com> (raw)
In-Reply-To: <de424e9d-95cd-4a42-8f1a-97ad04f5f9ef@baylibre.com>
On 11/7/25 9:48 PM, David Lechner wrote:
> On 11/7/25 9:50 AM, Ajith Anandhan wrote:
>> On 10/31/25 2:43 AM, David Lechner wrote:
>>> On 10/30/25 11:34 AM, Ajith Anandhan wrote:
>>>> Add driver for the Texas Instruments ADS1120, a precision 16-bit
>>>> analog-to-digital converter with an SPI interface.
>>>>
> One note about the review process. Any suggestions you agree with, you
> don't need to reply to specifically. You can trim out those parts in
> your reply. It saves time for those reading the replies.
>
>>>> +struct ads1120_state {
>>>> + struct spi_device *spi;
>>>> + struct mutex lock;
>>>> + /*
>>>> + * Used to correctly align data.
>>>> + * Ensure natural alignment for potential future timestamp support.
>>>> + */
>>>> + u8 data[4] __aligned(IIO_DMA_MINALIGN);
>>>> +
>>>> + u8 config[4];
>>>> + int current_channel;
>>>> + int gain;
>>> Since inputs are multiplexed, we can make this gain a per-channel value, no?
>> Yes we can, However i want to keep the initial version simple so would it be
>>
>> fine to support per-channel gain configurationin upcoming patches?
> Absolutely. I really appreciate splitting things up like that as it makes
> it much easier to review.
>
>>> It also sounds like that certain mux input have to have the PGA bypassed
>>> which means they are limited to only 3 gain values. So these would have
>>> a different scale_available attribute.
>> Since, I'm gonna enable all the 15 channels. I believe we have to have all
>>
>> gains(for differential channels). Correct me if i'm wrong.
> Yes, that is how I understood the datasheet. Differential channels have all
> gains. Single-ended channels and diagnostic channels only get the low gains
> (1, 2, 4).
>
>
>>>> +static int ads1120_write_reg(struct ads1120_state *st, u8 reg, u8 value)
>>>> +{
>>>> + u8 buf[2];
>>>> +
>>>> + if (reg > ADS1120_REG_CONFIG3)
>>>> + return -EINVAL;
>>>> +
>>>> + buf[0] = ADS1120_CMD_WREG | (reg << 2);
>>>> + buf[1] = value;
>>>> +
>>>> + return spi_write(st->spi, buf, 2);
>>>> +}
>>> Can we use the regmap framework instead of writing our own?
>> I’d like to keep the first version simple so i will add the regmap support in the
>>
>> later patch since the single ended has less spi transaction to handle.
> It would be less churn to implement the regmap right away. Typically
> we try to avoid churn if we can help it. So this would be an exception
> to the general suggestion that splitting things up is better.
Got it, I’ll add regmap support and address all review comments in the v2
patch series.
BR,
Ajith.
next prev parent reply other threads:[~2025-11-09 8:46 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-30 16:34 [RFC PATCH 0/3] iio: adc: Add support for TI ADS1120 ADC Ajith Anandhan
2025-10-30 16:34 ` [RFC PATCH 1/3] dt-bindings: iio: adc: Add TI ADS1120 binding Ajith Anandhan
2025-10-30 17:12 ` Jonathan Cameron
2025-10-30 20:04 ` David Lechner
2025-11-01 12:24 ` Ajith Anandhan
2025-11-01 11:53 ` Ajith Anandhan
2025-10-30 16:34 ` [RFC PATCH 2/3] iio: adc: Add support for TI ADS1120 Ajith Anandhan
2025-10-30 17:54 ` Jonathan Cameron
2025-11-07 14:40 ` Ajith Anandhan
2025-11-09 14:02 ` Jonathan Cameron
2025-10-30 21:13 ` David Lechner
2025-11-07 15:50 ` Ajith Anandhan
2025-11-07 16:18 ` David Lechner
2025-11-09 8:45 ` Ajith Anandhan [this message]
2025-10-30 16:34 ` [RFC PATCH 3/3] MAINTAINERS: Add entry for TI ADS1120 ADC driver Ajith Anandhan
2025-10-30 17:55 ` Jonathan Cameron
2025-11-07 13:43 ` Ajith Anandhan
2025-10-30 16:40 ` [RFC PATCH 0/3] iio: adc: Add support for TI ADS1120 ADC Krzysztof Kozlowski
[not found] ` <CABPXPSKzOhGicdPLoMFy8xvd0Xx5_D2P2pduteY3QhDRV4d2Ow@mail.gmail.com>
2025-10-30 16:58 ` Ajith Anandhan
2025-10-30 17:08 ` Jonathan Cameron
2025-10-30 19:44 ` Krzysztof Kozlowski
2025-10-31 8:37 ` Andy Shevchenko
2025-11-01 11:37 ` Ajith Anandhan
2025-11-03 7:51 ` Andy Shevchenko
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=59ef14bb-0576-4660-8de1-be9cdd1a400d@gmail.com \
--to=ajithanandhan0406@gmail.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=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--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