devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Marcelo Schmitt <marcelo.schmitt@analog.com>
Cc: <linux-iio@vger.kernel.org>, <devicetree@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>, <lars@metafoo.de>,
	<Michael.Hennerich@analog.com>, <robh@kernel.org>,
	<krzk+dt@kernel.org>, <conor+dt@kernel.org>,
	<marcelo.schmitt1@gmail.com>,
	David Lechner <dlechner@baylibre.com>
Subject: Re: [PATCH v5 2/4] iio: adc: ad4000: Add timestamp channel
Date: Sat, 30 Nov 2024 17:37:45 +0000	[thread overview]
Message-ID: <20241130173745.52dd528a@jic23-huawei> (raw)
In-Reply-To: <b151d6ec2eeae52718ab985a24b237049dbd283b.1732885470.git.marcelo.schmitt@analog.com>

On Fri, 29 Nov 2024 10:13:52 -0300
Marcelo Schmitt <marcelo.schmitt@analog.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@baylibre.com>
> Reviewed-by: David Lechner <dlechner@baylibre.com>
> Signed-off-by: Marcelo Schmitt <marcelo.schmitt@analog.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.


> +}
> +

  reply	other threads:[~2024-11-30 17:37 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-29 13:13 [PATCH v5 0/4] Timestamp and PulSAR support for ad4000 Marcelo Schmitt
2024-11-29 13:13 ` [PATCH v5 1/4] dt-bindings: iio: adc: adi,ad4000: Add PulSAR Marcelo Schmitt
2024-11-30  9:42   ` Krzysztof Kozlowski
2024-11-29 13:13 ` [PATCH v5 2/4] iio: adc: ad4000: Add timestamp channel Marcelo Schmitt
2024-11-30 17:37   ` Jonathan Cameron [this message]
2024-11-29 13:14 ` [PATCH v5 3/4] iio: adc: ad4000: Use device specific timing for SPI transfers Marcelo Schmitt
2024-11-29 13:14 ` [PATCH v5 4/4] iio: adc: ad4000: Add support for PulSAR devices Marcelo Schmitt

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=20241130173745.52dd528a@jic23-huawei \
    --to=jic23@kernel.org \
    --cc=Michael.Hennerich@analog.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dlechner@baylibre.com \
    --cc=krzk+dt@kernel.org \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marcelo.schmitt1@gmail.com \
    --cc=marcelo.schmitt@analog.com \
    --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).