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: <745b3b220a8c8aec47b54fa5931a5c6334554ed5.camel@gmail.com>
Date: Mon, 26 May 2025 10:54:58 +0100
From: Nuno Sá <noname.nuno@...il.com>
To: Pop Ioan Daniel <pop.ioan-daniel@...log.com>, Lars-Peter Clausen	
 <lars@...afoo.de>, Michael Hennerich <Michael.Hennerich@...log.com>, 
 Jonathan Cameron	 <jic23@...nel.org>, David Lechner
 <dlechner@...libre.com>, Nuno Sá	 <nuno.sa@...log.com>,
 Andy Shevchenko <andy@...nel.org>, Rob Herring	 <robh@...nel.org>,
 Krzysztof Kozlowski <krzk+dt@...nel.org>, Conor Dooley	
 <conor+dt@...nel.org>, Sergiu Cuciurean <sergiu.cuciurean@...log.com>, 
 Dragos Bogdan <dragos.bogdan@...log.com>, Antoniu Miclaus
 <antoniu.miclaus@...log.com>, Olivier Moysan	 <olivier.moysan@...s.st.com>,
 Javier Carrasco <javier.carrasco.cruz@...il.com>,  Matti Vaittinen
 <mazziesaccount@...il.com>, Tobias Sperling <tobias.sperling@...ting.com>,
 Alisa-Dariana Roman	 <alisadariana@...il.com>, Marcelo Schmitt
 <marcelo.schmitt@...log.com>,  João Paulo
 Gonçalves	 <joao.goncalves@...adex.com>, Thomas
 Bonnefille <thomas.bonnefille@...tlin.com>, 	linux-iio@...r.kernel.org,
 devicetree@...r.kernel.org, 	linux-kernel@...r.kernel.org
Subject: Re: [PATCH v4 3/6] iio: adc: adi-axi-adc: add
 axi_adc_oversampling_ratio_set

On Mon, 2025-05-19 at 17:02 +0300, Pop Ioan Daniel wrote:
> Add support for setting decimation rate.
> 
> Signed-off-by: Pop Ioan Daniel <pop.ioan-daniel@...log.com>
> ---

And with the requested change:

Reviewed-by: Nuno Sá <nuno.sa@...log.com>

> no changes in v4.
>  drivers/iio/adc/adi-axi-adc.c | 20 +++++++++++++++++++-
>  1 file changed, 19 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/iio/adc/adi-axi-adc.c b/drivers/iio/adc/adi-axi-adc.c
> index 4116c44197b8..0b8673668745 100644
> --- a/drivers/iio/adc/adi-axi-adc.c
> +++ b/drivers/iio/adc/adi-axi-adc.c
> @@ -80,6 +80,9 @@
>  #define ADI_AXI_ADC_REG_CHAN_CTRL_3(c)		(0x0418 + (c) * 0x40)
>  #define   ADI_AXI_ADC_CHAN_PN_SEL_MASK		GENMASK(19, 16)
>  
> +#define ADI_AXI_ADC_REG_CHAN_USR_CTRL_2(c)	(0x0424 + (c) * 0x40)
> +#define   ADI_AXI_ADC_CHAN_USR_CTRL_2_DEC_RATE_N_MASK		GENMASK(15,
> 0)
> +
>  /* IO Delays */
>  #define ADI_AXI_ADC_REG_DELAY(l)		(0x0800 + (l) * 0x4)
>  #define   AXI_ADC_DELAY_CTRL_MASK		GENMASK(4, 0)
> @@ -242,6 +245,19 @@ static int axi_adc_test_pattern_set(struct iio_backend
> *back,
>  	}
>  }
>  
> +static int axi_adc_oversampling_ratio_set(struct iio_backend *back,
> +					  unsigned int chan,
> +					  unsigned int rate)
> +{
> +	struct adi_axi_adc_state *st = iio_backend_get_priv(back);
> +
> +	return regmap_update_bits(st->regmap,
> +				  ADI_AXI_ADC_REG_CHAN_USR_CTRL_2(chan),
> +				 
> ADI_AXI_ADC_CHAN_USR_CTRL_2_DEC_RATE_N_MASK,
> +				 
> FIELD_PREP(ADI_AXI_ADC_CHAN_USR_CTRL_2_DEC_RATE_N_MASK,
> +					     rate));
> +}
> +
>  static int axi_adc_read_chan_status(struct adi_axi_adc_state *st, unsigned
> int chan,
>  				    unsigned int *status)
>  {
> @@ -381,7 +397,8 @@ static int axi_adc_ad485x_data_size_set(struct iio_backend
> *back,
>  }
>  
>  static int axi_adc_ad485x_oversampling_ratio_set(struct iio_backend *back,
> -					  unsigned int ratio)
> +						 unsigned int chan,
> +						 unsigned int ratio)
>  {
>  	struct adi_axi_adc_state *st = iio_backend_get_priv(back);
>  
> @@ -549,6 +566,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,
> +	.oversampling_ratio_set = axi_adc_oversampling_ratio_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),
>  };

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ