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: <aEE1sjgMHa2sW5-X@smile.fi.intel.com>
Date: Thu, 5 Jun 2025 09:14:10 +0300
From: Andy Shevchenko <andy@...nel.org>
To: Jonathan Santos <Jonathan.Santos@...log.com>
Cc: linux-iio@...r.kernel.org, devicetree@...r.kernel.org,
	linux-kernel@...r.kernel.org, linux-gpio@...r.kernel.org,
	nuno.sa@...log.com, Michael.Hennerich@...log.com,
	marcelo.schmitt@...log.com, jic23@...nel.org, robh@...nel.org,
	krzk+dt@...nel.org, conor+dt@...nel.org, marcelo.schmitt1@...il.com,
	linus.walleij@...aro.org, brgl@...ev.pl, lgirdwood@...il.com,
	broonie@...nel.org, jonath4nns@...il.com, dlechner@...libre.com
Subject: Re: [PATCH v10 12/12] iio: adc: ad7768-1: add low pass -3dB cutoff
 attribute

On Wed, Jun 04, 2025 at 04:37:49PM -0300, Jonathan Santos wrote:
> Ad7768-1 has a different -3db frequency multiplier depending on
> the filter type configured. The cutoff frequency also varies according
> to the current ODR.
> 
> Add a readonly low pass -3dB frequency cutoff attribute to clarify to
> the user which bandwidth is being allowed depending on the filter
> configurations.

...

> +/*
> + * -3dB cutoff frequency multipliers (relative to ODR) for
> + * each filter type. Values are multiplied by 1000.

Instead of the second sentence in the comments...

> + */
> +static const int ad7768_filter_3db_odr_multiplier[] = {
> +	[AD7768_FILTER_SINC5] = 204,

...just add a comment on each line

	[AD7768_FILTER_SINC5] = 204,		/* 0.204 */

> +	[AD7768_FILTER_SINC3] = 262,
> +	[AD7768_FILTER_SINC3_REJ60] = 262,
> +	[AD7768_FILTER_WIDEBAND] = 433,
> +};

At least to me it will look much better as it immediately gives the actual
(float) value in accordance to the datasheet, right?

...

>  	case IIO_CHAN_INFO_OVERSAMPLING_RATIO:
>  		*val = st->oversampling_ratio;
>  
> +		return IIO_VAL_INT;
> +
> +	case IIO_CHAN_INFO_LOW_PASS_FILTER_3DB_FREQUENCY:
> +		temp = st->samp_freq * ad7768_filter_3db_odr_multiplier[st->filter_type];
> +		*val = DIV_ROUND_CLOSEST(temp, 1000);
> +
>  		return IIO_VAL_INT;

Just wondering if you are using --histogram diff algo when preparing the
patches to send. If not, please do. (The above suggests that you don't use
or in unlike event that algo can't really catch the same return line in
different blocks.)

-- 
With Best Regards,
Andy Shevchenko



Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ