From: Rodrigo Alencar via B4 Relay <devnull+rodrigo.alencar.analog.com@kernel.org>
To: linux-iio@vger.kernel.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org
Cc: Lars-Peter Clausen <lars@metafoo.de>,
Michael Hennerich <Michael.Hennerich@analog.com>,
Jonathan Cameron <jic23@kernel.org>,
David Lechner <dlechner@baylibre.com>,
Andy Shevchenko <andy@kernel.org>, Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
Philipp Zabel <p.zabel@pengutronix.de>,
Jonathan Corbet <corbet@lwn.net>,
Shuah Khan <skhan@linuxfoundation.org>,
Rodrigo Alencar <rodrigo.alencar@analog.com>
Subject: [PATCH RFC v2 7/9] iio: frequency: ad9910: add channel labels
Date: Wed, 18 Mar 2026 17:56:07 +0000 [thread overview]
Message-ID: <20260318-ad9910-iio-driver-v2-7-e79f93becf11@analog.com> (raw)
In-Reply-To: <20260318-ad9910-iio-driver-v2-0-e79f93becf11@analog.com>
From: Rodrigo Alencar <rodrigo.alencar@analog.com>
Add human-readable labels for all AD9910 IIO channels via the read_label
callback.
Signed-off-by: Rodrigo Alencar <rodrigo.alencar@analog.com>
---
drivers/iio/frequency/ad9910.c | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
diff --git a/drivers/iio/frequency/ad9910.c b/drivers/iio/frequency/ad9910.c
index 35572d60d6d2..8ff2a9d69265 100644
--- a/drivers/iio/frequency/ad9910.c
+++ b/drivers/iio/frequency/ad9910.c
@@ -1965,10 +1965,29 @@ static const struct fw_upload_ops ad9910_ram_fwu_ops = {
.cancel = ad9910_ram_fwu_cancel
};
+static const char * const ad9910_channel_str[] = {
+ [AD9910_CHAN_IDX_PHY] = "phy",
+ [AD9910_CHAN_IDX_SINGLE_TONE] = "single_tone",
+ [AD9910_CHAN_IDX_PARALLEL_PORT] = "parallel_port",
+ [AD9910_CHAN_IDX_DRG] = "digital_ramp_generator",
+ [AD9910_CHAN_IDX_DRG_RAMP_UP] = "digital_ramp_up",
+ [AD9910_CHAN_IDX_DRG_RAMP_DOWN] = "digital_ramp_down",
+ [AD9910_CHAN_IDX_RAM] = "ram_control",
+ [AD9910_CHAN_IDX_OSK] = "output_shift_keying",
+};
+
+static int ad9910_read_label(struct iio_dev *indio_dev,
+ struct iio_chan_spec const *chan,
+ char *label)
+{
+ return sysfs_emit(label, "%s\n", ad9910_channel_str[chan->address]);
+}
+
static const struct iio_info ad9910_info = {
.read_raw = ad9910_read_raw,
.write_raw = ad9910_write_raw,
.write_raw_get_fmt = ad9910_write_raw_get_fmt,
+ .read_label = ad9910_read_label,
.debugfs_reg_access = &ad9910_reg_access,
};
--
2.43.0
next prev parent reply other threads:[~2026-03-18 17:56 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-18 17:56 [PATCH RFC v2 0/9] AD9910 Direct Digital Synthesizer Rodrigo Alencar via B4 Relay
2026-03-18 17:56 ` [PATCH RFC v2 1/9] dt-bindings: iio: frequency: add ad9910 Rodrigo Alencar via B4 Relay
2026-03-19 17:25 ` Conor Dooley
2026-03-20 11:21 ` Rodrigo Alencar
2026-03-20 14:00 ` Conor.Dooley
2026-03-20 17:14 ` Conor Dooley
2026-03-18 17:56 ` [PATCH RFC v2 2/9] iio: frequency: ad9910: initial driver implementation Rodrigo Alencar via B4 Relay
2026-03-22 16:50 ` Jonathan Cameron
2026-03-23 10:34 ` Rodrigo Alencar
2026-03-23 11:00 ` Andy Shevchenko
2026-03-18 17:56 ` [PATCH RFC v2 3/9] iio: frequency: ad9910: add simple parallel port mode support Rodrigo Alencar via B4 Relay
2026-03-18 18:28 ` Andy Shevchenko
2026-03-22 16:52 ` Jonathan Cameron
2026-03-23 10:39 ` Rodrigo Alencar
2026-03-23 11:01 ` Andy Shevchenko
2026-03-18 17:56 ` [PATCH RFC v2 4/9] iio: frequency: ad9910: add digital ramp generator support Rodrigo Alencar via B4 Relay
2026-03-18 19:14 ` Andy Shevchenko
2026-03-18 17:56 ` [PATCH RFC v2 5/9] iio: frequency: ad9910: add RAM mode support Rodrigo Alencar via B4 Relay
2026-03-22 17:05 ` Jonathan Cameron
2026-03-18 17:56 ` [PATCH RFC v2 6/9] iio: frequency: ad9910: add output shift keying support Rodrigo Alencar via B4 Relay
2026-03-18 17:56 ` Rodrigo Alencar via B4 Relay [this message]
2026-03-18 17:56 ` [PATCH RFC v2 8/9] Documentation: ABI: testing: add docs for ad9910 sysfs entries Rodrigo Alencar via B4 Relay
2026-03-22 17:22 ` Jonathan Cameron
2026-03-23 11:36 ` Rodrigo Alencar
2026-04-12 14:51 ` Jonathan Cameron
2026-04-12 18:45 ` David Lechner
2026-03-18 17:56 ` [PATCH RFC v2 9/9] docs: iio: add documentation for ad9910 driver Rodrigo Alencar via B4 Relay
2026-03-22 17:34 ` Jonathan Cameron
2026-03-23 11:58 ` Rodrigo Alencar
2026-04-12 14:54 ` 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=20260318-ad9910-iio-driver-v2-7-e79f93becf11@analog.com \
--to=devnull+rodrigo.alencar.analog.com@kernel.org \
--cc=Michael.Hennerich@analog.com \
--cc=andy@kernel.org \
--cc=conor+dt@kernel.org \
--cc=corbet@lwn.net \
--cc=devicetree@vger.kernel.org \
--cc=dlechner@baylibre.com \
--cc=jic23@kernel.org \
--cc=krzk+dt@kernel.org \
--cc=lars@metafoo.de \
--cc=linux-doc@vger.kernel.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=p.zabel@pengutronix.de \
--cc=robh@kernel.org \
--cc=rodrigo.alencar@analog.com \
--cc=skhan@linuxfoundation.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
all inboxes | Powered by JetHome®