From: "Nuno Sá" <noname.nuno@gmail.com>
To: Antoniu Miclaus <antoniu.miclaus@analog.com>,
jic23@kernel.org, robh@kernel.org, conor+dt@kernel.org,
linux-iio@vger.kernel.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 07/11] iio: adc: adi-axi-adc: add sync enable/disable
Date: Tue, 29 Apr 2025 09:28:16 +0100 [thread overview]
Message-ID: <6db027ae67a46cfff906932e5d306fa0d9edf766.camel@gmail.com> (raw)
In-Reply-To: <20250425112538.59792-8-antoniu.miclaus@analog.com>
On Fri, 2025-04-25 at 14:25 +0300, Antoniu Miclaus wrote:
> Add support for enabling/disabling the sync process used for data
> capture alignment.
>
> Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com>
> ---
Some comments from me... I'm also still not convinced this API can't be merged
with the sync get. More comments on the frontend driver patch.
> changes in v3:
> - update the function to match the new backend interface.
> drivers/iio/adc/adi-axi-adc.c | 21 +++++++++++++++++++++
> 1 file changed, 21 insertions(+)
>
> diff --git a/drivers/iio/adc/adi-axi-adc.c b/drivers/iio/adc/adi-axi-adc.c
> index 2a3a6c3f5e59..9947be059f98 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 AXI_AD408X_CTRL_SYNC_MSK BIT(3)
> #define ADI_AXI_ADC_CTRL_DDR_EDGESEL_MASK BIT(1)
>
> #define ADI_AXI_ADC_REG_CNTRL_3 0x004c
> @@ -416,6 +417,22 @@ static int axi_adc_ad408x_filter_type_set(struct
> iio_backend *back,
> AXI_AD408X_CNTRL_3_FILTER_EN_MSK);
> }
>
> +static int axi_adc_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_CTRL,
> + AXI_AD408X_CTRL_SYNC_MSK);
> +}
> +
> +static int axi_adc_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_CTRL,
> + AXI_AD408X_CTRL_SYNC_MSK);
> +}
> +
> static struct iio_buffer *axi_adc_request_buffer(struct iio_backend *back,
> struct iio_dev *indio_dev)
> {
> @@ -559,6 +576,8 @@ static const struct iio_backend_ops adi_axi_adc_ops = {
> .request_buffer = axi_adc_request_buffer,
> .free_buffer = axi_adc_free_buffer,
> .data_sample_trigger = axi_adc_data_sample_trigger,
> + .data_alignment_enable = axi_adc_sync_enable,
> + .data_alignment_disable = axi_adc_sync_disable,
Same comment as for the number of lanes op...
> .iodelay_set = axi_adc_iodelays_set,
> .test_pattern_set = axi_adc_test_pattern_set,
> .chan_status = axi_adc_chan_status,
> @@ -605,6 +624,8 @@ static const struct iio_backend_ops adi_ad408x_ops = {
> .free_buffer = axi_adc_free_buffer,
> .data_sample_trigger = axi_adc_data_sample_trigger,
> .filter_type_set = axi_adc_ad408x_filter_type_set,
> + .data_alignment_enable = axi_adc_sync_enable,
> + .data_alignment_disable = axi_adc_sync_disable,
Are we using the disable op at all?
> .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),
> };
next prev parent reply other threads:[~2025-04-29 8:28 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-25 11:25 [PATCH v3 00/11] Add support for AD4080 ADC Antoniu Miclaus
2025-04-25 11:25 ` [PATCH v3 01/11] iio: backend: add support for filter config Antoniu Miclaus
2025-04-26 13:14 ` Jonathan Cameron
2025-04-29 8:14 ` Nuno Sá
2025-04-25 11:25 ` [PATCH v3 02/11] iio: backend: add support for data alignment Antoniu Miclaus
2025-04-25 11:25 ` [PATCH v3 03/11] iio: backend: add support for sync status Antoniu Miclaus
2025-04-25 11:25 ` [PATCH v3 04/11] iio: backend: add support for number of lanes Antoniu Miclaus
2025-04-29 8:19 ` Nuno Sá
2025-04-25 11:25 ` [PATCH v3 05/11] dt-bindings: iio: adc: add ad408x axi variant Antoniu Miclaus
2025-04-25 11:25 ` [PATCH v3 06/11] iio: adc: adi-axi-adc: add filter type config Antoniu Miclaus
2025-04-29 8:18 ` Nuno Sá
2025-04-25 11:25 ` [PATCH v3 07/11] iio: adc: adi-axi-adc: add sync enable/disable Antoniu Miclaus
2025-04-29 8:28 ` Nuno Sá [this message]
2025-04-29 17:22 ` David Lechner
2025-04-25 11:25 ` [PATCH v3 08/11] iio: adc: adi-axi-adc: add sync status Antoniu Miclaus
2025-04-25 11:25 ` [PATCH v3 09/11] iio: adc: adi-axi-adc: add num lanes support Antoniu Miclaus
2025-04-29 8:26 ` Nuno Sá
2025-04-29 17:26 ` David Lechner
2025-04-25 11:25 ` [PATCH v3 10/11] dt-bindings: iio: adc: add ad4080 Antoniu Miclaus
2025-04-25 11:25 ` [PATCH v3 11/11] iio: adc: ad4080: add driver support Antoniu Miclaus
2025-04-26 13:13 ` Jonathan Cameron
2025-04-26 16:48 ` kernel test robot
2025-04-29 8:46 ` Nuno Sá
2025-04-29 19:15 ` David Lechner
2025-04-30 12:31 ` Miclaus, Antoniu
2025-04-30 14:11 ` David Lechner
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=6db027ae67a46cfff906932e5d306fa0d9edf766.camel@gmail.com \
--to=noname.nuno@gmail.com \
--cc=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;
as well as URLs for NNTP newsgroup(s).