From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-oo1-f47.google.com (mail-oo1-f47.google.com [209.85.161.47]) (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 8FCA325A625 for ; Wed, 30 Apr 2025 15:04:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.161.47 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1746025494; cv=none; b=XH8tpT8Knqm6raLUpGkxxpm1orUpwDTE/6O5Tvpgm++D32T2j9q6fYU61Ew8HJcThia4Bo+PrRnVh4Z6+UFXVzvDbSlxaeVga+COhv9LocZndA7EguQ9vfR8pn6UV6ej3vtQhTh71EKhhAaIILDUKip2qRHiCQqlvVksiz2qQes= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1746025494; c=relaxed/simple; bh=iAUBF84BT6XPeN8Y/n4Oehp+UL7zE/zH+6aZ+LiCsHc=; h=Message-ID:Date:MIME-Version:Subject:From:To:Cc:References: In-Reply-To:Content-Type; b=EqVPWliWbqifoLgG2iadrNP4l9GLMv1Bb2MoMzuP09zPVjlDS3DjMIyeifFpDhxkYfGmt4zxC1tutqa4yJazujU+zks73zJp6Od8rK09w/RpON00plhE9W8M5pOyl7D26TVpCgEqIE/dsOO+lIhNSpGxXCK0uzbIPqQLP9qrvtU= 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=VezMumEH; arc=none smtp.client-ip=209.85.161.47 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="VezMumEH" Received: by mail-oo1-f47.google.com with SMTP id 006d021491bc7-604ad6c4cf1so2621692eaf.3 for ; Wed, 30 Apr 2025 08:04:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1746025491; x=1746630291; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:content-language:references :cc:to:from:subject:user-agent:mime-version:date:message-id:from:to :cc:subject:date:message-id:reply-to; bh=n3T9+6PFQU7ODBU+5+B8t+gjHfIuLl3Jh/pj8rJ6DXA=; b=VezMumEH4PnXDpfdIiVOA8FcSVMdKGiH03QLdp2m5CaGxxYPtYQrjtwt3t0cAmix5x 2q2rDP9CUs+5m/PybmjnrVslLmWPVZetohfDthCZhqh6DJsLgrJM2juuyGqWEyx6b9QK jiVmvYiNp6VqcNayES9DJnYGeRwk4GKzulrPL4l3KYL8DfTfirsMi1lbfmUHVxozphzw 8W9uV6SpqVgGkW7pSbRWLIG3bJEYPLkKkY1rmfmFxG99w1UqboVvqBZP+TfmLt5uuDW5 KOcSpJddBNA1BwJ7jV8FXkeE2kPrBUM9lXgf7HOrk+3ihxFCqKpKVnKBdlIXRixdZIBj 5QXA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1746025491; x=1746630291; h=content-transfer-encoding:in-reply-to:content-language:references :cc:to:from:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=n3T9+6PFQU7ODBU+5+B8t+gjHfIuLl3Jh/pj8rJ6DXA=; b=gc42x6A72B/oN4wQ2n8/UaKtZk62fHXUqFNvzRFy6ehJKkIDIvKRYlsaD23hC7jYIl WJvxnEvMjtyzGdqCakRCAHXDh2tCfB+9lBbkP9HpFFdcwlnTKy4I9plR1YNX/Mq8179j 6pHhhenQdD0AA5AczlRg3tMlGmOQiNUwmiu3qwblHlz/QYFvSxxGS42UkFfCEyYrumqy 6/Q+wCVP3EKVwJYMKA/4SpAd/GQ/nvzM9ShS8YwomMgiVvLNj2sAMdjq0/u2JQeU0ii+ PNP83iK4WsKthVxnZsasm1Qi/Tud1+9ttV8cMJsZw8UyHeFtIuWhT/VkorBB3Ti7HnTr AsGA== X-Forwarded-Encrypted: i=1; AJvYcCUVKFCUB24+EDeIAyFkp6y7F/vqHUdpYeqXht/1IOd+Qu1Qo1lJy84vfacJlha+bW2HGD6dP4AfS5krJU4=@vger.kernel.org X-Gm-Message-State: AOJu0YwM5alRXxFLf4KuJVjbRFveUQzu1DGNkyjm/dkWYruB9PX7mLiQ ZG2TFyB1QyMSWhxuHFp1z25yX8ic+t1msk4Qu2UreU1eivoqT3/hNL3NE9PzZT0= X-Gm-Gg: ASbGncvQ09X2jKocjZP1QrEcvjzoEzRfNPwKyoknFPf+O9OWt8OIUWOX3mK2e0v7yJf 2p0bNAKImZjRH/z0hymCyMT124tY8lphaE/Uj6d4inTGq9L5u1fUa/8hnn39etlI0cgnEkcMULt XelszMrPpKqzuXGhsDdhpl1qUgJLGEKwy2YVIjU6PEmpMYTL/RVDwpB39bxlPVf7AkJxbBy7ckH K6aLZxH8gPSMTHdALbz8jkJ+81gvkitQgJLfUqBxQGUmsxYLTeI5WAi4DndqQgR3fl2NCJZO+XI uPnlX3xHYTqqHFaD9nWC2iTtJnm/AOh8wQ8q1VCnjMyqfpwTX3rCQENiwH5VBoEMkJDzJEhmxX2 iy6qDHEjfSElHrEY= X-Google-Smtp-Source: AGHT+IGzbbqKeOG5/Z3RMXw05bmJvQ6JAZJPq3w+KmxakZsKev1SHX78l6FcGWqPiLMhX3MPVZr9Uw== X-Received: by 2002:a05:6820:3094:b0:606:107a:ebd8 with SMTP id 006d021491bc7-607d5675e89mr1620447eaf.5.1746025491559; Wed, 30 Apr 2025 08:04:51 -0700 (PDT) Received: from ?IPV6:2600:8803:e7e4:1d00:359a:f1e:f988:206a? ([2600:8803:e7e4:1d00:359a:f1e:f988:206a]) by smtp.gmail.com with ESMTPSA id 006d021491bc7-60686ec905dsm811235eaf.15.2025.04.30.08.04.48 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 30 Apr 2025 08:04:49 -0700 (PDT) Message-ID: <7fe18625-3a25-40c8-bfb7-a7a22a3eccff@baylibre.com> Date: Wed, 30 Apr 2025 10:04:47 -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 1/5] Documentation: ABI: IIO: add calibphase_delay documentation From: David Lechner To: Andy Shevchenko Cc: =?UTF-8?Q?Nuno_S=C3=A1?= , Angelo Dureghello , Jonathan Cameron , =?UTF-8?Q?Nuno_S=C3=A1?= , Lars-Peter Clausen , Michael Hennerich , Rob Herring , Krzysztof Kozlowski , Conor Dooley , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org References: <20250429-wip-bl-ad7606-calibration-v1-0-eb4d4821b172@baylibre.com> <20250429-wip-bl-ad7606-calibration-v1-1-eb4d4821b172@baylibre.com> <4645ae3e0c3bb1ada9d4cadce77b64fe5e651596.camel@gmail.com> <070b269c-c536-49c5-a11d-7e23653613f9@baylibre.com> <896023ae-c279-4201-a7a8-dfd9b33fe0e5@baylibre.com> Content-Language: en-US In-Reply-To: <896023ae-c279-4201-a7a8-dfd9b33fe0e5@baylibre.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On 4/30/25 9:56 AM, David Lechner wrote: > On 4/30/25 9:45 AM, Andy Shevchenko wrote: >> On Wed, Apr 30, 2025 at 09:21:28AM -0500, David Lechner wrote: >>> On 4/30/25 12:40 AM, Nuno Sá wrote: >>>> On Tue, 2025-04-29 at 15:06 +0200, Angelo Dureghello wrote: >>>>> From: Angelo Dureghello >>>>> >>>>> Add new IIO calibphase_delay documentation. >>>>> >>>>> The delay suffix is added to specify that the phase, generally in >>>>> radiants, is for this case (needed from ad7606) in nanoseconds. >> >> ... >> >>>>> +What: /sys/bus/iio/devices/iio:deviceX/in_voltageY_calibphase_delay >>>> >>>> Not sure if I'm too convinced on the _delay suffix >>>> >>> Phase is measured in radians, not seconds, so it seems wrong to use it here. >>> >>> https://en.wikipedia.org/wiki/Phase_(waves) >>> >>> And the delay here is with respect to individual samples in a simultaneous >>> conversion without regard for a sampling frequency, so I don't see how we could >>> convert the time to radians in any meaningful way. >> >> And how this delay is aplicable to the phase in the hardware? Sounds to me that >> HW has some meaningful way of such a conversion? >> > > It is a calibration to account for a phase difference between two input signals. > This is a simultaneous sampling ADC, so all channels normally sample at exactly > the same time. This phase delay calibration factor can introduce a small delay > on an individual channel so that it starts it's conversion some microseconds > after the others. > > There is a nice diagram here: > > https://www.analog.com/media/en/technical-documentation/data-sheets/ad7606c-18.pdf#%5B%7B%22num%22%3A113%2C%22gen%22%3A0%7D%2C%7B%22name%22%3A%22XYZ%22%7D%2C34%2C594%2C0%5D > > To convert the phase delay to a phase angle and back would require also knowing > the frequency of the input voltage signals. Maybe calling it "conversion delay" would make more sense? Since the phase part of it is really referring to the application rather than to what we are actually adjusting.