From: Marcelo Schmitt <marcelo.schmitt1@gmail.com>
To: Matti Vaittinen <mazziesaccount@gmail.com>
Cc: Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com>,
Jonathan Cameron <jic23@kernel.org>,
Lars-Peter Clausen <lars@metafoo.de>,
Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>,
Chen-Yu Tsai <wens@csie.org>,
Jernej Skrabec <jernej.skrabec@gmail.com>,
Samuel Holland <samuel@sholland.org>,
Nuno Sa <nuno.sa@analog.com>,
David Lechner <dlechner@baylibre.com>,
Javier Carrasco <javier.carrasco.cruz@gmail.com>,
Guillaume Stols <gstols@baylibre.com>,
Dumitru Ceclan <mitrutzceclan@gmail.com>,
Trevor Gamblin <tgamblin@baylibre.com>,
Matteo Martelli <matteomartelli3@gmail.com>,
Alisa-Dariana Roman <alisadariana@gmail.com>,
Ramona Alexandra Nechita <ramona.nechita@analog.com>,
AngeloGioacchino Del Regno
<angelogioacchino.delregno@collabora.com>,
linux-iio@vger.kernel.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org,
linux-renesas-soc@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-sunxi@lists.linux.dev
Subject: Re: [PATCH v10 3/8] iio: adc: add helpers for parsing ADC nodes
Date: Sun, 30 Mar 2025 17:19:02 -0300 [thread overview]
Message-ID: <Z-mnNtYLkwsTYjMh@debian-BULLSEYE-live-builder-AMD64> (raw)
In-Reply-To: <f1d8b3e15237947738912c0d297b3e1e21d8b03e.1742560649.git.mazziesaccount@gmail.com>
Hi Matti,
The new helpers for ADC drivers look good to me.
I am now very late to complain about anything but am leaving some minor comments
below that can be completely ignored.
Reviewed-by: Marcelo Schmitt <marcelo.schmitt1@gmail.com>
Thanks,
Marcelo
On 03/24, Matti Vaittinen wrote:
> There are ADC ICs which may have some of the AIN pins usable for other
> functions. These ICs may have some of the AIN pins wired so that they
> should not be used for ADC.
>
> (Preferred?) way for marking pins which can be used as ADC inputs is to
> add corresponding channels@N nodes in the device tree as described in
> the ADC binding yaml.
Not sure it's preferred to have ADC channels always declared in dt. That
question was somewhat also raised during ADC doc review [1]. In short, ADC
channel may and may not be declared under ADC dt node. ADC bindings often don't
enforce channels to be declared. On IIO side of things, many ADC drivers just
populate channels even if they are not declared in dt.
The ADCs you are supporting in the other patches of this series seem to require
dt declared channels though.
[1]: https://lore.kernel.org/linux-iio/20250118155153.2574dbe5@jic23-huawei/
Would something like
A common way of marking pins that can be used as ADC inputs is to add
corresponding channel@N nodes in the device tree as described in the ADC
binding yaml.
be a good rephrasing of the above paragraph?
>
> Add couple of helper functions which can be used to retrieve the channel
> information from the device node.
>
> Signed-off-by: Matti Vaittinen <mazziesaccount@gmail.com>
> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
>
...
> +static inline int iio_adc_device_num_channels(struct device *dev)
> +{
> + return device_get_named_child_node_count(dev, "channel");
> +}
I wonder if this function name can eventually become misleading.
In Documentation/devicetree/bindings/iio/temperature/adi,ltc2983.yaml we have
temperature sensor with channel nodes named after external hardware connected to
the sensor, leading to channels having different node names. Can anything like
that ever be accepted for ADC bindings?
next prev parent reply other threads:[~2025-03-30 20:20 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-24 7:12 [PATCH v10 0/8] Support ROHM BD79124 ADC Matti Vaittinen
2025-03-24 7:12 ` [PATCH v10 2/8] property: Add functions to iterate named child Matti Vaittinen
2025-03-30 16:39 ` Jonathan Cameron
2025-04-10 16:07 ` Sakari Ailus
2025-03-24 7:13 ` [PATCH v10 3/8] iio: adc: add helpers for parsing ADC nodes Matti Vaittinen
2025-03-30 20:19 ` Marcelo Schmitt [this message]
2025-03-31 5:39 ` Matti Vaittinen
2025-03-31 9:48 ` Jonathan Cameron
2025-03-31 9:57 ` Matti Vaittinen
2025-03-24 7:13 ` [PATCH v10 5/8] iio: adc: sun20i-gpadc: Use adc-helpers Matti Vaittinen
2025-03-24 7:13 ` [PATCH v10 7/8] MAINTAINERS: Add IIO ADC helpers Matti Vaittinen
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=Z-mnNtYLkwsTYjMh@debian-BULLSEYE-live-builder-AMD64 \
--to=marcelo.schmitt1@gmail.com \
--cc=alisadariana@gmail.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=angelogioacchino.delregno@collabora.com \
--cc=devicetree@vger.kernel.org \
--cc=dlechner@baylibre.com \
--cc=gstols@baylibre.com \
--cc=javier.carrasco.cruz@gmail.com \
--cc=jernej.skrabec@gmail.com \
--cc=jic23@kernel.org \
--cc=lars@metafoo.de \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-renesas-soc@vger.kernel.org \
--cc=linux-sunxi@lists.linux.dev \
--cc=matteomartelli3@gmail.com \
--cc=matti.vaittinen@fi.rohmeurope.com \
--cc=mazziesaccount@gmail.com \
--cc=mitrutzceclan@gmail.com \
--cc=nuno.sa@analog.com \
--cc=prabhakar.mahadev-lad.rj@bp.renesas.com \
--cc=ramona.nechita@analog.com \
--cc=samuel@sholland.org \
--cc=tgamblin@baylibre.com \
--cc=wens@csie.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