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] [day] [month] [year] [list]
Message-ID: <20241130173745.52dd528a@jic23-huawei>
Date: Sat, 30 Nov 2024 17:37:45 +0000
From: Jonathan Cameron <jic23@...nel.org>
To: Marcelo Schmitt <marcelo.schmitt@...log.com>
Cc: <linux-iio@...r.kernel.org>, <devicetree@...r.kernel.org>,
 <linux-kernel@...r.kernel.org>, <lars@...afoo.de>,
 <Michael.Hennerich@...log.com>, <robh@...nel.org>, <krzk+dt@...nel.org>,
 <conor+dt@...nel.org>, <marcelo.schmitt1@...il.com>, David Lechner
 <dlechner@...libre.com>
Subject: Re: [PATCH v5 2/4] iio: adc: ad4000: Add timestamp channel

On Fri, 29 Nov 2024 10:13:52 -0300
Marcelo Schmitt <marcelo.schmitt@...log.com> wrote:

> The ADC data is pushed to the IIO buffer along with timestamp but no
> timestamp channel was provided to retried the time data.
> Add a timestamp channel to provide sample capture time.
> 
> Suggested-by: David Lechner <dlechner@...libre.com>
> Reviewed-by: David Lechner <dlechner@...libre.com>
> Signed-off-by: Marcelo Schmitt <marcelo.schmitt@...log.com>
H Marcelo,

Given you are going to be spinning a v6 anyway, trivial comments inline.

Thanks,

Jonathan

> ---
>  drivers/iio/adc/ad4000.c | 98 +++++++++++++++++++++++-----------------
>  1 file changed, 56 insertions(+), 42 deletions(-)
> 
> diff --git a/drivers/iio/adc/ad4000.c b/drivers/iio/adc/ad4000.c
> index b3b82535f5c1..21731c4d31ee 100644
> --- a/drivers/iio/adc/ad4000.c
> +++ b/drivers/iio/adc/ad4000.c
> @@ -49,6 +49,7 @@
>  	.info_mask_separate = BIT(IIO_CHAN_INFO_RAW) |				\
>  			      BIT(IIO_CHAN_INFO_SCALE),				\
>  	.info_mask_separate_available = _reg_access ? BIT(IIO_CHAN_INFO_SCALE) : 0,\
> +	.scan_index = 0,							\
>  	.scan_type = {								\
>  		.sign = _sign,							\
>  		.realbits = _real_bits,						\
> @@ -62,6 +63,12 @@
>  	__AD4000_DIFF_CHANNEL((_sign), (_real_bits),				\
>  				     ((_real_bits) > 16 ? 32 : 16), (_reg_access))
>  
> +#define AD4000_DIFF_CHANNELS(_sign, _real_bits, _reg_access)			\
> +{										\
> +	AD4000_DIFF_CHANNEL(_sign, _real_bits, _reg_access),			\
> +	IIO_CHAN_SOFT_TIMESTAMP(1)						\
Add a trailing ,
In theory we can add more channels after this.
> +}
> +
>  #define __AD4000_PSEUDO_DIFF_CHANNEL(_sign, _real_bits, _storage_bits, _reg_access)\
>  {										\
>  	.type = IIO_VOLTAGE,							\
> @@ -71,6 +78,7 @@
>  			      BIT(IIO_CHAN_INFO_SCALE) |			\
>  			      BIT(IIO_CHAN_INFO_OFFSET),			\
>  	.info_mask_separate_available = _reg_access ? BIT(IIO_CHAN_INFO_SCALE) : 0,\
> +	.scan_index = 0,							\
>  	.scan_type = {								\
>  		.sign = _sign,							\
>  		.realbits = _real_bits,						\
> @@ -84,6 +92,12 @@
>  	__AD4000_PSEUDO_DIFF_CHANNEL((_sign), (_real_bits),			\
>  				     ((_real_bits) > 16 ? 32 : 16), (_reg_access))
>  
> +#define AD4000_PSEUDO_DIFF_CHANNELS(_sign, _real_bits, _reg_access)		\
> +{										\
> +	AD4000_PSEUDO_DIFF_CHANNEL(_sign, _real_bits, _reg_access),		\
> +	IIO_CHAN_SOFT_TIMESTAMP(1)						\
As above. Trailing comma should be here.
The only exception to that is when we have a terminator entry (NULL or similar) 
where we want to make it hard to add anything after it.


> +}
> +

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ