Devicetree
 help / color / mirror / Atom feed
From: Marcelo Schmitt <marcelo.schmitt1@gmail.com>
To: linux-iio@vger.kernel.org
Cc: Marcelo Schmitt <marcelo.schmitt@analog.com>,
	conor+dt@kernel.org, robh@kernel.org, devicetree@vger.kernel.org,
	marcelo.schmitt1@gmail.com
Subject: Re: [PATCH v9 2/6] iio: adc: ltc2378: Add support for LTC2378-20 and similar ADCs
Date: Tue, 28 Jul 2026 10:06:53 -0300	[thread overview]
Message-ID: <amipbdc0tup9x3e2@debian-BULLSEYE-live-builder-AMD64> (raw)
In-Reply-To: <20260727214213.D377F1F000E9@smtp.kernel.org>

On 07/27, sashiko-bot@kernel.org wrote:
> Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
> - [High] Holding CNV high during SPI transfer breaks 3-wire SPI wiring mode.
> --
> 
> --- Patch [2]: [PATCH v9 2/6] iio: adc: ltc2378: Add support for LTC2378-20 and similar ADCs ---
> commit 4d4231cee28f9742280dd61ed84f85cf3b4e0386
> Author: Marcelo Schmitt <marcelo.schmitt@analog.com>
> 
> iio: adc: ltc2378: Add support for LTC2378-20 and similar ADCs
> 
> This commit adds support for the Analog Devices LTC2378-20 and similar
> analog-to-digital converters.
> 
> > diff --git a/drivers/iio/adc/ltc2378.c b/drivers/iio/adc/ltc2378.c
> > new file mode 100644
> > --- /dev/null
> > +++ b/drivers/iio/adc/ltc2378.c
> [ ... ]
> > +static int ltc2378_convert_and_acquire(struct ltc2378_state *st)
> > +{
> > +	int ret;
> > +
> > +	/* Cause a rising edge of CNV to initiate a new ADC conversion */
> > +	gpiod_set_value_cansleep(st->cnv_gpio, 1);
> > +	fsleep(LTC2378_MAX_DATA_WAIT_US);
> > +	ret = spi_sync_transfer(st->spi, &st->xfer, 1);
> 
> [Severity: High]
> Does holding CNV high during the SPI transfer break 3-wire SPI wiring mode?
> In 3-wire mode (where SDI is tied to GND), the SDO pin of the ADC remains in
> a high-impedance state as long as the CNV pin is held high.
No.

> 
> Since the CNV pin remains high throughout the SPI transfer, could the SPI
> controller clock in garbage data from a floating bus?
No. That would only happen if the controller runs more SCLKs than the amount of
precision/resolution bits (non-offload use case) but in those cases we right
shift by _storage_bits - _real_bits, discarding any potential unwanted noise.

> 
> Would lowering CNV after the fsleep() wait and before calling
> spi_sync_transfer() correctly enable SDO for 3-wire mode while remaining
> compatible with 4-wire (CS) mode?
These devices don't have a CS pin. SDI is tied to GND in the currently supported
wiring configuration (single device normal mode). There is no SPI 4-wire mode.

> 
> > +	gpiod_set_value_cansleep(st->cnv_gpio, 0);
> > +
> > +	return ret;
> > +}
> [ ... ]
> 
> -- 
> Sashiko AI review · https://sashiko.dev/#/patchset/cover.1785186980.git.marcelo.schmitt@analog.com?part=2

  reply	other threads:[~2026-07-28 13:05 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-27 21:30 [PATCH v9 0/6] iio: adc: Add support for LTC2378 and similar ADCs Marcelo Schmitt
2026-07-27 21:30 ` [PATCH v9 1/6] dt-bindings: iio: adc: Add ltc2378 Marcelo Schmitt
2026-07-27 21:30 ` [PATCH v9 2/6] iio: adc: ltc2378: Add support for LTC2378-20 and similar ADCs Marcelo Schmitt
2026-07-27 21:42   ` sashiko-bot
2026-07-28 13:06     ` Marcelo Schmitt [this message]
2026-07-27 21:31 ` [PATCH v9 3/6] iio: adc: ltc2378: Enable high-speed data capture Marcelo Schmitt
2026-07-27 21:49   ` sashiko-bot
2026-07-27 21:31 ` [PATCH v9 4/6] iio: adc: ltc2378: Enable triggered buffer " Marcelo Schmitt
2026-07-27 21:31 ` [PATCH v9 5/6] iio: adc: ltc2378: Add support for LTC2338-18 Marcelo Schmitt
2026-07-27 21:40   ` sashiko-bot
2026-07-28 13:12     ` Marcelo Schmitt
2026-08-01 21:12       ` Jonathan Cameron
2026-08-10  7:37   ` Andy Shevchenko
2026-08-11  2:45     ` Marcelo Schmitt
2026-07-27 21:32 ` [PATCH v9 6/6] iio: ABI: Encourage differential voltage ABI usage 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=amipbdc0tup9x3e2@debian-BULLSEYE-live-builder-AMD64 \
    --to=marcelo.schmitt1@gmail.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=linux-iio@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