public inbox for devicetree@vger.kernel.org
 help / color / mirror / Atom feed
From: Marcelo Schmitt <marcelo.schmitt1@gmail.com>
To: David Lechner <dlechner@baylibre.com>
Cc: Marcelo Schmitt <marcelo.schmitt@analog.com>,
	lars@metafoo.de, Michael.Hennerich@analog.com, jic23@kernel.org,
	robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org,
	linux-iio@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 3/4] iio: adc: ad4000: Use device specific timing for SPI transfers
Date: Mon, 18 Nov 2024 08:34:42 -0300	[thread overview]
Message-ID: <ZzsmUqqyAll9BBCv@debian-BULLSEYE-live-builder-AMD64> (raw)
In-Reply-To: <7e302a49-db5a-444d-aae1-3c80ab75b471@baylibre.com>

On 11/15, David Lechner wrote:
> On 11/14/24 5:51 PM, Marcelo Schmitt wrote:
> > The SPI transfers for AD4020, AD4021, and AD4022 have slightly different
> > timing specifications. Use device specific timing constraints to set SPI
> > transfer parameters.
> > 
> > Signed-off-by: Marcelo Schmitt <marcelo.schmitt@analog.com>
> > ---
> >  drivers/iio/adc/ad4000.c | 50 ++++++++++++++++++++++++++++++++--------
> >  1 file changed, 41 insertions(+), 9 deletions(-)
> > 
> > diff --git a/drivers/iio/adc/ad4000.c b/drivers/iio/adc/ad4000.c
> > index 21731c4d31ee..68ac77494263 100644
> > --- a/drivers/iio/adc/ad4000.c
> > +++ b/drivers/iio/adc/ad4000.c
> > @@ -35,10 +35,6 @@
> >  
> >  #define AD4000_SCALE_OPTIONS		2
> >  
> > -#define AD4000_TQUIET1_NS		190
> > -#define AD4000_TQUIET2_NS		60
> > -#define AD4000_TCONV_NS			320
> 
> We are removing 3 but only adding 2 in the struct below?
> 
> If one of these was unused, best to mention it in the commit message.

One of them was unused (AD4000_TQUIET1_NS IRCC).
Sure, will add a comment about it in the commit body.

> 
> > -
> >  #define __AD4000_DIFF_CHANNEL(_sign, _real_bits, _storage_bits, _reg_access)	\
> >  {										\
> >  	.type = IIO_VOLTAGE,							\
> > @@ -122,10 +118,30 @@ static const int ad4000_gains[] = {
> >  	454, 909, 1000, 1900,
> >  };
> >  
> > +struct ad4000_time_spec {
> > +	int t_conv_ns;
> > +	int t_quiet2_ns;
> > +};
> > +
> > +/*
> > + * Same timing specifications for all of AD4000, AD4001, ..., AD4008, AD4010,
> > + * ADAQ4001, and ADAQ4003.
> > + */
> > +static const struct ad4000_time_spec ad4000_t_spec = {
> > +	.t_conv_ns = 320,
> > +	.t_quiet2_ns = 60,
> > +};
> > +
> > +static const struct ad4000_time_spec ad4020_t_spec = {
> > +	.t_conv_ns = 350,
> > +	.t_quiet2_ns = 60,
> > +};
> 
> t_quiet2_ns is the same in both cases, so do we actually need to
> add it here instead of using a common macro? Or if it is for future
> differences, mention that in the commit message.

Okay, will add a macro for setting ad4000_time_spec. My plan is to also add a
t_quiet1_ns filed which will be needed for offloading support.
t_quiet1_ns will also differ between AD4000 and AD4020.

  reply	other threads:[~2024-11-18 11:34 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-14 23:50 [PATCH 0/4] Timestamp and PulSAR support for ad4000 Marcelo Schmitt
2024-11-14 23:50 ` [PATCH 1/4] dt-bindings: iio: adc: adi,ad4000: Add PulSAR Marcelo Schmitt
2024-11-15 17:06   ` David Lechner
2024-11-18 11:24     ` Marcelo Schmitt
2024-11-18 15:39       ` David Lechner
2024-11-18 18:25       ` Marcelo Schmitt
2024-11-18 18:33         ` David Lechner
2024-11-24 13:11         ` Jonathan Cameron
2024-11-25 18:43           ` Conor Dooley
2024-11-14 23:50 ` [PATCH 2/4] iio: adc: ad4000: Add timestamp channel Marcelo Schmitt
2024-11-15 17:07   ` David Lechner
2024-11-14 23:51 ` [PATCH 3/4] iio: adc: ad4000: Use device specific timing for SPI transfers Marcelo Schmitt
2024-11-15 17:07   ` David Lechner
2024-11-18 11:34     ` Marcelo Schmitt [this message]
2024-11-14 23:51 ` [PATCH 4/4] iio: adc: ad4000: Add support for PulSAR devices Marcelo Schmitt
2024-11-15 17:14   ` David Lechner
2024-11-18 11:37     ` 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=ZzsmUqqyAll9BBCv@debian-BULLSEYE-live-builder-AMD64 \
    --to=marcelo.schmitt1@gmail.com \
    --cc=Michael.Hennerich@analog.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dlechner@baylibre.com \
    --cc=jic23@kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --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