Linux IIO development
 help / color / mirror / Atom feed
From: David Lechner <dlechner@baylibre.com>
To: Jonathan Cameron <jic23@kernel.org>
Cc: "Nuno Sá" <nuno.sa@analog.com>,
	"Andy Shevchenko" <andy@kernel.org>, "Chris Hall" <c-hall@ti.com>,
	"Patrick Edwards" <pedwards@ti.com>,
	"Kurt Borja" <kuurtb@gmail.com>,
	"Nguyen Minh Tien" <zizuzacker@gmail.com>,
	linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 3/3] iio: adc: ti-ads112c14: add support for buffered read
Date: Fri, 24 Jul 2026 09:47:34 -0500	[thread overview]
Message-ID: <d8d69bf3-8fd7-41ed-8fd4-8b42e9165ac9@baylibre.com> (raw)
In-Reply-To: <20260724002508.7e176510@jic23-huawei>

On 7/23/26 6:25 PM, Jonathan Cameron wrote:
> On Tue, 21 Jul 2026 18:23:58 -0500
> David Lechner <dlechner@baylibre.com> wrote:
> 
>> On 7/19/26 7:55 PM, Jonathan Cameron wrote:
>>> On Tue, 14 Jul 2026 19:19:32 -0500
>>> "David Lechner (TI)" <dlechner@baylibre.com> wrote:
>>>   
>>>> Add support for buffered reads using a triggered buffer.
>>>>
>>>> The device has a continuous conversion mode, but that can only be used
>>>> with one channel at a time since there is nothing like a sequencer to
>>>> support that in hardware. Instead, we use single-shot reads like we do
>>>> for direct reads to be able to read multiple channels.
>>>>
>>>> Support for continuous conversion mode could be added in the future if
>>>> needed via a 2nd buffer.  
>>>
>>> How about enabling that if only one channel is requested?  I vaguely recall
>>> us doing that for another driver (though I might be dreaming :)  I did
>>> see your comment in the cover letter about it affecting timing and that
>>> making life complex.  Fine to leave considering this for another day
>>> but maybe don't suggest a particular solution here.
>>>   
>> Actually, my latest thought it to do it by trigger type. This chip has
>> a DRDY interrupt that can be used as the trigger for the continuous
>> conversion mode but we need some software trigger to the single-shot
>> mode. It think this would take care of the timing issues as well.
>>
>> The logic would be that if the self trigger (DRDY) is selected in
>> the trigger/current_trigger attribute, then buffered read will use
>> continuous mode and fail if more than one channel is enabled. If
>> another (software) trigger is enabled, then use single-shot mode
>> and allow multiple channels.
> 
> Hmm. Bit unintuitive but can't really be helped.
> 
>>
>> The timing issue is that (or will be since I haven't sent the relevant
>> patches yet) there is a settling delay before the first sample. For
>> single-shot mode, every sample is considered the first sample (because
>> it is "single"), so the chip applies this settling time on every sample.
>> So it might be good enough to just document that as a quirk of software
>> triggers for this particular chip since they would be using single-shot
>> mode?
>>
> This is where it gets messy if settling time is reported. I guess acceptable
> given it doesn't make that much sense for an external trigger anyway.
> In theory if the settling time has to happen each single shot, we could
> just merge it into sampling frequency (as no longer depends on whether
> channel changes or not) but then we have to make that dependent on whether
> it is the devices own trigger or not. Messy. I guess one to paper over
> as a quirk / corner case and document as you say.
Yes, this is the direction I am leaning as well. The input chopping feature
that we have been talking about has a similar issue. In addition to doubling
the sample period, it also includes the settling time (2x as well) minus a
few clock cycles. Even messier.



  reply	other threads:[~2026-07-24 14:47 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-15  0:19 [PATCH 0/3] iio: adc: ti-ads112c14: buffered read support David Lechner (TI)
2026-07-15  0:19 ` [PATCH 1/3] iio: adc: ti-ads112c14: add debugfs register access David Lechner (TI)
2026-07-20  0:24   ` Jonathan Cameron
2026-07-22 22:52     ` David Lechner
2026-07-23 23:18       ` Jonathan Cameron
2026-07-15  0:19 ` [PATCH 2/3] iio: adc: ti-ads112c14: add support for I2C CRC8 David Lechner (TI)
2026-07-20  0:35   ` Jonathan Cameron
2026-07-15  0:19 ` [PATCH 3/3] iio: adc: ti-ads112c14: add support for buffered read David Lechner (TI)
2026-07-20  0:55   ` Jonathan Cameron
2026-07-21 23:23     ` David Lechner
2026-07-23 23:25       ` Jonathan Cameron
2026-07-24 14:47         ` David Lechner [this message]
2026-07-24 21:34           ` Jonathan Cameron

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=d8d69bf3-8fd7-41ed-8fd4-8b42e9165ac9@baylibre.com \
    --to=dlechner@baylibre.com \
    --cc=andy@kernel.org \
    --cc=c-hall@ti.com \
    --cc=jic23@kernel.org \
    --cc=kuurtb@gmail.com \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nuno.sa@analog.com \
    --cc=pedwards@ti.com \
    --cc=zizuzacker@gmail.com \
    /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