From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-oi1-f176.google.com (mail-oi1-f176.google.com [209.85.167.176]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 101B364A8F for ; Sun, 30 Mar 2025 17:34:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.176 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743356086; cv=none; b=KId95+A2/Y5nYZ1moQebgLFaIu0hDC1TaqjjbzsTHmXPotC1aso9hzUr7nR6lMBH52PWW1Q8aqIu6qqNQEAWvjwtGnPg4y+Lm2ByYPKBx41gUGcB++ohbrHR+mLP0MRBCR6MRGJeZwaPW9rd3NWoCAyl6a//Qa+ToXJfZax91YA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743356086; c=relaxed/simple; bh=5U4Clltkv80WoyfzgJ6eTMysFZQXQPuuPC+tduvLBCM=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=XbR6l4VSY4q2LBT8iEWR7MId6aWW1ul9kjN8MEteQDiK8QCc7judPs08UWLnjBYnm0gsJfqOWZjrVMyZxaudnIQdwL+IUB5oQElgomYVM7W9yWXSbRvz54ZYZfdNWBEwAb8VBC9wibafgItE+mbuXGBUbyuWle2LdmllYIcfDKA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com; spf=pass smtp.mailfrom=baylibre.com; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b=w2mwmBur; arc=none smtp.client-ip=209.85.167.176 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=baylibre.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b="w2mwmBur" Received: by mail-oi1-f176.google.com with SMTP id 5614622812f47-3f8df49e75fso916585b6e.1 for ; Sun, 30 Mar 2025 10:34:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1743356083; x=1743960883; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=iBuISF6jbYBXth4JoPLKPG1nY0sGBae58GEnveT2Zws=; b=w2mwmBurSdjQDXRwGxtElR+z9AzymUcuB9lGPfUOc+5shelRZFWOwVuadd9kD4rGCw 90nIkPQ325AAP8Tmp9pfv41W3hVLPf/UbG2iYUSZx5AxK6DfyICKbK021QbZhicoSahA OGuR9hqcwyKU1Sq2n4BCsFwL4IOInPru53h11BvENfTyji1peCDziJ+on2yaZQMcMlf7 38/dxrhe+VYyzXZcNy8IJ3N4i3UNrIriMBA5dlOcJPmN5c+X9omKUDEPrLeardA2GtTs ib1pSJddTVmAewtkoYQWCQ+V7VtSWOQoMWoyU0yyv1q76Ut7Hi1bAtp5X6c751saopmK 4OrQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1743356083; x=1743960883; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=iBuISF6jbYBXth4JoPLKPG1nY0sGBae58GEnveT2Zws=; b=O96DEZgH3J0cU1hQM/aRWJDa/XlEiblsvXzh6yCaxbIF6iEo/m4wyp3Nr4FC6iXGOZ LwfkcainnzyDs7+GvzYWn9yanzC7k9krESIVWxI4UuBcPgjtjrsFvVfq4TNvecmd2/WF dtED90mGIk01Wy8zEWaf0p27hkH8TrFov3nrZ4BMH9xMmRb07hPCxqvbZ/axCO/6e7hN VEgelbJXED8rETxSiMFY78R1yKSIsm79iGR+b3F7JjP8YBihmSK2naEfoR7N4dJP2YVN wv0UD/jwphNxevnQ+IRfETgn+d6DtwUdf6GTz1YNyLC8Ew0k3iN7jSbljq27Ss8i92aJ YdBA== X-Forwarded-Encrypted: i=1; AJvYcCXeapmhzQ+Y1vFc6Dh9zcbBaoaDB90cGMmY+EiqW1/oyblYXNkUAij4qOZmocJCbOnaW8lX5s4/e1mwi0M=@vger.kernel.org X-Gm-Message-State: AOJu0Yx8zHiMoSXB57VZqma//zQEaif/ilLFc8bo2eeHH4na4l+YpoDz g8VXQ618EgR41zLvHjWmOAQVVikFz1NYwymTjzrwSPt4eSkPz3a8FXd3TCefsvE= X-Gm-Gg: ASbGncu/A0uJr9ispizVnXrzWFvhCUPoA83zgVSGfJjkX462i0oCWRGaNyaOi4O8StX qOW0MdzWBRohmMnx3LxmEYtiJ7Hr0SVyr29kEeR2BX5by45ZVSiv/ls6nN2yiL1SuO8dOmNl+IN IxopxdBmfvGmCl+pchj6Bp0H9bL/ciabuBb9oYsyn3g7O2h95VXw3OFBiK7rHhUBRxnaECUv2aO cBZuTP1M4oEHl75Q5rk/R1+p0bHgANjhFYaBT4lL70XxKScRPHzJtwjELwxH3JszalB0pkJwklB tJKn4gICcYZq4I8d3/HHEt3zf0rlp7mLxAqNIcPz6i/WWO8L7DkmSADVkpoppcySd6aicS9ItS0 KTr2DYg== X-Google-Smtp-Source: AGHT+IFKNqyLxoS7q9afhTJ9PDwxwlzxNhC+QwhLSfePM4OfbMQPkD2Wtprcexa5g1W4C6bNtwH9Ug== X-Received: by 2002:a05:6808:2e4b:b0:3f6:ab0d:8dc0 with SMTP id 5614622812f47-3ff0f59b9famr4159919b6e.24.1743356082956; Sun, 30 Mar 2025 10:34:42 -0700 (PDT) Received: from [192.168.0.113] (ip98-183-112-25.ok.ok.cox.net. [98.183.112.25]) by smtp.gmail.com with ESMTPSA id 006d021491bc7-602845027b6sm1197779eaf.16.2025.03.30.10.34.40 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 30 Mar 2025 10:34:41 -0700 (PDT) Message-ID: <3ad6f137-5f67-4448-b0c9-2e760bd935a7@baylibre.com> Date: Sun, 30 Mar 2025 12:34:39 -0500 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 2/2] Documentation: ABI: add oversampling frequency in sysfs-bus-iio To: Jonathan Cameron , Jorge Marques Cc: Lars-Peter Clausen , Michael.Hennerich@analog.com, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org References: <20250321-abi-oversampling-events-frequency-v1-0-794c1ab2f079@analog.com> <20250321-abi-oversampling-events-frequency-v1-2-794c1ab2f079@analog.com> <20250330181320.0ec4351c@jic23-huawei> Content-Language: en-US From: David Lechner In-Reply-To: <20250330181320.0ec4351c@jic23-huawei> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 3/30/25 12:13 PM, Jonathan Cameron wrote: > On Fri, 21 Mar 2025 15:50:02 +0100 > Jorge Marques 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 >> --- >> 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 >> >