From: Nuno Sa via B4 Relay <devnull+nuno.sa.analog.com@kernel.org>
To: linux-iio@vger.kernel.org
Cc: Lars-Peter Clausen <lars@metafoo.de>,
Michael Hennerich <Michael.Hennerich@analog.com>,
Jonathan Cameron <jic23@kernel.org>,
Olivier Moysan <olivier.moysan@foss.st.com>,
Dragos Bogdan <dragos.bogdan@analog.com>
Subject: [PATCH v2 5/8] iio: adc: adi-axi-adc: split axi_adc_chan_status()
Date: Fri, 02 Aug 2024 16:27:03 +0200 [thread overview]
Message-ID: <20240802-dev-iio-backend-add-debugfs-v2-5-4cb62852f0d0@analog.com> (raw)
In-Reply-To: <20240802-dev-iio-backend-add-debugfs-v2-0-4cb62852f0d0@analog.com>
From: Nuno Sa <nuno.sa@analog.com>
Add a new axi_adc_read_chan_status() helper so we get the raw register
value out of it.
This is in preparation of a future change where we really want to look
into dedicated bits of the register.
Signed-off-by: Nuno Sa <nuno.sa@analog.com>
---
drivers/iio/adc/adi-axi-adc.c | 19 ++++++++++++++-----
1 file changed, 14 insertions(+), 5 deletions(-)
diff --git a/drivers/iio/adc/adi-axi-adc.c b/drivers/iio/adc/adi-axi-adc.c
index f4cdfcca865d..442a87024e1a 100644
--- a/drivers/iio/adc/adi-axi-adc.c
+++ b/drivers/iio/adc/adi-axi-adc.c
@@ -208,12 +208,10 @@ static int axi_adc_test_pattern_set(struct iio_backend *back,
}
}
-static int axi_adc_chan_status(struct iio_backend *back, unsigned int chan,
- bool *error)
+static int axi_adc_read_chan_status(struct adi_axi_adc_state *st, unsigned int chan,
+ unsigned int *status)
{
- struct adi_axi_adc_state *st = iio_backend_get_priv(back);
int ret;
- u32 val;
guard(mutex)(&st->lock);
/* reset test bits by setting them */
@@ -225,7 +223,18 @@ static int axi_adc_chan_status(struct iio_backend *back, unsigned int chan,
/* let's give enough time to validate or erroring the incoming pattern */
fsleep(1000);
- ret = regmap_read(st->regmap, ADI_AXI_ADC_REG_CHAN_STATUS(chan), &val);
+ return regmap_read(st->regmap, ADI_AXI_ADC_REG_CHAN_STATUS(chan),
+ status);
+}
+
+static int axi_adc_chan_status(struct iio_backend *back, unsigned int chan,
+ bool *error)
+{
+ struct adi_axi_adc_state *st = iio_backend_get_priv(back);
+ u32 val;
+ int ret;
+
+ ret = axi_adc_read_chan_status(st, chan, &val);
if (ret)
return ret;
--
2.45.2
next prev parent reply other threads:[~2024-08-02 14:27 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-02 14:26 [PATCH v2 0/8] iio: adc: ad9467: add debugFS test mode support Nuno Sa via B4 Relay
2024-08-02 14:26 ` [PATCH v2 1/8] iio: backend: introduce struct iio_backend_info Nuno Sa via B4 Relay
2024-08-02 14:27 ` [PATCH v2 2/8] iio: backend: add debugFs interface Nuno Sa via B4 Relay
2024-08-02 14:27 ` [PATCH v2 3/8] iio: backend: add a modified prbs23 support Nuno Sa via B4 Relay
2024-08-02 14:27 ` [PATCH v2 4/8] iio: adc: adi-axi-adc: support modified prbs23 Nuno Sa via B4 Relay
2024-08-02 14:27 ` Nuno Sa via B4 Relay [this message]
2024-08-02 14:27 ` [PATCH v2 6/8] iio: adc: adi-axi-adc: implement backend debugfs interface Nuno Sa via B4 Relay
2024-08-02 14:27 ` [PATCH v2 7/8] iio: adc: ad9467: add backend test mode helpers Nuno Sa via B4 Relay
2024-08-02 14:27 ` [PATCH v2 8/8] iio: adc: ad9467: add digital interface test to debugfs Nuno Sa via B4 Relay
2024-08-03 13:38 ` Jonathan Cameron
2024-08-05 6:39 ` Nuno Sá
2024-08-03 13:39 ` [PATCH v2 0/8] iio: adc: ad9467: add debugFS test mode support 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=20240802-dev-iio-backend-add-debugfs-v2-5-4cb62852f0d0@analog.com \
--to=devnull+nuno.sa.analog.com@kernel.org \
--cc=Michael.Hennerich@analog.com \
--cc=dragos.bogdan@analog.com \
--cc=jic23@kernel.org \
--cc=lars@metafoo.de \
--cc=linux-iio@vger.kernel.org \
--cc=nuno.sa@analog.com \
--cc=olivier.moysan@foss.st.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