From: Jonathan Cameron <Jonathan.Cameron@Huawei.com>
To: George Stark <gnstark@sberdevices.ru>
Cc: <jic23@kernel.org>, <lars@metafoo.de>,
<neil.armstrong@linaro.org>, <khilman@baylibre.com>,
<jbrunet@baylibre.com>, <martin.blumenstingl@googlemail.com>,
<andriy.shevchenko@linux.intel.com>, <nuno.sa@analog.com>,
<linux-iio@vger.kernel.org>,
<linux-arm-kernel@lists.infradead.org>,
<linux-kernel@vger.kernel.org>,
<linux-amlogic@lists.infradead.org>, <kernel@sberdevices.ru>
Subject: Re: [PATCH v3 4/5] meson saradc: add channel labels
Date: Sun, 2 Jul 2023 17:16:14 +0800 [thread overview]
Message-ID: <20230702171614.00000480@Huawei.com> (raw)
In-Reply-To: <20230627224017.1724097-5-gnstark@sberdevices.ru>
On Wed, 28 Jun 2023 01:37:17 +0300
George Stark <gnstark@sberdevices.ru> wrote:
> Add attribute 'label' to all iio channels.
Why? Reasoning is more useful here than a simple statement of 'what'.
>
> Signed-off-by: George Stark <GNStark@sberdevices.ru>
> ---
> drivers/iio/adc/meson_saradc.c | 12 ++++++++++++
> 1 file changed, 12 insertions(+)
>
> diff --git a/drivers/iio/adc/meson_saradc.c b/drivers/iio/adc/meson_saradc.c
> index b87f05dfb322..85970fe852af 100644
> --- a/drivers/iio/adc/meson_saradc.c
> +++ b/drivers/iio/adc/meson_saradc.c
> @@ -1058,8 +1058,20 @@ static int meson_sar_adc_calib(struct iio_dev *indio_dev)
> return ret;
> }
>
> +static int read_label(struct iio_dev *indio_dev,
> + struct iio_chan_spec const *chan,
> + char *label)
> +{
> + if (chan->type == IIO_TEMP)
> + return sprintf(label, "%s\n", "temp-sensor");
> + if (chan->type == IIO_VOLTAGE)
> + return sprintf(label, "channel-%d\n", chan->channel);
> + return 0;
> +}
> +
> static const struct iio_info meson_sar_adc_iio_info = {
> .read_raw = meson_sar_adc_iio_info_read_raw,
> + .read_label = read_label,
> };
>
> static const struct meson_sar_adc_param meson_sar_adc_meson8_param = {
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2023-07-02 9:16 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-27 22:37 [PATCH v3 0/5] meson saradc: add iio channels to read channel 7 mux inputs George Stark
2023-06-27 22:37 ` [PATCH v3 1/5] meson saradc: move enums declaration before variables declaration George Stark
2023-07-02 9:14 ` Jonathan Cameron
2023-07-04 0:39 ` George Stark
2023-06-27 22:37 ` [PATCH v3 2/5] meson saradc: move meson_sar_adc_set_chan7_mux routine upper George Stark
2023-06-27 22:37 ` [PATCH v3 3/5] meson saradc: add enum for iio channel numbers George Stark
2023-06-27 22:37 ` [PATCH v3 4/5] meson saradc: add channel labels George Stark
2023-07-02 9:16 ` Jonathan Cameron [this message]
2023-07-04 1:32 ` George Stark
2023-06-27 22:37 ` [PATCH v3 5/5] meson saradc: support reading from channel 7 mux inputs George Stark
2023-06-28 10:06 ` Andy Shevchenko
2023-07-02 9:21 ` Jonathan Cameron
2023-07-03 19:39 ` Martin Blumenstingl
2023-07-04 8:08 ` George Stark
[not found] ` <6ee38b3a-8e2f-15d6-f7bd-06ef567d2b68@sberdevices.ru>
2023-07-05 8:04 ` Jonathan Cameron
2023-07-02 9:11 ` [PATCH v3 0/5] meson saradc: add iio channels to read " 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=20230702171614.00000480@Huawei.com \
--to=jonathan.cameron@huawei.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=gnstark@sberdevices.ru \
--cc=jbrunet@baylibre.com \
--cc=jic23@kernel.org \
--cc=kernel@sberdevices.ru \
--cc=khilman@baylibre.com \
--cc=lars@metafoo.de \
--cc=linux-amlogic@lists.infradead.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=martin.blumenstingl@googlemail.com \
--cc=neil.armstrong@linaro.org \
--cc=nuno.sa@analog.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;
as well as URLs for NNTP newsgroup(s).