Linux IIO development
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: David Lechner <dlechner@baylibre.com>
Cc: Ajith Anandhan <ajithanandhan0406@gmail.com>,
	nuno.sa@analog.com, andy@kernel.org, robh@kernel.org,
	krzk+dt@kernel.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 TI ADS1120
Date: Sun, 21 Dec 2025 18:57:16 +0000	[thread overview]
Message-ID: <20251221185716.65b442d9@jic23-huawei> (raw)
In-Reply-To: <5926ca19-c204-4abc-9e59-86a797b63b5c@baylibre.com>

On Mon, 15 Dec 2025 11:42:15 -0600
David Lechner <dlechner@baylibre.com> wrote:

> On 12/15/25 10:49 AM, Ajith Anandhan wrote:
> > On 12/15/25 10:06 PM, David Lechner wrote:  
> >> On 12/15/25 10:13 AM, Ajith Anandhan wrote:  
> >>> On 11/18/25 7:34 PM, David Lechner wrote:  
> >>>> On 11/9/25 8:11 AM, Ajith Anandhan wrote:  
> >>>>> Add driver for the Texas Instruments ADS1120, a precision 16-bit
> >>>>> analog-to-digital converter with an SPI interface.
> >>>>>  
> >>>> ...
> >>>>  
> >>>>> +#define ADS1120_CFG0_GAIN_MASK        GENMASK(3, 1)
> >>>>> +#define ADS1120_CFG0_GAIN_1        0
> >>>>> +#define ADS1120_CFG0_GAIN_2        1
> >>>>> +#define ADS1120_CFG0_GAIN_4        2
> >>>>> +#define ADS1120_CFG0_GAIN_8        3
> >>>>> +#define ADS1120_CFG0_GAIN_16        4
> >>>>> +#define ADS1120_CFG0_GAIN_32        5
> >>>>> +#define ADS1120_CFG0_GAIN_64        6
> >>>>> +#define ADS1120_CFG0_GAIN_128        7  
> >>>> We could avoid these macros by just doing ilog2(gain).  
> >>>
> >>> I understand your concern about unused macros. I've kept them for documentation purposes as they map directly to the datasheet register definitions, which makes it easier to verify correctness against hardware specs also I'd prefer to keep it like this since it give more readability Shall i keep this as it is for this initial version?  
> >> I would argue that if they aren't being used then omitting them would
> >> save us the time of having to verify the correctness in the first place.
> >>  
> > I understand your concern about unused macros. This was suggested by Jonathan earlier.  
> 
> Jonathan is the maintainer, so if he is fine with it, he has the final say. :-)

I don't care strongly either way.  Personally I slightly prefer
to see full definition of a specific register rather than just some
fields so we now what else is being written to 0.  For the
case of registers that aren't touched at all it can be a lot
of noise to define them if there are lots of them. For one
or two it can be better to just do it even if they aren't used.

Anyhow, I'm not going to be fussy about it either way!

Jonathan


      parent reply	other threads:[~2025-12-21 18:57 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-09 14:11 [PATCH v2 0/2] iio: adc: ti-ads1120: Add driver and dt-binding Ajith Anandhan
2025-11-09 14:11 ` [PATCH v2 1/2] dt-bindings: iio: adc: Add TI ADS1120 binding Ajith Anandhan
2025-11-10  7:59   ` Krzysztof Kozlowski
2025-11-15 18:31   ` Jonathan Cameron
2025-11-18  0:19     ` David Lechner
2025-12-15 14:49       ` Ajith Anandhan
2025-12-15 15:58         ` David Lechner
2025-11-09 14:11 ` [PATCH v2 2/2] iio: adc: Add support for TI ADS1120 Ajith Anandhan
2025-11-09 17:03   ` Andy Shevchenko
2025-11-09 17:05     ` Andy Shevchenko
2025-11-10 10:17   ` kernel test robot
2025-11-15 18:45   ` Jonathan Cameron
2025-11-18 14:04   ` David Lechner
2025-12-15 16:13     ` Ajith Anandhan
2025-12-15 16:36       ` David Lechner
2025-12-15 16:49         ` Ajith Anandhan
2025-12-15 17:00           ` Andy Shevchenko
2025-12-15 17:38             ` Ajith Anandhan
2025-12-15 17:42           ` David Lechner
2025-12-15 17:50             ` Ajith Anandhan
2025-12-21 18:57             ` Jonathan Cameron [this message]

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=20251221185716.65b442d9@jic23-huawei \
    --to=jic23@kernel.org \
    --cc=ajithanandhan0406@gmail.com \
    --cc=andy@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dlechner@baylibre.com \
    --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