From nobody Fri Dec 19 15:49:46 2025 Received: from mail-wr1-f54.google.com (mail-wr1-f54.google.com [209.85.221.54]) (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 8FF0C274658 for ; Mon, 19 May 2025 10:15:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.54 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1747649735; cv=none; b=dWwhoZIvdOl5aEZdkrFrA8pYU42ujPCL+RxAwfiovB8gTqStAG5ocr+WOz7NbkbanXnI472o+YaSo8QunbXtOnvRnTUYnhg5ibdpjKeT2zeX6ntZH7tPAuUgFeQYkxOWZ+oIGL7uXB1dCIKuUmdtYpntyr+2afM0QkBmF9T0zd0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1747649735; c=relaxed/simple; bh=kAXfCDDkqD0YIX5fRdivLoZDb1cS9/ZqEEtcHuRvJc4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=uNXGsoydAVpndlCzLlVR58ZAssEPEOj9zs0eZLVI+p0uu9rDJNxN5QuOnqDUeu1hU57nQCCTw9JK8G5kijtZI+H+SEAu5JkjaPA4N4XCTUXzmbiJkgwgG7fh1jDBp+bn92Ca70Cn+fBCVOIqe+98Z03FUDjvu0K/NArDl3rZRJ4= 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=gvQq8HzH; arc=none smtp.client-ip=209.85.221.54 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="gvQq8HzH" Received: by mail-wr1-f54.google.com with SMTP id ffacd0b85a97d-3a375888197so222388f8f.0 for ; Mon, 19 May 2025 03:15:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1747649732; x=1748254532; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=fCnfzj1ToVJ8veFs1TqP1KJeHenvC/HvjKycXP/yVqE=; b=gvQq8HzHrxAwosigLcKy+tRLlQSxdstOmMmayhHeowy7WvjKNfMUJCNqj3VIfLtNH5 13kQ7eptQkqs+PSXdIyQ5cuGAh9ZrIFyj0dzASNro6XMp6cbm24euF4aSFADsKBXs39n VHDPyM6rZFUf5Ed25roBhiODBPDuqWpwXqVdKAJ+ppxpXtb9gi4W6lbcnAbpLq5UKaIm 7RgvWmO8/FkhgRCz0wJfATYlXRm7MiT25OaEqTtbLGZ4OAzOlzcg/vBurLeBsTxNp4b2 oJNv8eg7mqpcWa2/WpLcrYwsffuyOqrA+mCnzeOuI3hCEwXpe7DG/k3/g2QvMl/elbKH Ia6A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1747649732; x=1748254532; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=fCnfzj1ToVJ8veFs1TqP1KJeHenvC/HvjKycXP/yVqE=; b=r6J3/Dv7tFd+42mFYoFS875J/BTY58pdZbfjW/pr9Gafl9niJgv5SZFf0SREsQWpm/ IIE4uX7BP/hVTTOVa9smc2TXHaACmv6lJzczfT758FtYStGwDeA1lvgp9Qwph46d/iTs UiCpbdVDEtk3lsC/9lpA4PJbRBWaXbWjfPu80qnu38V6dEtug2qSPfvwrI8XzUQlPrIQ v19an0lkt8/rbj93HPLRS5TgXa85KXtFn2TNJhjTdcPYLT1+ULQQV2TmeCZYmkXrEr4+ 7intTsmoLowVv1cRK0ac/ixUwbyM61LbPA3XcPjbisB7HQAfYfV2dS3QaP+1Gs27ZQg0 ALbA== X-Forwarded-Encrypted: i=1; AJvYcCWRNHWMvBulSW0pmYptA0dL9xITCMIIvgpRn3FyQJRZG+Pl3BeRI4nurH8fO68+azt78Ok/XQiCDTatRcw=@vger.kernel.org X-Gm-Message-State: AOJu0YyD79N7lkH9laDGOSbEph6MLxYrb/Fss5vs/wrzBIA+KniXXJK7 xB13uFUZF8tI5tTXQeEp0pX7zp2VfKPjbCMrveH6ICLkidakh3Ty7IZVCANfZdSQB54= X-Gm-Gg: ASbGnctloTTl1GEoqvDl+pKw2gEe//7BRGiNeHO9nFNnZqou5wSBCned9D344ns2IL5 V6iRtF1rjaw6BWhs6OP/ST8Wnahen2/vB06kNMhJ3tO2B+YT2oouV8xIl/bsmbm8jZwjoeIAmQZ 7SB2Ywum7YotcA/qVUKB9x+ofcgHlLsCITs3DK1yPZvfSCAuS9fcWXYvyCMmyznczPn9YIwRL3o RuazoN3lhafL8wWMh2DjdLFOedtnI3ygEKwWaFyuPSj8OUHxx0FcGNQXLOIaNr9HoamPbudCP3F uQvUvwDOqCBEVVswTkx2Y7E7yFGzYO6lXIEEl5g8mfQmQNyprz7KxUOBNUWE9g0zY0JmaTuhZN2 tvWoItIoNPygqxNVlEegDRVSlYM6/Qhw= X-Google-Smtp-Source: AGHT+IEkeNEpFV4F4DukOo+8s4LSL5goJzYTBy9MSihVWCaRY8jONp/y+12U3eIyMbpPCa2we8wGpQ== X-Received: by 2002:a05:6000:4313:b0:3a1:f67e:37bc with SMTP id ffacd0b85a97d-3a35c7dca79mr10651186f8f.0.1747649731714; Mon, 19 May 2025 03:15:31 -0700 (PDT) Received: from [192.168.0.2] (host-80-116-51-117.retail.telecomitalia.it. [80.116.51.117]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3a35ca4d105sm12499021f8f.11.2025.05.19.03.15.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 May 2025 03:15:31 -0700 (PDT) From: Angelo Dureghello X-Google-Original-From: Angelo Dureghello Date: Mon, 19 May 2025 12:13:38 +0200 Subject: [PATCH v5 1/5] Documentation: ABI: IIO: add calibconv_delay documentation Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250519-wip-bl-ad7606-calibration-v5-1-4054fc7c9f3d@baylibre.com> References: <20250519-wip-bl-ad7606-calibration-v5-0-4054fc7c9f3d@baylibre.com> In-Reply-To: <20250519-wip-bl-ad7606-calibration-v5-0-4054fc7c9f3d@baylibre.com> To: Jonathan Cameron , David Lechner , =?utf-8?q?Nuno_S=C3=A1?= , Andy Shevchenko , Lars-Peter Clausen , Michael Hennerich , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, Michael Hennerich , devicetree@vger.kernel.org, Angelo Dureghello X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=1861; i=adureghello@baylibre.com; h=from:subject:message-id; bh=WN6HkM4XgPmjxefJhFewSDj6qFVZk19CADasf1AQmr0=; b=owGbwMvMwCXGf3bn1e/btlsznlZLYsjQZol5vdl757rEBKY8s/9MKk8Ze+XZkpdHzDG+kv5cZ KqkGmdWRykLgxgXg6yYIktdYoRJ6O1QKeUFjLNh5rAygQxh4OIUgInsW8nwP4736t0wBo0JtdrO SmfirR6Ka8y0VZ+zzOurms2nK7prVjIyXF5wLK5dLoiJ49E/VlvFzCY3zdo0iSUhprvXFPPLvHN jBAA= X-Developer-Key: i=adureghello@baylibre.com; a=openpgp; fpr=703CDFAD8B573EB00850E38366D1CB9419AF3953 From: Angelo Dureghello Add new IIO calibconv_delay documentation. The ad7606 implements a phase calibation feature, in nanoseconds. Being this a time delay, using the conv_delay suffix. Signed-off-by: Angelo Dureghello --- Documentation/ABI/testing/sysfs-bus-iio | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/Documentation/ABI/testing/sysfs-bus-iio b/Documentation/ABI/te= sting/sysfs-bus-iio index 190bfcc1e836b69622692d7c056c0092e00f1a9b..4cf482eca3d8a0a80b051fbb496= f82f836ab76f8 100644 --- a/Documentation/ABI/testing/sysfs-bus-iio +++ b/Documentation/ABI/testing/sysfs-bus-iio @@ -559,6 +559,30 @@ Description: - a small discrete set of values like "0 2 4 6 8" - a range specified as "[min step max]" =20 +What: /sys/bus/iio/devices/iio:deviceX/in_voltageY_convdelay +KernelVersion: 6.16 +Contact: linux-iio@vger.kernel.org +Description: + Delay of start of conversion from common reference point shared + by all channels. Can be writable when used to compensate for + delay variation introduced by external filters feeding a + simultaneous sampling ADC. + + I.e., for the ad7606 ADC series, this value is intended as a + configurable time delay in seconds, to correct delay introduced + by an optional external filtering circuit. + +What: /sys/bus/iio/devices/iio:deviceX/in_voltageY_convdelay_available +KernelVersion: 6.16 +Contact: linux-iio@vger.kernel.org +Description: + Available values of convdelay. Maybe expressed as: + + - a range specified as "[min step max]" + + If shared across all channels, _calibconv_delay_available + is used. + What: /sys/bus/iio/devices/iio:deviceX/in_accel_x_calibscale What: /sys/bus/iio/devices/iio:deviceX/in_accel_y_calibscale What: /sys/bus/iio/devices/iio:deviceX/in_accel_z_calibscale --=20 2.49.0 From nobody Fri Dec 19 15:49:46 2025 Received: from mail-wm1-f53.google.com (mail-wm1-f53.google.com [209.85.128.53]) (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 DA3D0274678 for ; Mon, 19 May 2025 10:15:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.53 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1747649736; cv=none; b=FUAdqKEaw9onVd4IIA7vKTj5LQPyYxrljWdsnN/M6K4pAliiilBm36N4CMAKkF7FtP5DlyMC0VjbylY1QXB7iTNFe3HstVStO4A30MEKhQhc7/LIcQnaj6Ay4q1k3xoO9kjWwAYkwS5X/wrbjxJHo3ZRcWPFFUuJCfU8Q14jgI4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1747649736; c=relaxed/simple; bh=8DecWNX9a+g7ci97Vv7IU6U85+eTrGoiJDNqhMLAwD0=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=tRe5gzO6BV31k7bdsnO40bT14bnZfH46kNTBpJ/v/O260h84yS0Rwy6yEGcvnIiXsH10lmRuLmzzcMu8qpS9UfPKvd1F+x1DgtNrAREUeyJCmmdxSkYoTxJa/cwaT1q37vNgQzdUg0bV9fzFkThjb2CSh5OerXofK0sfP0semLI= 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=cVNYfRjG; arc=none smtp.client-ip=209.85.128.53 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="cVNYfRjG" Received: by mail-wm1-f53.google.com with SMTP id 5b1f17b1804b1-43ede096d73so29339515e9.2 for ; Mon, 19 May 2025 03:15:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1747649733; x=1748254533; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=gQIoahuutc2qqjFxwM4CJBJC7cg2fQ/5cUj9Q0XSXuA=; b=cVNYfRjGHwE+IhXCTshTb2X469FlAdjpiAk5Fmf61Bok9BOYZjqQveTbSA7+hBYxeL ce2h/i9kZyXNRPsMZEZUN0P31DAzHsHzkCMHoEi4Ygp6LAq5UZnCRCc/sVkBgDkBeRsY rMafzZa4KvXTYCsBmj7Fi+mTKC9d+7dntA+uZNOQFqmHZsLDfNFQabfdnQOpe/+Bd5vl 5zstXH3PiV8vsYPeTm+bIoETTdpctBDgKaXzjm/q9wHNVmSuqTfW8PzeAl25/qRgz63w QTJ8aZxZgau8zS3RgeKsS24CF+aXnmzGAJRolhj0DXnwDz00DVeuAJTqv6pn2VRk/I1S CUpg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1747649733; x=1748254533; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=gQIoahuutc2qqjFxwM4CJBJC7cg2fQ/5cUj9Q0XSXuA=; b=MYOBoVHk2gmHVlskC2Tl0avdbkV/qEW+7Ug4zsOmLNAhrnBLqnZBWI+ea0I1MWvDf9 VTORvApCQQRsis5IuSqCwnbYVsBhmjYWdoL4hDneLvCaFBVpkD2YeI7MAwHjbb5/iwSf 2UxhfGZ/pTFS5M7/kcJuKvntIP1tgg7u0lT1dMJoDCi4ZemHjEpVlk6YBN2YJH4F7hfn y6qV/P/gsUCPAIpaxoMYuKIpY7MAxlbyafTnUpW1U0RJmfP5RbxRGFLQyvNQNlr+5WfJ 9bhcEyHzDFCdQnMlofwLVgNuYcB/Z7Oq1eoQhkmOFwGUnm3cK6l0HLjomdcEMg/makiF f9WA== X-Forwarded-Encrypted: i=1; AJvYcCX4F6hLq+p5FQl4K6a4Pgsyrz9ngPYRCHinklIgghukHykogBgJDq3AqPZOklNE40+P6xDYKr43OI8MoiQ=@vger.kernel.org X-Gm-Message-State: AOJu0Yxw/hXirPyIhPAdxmM/3D+W77WVcVdU9i9fazE6WPpCQ7SN8gl8 zRiuWoJbPdPg4R627BsNvZQ5OQI+L+eq6xslDNgCxugY4u3I3xEr7l+TwHYlPEr8A5Q= X-Gm-Gg: ASbGncv83ZOgCJpdFrZMx/arj4HRudu8Ykt42ZUj9xWWmuNxuzYcj4kKg2LAPtiOVot YiNcWG2cDXxY4xh/P+hMCw5ghwjdmkUvR4Kv5fFzRIt6lRzETS8y1IOA+cMQ6RAdsuDL+KigRcg V7e3rxrvFu56735yKinP068Qv348OLdkHgjRmh2udXkB2fWwFJ87nJPbRbFbZm7UxKBSlnc0wgP UTI22XsBKOWTxSbyvpQH+h2kImymoVsgb+hjlxxWUg9w6cGdNxAH4gMfvOQX1vobC1A6+UKHlOz iIrAn86LbiwZLWMQc5vYI2MQbeUzrF0yN/o67tc2wp0D0+kiXvGkJ+jrIHAR+fNv5Bayejjqjy4 Kmc8T2Cxa8o4eYREiiA+YGvma5iI4s8A= X-Google-Smtp-Source: AGHT+IGu8R0zvZTDHBzZBbCIHqlkqesk+rlx3McpD3Lqxw7BERLyITjAkkGT0uILmEOlJzPwfPVziw== X-Received: by 2002:a05:6000:18ab:b0:3a3:6e23:3a46 with SMTP id ffacd0b85a97d-3a36e233c0amr3159410f8f.43.1747649733123; Mon, 19 May 2025 03:15:33 -0700 (PDT) Received: from [192.168.0.2] (host-80-116-51-117.retail.telecomitalia.it. [80.116.51.117]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3a35ca4d105sm12499021f8f.11.2025.05.19.03.15.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 May 2025 03:15:32 -0700 (PDT) From: Angelo Dureghello X-Google-Original-From: Angelo Dureghello Date: Mon, 19 May 2025 12:13:39 +0200 Subject: [PATCH v5 2/5] iio: core: add ADC delay calibration definition Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250519-wip-bl-ad7606-calibration-v5-2-4054fc7c9f3d@baylibre.com> References: <20250519-wip-bl-ad7606-calibration-v5-0-4054fc7c9f3d@baylibre.com> In-Reply-To: <20250519-wip-bl-ad7606-calibration-v5-0-4054fc7c9f3d@baylibre.com> To: Jonathan Cameron , David Lechner , =?utf-8?q?Nuno_S=C3=A1?= , Andy Shevchenko , Lars-Peter Clausen , Michael Hennerich , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, Michael Hennerich , devicetree@vger.kernel.org, Angelo Dureghello X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=1303; i=adureghello@baylibre.com; h=from:subject:message-id; bh=4Hb5fAw6wk9UOyjGvMGWLBgqM5yKlaYwdF7azoNoMts=; b=owGbwMvMwCXGf3bn1e/btlsznlZLYsjQZknWdBb10+eLTHMInXtz9tqvJy6+j11aG8stJiEsd 4hF+2JoRykLgxgXg6yYIktdYoRJ6O1QKeUFjLNh5rAygQxh4OIUgIkUuTAyrHvpdtLp0sXLfz4k 96tzf2PaFlshFFHgPVmt3yneJsMul5Hh0+uFbCKH2bPXOywXfOXcYtP3IiGa8dwB7rCipbHWn7/ zAQA= X-Developer-Key: i=adureghello@baylibre.com; a=openpgp; fpr=703CDFAD8B573EB00850E38366D1CB9419AF3953 From: Angelo Dureghello ADCs as ad7606 implement a phase calibration as a delay. Add such definition, needed for ad7606. Signed-off-by: Angelo Dureghello --- drivers/iio/industrialio-core.c | 1 + include/linux/iio/types.h | 1 + 2 files changed, 2 insertions(+) diff --git a/drivers/iio/industrialio-core.c b/drivers/iio/industrialio-cor= e.c index 178e99b111debc59a247fcc3a6037e429db3bebf..f13c3aa470d774bfe655d6a9fb0= 0c263789db637 100644 --- a/drivers/iio/industrialio-core.c +++ b/drivers/iio/industrialio-core.c @@ -188,6 +188,7 @@ static const char * const iio_chan_info_postfix[] =3D { [IIO_CHAN_INFO_CALIBAMBIENT] =3D "calibambient", [IIO_CHAN_INFO_ZEROPOINT] =3D "zeropoint", [IIO_CHAN_INFO_TROUGH] =3D "trough_raw", + [IIO_CHAN_INFO_CONVDELAY] =3D "convdelay", }; /** * iio_device_id() - query the unique ID for the device diff --git a/include/linux/iio/types.h b/include/linux/iio/types.h index d89982c98368cf72c0fc30fa66ab001e48af4e8b..ad2761efcc8315e1f9907d2a715= 9447fb463333e 100644 --- a/include/linux/iio/types.h +++ b/include/linux/iio/types.h @@ -69,6 +69,7 @@ enum iio_chan_info_enum { IIO_CHAN_INFO_CALIBAMBIENT, IIO_CHAN_INFO_ZEROPOINT, IIO_CHAN_INFO_TROUGH, + IIO_CHAN_INFO_CONVDELAY, }; =20 #endif /* _IIO_TYPES_H_ */ --=20 2.49.0 From nobody Fri Dec 19 15:49:46 2025 Received: from mail-wr1-f44.google.com (mail-wr1-f44.google.com [209.85.221.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 6FD72274640 for ; Mon, 19 May 2025 10:15:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.44 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1747649739; cv=none; b=HXQR5qia80s1JgKgFpJUf72Pq5L0ALG+6+A9boiCvyC8Y5/OTanZOFesKVqVmC+HrXTjCHyLAF97I1vL6cIn/9wY0v9sBvVV/RDo19BWJ/y0EWqk8CJCo9sMr7AQFzVwYhafXy/E6cvuPEGIUT6Gz7NSDOqBa7kYqPRP+2GF5RE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1747649739; c=relaxed/simple; bh=wFvmJ2ACA7EcnRy+JbYqGuFYcaPQEaBgFiYTUS/HW9c=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=K3jzWNSTGOwZr3IXHg1kit/FABfWiEqPacttQHiD58aikAz3tjiyhV0ommAW9FqAtyTtcOY0sLFDyorFVe7F8H9MpO5/tAreTCYVXANHvNte9Bg4AmELcn4ESPGKcEtTWUUAQw5swya8PPeKsDy/dRc+en7o+++yb5vLnyRxVnM= 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=G8w7mpQL; arc=none smtp.client-ip=209.85.221.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="G8w7mpQL" Received: by mail-wr1-f44.google.com with SMTP id ffacd0b85a97d-3a0b9af89f2so2960066f8f.3 for ; Mon, 19 May 2025 03:15:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1747649734; x=1748254534; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=qyu12fLUZxKWxsPKsBRvp8YH/7xIo9JB/uB2j02OcJk=; b=G8w7mpQLt8jdj/y9BSDVk2lcY4I6M+CjtVySleKwKPhN9Ro4gwSJFyWI88DYpVFZRZ hNztZKuUNk2GaTgyUrHq+IJjiClNv6QO0VrYpBtpP7X44oRXnbBE2IXLmGngm234Xwbu EofNG6NPyTlxfT+SRzrBlG/Zij0Tggg77LiQ36rBwG/DeeqqD+AZ//uCOAA8Uqjc0FW0 bm+S8eg211cTB2nVdnv9kCrOGk//x1++TuQZJCL+AED2KlXCVREhWcfgvA4/jl9Vp6dz sE7+JrRigAJnjdsZRLdVKKgxSNv/K9MYntyjkydThSVst6lg3Dx6gZ3sHWYANEzOTUUy NX5g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1747649734; x=1748254534; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=qyu12fLUZxKWxsPKsBRvp8YH/7xIo9JB/uB2j02OcJk=; b=NfptfdlSIaW/U5KumLuTUGFd/M9XL0yeSyzqEsA03xOJ+K43KfLQ/KTZqXOk8dvobu s8PMTHqCuxsacRzYm3Fb1A/7fn7knxsEVHllmhTeCl4HJWWH5PksbmYfq/1BOEguGeNQ Bmd5PAZscVQdNy6jQBebLMk4PsakvxhkY06WYbsuzeS3Tr1tQgiPHz7nLFQqqrcUlum8 UCsL1/6rCOI6fqQZ1vMdeTHWZ9ADfAGiyEBcSlUIYij7eX86fOj0HMqTqFq1MKTn19fO i1j8fa9cb0Y0pnjv0TbKmRcMtNyO1LAf8SIjej3uXTSvHdeolh7vWe8yUp7Ndv8nQBSP 6wPA== X-Forwarded-Encrypted: i=1; AJvYcCW9WSoJawRgCDO/FBfxsytqx74Bf7gkRWkUuooI5GvMkSIBJpjSE1RIM7NK+T0MGvrdnzSQ9iGWUUAOJOs=@vger.kernel.org X-Gm-Message-State: AOJu0Ywk7Y+hlGOttVnO9lQkxnqSe5Y1wWXiYnZTxDX6D16hXaHalRPb yFrpokcpZBDbSXVOPCP6JNkBT0SuXzeVPwu26nJPjXBnFKo2uNwEvGOShDbPsRsOFOg= X-Gm-Gg: ASbGncv3IRI/Tg7Tj0tKtnH90okr8QVuiLX8ru8ep81YyZojvgHcqaviThLf5Ref2OR NB6yKp4nKELuJJclQq0mRFaieK8wyuknqrFHp//p2bvstdSS5k51wKIL9hx9vJd5sLBB7BHwRbu 83xd+IgBp0GCauXsRPt3M/2YazCHWyZx5JFPI62ySU1suRy/oij/+foTv54ujY0XgYtXjRl7lEt Kpg/g8mxent3tlWzyL0wKG7Zo8hY6GM866L+kzu6pZBfz/BxLAJRFdu9JyoDrbMTpAP0fS7apDP +1Ee2Y0H+4eLsjzLFrWAgeqcxE2YGfLLE6vJn7AujPByIMKpkpQQn+OzVJwF64L665gE9/DkBH5 pEblchxgPDsVZru9HZh22X2PkgyRn6W5hea/UXYfA3A== X-Google-Smtp-Source: AGHT+IFVA8Krbq0U/MkoEv0g1EKm6EL1bCCYIYAZSI9+ylLXsOpTf2hX9sn0DqCKWpgcTbV94KyClw== X-Received: by 2002:a05:6000:4284:b0:3a3:2aa5:11bc with SMTP id ffacd0b85a97d-3a3600db421mr8578049f8f.54.1747649734552; Mon, 19 May 2025 03:15:34 -0700 (PDT) Received: from [192.168.0.2] (host-80-116-51-117.retail.telecomitalia.it. [80.116.51.117]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3a35ca4d105sm12499021f8f.11.2025.05.19.03.15.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 May 2025 03:15:34 -0700 (PDT) From: Angelo Dureghello X-Google-Original-From: Angelo Dureghello Date: Mon, 19 May 2025 12:13:40 +0200 Subject: [PATCH v5 3/5] iio: adc: ad7606: add offset and phase calibration support Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250519-wip-bl-ad7606-calibration-v5-3-4054fc7c9f3d@baylibre.com> References: <20250519-wip-bl-ad7606-calibration-v5-0-4054fc7c9f3d@baylibre.com> In-Reply-To: <20250519-wip-bl-ad7606-calibration-v5-0-4054fc7c9f3d@baylibre.com> To: Jonathan Cameron , David Lechner , =?utf-8?q?Nuno_S=C3=A1?= , Andy Shevchenko , Lars-Peter Clausen , Michael Hennerich , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, Michael Hennerich , devicetree@vger.kernel.org, Angelo Dureghello X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=9455; i=adureghello@baylibre.com; h=from:subject:message-id; bh=7p7MAdn2ceJCkir2IZZuxGPKP4uvLOKDV4uGdI5qSy8=; b=owGbwMvMwCXGf3bn1e/btlsznlZLYsjQZsk0udX1IkS3fepEXlO9/pTiX4+Z7i7kPOu6aW7oT pnyV9tPdJSyMIhxMciKKbLUJUaYhN4OlVJewDgbZg4rE8gQBi5OAZiIsznDX5kZiekac7v36y79 yLRKXPZ+yjH2AJFJzl+0Y1hfLJ9g+Jbhr/DK5x8seOd6p1+0v3vjyI+e4wLHGjWDQxqZ2LR1IlL kmAA= X-Developer-Key: i=adureghello@baylibre.com; a=openpgp; fpr=703CDFAD8B573EB00850E38366D1CB9419AF3953 From: Angelo Dureghello Add support for offset and phase calibration, only for devices that support software mode, that are: ad7606b ad7606c-16 ad7606c-18 Tested-by: David Lechner Reviewed-by: Nuno S=C3=A1 Signed-off-by: Angelo Dureghello --- drivers/iio/adc/ad7606.c | 160 +++++++++++++++++++++++++++++++++++++++++++= ++++ drivers/iio/adc/ad7606.h | 9 +++ 2 files changed, 169 insertions(+) diff --git a/drivers/iio/adc/ad7606.c b/drivers/iio/adc/ad7606.c index 2aa59481c52c07537110e7fc1fd1aedbab6b098d..bb0c89fc618874f4a5948d8e537= 716f87127bc92 100644 --- a/drivers/iio/adc/ad7606.c +++ b/drivers/iio/adc/ad7606.c @@ -95,6 +95,22 @@ static const unsigned int ad7616_oversampling_avail[8] = =3D { 1, 2, 4, 8, 16, 32, 64, 128, }; =20 +static const int ad7606_calib_offset_avail[3] =3D { + -128, 1, 127, +}; + +static const int ad7606c_18bit_calib_offset_avail[3] =3D { + -512, 4, 508, +}; + +static const int ad7606b_calib_phase_avail[][2] =3D { + { 0, 0 }, { 0, 1250 }, { 0, 318750 }, +}; + +static const int ad7606c_calib_phase_avail[][2] =3D { + { 0, 0 }, { 0, 1000 }, { 0, 255000 }, +}; + static int ad7606c_18bit_chan_scale_setup(struct iio_dev *indio_dev, struct iio_chan_spec *chan); static int ad7606c_16bit_chan_scale_setup(struct iio_dev *indio_dev, @@ -164,6 +180,8 @@ const struct ad7606_chip_info ad7606b_info =3D { .scale_setup_cb =3D ad7606_16bit_chan_scale_setup, .sw_setup_cb =3D ad7606b_sw_mode_setup, .offload_storagebits =3D 32, + .calib_offset_avail =3D ad7606_calib_offset_avail, + .calib_phase_avail =3D ad7606b_calib_phase_avail, }; EXPORT_SYMBOL_NS_GPL(ad7606b_info, "IIO_AD7606"); =20 @@ -177,6 +195,8 @@ const struct ad7606_chip_info ad7606c_16_info =3D { .scale_setup_cb =3D ad7606c_16bit_chan_scale_setup, .sw_setup_cb =3D ad7606b_sw_mode_setup, .offload_storagebits =3D 32, + .calib_offset_avail =3D ad7606_calib_offset_avail, + .calib_phase_avail =3D ad7606c_calib_phase_avail, }; EXPORT_SYMBOL_NS_GPL(ad7606c_16_info, "IIO_AD7606"); =20 @@ -226,6 +246,8 @@ const struct ad7606_chip_info ad7606c_18_info =3D { .scale_setup_cb =3D ad7606c_18bit_chan_scale_setup, .sw_setup_cb =3D ad7606b_sw_mode_setup, .offload_storagebits =3D 32, + .calib_offset_avail =3D ad7606c_18bit_calib_offset_avail, + .calib_phase_avail =3D ad7606c_calib_phase_avail, }; EXPORT_SYMBOL_NS_GPL(ad7606c_18_info, "IIO_AD7606"); =20 @@ -683,6 +705,40 @@ static int ad7606_scan_direct(struct iio_dev *indio_de= v, unsigned int ch, return ret; } =20 +static int ad7606_get_calib_offset(struct ad7606_state *st, int ch, int *v= al) +{ + int ret; + + ret =3D st->bops->reg_read(st, AD7606_CALIB_OFFSET(ch)); + if (ret < 0) + return ret; + + *val =3D st->chip_info->calib_offset_avail[0] + + ret * st->chip_info->calib_offset_avail[1]; + + return 0; +} + +static int ad7606_get_calib_phase(struct ad7606_state *st, int ch, int *va= l, + int *val2) +{ + int ret; + + ret =3D st->bops->reg_read(st, AD7606_CALIB_PHASE(ch)); + if (ret < 0) + return ret; + + *val =3D 0; + + /* + * ad7606b: phase delay from 0 to 318.75 =CE=BCs in steps of 1.25 =CE=BCs. + * ad7606c-16/18: phase delay from 0 =C2=B5s to 255 =C2=B5s in steps of 1= =C2=B5s. + */ + *val2 =3D ret * st->chip_info->calib_phase_avail[1][1]; + + return 0; +} + static int ad7606_read_raw(struct iio_dev *indio_dev, struct iio_chan_spec const *chan, int *val, @@ -717,6 +773,22 @@ static int ad7606_read_raw(struct iio_dev *indio_dev, pwm_get_state(st->cnvst_pwm, &cnvst_pwm_state); *val =3D DIV_ROUND_CLOSEST_ULL(NSEC_PER_SEC, cnvst_pwm_state.period); return IIO_VAL_INT; + case IIO_CHAN_INFO_CALIBBIAS: + if (!iio_device_claim_direct(indio_dev)) + return -EBUSY; + ret =3D ad7606_get_calib_offset(st, chan->scan_index, val); + iio_device_release_direct(indio_dev); + if (ret) + return ret; + return IIO_VAL_INT; + case IIO_CHAN_INFO_CONVDELAY: + if (!iio_device_claim_direct(indio_dev)) + return -EBUSY; + ret =3D ad7606_get_calib_phase(st, chan->scan_index, val, val2); + iio_device_release_direct(indio_dev); + if (ret) + return ret; + return IIO_VAL_INT_PLUS_NANO; } return -EINVAL; } @@ -767,6 +839,64 @@ static int ad7606_write_os_hw(struct iio_dev *indio_de= v, int val) return 0; } =20 +static int ad7606_set_calib_offset(struct ad7606_state *st, int ch, int va= l) +{ + int start_val, step_val, stop_val; + int offset; + + start_val =3D st->chip_info->calib_offset_avail[0]; + step_val =3D st->chip_info->calib_offset_avail[1]; + stop_val =3D st->chip_info->calib_offset_avail[2]; + + if (val < start_val || val > stop_val) + return -EINVAL; + + offset =3D (val - start_val) / step_val; + + return st->bops->reg_write(st, AD7606_CALIB_OFFSET(ch), offset); +} + +static int ad7606_set_calib_phase(struct ad7606_state *st, int ch, int val, + int val2) +{ + int wreg, start_ns, step_ns, stop_ns; + + if (val !=3D 0) + return -EINVAL; + + start_ns =3D st->chip_info->calib_phase_avail[0][1]; + step_ns =3D st->chip_info->calib_phase_avail[1][1]; + stop_ns =3D st->chip_info->calib_phase_avail[2][1]; + + /* + * ad7606b: phase delay from 0 to 318.75 =CE=BCs in steps of 1.25 =CE=BCs. + * ad7606c-16/18: phase delay from 0 =C2=B5s to 255 =C2=B5s in steps of 1= =C2=B5s. + */ + if (val2 < start_ns || val2 > stop_ns) + return -EINVAL; + + wreg =3D val2 / step_ns; + + return st->bops->reg_write(st, AD7606_CALIB_PHASE(ch), wreg); +} + +static int ad7606_write_raw_get_fmt(struct iio_dev *indio_dev, + struct iio_chan_spec const *chan, long info) +{ + switch (info) { + case IIO_CHAN_INFO_SCALE: + return IIO_VAL_INT_PLUS_MICRO; + case IIO_CHAN_INFO_SAMP_FREQ: + case IIO_CHAN_INFO_OVERSAMPLING_RATIO: + case IIO_CHAN_INFO_CALIBBIAS: + return IIO_VAL_INT; + case IIO_CHAN_INFO_CONVDELAY: + return IIO_VAL_INT_PLUS_NANO; + default: + return -EINVAL; + } +} + static int ad7606_write_raw(struct iio_dev *indio_dev, struct iio_chan_spec const *chan, int val, @@ -820,6 +950,18 @@ static int ad7606_write_raw(struct iio_dev *indio_dev, if (val < 0 && val2 !=3D 0) return -EINVAL; return ad7606_set_sampling_freq(st, val); + case IIO_CHAN_INFO_CALIBBIAS: + if (!iio_device_claim_direct(indio_dev)) + return -EBUSY; + ret =3D ad7606_set_calib_offset(st, chan->scan_index, val); + iio_device_release_direct(indio_dev); + return ret; + case IIO_CHAN_INFO_CONVDELAY: + if (!iio_device_claim_direct(indio_dev)) + return -EBUSY; + ret =3D ad7606_set_calib_phase(st, chan->scan_index, val, val2); + iio_device_release_direct(indio_dev); + return ret; default: return -EINVAL; } @@ -998,6 +1140,14 @@ static int ad7606_read_avail(struct iio_dev *indio_de= v, *type =3D IIO_VAL_INT_PLUS_MICRO; =20 return IIO_AVAIL_LIST; + case IIO_CHAN_INFO_CALIBBIAS: + *vals =3D st->chip_info->calib_offset_avail; + *type =3D IIO_VAL_INT; + return IIO_AVAIL_RANGE; + case IIO_CHAN_INFO_CONVDELAY: + *vals =3D (const int *)st->chip_info->calib_phase_avail; + *type =3D IIO_VAL_INT_PLUS_NANO; + return IIO_AVAIL_RANGE; } return -EINVAL; } @@ -1060,6 +1210,7 @@ static const struct iio_info ad7606_info_sw_mode =3D { .read_raw =3D &ad7606_read_raw, .write_raw =3D &ad7606_write_raw, .read_avail =3D &ad7606_read_avail, + .write_raw_get_fmt =3D ad7606_write_raw_get_fmt, .debugfs_reg_access =3D &ad7606_reg_access, .validate_trigger =3D &ad7606_validate_trigger, .update_scan_mode =3D &ad7606_update_scan_mode, @@ -1252,6 +1403,15 @@ static int ad7606_probe_channels(struct iio_dev *ind= io_dev) chan->info_mask_separate_available |=3D BIT(IIO_CHAN_INFO_SCALE); =20 + if (st->chip_info->calib_offset_avail) { + chan->info_mask_separate |=3D + BIT(IIO_CHAN_INFO_CALIBBIAS) | + BIT(IIO_CHAN_INFO_CONVDELAY); + chan->info_mask_separate_available |=3D + BIT(IIO_CHAN_INFO_CALIBBIAS) | + BIT(IIO_CHAN_INFO_CONVDELAY); + } + /* * All chips with software mode support oversampling, * so we skip the oversampling_available check. And the diff --git a/drivers/iio/adc/ad7606.h b/drivers/iio/adc/ad7606.h index 441e62c521bcbea69b4f70bb2d55f65334d22276..f613583a7fa4095115b0b28e3f8= e51cd32b93524 100644 --- a/drivers/iio/adc/ad7606.h +++ b/drivers/iio/adc/ad7606.h @@ -40,6 +40,11 @@ #define AD7606_RANGE_CH_ADDR(ch) (0x03 + ((ch) >> 1)) #define AD7606_OS_MODE 0x08 =20 +#define AD7606_CALIB_GAIN(ch) (0x09 + (ch)) +#define AD7606_CALIB_GAIN_MASK GENMASK(5, 0) +#define AD7606_CALIB_OFFSET(ch) (0x11 + (ch)) +#define AD7606_CALIB_PHASE(ch) (0x19 + (ch)) + struct ad7606_state; =20 typedef int (*ad7606_scale_setup_cb_t)(struct iio_dev *indio_dev, @@ -61,6 +66,8 @@ typedef int (*ad7606_sw_setup_cb_t)(struct iio_dev *indio= _dev); * @init_delay_ms: required delay in milliseconds for initialization * after a restart * @offload_storagebits: storage bits used by the offload hw implementation + * @calib_offset_avail: pointer to offset calibration range/limits array + * @calib_phase_avail: pointer to phase calibration range/limits array */ struct ad7606_chip_info { unsigned int max_samplerate; @@ -74,6 +81,8 @@ struct ad7606_chip_info { bool os_req_reset; unsigned long init_delay_ms; u8 offload_storagebits; + const int *calib_offset_avail; + const int (*calib_phase_avail)[2]; }; =20 /** --=20 2.49.0 From nobody Fri Dec 19 15:49:46 2025 Received: from mail-wr1-f50.google.com (mail-wr1-f50.google.com [209.85.221.50]) (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 93166274FE2 for ; Mon, 19 May 2025 10:15:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.50 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1747649739; cv=none; b=XcfcR/aFJJvqddT/ETQwUzlv5lVbE71lB2q0geXDGeCjnM3iVd4r+3jDyOT+q2Jqtq79boh8BB+i8iSNCMwnegKzVThV00Ana4N4DojplCsItzeieSMKE/u+SC2yVSR9F3pjAglIKi+/gZfhQAlfVWxRKGIpvqA4PeftuQ0qde0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1747649739; c=relaxed/simple; bh=NtotUFQE861trIH/6KVUMJlh1RHFkSekY2PpGsDNTzs=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=MDPv9FNeUY9UEG3qWaXbflxyuN9JkojdBlrtSwkYw5FbOO7gUsbgpWgTTRWlIEcVo7FltWKy9/9Zz715TTM9kFXwfbeKshnhdUIbe+oKKprWZWsgnzSTIxvLRkTqQh3m1m31zKfeu3LkY2wxGKCyHdAj34McZUiroMwpLXSNBTw= 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=S77uXptW; arc=none smtp.client-ip=209.85.221.50 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="S77uXptW" Received: by mail-wr1-f50.google.com with SMTP id ffacd0b85a97d-3a36abf5df9so842364f8f.0 for ; Mon, 19 May 2025 03:15:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1747649736; x=1748254536; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=SSPYC82OHD2BI/YU/tjmuoLa3AQcRKZBypSGl/10x2A=; b=S77uXptWy4SfZBZU3DQgoAPg4xDp8r41EIOQdZQXzuENOOc7PBd+VFyUU+irlv54oI j+Zr8d8QCyZn9hvoUz032sYhZCP/ol/4eoDSs2UjrktGez0Cq1cUgIn3qQvQ4+XjT1w7 PgyaexWsIRwwndy950Ktac7HxF9HBhPquuYPLKWUzewMjBMGpzlbY5kXh1S5Bcq0+/9f 93teAzmYCS2r2jMA8Pdm8KTr/cT4OUCYhdGbOIPFlRmX1IsLA3vnMPdp6qOGATkpTeiW zmSG2I/GM2KrjuO2rF9D2dFq12exTv9j8PRewFjK+uSYVZ+pXOO9Z2e68AfgOAY02J09 LgCw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1747649736; x=1748254536; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=SSPYC82OHD2BI/YU/tjmuoLa3AQcRKZBypSGl/10x2A=; b=g4bTULcdQHnqE8O21TR8BJO9hA/j712GQRKRYm9GujA40J0Z2Wo0dQDNc7irzaN7dW Qo/hLCimQ05dTglBLeeJSm+gZUBZOqPP8T3T5cpHd1v5K7r+VgCgbhuMBdliRvWU0Gbk PLCZ50wHsen/VnAjFsYv+gz5LvU8WHFeTwuywLs85uxG8DaOZa46GtKPV4AOxZpXPWHh OXzydjdZYGX6SK40TU6P5yIB+cQ6jhZHEfdMxkopFD/j38n6ph1XQGnHMN60UjtMu7YO OVaO1WqMWRdDn9+otviS6E5IEkqJUBzO+uSFcHYQrF+awHqX2WHqjdNlLADjCgECwRO4 ea9w== X-Forwarded-Encrypted: i=1; AJvYcCWIHMhau5Cmt2xLlNjUNTxFa8tefUQYl9AzbaQ4ZW0/p9e3w0j1yAcbcJ4u9BAK++oJwa+DRUh2bidvQIs=@vger.kernel.org X-Gm-Message-State: AOJu0Yy5QyRdwC3Qzy1rDJeM4OPbOrqzGP9d24c7fs+mlFMFMtVRHgyN yp1MWmynpOrh72uEABgvUU6lbTBWiXQdfl3sqikNbMsrIVSpo5K+JRs8e25mH8D0zIk= X-Gm-Gg: ASbGnctapBrAoLhQSc4YAWr5qpyAAC1saX/sZy+i/XU4VTkPe5j+ArXxMg7fAKlSRjn ZyS5VxMVwTRc1+HbFm/twCSq3vnX8v4JjRklyo637NcGCnYIaFSvlI83odFMUXWsXUpLJxLWpzi QxQTBi2sS/k9wuyef5DUnEoAN27Hw5e5V+iiXetR0vjfFOTytm3LRfjR614MRfKCsjt9imbA+Ro 66NqgxpNI5Jz5SExbHdYb6jQs7lqolBqMVM2mW9X3owum6z99Q082R775XJwJeU8q0gSTvyvATd JBaIWT6n/TU79LhZE42mm8AJ4zQxDLCG1KMvY2fQuRn3Kyb7n5RXf5en2CWbYjdUvIgd5wy3not VShhs/WGi+I+EWZzCO+SKHCt3/Nh++50ukcqmvJVZdg== X-Google-Smtp-Source: AGHT+IER7v6KyF/cbFUflH1Cc5yxc79s6LmvGLxj7K8QrO5yV9tOzOi8ElwaaFJqW3KLhGCvw0DKcw== X-Received: by 2002:a05:6000:2203:b0:3a3:4220:1bb0 with SMTP id ffacd0b85a97d-3a351210b0cmr13037471f8f.18.1747649735930; Mon, 19 May 2025 03:15:35 -0700 (PDT) Received: from [192.168.0.2] (host-80-116-51-117.retail.telecomitalia.it. [80.116.51.117]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3a35ca4d105sm12499021f8f.11.2025.05.19.03.15.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 May 2025 03:15:35 -0700 (PDT) From: Angelo Dureghello X-Google-Original-From: Angelo Dureghello Date: Mon, 19 May 2025 12:13:41 +0200 Subject: [PATCH v5 4/5] dt-bindings: iio: adc: adi,ad7606: add gain calibration support Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250519-wip-bl-ad7606-calibration-v5-4-4054fc7c9f3d@baylibre.com> References: <20250519-wip-bl-ad7606-calibration-v5-0-4054fc7c9f3d@baylibre.com> In-Reply-To: <20250519-wip-bl-ad7606-calibration-v5-0-4054fc7c9f3d@baylibre.com> To: Jonathan Cameron , David Lechner , =?utf-8?q?Nuno_S=C3=A1?= , Andy Shevchenko , Lars-Peter Clausen , Michael Hennerich , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, Michael Hennerich , devicetree@vger.kernel.org, Angelo Dureghello , Conor Dooley X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=2030; i=adureghello@baylibre.com; h=from:subject:message-id; bh=mK1GoQiX2hS20/yC/1czrPjfc5t1uAwSltJDkMx72Mc=; b=kA0DAAoWD8251fe2tzsByyZiAGgrBG+iKGbgWUSFybbH+6dfsu4AgBRpoFXy+9C4B77kkSgop 4h1BAAWCgAdFiEEfmFYNFXbVRojoAGbD8251fe2tzsFAmgrBG8ACgkQD8251fe2tzvMrQD/Y8la WNUyw+5EqyElHuvKyoanDisVpJErB+/EOybLdtYBALcSFi3i1HOTJo9aYn+snFEKMixSwYVTDrK R6mSPW0YB X-Developer-Key: i=adureghello@baylibre.com; a=openpgp; fpr=703CDFAD8B573EB00850E38366D1CB9419AF3953 From: Angelo Dureghello Add gain calibration support by a per-channel resistor value. Acked-by: Conor Dooley Signed-off-by: Angelo Dureghello --- .../devicetree/bindings/iio/adc/adi,ad7606.yaml | 29 ++++++++++++++++++= ++++ 1 file changed, 29 insertions(+) diff --git a/Documentation/devicetree/bindings/iio/adc/adi,ad7606.yaml b/Do= cumentation/devicetree/bindings/iio/adc/adi,ad7606.yaml index 29f12d650442b8ff2eb455306ce59a0e87867ddd..6926f5f090ad6bbbe7bfd9327dc= 5ae17dafcd1fd 100644 --- a/Documentation/devicetree/bindings/iio/adc/adi,ad7606.yaml +++ b/Documentation/devicetree/bindings/iio/adc/adi,ad7606.yaml @@ -204,6 +204,15 @@ patternProperties: considered a bipolar differential channel. Otherwise it is bipol= ar single-ended. =20 + adi,rfilter-ohms: + description: + For ADCs that supports gain calibration, this property must be s= et to + the value of the external RFilter resistor. Proper gain error + correction is applied based on this value. + default: 0 + minimum: 0 + maximum: 64512 + required: - reg - bipolar @@ -256,6 +265,25 @@ allOf: properties: adi,oversampling-ratio-gpios: false =20 + - if: + properties: + compatible: + contains: + enum: + - adi,ad7605-4 + - adi,ad7606-4 + - adi,ad7606-6 + - adi,ad7606-8 + - adi,ad7607 + - adi,ad7608 + - adi,ad7609 + - adi,ad7616 + then: + patternProperties: + "^channel@[0-9a-f]+$": + properties: + adi,rfilter-ohms: false + - if: properties: compatible: @@ -398,6 +426,7 @@ examples: reg =3D <8>; diff-channels =3D <8 8>; bipolar; + adi,rfilter-ohms =3D <2048>; }; =20 }; --=20 2.49.0 From nobody Fri Dec 19 15:49:46 2025 Received: from mail-wr1-f52.google.com (mail-wr1-f52.google.com [209.85.221.52]) (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 5197B2749FC for ; Mon, 19 May 2025 10:15:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.52 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1747649741; cv=none; b=cIV1IgkuL/Nc4Ywot49Eu7E1hXUZrkiYcbRVsxXUfs0uZn7gf3ljRR5AXm42u0fHsNWzkFuXHZhNmHtVeeVhMDyc1S1qLOns32RMLXppabvB/UO/TQ1NqOHilEwsv7qPRv5uzb/GfvqWgaWp3WpU7+cUM/bmLfVrcXPq33eyFVQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1747649741; c=relaxed/simple; bh=k8C+7ZKPgiBvpe9orKJUPwV3VT8i/8pM3z/vkYUKVYg=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=FciEBiZgg1keu+yqxOthtyAWBdfxFlC318lbXBPE4BacoaJPH8giYZngbSPIxUu+AFtfo9N7GesBYTtv74c15APMH98RAYofuikwIJCrMXyfXWz/ehFARB1euBWLrYdX2tL0FYzfOFhT2XfUs3SBhKOoNjO4KZhgp9+gVyqKBME= 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=YjBN2vJ7; arc=none smtp.client-ip=209.85.221.52 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="YjBN2vJ7" Received: by mail-wr1-f52.google.com with SMTP id ffacd0b85a97d-3a375e72473so203844f8f.0 for ; Mon, 19 May 2025 03:15:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1747649737; x=1748254537; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=LDGwTef4sEIXmEjkxTASZN7dUj6mE4M4+Vtn0mnrAsA=; b=YjBN2vJ7jv9xZi6nNKa4Nrjghhd5zf8h9BGLuPTqvwgu2+iYWyg0jhsFVWEMB74ZuF 78hk/eRuc56MR2625uUm1G8mz78bT8EopumaUaLAdv/CQvCPQVNEbN0BmsirTaaf0C/t 26dW9PPLPLQOYDdZlRx9FJtUJqTpYytS5sOHvb5GjXQIcnBEzSdsnnDAzhG9TszcURx4 6M3mn6n70A50DiIewwTbyVldU5aQJxtntSBsSt+67qeHmMLG8vO5186D1GSxVKkxdl+r uK87z9a8KzvkPkBv3be0S3ohO87/RN54lyNbW0T4dt8CpzVvTobzv8ArtWTJMBjBbE/8 Z1Dw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1747649737; x=1748254537; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=LDGwTef4sEIXmEjkxTASZN7dUj6mE4M4+Vtn0mnrAsA=; b=KJchbQ9urQHi3j0VgqewQE/kO7TfnG5N6kiighP0+Jh7SGCNj27rTVBDSKgpstp4ym 0oMRCXla+XrEoJx6x+koUq4l5HGxnS2J4PUUOncpo1S73bV1GDSiAQ9eCs5dhExGWonr 3Ld7GNlydqFsCn7Yj4AbyOGV0xet+PRwjN8RhqYVEx92XC35402qHKKbIpzsV5YK5Xcn 4/mz2G9HaQFr2GQEGhv2TPpLS4/lu2uvWySkyOyocodLEMSHVzvcl+dDIKjiC92JxN9k qo9ZNKU6BUs/MCIuIAIE43YJ7h1na74wl5tz2bCOstPdf8luDsGpaKSs9XyQEvISlTlL xMbw== X-Forwarded-Encrypted: i=1; AJvYcCXRlSZD+mwsr4zUHwi62TPPBJx6U6EzMqKssA8sp5RWGiJY+M35uojqL0a1bRS2wPw3/owMIQsnxrLk2pI=@vger.kernel.org X-Gm-Message-State: AOJu0YzExPMAXtdNTygBR3AdQgppISHQvRvHlHw2POOrPsAk8kvL9sSk mqmGrE9A4LjmGwH9f1sUHvex2slugBxZf4nen+XxMu2Ame0I/biueOvtc+3jYZYoCdWHN0qpwiN 8QePi X-Gm-Gg: ASbGncsq7/3f+9E5fz/vDja1u42tNHwArnAGlXRZIYlFMT7a+cOC39yVy1e1xqG+p4D ARS1uF/VfvlwbeRxmpVH84T2HPB4m1u5wnAuB8wGsJYc0aQvlPNIYV5zKYVldi2aemIGxZaOSmQ L4tzDfrpYOVpMLdOPjF8eTIpzueGZHyFb3EbMmqpHXHm18FhelUcfbiuV0YTh65mkTlOXpPT1BM yPRvp3zVN+TYD0oTV8fJ8OKzVHr6/osC5HQaKr0Q07PQnG3x/7iBCdf8vel3GE45sod0154Ma/U qaxaidg7yGdVGf5KDU8PWvZR1JazO7Qc38k/oaZtUZzIu+G8oShI6CeVIQ5g5bzt9ujVV0p2Lre XU+HzSl1Y32Ql4gjWJK2IPual0HwKLWg= X-Google-Smtp-Source: AGHT+IG6untCYVljUwKCNJpWBawGnPsAus8uJcLZGOrYcJGO297sZTir+y1sKaGYKgA9M9Pqy5tNKQ== X-Received: by 2002:a5d:588d:0:b0:3a3:6cb6:defa with SMTP id ffacd0b85a97d-3a36cb6e114mr3852262f8f.40.1747649737411; Mon, 19 May 2025 03:15:37 -0700 (PDT) Received: from [192.168.0.2] (host-80-116-51-117.retail.telecomitalia.it. [80.116.51.117]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3a35ca4d105sm12499021f8f.11.2025.05.19.03.15.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 May 2025 03:15:36 -0700 (PDT) From: Angelo Dureghello X-Google-Original-From: Angelo Dureghello Date: Mon, 19 May 2025 12:13:42 +0200 Subject: [PATCH v5 5/5] iio: adc: ad7606: add gain calibration support Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250519-wip-bl-ad7606-calibration-v5-5-4054fc7c9f3d@baylibre.com> References: <20250519-wip-bl-ad7606-calibration-v5-0-4054fc7c9f3d@baylibre.com> In-Reply-To: <20250519-wip-bl-ad7606-calibration-v5-0-4054fc7c9f3d@baylibre.com> To: Jonathan Cameron , David Lechner , =?utf-8?q?Nuno_S=C3=A1?= , Andy Shevchenko , Lars-Peter Clausen , Michael Hennerich , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, Michael Hennerich , devicetree@vger.kernel.org, Angelo Dureghello X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=5809; i=adureghello@baylibre.com; h=from:subject:message-id; bh=U7IdkRU8bIy3slfzEZWptpFJZiO7glTgD+eqaNh8CLE=; b=owGbwMvMwCXGf3bn1e/btlsznlZLYsjQZimV4kq7kBW+7Nvj7LyOWw7eE+89+Nwq8213Tk3YB ckX95w+dZSyMIhxMciKKbLUJUaYhN4OlVJewDgbZg4rE8gQBi5OAZjISVmG/6n5d+8+3rzpTcci De77m/jqFrxjiT0+6alTxqK9Owp9p+ow/NOMdm25EC83t8Oh5ZJpwO+wQ/s2yeavcvU4uen+tKu 1K9kB X-Developer-Key: i=adureghello@baylibre.com; a=openpgp; fpr=703CDFAD8B573EB00850E38366D1CB9419AF3953 From: Angelo Dureghello Add gain calibration support, using resistor values set on devicetree, values to be set accordingly with ADC external RFilter, as explained in the ad7606c-16 datasheet, rev0, page 37. Usage example in the fdt yaml documentation. Tested-by: David Lechner Reviewed-by: Nuno S=C3=A1 Signed-off-by: Angelo Dureghello --- drivers/iio/adc/ad7606.c | 61 ++++++++++++++++++++++++++++++++++++++++++++= ++++ drivers/iio/adc/ad7606.h | 3 +++ 2 files changed, 64 insertions(+) diff --git a/drivers/iio/adc/ad7606.c b/drivers/iio/adc/ad7606.c index bb0c89fc618874f4a5948d8e537716f87127bc92..19802bb7ec6624203b50589b6b7= 6085c9f2f9628 100644 --- a/drivers/iio/adc/ad7606.c +++ b/drivers/iio/adc/ad7606.c @@ -33,6 +33,10 @@ =20 #include "ad7606.h" =20 +#define AD7606_CALIB_GAIN_MIN 0 +#define AD7606_CALIB_GAIN_STEP 1024 +#define AD7606_CALIB_GAIN_MAX (63 * AD7606_CALIB_GAIN_STEP) + /* * Scales are computed as 5000/32768 and 10000/32768 respectively, * so that when applied to the raw values they provide mV values. @@ -125,6 +129,7 @@ static int ad7609_chan_scale_setup(struct iio_dev *indi= o_dev, struct iio_chan_spec *chan); static int ad7616_sw_mode_setup(struct iio_dev *indio_dev); static int ad7606b_sw_mode_setup(struct iio_dev *indio_dev); +static int ad7606_chan_calib_gain_setup(struct iio_dev *indio_dev); =20 const struct ad7606_chip_info ad7605_4_info =3D { .max_samplerate =3D 300 * KILO, @@ -180,6 +185,7 @@ const struct ad7606_chip_info ad7606b_info =3D { .scale_setup_cb =3D ad7606_16bit_chan_scale_setup, .sw_setup_cb =3D ad7606b_sw_mode_setup, .offload_storagebits =3D 32, + .calib_gain_setup_cb =3D ad7606_chan_calib_gain_setup, .calib_offset_avail =3D ad7606_calib_offset_avail, .calib_phase_avail =3D ad7606b_calib_phase_avail, }; @@ -195,6 +201,7 @@ const struct ad7606_chip_info ad7606c_16_info =3D { .scale_setup_cb =3D ad7606c_16bit_chan_scale_setup, .sw_setup_cb =3D ad7606b_sw_mode_setup, .offload_storagebits =3D 32, + .calib_gain_setup_cb =3D ad7606_chan_calib_gain_setup, .calib_offset_avail =3D ad7606_calib_offset_avail, .calib_phase_avail =3D ad7606c_calib_phase_avail, }; @@ -246,6 +253,7 @@ const struct ad7606_chip_info ad7606c_18_info =3D { .scale_setup_cb =3D ad7606c_18bit_chan_scale_setup, .sw_setup_cb =3D ad7606b_sw_mode_setup, .offload_storagebits =3D 32, + .calib_gain_setup_cb =3D ad7606_chan_calib_gain_setup, .calib_offset_avail =3D ad7606c_18bit_calib_offset_avail, .calib_phase_avail =3D ad7606c_calib_phase_avail, }; @@ -357,6 +365,52 @@ static int ad7606_get_chan_config(struct iio_dev *indi= o_dev, int ch, return 0; } =20 +static int ad7606_chan_calib_gain_setup(struct iio_dev *indio_dev) +{ + struct ad7606_state *st =3D iio_priv(indio_dev); + unsigned int num_channels =3D st->chip_info->num_adc_channels; + struct device *dev =3D st->dev; + int ret; + + /* + * This function is called once, and parses all the channel nodes, + * so continuing on next channel node on errors, informing of them. + */ + device_for_each_child_node_scoped(dev, child) { + u32 reg, r_gain; + + ret =3D fwnode_property_read_u32(child, "reg", ®); + if (ret) + continue; + + /* Chan reg is a 1-based index. */ + if (reg < 1 || reg > num_channels) { + dev_warn(dev, "wrong ch number (ignoring): %d\n", reg); + continue; + } + + ret =3D fwnode_property_read_u32(child, "adi,rfilter-ohms", + &r_gain); + if (ret) + /* Keep the default register value. */ + continue; + + if (r_gain > AD7606_CALIB_GAIN_MAX) { + dev_warn(dev, "wrong gain calibration value"); + continue; + } + + ret =3D st->bops->reg_write(st, AD7606_CALIB_GAIN(reg - 1), + DIV_ROUND_CLOSEST(r_gain, AD7606_CALIB_GAIN_STEP)); + if (ret) { + dev_warn(dev, "error writing r_gain"); + continue; + } + } + + return 0; +} + static int ad7606c_18bit_chan_scale_setup(struct iio_dev *indio_dev, struct iio_chan_spec *chan) { @@ -1448,6 +1502,13 @@ static int ad7606_probe_channels(struct iio_dev *ind= io_dev) if (slow_bus) channels[i] =3D (struct iio_chan_spec)IIO_CHAN_SOFT_TIMESTAMP(i); =20 + /* Setting up gain calibration for all channels. */ + if (st->sw_mode_en && st->chip_info->calib_offset_avail) { + ret =3D st->chip_info->calib_gain_setup_cb(indio_dev); + if (ret) + return ret; + } + indio_dev->channels =3D channels; =20 return 0; diff --git a/drivers/iio/adc/ad7606.h b/drivers/iio/adc/ad7606.h index f613583a7fa4095115b0b28e3f8e51cd32b93524..6313eea2bd0ccf97222a50dc26d= 8ec65042d0db7 100644 --- a/drivers/iio/adc/ad7606.h +++ b/drivers/iio/adc/ad7606.h @@ -50,6 +50,7 @@ struct ad7606_state; typedef int (*ad7606_scale_setup_cb_t)(struct iio_dev *indio_dev, struct iio_chan_spec *chan); typedef int (*ad7606_sw_setup_cb_t)(struct iio_dev *indio_dev); +typedef int (*ad7606_calib_gain_setup_cb_t)(struct iio_dev *indio_dev); =20 /** * struct ad7606_chip_info - chip specific information @@ -66,6 +67,7 @@ typedef int (*ad7606_sw_setup_cb_t)(struct iio_dev *indio= _dev); * @init_delay_ms: required delay in milliseconds for initialization * after a restart * @offload_storagebits: storage bits used by the offload hw implementation + * @calib_gain_setup_cb: callback to setup of gain calibration * @calib_offset_avail: pointer to offset calibration range/limits array * @calib_phase_avail: pointer to phase calibration range/limits array */ @@ -81,6 +83,7 @@ struct ad7606_chip_info { bool os_req_reset; unsigned long init_delay_ms; u8 offload_storagebits; + ad7606_calib_gain_setup_cb_t calib_gain_setup_cb; const int *calib_offset_avail; const int (*calib_phase_avail)[2]; }; --=20 2.49.0