mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: David Lechner <dlechner@baylibre.com>
To: Jonathan Cameron <jic23@kernel.org>,
	Jorge Marques <jorge.marques@analog.com>
Cc: Lars-Peter Clausen <lars@metafoo.de>,
	Michael.Hennerich@analog.com, linux-iio@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] Documentation: ABI: add oversampling frequency in sysfs-bus-iio
Date: Sun, 30 Mar 2025 12:34:39 -0500	[thread overview]
Message-ID: <3ad6f137-5f67-4448-b0c9-2e760bd935a7@baylibre.com> (raw)
In-Reply-To: <20250330181320.0ec4351c@jic23-huawei>

On 3/30/25 12:13 PM, Jonathan Cameron wrote:
> On Fri, 21 Mar 2025 15:50:02 +0100
> Jorge Marques <jorge.marques@analog.com> wrote:
> 
>> Some devices have an internal clock used to space out the conversion
>> trigger for the oversampling filter,
>> Consider an ADC with conversion and data ready pins topology:
>>
>>   Sampling trigger |       |       |       |       |
>>   ADC conversion   ++++    ++++    ++++    ++++    ++++
>>   ADC data ready      *       *       *       *       *
>>
>> With the oversampling frequency, conversions can be evenly space between
>> the sampling edge:
> 
> I'm not sure what this second example is providing.  Are you suggesting
> that if we don't provide oversampling frequency we should assume this
> pattern?  i.e. it is the default?
> 
>>
>>   Sampling trigger |       |       |       |       |
>>   ADC conversion   + + + + + + + + + + + + + + + + + + + +
>>   ADC data ready         *       *       *       *       *
>>
> In general this patch needs to go in with the first driver using it.
> I don't think we have any such driver yet?
> 
>> Signed-off-by: Jorge Marques <jorge.marques@analog.com>
>> ---
>>  Documentation/ABI/testing/sysfs-bus-iio | 17 +++++++++++++++++
>>  1 file changed, 17 insertions(+)
>>
>> diff --git a/Documentation/ABI/testing/sysfs-bus-iio b/Documentation/ABI/testing/sysfs-bus-iio
>> index 33c09c4ac60a4feec82308461643134f5ba84b66..2317bacf6a2884691a08725d6f01d18555a96227 100644
>> --- a/Documentation/ABI/testing/sysfs-bus-iio
>> +++ b/Documentation/ABI/testing/sysfs-bus-iio
>> @@ -139,6 +139,23 @@ Contact:	linux-iio@vger.kernel.org
>>  Description:
>>  		Hardware dependent values supported by the oversampling filter.
>>  
>> +What:		/sys/bus/iio/devices/iio:deviceX/oversampling_frequency
>> +KernelVersion:	6.15
>> +Contact:	linux-iio@vger.kernel.org
>> +Description:
>> +		Some devices have internal clocks for the ADC oversampling.
> I wonder if we can hint at your diagram above?
> Maybe
> 		Some devices have internal clocks for the ADC oversampling allowing
> 		the over samples to be bunched up, rather than evenly spread over the
> 		period set by the sampling frequency.
> 
>> +		Sets the resulting sampling frequency to trigger a conversion
>> +		used by the oversampling filter.
>> +		Can be used to evenly space conversion between the sampling edge
>> +		on some devices.
> I'd skip this last line, or maybe say something like:
> 
> 		If not provided, the default assumption is that the oversamples
> 		are evenly spread over the period of the sample.

Does that mean we should go through existing drivers and add this new
attribute if appropriate? For example, ad7380 comes to mind. It has a
fixed-rate internal clock for oversampling, so would have a read-only
oversampling_frequency attribute.

> 
>> +
>> +What:		/sys/bus/iio/devices/iio:deviceX/oversampling_frequency_available
>> +KernelVersion:	6.15
>> +Contact:	linux-iio@vger.kernel.org
>> +Description:
>> +		Hardware dependent values supported by the oversampling
>> +		frequency.
>> +
>>  What:		/sys/bus/iio/devices/iio:deviceX/in_voltageY_raw
>>  What:		/sys/bus/iio/devices/iio:deviceX/in_voltageY_supply_raw
>>  What:		/sys/bus/iio/devices/iio:deviceX/in_voltageY_i_raw
>>
> 


  reply	other threads:[~2025-03-30 17:34 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-21 14:50 [PATCH 0/2] Add sys-bus-iio ABI frequency options to events and oversampling Jorge Marques
2025-03-21 14:50 ` [PATCH 1/2] Documentation: ABI: add events sampling frequency in sysfs-bus-iio Jorge Marques
2025-03-30 17:08   ` Jonathan Cameron
2025-03-21 14:50 ` [PATCH 2/2] Documentation: ABI: add oversampling " Jorge Marques
2025-03-30 17:13   ` Jonathan Cameron
2025-03-30 17:34     ` David Lechner [this message]
2025-03-30 17:53       ` Jonathan Cameron
2025-04-02 13:47         ` Jorge Marques
2025-04-02 20:27           ` David Lechner
2025-04-03  8:35             ` Jorge Marques
2025-04-06 10:25               ` Jonathan Cameron
2025-04-07 16:28                 ` Jorge Marques
2025-04-07 18:40                   ` 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=3ad6f137-5f67-4448-b0c9-2e760bd935a7@baylibre.com \
    --to=dlechner@baylibre.com \
    --cc=Michael.Hennerich@analog.com \
    --cc=jic23@kernel.org \
    --cc=jorge.marques@analog.com \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.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

all inboxes | Powered by JetHome®