Received: by 2002:ab2:7903:0:b0:1fb:b500:807b with SMTP id a3csp150143lqj; Sat, 1 Jun 2024 11:51:52 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCX0uge3Gpdz3CK/gVIWUAENQxmFywLWB6BK9o+1dQeJZrDw0vFzS9r4Bw4CM/ez1teN0GUwlZaWp1zUvMXMhmD+7wGiNRAF/hdyS0KmLA== X-Google-Smtp-Source: AGHT+IG+UGnO3/MybBuxUJr3bKOU32kWOSI8CnSoHBecryCWE2XlyVUsqKdmeTxdh5rLMf3VIrHE X-Received: by 2002:a05:6a00:1949:b0:6f0:28a4:a871 with SMTP id d2e1a72fcca58-7024780cee4mr5367883b3a.19.1717267912091; Sat, 01 Jun 2024 11:51:52 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717267912; cv=pass; d=google.com; s=arc-20160816; b=zkSPO8M+KOrZPmTCkDklR9EiewIIJKyTn2+zIW2h/Q1pFLC9XTs7yfMG/zjBs41SFF WSa+MDafXaloSLZwz+ISTBPQeuRa2fV/4f86bf0H/z61M3a3XB/ExXoVEwhATMONiGQk 5Pdad/HAMx66L6Uuz+7CqB0UVX1fNzYJmJovrPCCN2diollVOK52Geuk6vpe5rTHavAv pUIuWwzE2aMwRjX/5EPwmX93RAAz0KSvMsTW2cFnDYAJTroYPkLQwRp0uJB+J+/n+HaI 2ZGzU1mmuEXAWS7VCEn6Z44SwBPs58XChkFXnAl05jArVigbLITpaMM9i8ejuqjCwyIg LiAQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :subject:cc:to:from:date:dkim-signature; bh=pDWq5QdZgFNZN8e4MdznZuhrOc8ucIJ0hXTrYg0LZKA=; fh=C597koMrEIVVpqmXdhAbpooNLr6G+7qi2oehrjEXeJA=; b=TB2pP+VmpiJl4QcRRKxNQyVnHXUn7wjf9LnbUSWoIyPPLG8PE7TzTSqPeSF5YP9WAZ hZLpZvYVkNl2RFIYVYd7f2dkj445Zv9PtBq2HMj2pVj+BX8+dygJKxJI9RPqyHEplRWi Sbtm1qzdWbjhFzMOtwKslWgoGzrPybIUiEDXcysuD4mnCP4nYP4XGM0GmUujsbTl5SI+ jHF3JLn/YRHXae6OKl6LfN0ofRVTgAOAnbHTLpqJQ3Z4YZZz4rqVoTPu80zZAJA4XO+C VNKR16E+JyKkrZJJOBa7sLePFGw+dXUBTMoMNFqydZgteqb+Axk/YRWqF8VcLdJCoPLq Pjcg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=J5KsgmJe; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-197985-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-197985-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id d2e1a72fcca58-70242c626b3si3695227b3a.309.2024.06.01.11.51.51 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 01 Jun 2024 11:51:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-197985-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=J5KsgmJe; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-197985-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-197985-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 7137CB2130E for ; Sat, 1 Jun 2024 18:51:48 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C893A154C0E; Sat, 1 Jun 2024 18:51:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="J5KsgmJe" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EAF0D4690; Sat, 1 Jun 2024 18:51:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717267898; cv=none; b=ORp339A9VN10ciMd2mtHDlmgO257XZ2J/z3tJKQtQDPdu/gFwTn0VX9Wm5+cajZ/XuI0wviLyp0QQguqRWo2bdBaAvcU/YtVHU266XNrgaQkTZkEyDFMd+dYB6eRKtNQEq04CJuV3cLDSmnaLJNcaJN/G9aPxB/ZcQsc0ejzq08= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717267898; c=relaxed/simple; bh=kTLzy0XiVry8kuQv5OCV1tD1sJs1sBzRICilwHuwLuo=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=UVPxdcAm9D09A/e3ASosH0I5f339/ait7TcO5EUVaIuN7SUIMG6jAnz4ABdBZK8RrKUmHWjmV5wPmm7zjp2Afqc+1gGX3424iWYbF0ZmuJLRG4CHPfu0OMkuwn7oXqgxgQCtGiclhHl4Szvgu6mufl2yoqdw6DpWEIhdBGixs7Q= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=J5KsgmJe; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 20136C116B1; Sat, 1 Jun 2024 18:51:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1717267897; bh=kTLzy0XiVry8kuQv5OCV1tD1sJs1sBzRICilwHuwLuo=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=J5KsgmJesgJCgXIIdKc/PnEk8dYuoyOYgOxUI6maA07A0VmgdPs6YVcwFZQvyM62+ jYgVUmMj0QaldLRaGn/vHUZHZRkJtoW74TuoTcGuj0W/85g2C5xEpAHgwsJ3gQqlvN KjUDecuLzlpTq3rO2TewQ+SPAKK/fSlge39bzbM7yhvlfG4/88KG+RMwYGieme0bZq jPzhmjCcSWwvhxB6/hs6Kn2mlRyu7U83t8kM1DjpfP1YdfeYZYE+utDlj0Cln7Q9Ex s2sqJkTGOoch6E9oMWxgnGAAh/Qs4YeW4MGedh8NzzQeIDRunnoYcVoKzUIsYgqRvg vu0+TT1f4K3LQ== Date: Sat, 1 Jun 2024 19:51:22 +0100 From: Jonathan Cameron To: Dumitru Ceclan via B4 Relay Cc: dumitru.ceclan@analog.com, Lars-Peter Clausen , Michael Hennerich , Rob Herring , Krzysztof Kozlowski , Conor Dooley , David Lechner , linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Dumitru Ceclan , Nuno Sa Subject: Re: [PATCH v4 4/6] iio: adc: ad7173: add support for special inputs Message-ID: <20240601195122.5e6ffeba@jic23-huawei> In-Reply-To: <20240531-ad4111-v4-4-64607301c057@analog.com> References: <20240531-ad4111-v4-0-64607301c057@analog.com> <20240531-ad4111-v4-4-64607301c057@analog.com> X-Mailer: Claws Mail 4.2.0 (GTK 3.24.42; x86_64-pc-linux-gnu) 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 On Fri, 31 May 2024 22:42:30 +0300 Dumitru Ceclan via B4 Relay = wrote: > From: Dumitru Ceclan >=20 > Add support for selecting REF+ and REF- inputs on all models. > Add support for selecting ((AVDD1 =E2=88=92 AVSS)/5) inputs > on supported models. >=20 > Reviewed-by: Nuno Sa > Signed-off-by: Dumitru Ceclan Random passing comment inline. This looks fine to me. > --- > drivers/iio/adc/ad7173.c | 21 +++++++++++++++++++++ > 1 file changed, 21 insertions(+) >=20 > diff --git a/drivers/iio/adc/ad7173.c b/drivers/iio/adc/ad7173.c > index a20831d99aa5..ebfd2d5f9632 100644 > --- a/drivers/iio/adc/ad7173.c > +++ b/drivers/iio/adc/ad7173.c > @@ -66,6 +66,10 @@ > FIELD_PREP(AD7173_CH_SETUP_AINNEG_MASK, neg)) > #define AD7173_AIN_TEMP_POS 17 > #define AD7173_AIN_TEMP_NEG 18 > +#define AD7173_AIN_COM_IN_POS 19 > +#define AD7173_AIN_COM_IN_NEG 20 > +#define AD7173_AIN_REF_POS 21 > +#define AD7173_AIN_REF_NEG 22 > =20 > #define AD7172_2_ID 0x00d0 > #define AD7175_ID 0x0cd0 > @@ -146,6 +150,8 @@ struct ad7173_device_info { > unsigned int id; > char *name; > bool has_temp; > + /* ((AVDD1 =E2=88=92 AVSS)/5) */ > + bool has_common_input; > bool has_input_buf; > bool has_int_ref; > bool has_ref2; > @@ -216,6 +222,7 @@ static const struct ad7173_device_info ad7173_device_= info[] =3D { > .has_temp =3D true, > .has_input_buf =3D true, > .has_int_ref =3D true, > + .has_common_input =3D true, This is another good reason for breaking up this array (as suggested in v3 = review but perhaps a job for another patch set!) If you break it up we can see which entry each of these actually is in the = diff rather than having to use line count to figure it out! > .clock =3D 2 * HZ_PER_MHZ, > .sinc5_data_rates =3D ad7173_sinc5_data_rates, > .num_sinc5_data_rates =3D ARRAY_SIZE(ad7173_sinc5_data_rates), > @@ -230,6 +237,7 @@ static const struct ad7173_device_info ad7173_device_= info[] =3D {