From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-oa1-f44.google.com (mail-oa1-f44.google.com [209.85.160.44]) (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 A3DA532C85 for ; Thu, 1 May 2025 14:44:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.44 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1746110697; cv=none; b=sf32vgQh/EelphO8uo5W0wKIUf385QGYkSxRJwg6TB5bsWoXZiHYH8tX112j8f8bnSFnrTbhKj0g9C3uHxr8PhjRzOHgbyKU1ftXKoQEafKWc0a/zOQsi/V0kD3Fz69zNfme22rjY0w3blONRQyf3U+Ouoz/xTHNYeyw7tfzcyI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1746110697; c=relaxed/simple; bh=pkCKg8REI2kJ+KBl+ostpIL6/TdSCwYqr+PRuvynaa8=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=VqWc50SV3qHFUVydzgRzKgkkB7g2u9/o6gUtMHIvPF4oQ3tFcqzOpU9/g0QHpLpX4GbwbitfA49/phLoRxTOo8ra/bBY+QJVlYrlECui5Ip1zWR5wF8gDpVOdCs/COZgEB/oK7C5C3bParU5SgvWNf+xpN6ywqU2NNjgHuGrpbA= 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=U9RMuezs; arc=none smtp.client-ip=209.85.160.44 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="U9RMuezs" Received: by mail-oa1-f44.google.com with SMTP id 586e51a60fabf-2cc82edcf49so305714fac.1 for ; Thu, 01 May 2025 07:44:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1746110694; x=1746715494; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:content-language:from :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=/2Se3FRDk6iAumT2Vgey+XR890FoK1DcHOmHi83BtWw=; b=U9RMuezsMOML5RMX7vEaf8SZSTQVeA19fS9lBI72RXPGZhhsCJ9RH90C/991QXCPCB mnHeYbB361GIQef1TvOVKw6CsGBBDzLrEy1zVRZLTOWeTVzcrfdDeRth9ZMwF5/YkF2U Ix094udzZ+83udIMXOjhtMFtJndmsplKa8JJXl854XiTHRq7h/RfQI7vq5j7bwqogsZr +LzjcVeys9bFK4GYmceIBloZI2goOchyg8/gybU5fSYr+CdBBrmxF5D1H+0lVlwULggw lUJ1m9iRqCBJJfAbygsIkC6wBuWMC41mI1TElgvVgXWO6G1KY6oEBkH231nL4t923/uj U5eg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1746110694; x=1746715494; h=content-transfer-encoding:in-reply-to:content-language:from :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=/2Se3FRDk6iAumT2Vgey+XR890FoK1DcHOmHi83BtWw=; b=jXczjYOQFRga39XSiRTAKSsklTC+PXkoAsArnVgHjUyu+gMqSXJuqjD+lHhx+JqAmM tmumlC8CN8zP9TemE7b7la8RqToEy7BM0vaKnChHlqnCmQfnY/V77UzUBrSG1ZzloxWG 6IIHD62/Kone9vwEhtm9O1knLnmIIaI0baPIm+3zBqmCPH67RT8QzpCrMB8ufIwMIKc0 ckx6L5+gZZXTBob7RMfRk7Vm7A706wCiRFyRQk+nFGKk1y/44mQ8ZXF8zT4UD8IRk0y6 UUCnTNm3NbixB13h1wi0jIjJlkBslzeQiaGCffpPiMfsBjI34EnInsALgtQZW46s9v+i 0nrg== X-Forwarded-Encrypted: i=1; AJvYcCUTWMXt/BxwrkMDJe+wIb21OiJqUJG+nf4x2YOBQOVkZCuTEf906tYTu3c/dbgktFZuRcM4rF0HGxhO@vger.kernel.org X-Gm-Message-State: AOJu0YzYYuoeaXNFmhJZ49MOzwORcEp7N9J5asPDYrdLb6Nevfj6HXQL 0nWMBqF/iugJq214IcNX4gJdXi7oZxSGPSY6qdbJBahS0Le/Y/22PB5WUsfi7v4= X-Gm-Gg: ASbGncuBjYSPlKfK07PKPzhkZG4XoxnXBZvWNs8Au/VSKmBtxcIoeeMhO1u97hSGVN9 XanXI7LHa6kn3iMICm9pQRvGDbSWxek1gIOU/87E4bDXeTS55Qjs9tthxf0hZKkETiCBmGn4CQw SJh//vK9QxQEgg+ZLdFkXUNt0iQc3aGB0F0FNOCgWsBUn8pmpxv+zgVQ1GfqKJGd6gh8yH2Qopj vFEZzZBp4VmmIZkgmApEVfYmoFJFyGCWCpyoZnmQVr+I7TF61CFRqlObguQtPDAJTl2+tpYUfjY 1umi4jRJvzIk150k1U9Sz4hzKYqNdrDQD9saciBi5QDZR/Io4FhdnLL8y1x2Jg+QwhrOHCBjLUY ew6UmgZuNSkz/eY4B1g== X-Google-Smtp-Source: AGHT+IGxJ3NT//fbjvEZXqvWEf4Xd+0HSjpGgi29P3/nQMqcDsGcwtvj80pgndfxfGUJJO0IM6invg== X-Received: by 2002:a05:6870:6112:b0:29f:97af:a1a0 with SMTP id 586e51a60fabf-2da8c713113mr1738332fac.24.1746110694629; Thu, 01 May 2025 07:44:54 -0700 (PDT) Received: from ?IPV6:2600:8803:e7e4:1d00:b1ed:e5d7:8ea6:40e0? ([2600:8803:e7e4:1d00:b1ed:e5d7:8ea6:40e0]) by smtp.gmail.com with ESMTPSA id 586e51a60fabf-2daa0ed6ef5sm152040fac.13.2025.05.01.07.44.51 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 01 May 2025 07:44:53 -0700 (PDT) Message-ID: <0c7e4efc-7c2a-46ac-b970-4134c386bc71@baylibre.com> Date: Thu, 1 May 2025 09:44:51 -0500 Precedence: bulk X-Mailing-List: devicetree@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 To: Angelo Dureghello Cc: Andy Shevchenko , =?UTF-8?Q?Nuno_S=C3=A1?= , 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> <7fe18625-3a25-40c8-bfb7-a7a22a3eccff@baylibre.com> From: David Lechner Content-Language: en-US In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On 5/1/25 7:33 AM, Angelo Dureghello wrote: > On 30.04.2025 10:04, David Lechner wrote: >> 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. > > Are there examples of a phase calibration in iio ? Becouse apply a radians > calibration seems complicated and maybe non approrpiate for non-periodic > signals as often used in real world applications. > > So another viable idea could be to use a IIO_CHAN_INFO_CALIBDELAY instead. > > Regards, > angelo I was looking at the datasheet on another ADC that popped up on the mailing list today. https://www.ti.com/product/ADS1262 It has a "conversion delay" register that does basically the same thing. So I'm liking that name even more now. Just calling it "delay" seems a bit too vague. We could make it IIO_CHAN_INFO_CALIBCONV_DELAY to try to keep it shorter.