Linux IIO development
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: David Lechner <dlechner@baylibre.com>
Cc: Lothar Rubusch <l.rubusch@gmail.com>,
	Matti Vaittinen <mazziesaccount@gmail.com>,
	nuno.sa@analog.com, andy@kernel.org, linux-iio@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	Sukrut Bellary <sbellary@baylibre.com>
Subject: Re: [PATCH v1 1/2] iio: adc: ti-adc128s052: add support for adc121s021
Date: Sat, 28 Jun 2025 16:29:10 +0100	[thread overview]
Message-ID: <20250628162910.1256b220@jic23-huawei> (raw)
In-Reply-To: <4d01de83-7b85-4127-960d-0563359a0844@baylibre.com>

On Fri, 27 Jun 2025 11:27:22 -0500
David Lechner <dlechner@baylibre.com> wrote:

> On 6/26/25 4:33 PM, Lothar Rubusch wrote:
> > Hi guys,
> >   
> 
> ...
> 
> > Perhaps just one little question here to you. You used the regulator
> > name "vdd" where others
> > before used "vref". At the end, this seems to be pretty free,
> > depending on how it is set in the
> > DT or how you name it in the DT (in my case it was "5v0", but I wanted
> > to keep the convention,
> > if so).
> > 
> > So, my question is, is there a naming convention what to take for a,
> > say, default
> > regulator naming or fixed 5V regulator?
> >   
> 
> I don't think there is a naming convention for supplies other than making
> it match the pin name from the datasheet.
> 
> If we were to try to come up with some standard naming convention though,
> I would not include the voltage value in the name. Rather, the properties
> should be named after the function that it does, like vref-supply for an
> external reference voltage, vio-supply for I/O pin voltage supply,
> power-supply for a whole-chip or main supply, analog-supply and digital-supply
> for chips that don't have a whole-chip supply but rather split the
> analog and digital circuitry. These are the most common ones that I have
> seen on ADCs.
> 
> The fact that the TI chips in this driver use "vref-supply" doesn't really
> make sense in the DT bindings. V_REF is an internal signal in the ADC.
> In other words, it's kind of abusing the binding to specify the reference
> voltage without actually saying that the chip also has power supplies.
> 
> Chips like adc128s052 should really have va-supply for the power supply
> connected to the V_A pin that also serves as the reference voltage and
> vd-supply for the supply connected to the V_D pin for the digital I/O
> supply. And adc121s021 would only have va-supply because there is no
> separate V_D pin for a separate I/O supply.
> 
> But there are lot's of ADCs already incorrectly using vref-supply like
> this, so not sure if it is worth trying to fix them or not. But if we
> wanted to fix it for these TI chips, I would suggest to deprecate the
> vref-supply and add the actual supplies to the DT bindings and implement
> a fallback in the driver to check for vref-supply if the other supplies
> are not given so that we don't break existing dtbs.

Agreed. vref-supply should only be used if it's an external pin labeled
vref.  (which is fairly common).  Where it's labeled V_A like here we
should name it after that.  Fix would be as you suggest with the fallback
to cover DT bindings in use.

Jonathan



  reply	other threads:[~2025-06-28 15:29 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-25 17:02 [PATCH v1 0/2] iio: adc: ti-adc128s052: add support for TI's ADC121s021 Lothar Rubusch
2025-06-25 17:02 ` [PATCH v1 1/2] iio: adc: ti-adc128s052: add support for adc121s021 Lothar Rubusch
2025-06-25 17:55   ` Andy Shevchenko
2025-06-26  5:24   ` Matti Vaittinen
2025-06-26 18:28     ` Jonathan Cameron
2025-06-26 21:33       ` Lothar Rubusch
2025-06-27 16:27         ` David Lechner
2025-06-28 15:29           ` Jonathan Cameron [this message]
2025-06-29  0:00       ` Sukrut Bellary
2025-06-29 16:13         ` Lothar Rubusch
2025-06-29 19:32           ` Sukrut Bellary
2025-06-27 16:33   ` David Lechner
2025-06-25 17:02 ` [PATCH v1 2/2] iio: adc: ti-adc128s052: replace literal by unit expression Lothar Rubusch
2025-06-25 17:57   ` Andy Shevchenko
2025-06-26 18:22     ` Jonathan Cameron
2025-06-26  5:07   ` Matti Vaittinen
2025-06-26 18:20     ` 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=20250628162910.1256b220@jic23-huawei \
    --to=jic23@kernel.org \
    --cc=andy@kernel.org \
    --cc=dlechner@baylibre.com \
    --cc=l.rubusch@gmail.com \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mazziesaccount@gmail.com \
    --cc=nuno.sa@analog.com \
    --cc=sbellary@baylibre.com \
    /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