public inbox for linux-doc@vger.kernel.org
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: David Lechner <dlechner@baylibre.com>
Cc: Alisa-Dariana Roman <alisadariana@gmail.com>,
	"Rob Herring (Arm)" <robh@kernel.org>,
	Alisa-Dariana Roman <alisa.roman@analog.com>,
	Jonathan Cameron <Jonathan.Cameron@huawei.com>,
	Ramona Gradinariu <ramona.bolboaca13@gmail.com>,
	linux-iio@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org,
	Lars-Peter Clausen <lars@metafoo.de>,
	Michael Hennerich <Michael.Hennerich@analog.com>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Jonathan Corbet <corbet@lwn.net>
Subject: Re: [PATCH v4 2/3] iio: adc: ad7191: add AD7191
Date: Sat, 8 Feb 2025 14:35:14 +0000	[thread overview]
Message-ID: <20250208143514.1db3510f@jic23-huawei> (raw)
In-Reply-To: <3f03b03d-9f41-4683-a284-df48afbee83e@baylibre.com>


> 
> 
> > +
> > +static const struct iio_chan_spec ad7191_channels[] = {
> > +	{
> > +		.type = IIO_TEMP,
> > +		.address = AD7191_CH_TEMP,
> > +		.info_mask_separate = BIT(IIO_CHAN_INFO_RAW) |
> > +				      BIT(IIO_CHAN_INFO_OFFSET),
> > +		.info_mask_shared_by_all = BIT(IIO_CHAN_INFO_SAMP_FREQ),
> > +		.info_mask_shared_by_all_available = BIT(IIO_CHAN_INFO_SAMP_FREQ),  
> 
> Should this one be info_mask_separate?
> 
> Since this is a multiplexed ADC and not simelutaneous sampling, I would expect
> that if the ORD pins are set to 10Hz (0.1s period), then a buffered read with
> all channels enabled would take 0.3s to do the 3 samples (effective sample rate
> of 3.33Hz), but if only one channel was enabled in the buffer, then it only
> takes 0.1s to do all of the samples (effective sample rate is 10Hz).
> 
> The iio convention is to use info_mask_separate for the sampling_frequency
> attribute to indicate that the rate only applies to each individual channel
> and not the combined rate to do one "set" of samples for all enabled channels.
> 
> A sampling_frequency attribute that was shared_by_all would mean that on each
> period equivlent to this rate, all samples are read no matter how many channels
> were enabled for a buffered read.

I think this device channel selection is onehot.  As such only one channel
is ever enabled at a time. See num_slots in ad_sigma_delta
which is set to 1 if not specified. We could argue that maybe one day the
infrastructure will be added to make that code deal with dynamic channel 
changes, settling time and all that mess though so maybe it should be
separate even though it makes no difference today.

Jonathan


  reply	other threads:[~2025-02-08 14:35 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-03 13:31 [PATCH v4 0/3] Add support for AD7191 Alisa-Dariana Roman
2025-02-03 13:31 ` [PATCH v4 1/3] dt-bindings: iio: adc: add AD7191 Alisa-Dariana Roman
2025-02-03 13:31 ` [PATCH v4 2/3] iio: adc: ad7191: " Alisa-Dariana Roman
2025-02-03 23:56   ` David Lechner
2025-02-08 14:35     ` Jonathan Cameron [this message]
2025-02-08 14:41   ` Jonathan Cameron
2025-02-03 13:31 ` [PATCH v4 3/3] docs: iio: " Alisa-Dariana Roman
2025-02-03 23:01   ` David Lechner

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=20250208143514.1db3510f@jic23-huawei \
    --to=jic23@kernel.org \
    --cc=Jonathan.Cameron@huawei.com \
    --cc=Michael.Hennerich@analog.com \
    --cc=alisa.roman@analog.com \
    --cc=alisadariana@gmail.com \
    --cc=conor+dt@kernel.org \
    --cc=corbet@lwn.net \
    --cc=devicetree@vger.kernel.org \
    --cc=dlechner@baylibre.com \
    --cc=krzk+dt@kernel.org \
    --cc=lars@metafoo.de \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ramona.bolboaca13@gmail.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