public inbox for devicetree@vger.kernel.org
 help / color / mirror / Atom feed
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>,
	"Nuno Sá" <nuno.sa@analog.com>
Subject: [PATCH v5 07/10] iio: adc: adi-axi-adc: add num lanes support
Date: Fri, 9 May 2025 13:50:16 +0300	[thread overview]
Message-ID: <20250509105019.8887-8-antoniu.miclaus@analog.com> (raw)
In-Reply-To: <20250509105019.8887-1-antoniu.miclaus@analog.com>

Add support for setting the number of lanes enabled.

Reviewed-by: Nuno Sá <nuno.sa@analog.com>
Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com>
---
no changes in v5.
 drivers/iio/adc/adi-axi-adc.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/drivers/iio/adc/adi-axi-adc.c b/drivers/iio/adc/adi-axi-adc.c
index f9c4018e3b41..d9a14fb6b8e8 100644
--- a/drivers/iio/adc/adi-axi-adc.c
+++ b/drivers/iio/adc/adi-axi-adc.c
@@ -44,6 +44,7 @@
 #define   ADI_AXI_ADC_REG_CONFIG_CMOS_OR_LVDS_N	BIT(7)
 
 #define ADI_AXI_ADC_REG_CTRL			0x0044
+#define    ADI_AXI_ADC_CTRL_NUM_LANES_MSK	GENMASK(12, 8)
 #define    ADI_AXI_ADC_CTRL_SYNC_MSK		BIT(3)
 #define    ADI_AXI_ADC_CTRL_DDR_EDGESEL_MASK	BIT(1)
 
@@ -439,6 +440,19 @@ static int axi_adc_ad408x_interface_data_align(struct iio_backend *back,
 					1, timeout_us);
 }
 
+static int axi_adc_num_lanes_set(struct iio_backend *back,
+				 unsigned int num_lanes)
+{
+	struct adi_axi_adc_state *st = iio_backend_get_priv(back);
+
+	if (!num_lanes)
+		return -EINVAL;
+
+	return regmap_update_bits(st->regmap, ADI_AXI_ADC_REG_CTRL,
+				  ADI_AXI_ADC_CTRL_NUM_LANES_MSK,
+				  FIELD_PREP(ADI_AXI_ADC_CTRL_NUM_LANES_MSK, num_lanes));
+}
+
 static struct iio_buffer *axi_adc_request_buffer(struct iio_backend *back,
 						 struct iio_dev *indio_dev)
 {
@@ -629,6 +643,7 @@ static const struct iio_backend_ops adi_ad408x_ops = {
 	.data_sample_trigger = axi_adc_data_sample_trigger,
 	.filter_type_set = axi_adc_ad408x_filter_type_set,
 	.interface_data_align = axi_adc_ad408x_interface_data_align,
+	.num_lanes_set = axi_adc_num_lanes_set,
 	.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.49.0


  parent reply	other threads:[~2025-05-09 10:50 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-09 10:50 [PATCH v5 00/10] Add support for AD4080 ADC Antoniu Miclaus
2025-05-09 10:50 ` [PATCH v5 01/10] iio: backend: add support for filter config Antoniu Miclaus
2025-05-09 10:50 ` [PATCH v5 02/10] iio: backend: add support for data alignment Antoniu Miclaus
2025-05-12  6:53   ` Nuno Sá
2025-05-09 10:50 ` [PATCH v5 03/10] iio: backend: add support for number of lanes Antoniu Miclaus
2025-05-09 10:50 ` [PATCH v5 04/10] dt-bindings: iio: adc: add ad408x axi variant Antoniu Miclaus
2025-05-09 10:50 ` [PATCH v5 05/10] iio: adc: adi-axi-adc: add filter type config Antoniu Miclaus
2025-05-09 10:50 ` [PATCH v5 06/10] iio: adc: adi-axi-adc: add data align process Antoniu Miclaus
2025-05-12  6:54   ` Nuno Sá
2025-05-09 10:50 ` Antoniu Miclaus [this message]
2025-05-09 10:50 ` [PATCH v5 08/10] dt-bindings: iio: adc: add ad4080 Antoniu Miclaus
2025-05-09 10:50 ` [PATCH v5 09/10] iio: adc: ad4080: add driver support Antoniu Miclaus
2025-05-12  6:59   ` Nuno Sá
2025-05-12 15:09   ` David Lechner
2025-05-09 10:50 ` [PATCH v5 10/10] Documetation: ABI: add sinc1 and sinc5+pf1 filter Antoniu Miclaus
2025-05-12 14:15   ` David Lechner
2025-05-11 14:40 ` [PATCH v5 00/10] Add support for AD4080 ADC 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=20250509105019.8887-8-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=nuno.sa@analog.com \
    --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