From: Antoniu Miclaus <antoniu.miclaus@analog.com>
To: <jic23@kernel.org>, <robh@kernel.org>, <conor+dt@kernel.org>,
<linux-iio@vger.kernel.org>, <devicetree@vger.kernel.org>,
<linux-kernel@vger.kernel.org>
Cc: Antoniu Miclaus <antoniu.miclaus@analog.com>
Subject: [PATCH 09/14] iio: adc: adi-axi-adc: add self sync support
Date: Thu, 20 Feb 2025 15:54:19 +0200 [thread overview]
Message-ID: <20250220135429.8615-10-antoniu.miclaus@analog.com> (raw)
In-Reply-To: <20250220135429.8615-1-antoniu.miclaus@analog.com>
Add support for data capture synchronization through CNV signal or
bit-slip.
Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com>
---
drivers/iio/adc/adi-axi-adc.c | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
diff --git a/drivers/iio/adc/adi-axi-adc.c b/drivers/iio/adc/adi-axi-adc.c
index c7811667f853..7f6dc0ff7c54 100644
--- a/drivers/iio/adc/adi-axi-adc.c
+++ b/drivers/iio/adc/adi-axi-adc.c
@@ -53,6 +53,7 @@
#define AXI_AD485X_PACKET_FORMAT_20BIT 0x0
#define AXI_AD485X_PACKET_FORMAT_24BIT 0x1
#define AXI_AD485X_PACKET_FORMAT_32BIT 0x2
+#define AXI_AD408X_CNTRL_3_SELF_SYNC_EN_MSK BIT(1)
#define AXI_AD408X_CNTRL_3_FILTER_EN_MSK BIT(0)
#define ADI_AXI_ADC_REG_DRP_STATUS 0x0074
@@ -436,6 +437,22 @@ static int axi_adc_ad408x_bitslip_disable(struct iio_backend *back)
AXI_AD408X_CTRL_BITSLIP_EN_MSK);
}
+static int axi_adc_ad408x_self_sync_enable(struct iio_backend *back)
+{
+ struct adi_axi_adc_state *st = iio_backend_get_priv(back);
+
+ return regmap_set_bits(st->regmap, ADI_AXI_ADC_REG_CNTRL_3,
+ AXI_AD408X_CNTRL_3_SELF_SYNC_EN_MSK);
+}
+
+static int axi_adc_ad408x_self_sync_disable(struct iio_backend *back)
+{
+ struct adi_axi_adc_state *st = iio_backend_get_priv(back);
+
+ return regmap_clear_bits(st->regmap, ADI_AXI_ADC_REG_CNTRL_3,
+ AXI_AD408X_CNTRL_3_SELF_SYNC_EN_MSK);
+}
+
static struct iio_buffer *axi_adc_request_buffer(struct iio_backend *back,
struct iio_dev *indio_dev)
{
@@ -628,6 +645,8 @@ static const struct iio_backend_ops adi_ad408x_ops = {
.filter_disable = axi_adc_ad408x_filter_disable,
.bitslip_enable = axi_adc_ad408x_bitslip_enable,
.bitslip_disable = axi_adc_ad408x_bitslip_disable,
+ .self_sync_enable = axi_adc_ad408x_self_sync_enable,
+ .self_sync_disable = axi_adc_ad408x_self_sync_disable,
.debugfs_reg_access = iio_backend_debugfs_ptr(axi_adc_reg_access),
.debugfs_print_chan_status = iio_backend_debugfs_ptr(axi_adc_debugfs_print_chan_status),
};
--
2.48.1
next prev parent reply other threads:[~2025-02-20 13:56 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-20 13:54 [PATCH 00/14] Add support for AD4080 ADC Antoniu Miclaus
2025-02-20 13:54 ` [PATCH 01/14] iio: backend: add support for filter config Antoniu Miclaus
2025-02-22 16:47 ` Jonathan Cameron
2025-02-20 13:54 ` [PATCH 02/14] iio: backend: add support for sync process Antoniu Miclaus
2025-02-22 16:49 ` Jonathan Cameron
2025-02-20 13:54 ` [PATCH 03/14] iio: backend: add support for self sync Antoniu Miclaus
2025-02-20 13:54 ` [PATCH 04/14] iio: backend: add support for sync status Antoniu Miclaus
2025-02-20 13:54 ` [PATCH 05/14] iio: backend: add support for number of lanes Antoniu Miclaus
2025-02-20 20:20 ` David Lechner
2025-02-21 15:59 ` Nuno Sá
2025-02-20 13:54 ` [PATCH 06/14] dt-bindings: iio: adc: add ad408x axi variant Antoniu Miclaus
2025-02-21 17:49 ` Conor Dooley
2025-02-20 13:54 ` [PATCH 07/14] iio: adc: adi-axi-adc: add filter enable/disable Antoniu Miclaus
2025-02-20 13:54 ` [PATCH 08/14] iio: adc: adi-axi-adc: add bitslip enable/disable Antoniu Miclaus
2025-02-20 13:54 ` Antoniu Miclaus [this message]
2025-02-20 13:54 ` [PATCH 10/14] iio: adc: adi-axi-adc: add sync status Antoniu Miclaus
2025-02-20 13:54 ` [PATCH 11/14] iio: adc: adi-axi-adc: add num lanes support Antoniu Miclaus
2025-02-20 13:54 ` [PATCH 12/14] dt-bindings: iio: adc: add ad4080 Antoniu Miclaus
2025-02-20 19:30 ` David Lechner
2025-02-21 17:51 ` Conor Dooley
2025-02-20 13:54 ` [PATCH 13/14] iio: adc: ad4080: add driver support Antoniu Miclaus
2025-02-20 15:21 ` Nuno Sá
2025-02-22 17:12 ` Jonathan Cameron
2025-02-20 13:54 ` [PATCH 14/14] Documentation: ABI: testing: ad4080 docs Antoniu Miclaus
2025-02-20 14:53 ` Nuno Sá
2025-02-20 18:27 ` David Lechner
2025-02-25 9:16 ` Nuno Sá
2025-02-25 15:26 ` David Lechner
2025-03-05 13:00 ` Jonathan Cameron
2025-02-20 20:12 ` [PATCH 00/14] Add support for AD4080 ADC David Lechner
2025-02-22 16:56 ` 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=20250220135429.8615-10-antoniu.miclaus@analog.com \
--to=antoniu.miclaus@analog.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=jic23@kernel.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=robh@kernel.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