lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250412180434.34f1426b@jic23-huawei>
Date: Sat, 12 Apr 2025 18:04:34 +0100
From: Jonathan Cameron <jic23@...nel.org>
To: Antoniu Miclaus <antoniu.miclaus@...log.com>
Cc: <robh@...nel.org>, <conor+dt@...nel.org>, <linux-iio@...r.kernel.org>,
 <devicetree@...r.kernel.org>, <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v2 10/13] iio: adc: adi-axi-adc: add sync status

On Fri, 11 Apr 2025 15:36:24 +0300
Antoniu Miclaus <antoniu.miclaus@...log.com> wrote:

> Add support for checking the ADC sync status.
> 
> Signed-off-by: Antoniu Miclaus <antoniu.miclaus@...log.com>
> ---
> no changes in v2.
>  drivers/iio/adc/adi-axi-adc.c | 20 ++++++++++++++++++++
>  1 file changed, 20 insertions(+)
> 
> diff --git a/drivers/iio/adc/adi-axi-adc.c b/drivers/iio/adc/adi-axi-adc.c
> index 017685854895..0d12c0121bbc 100644
> --- a/drivers/iio/adc/adi-axi-adc.c
> +++ b/drivers/iio/adc/adi-axi-adc.c
> @@ -56,6 +56,9 @@
>  #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_SYNC_STATUS		0x0068
> +#define   ADI_AXI_ADC_SYNC			BIT(0)
> +
>  #define ADI_AXI_ADC_REG_DRP_STATUS		0x0074
>  #define   ADI_AXI_ADC_DRP_LOCKED		BIT(17)
>  
> @@ -453,6 +456,21 @@ static int axi_adc_ad408x_self_sync_disable(struct iio_backend *back)
>  				 AXI_AD408X_CNTRL_3_SELF_SYNC_EN_MSK);
>  }
>  
> +static int axi_adc_sync_status_get(struct iio_backend *back, bool *sync_en)
> +{
> +	struct adi_axi_adc_state *st = iio_backend_get_priv(back);
> +	int ret;
> +	u32 val;
> +
> +	ret = regmap_read(st->regmap, ADI_AXI_ADC_REG_SYNC_STATUS, &val);
> +	if (ret)
> +		return ret;
> +
> +	*sync_en = (bool)FIELD_GET(ADI_AXI_ADC_SYNC, val);

Trivial but implicit casting from a bool to an int is fine.  I.e. drop
the (bool) as it doesn't add anything.

> +
> +	return 0;
> +}
> +
>  static struct iio_buffer *axi_adc_request_buffer(struct iio_backend *back,
>  						 struct iio_dev *indio_dev)
>  {
> @@ -600,6 +618,7 @@ static const struct iio_backend_ops adi_axi_adc_ops = {
>  	.test_pattern_set = axi_adc_test_pattern_set,
>  	.chan_status = axi_adc_chan_status,
>  	.interface_type_get = axi_adc_interface_type_get,
> +	.sync_status_get = axi_adc_sync_status_get,
>  	.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),
>  };
> @@ -647,6 +666,7 @@ static const struct iio_backend_ops adi_ad408x_ops = {
>  	.data_alignment_disable = axi_adc_ad408x_bitslip_disable,
>  	.self_sync_enable = axi_adc_ad408x_self_sync_enable,
>  	.self_sync_disable = axi_adc_ad408x_self_sync_disable,
> +	.sync_status_get = axi_adc_sync_status_get,
>  	.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),
>  };


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ