Received: by 2002:a05:7412:2a8a:b0:fc:a2b0:25d7 with SMTP id u10csp456831rdh; Wed, 7 Feb 2024 09:27:28 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXQ0FruZWAUGjlvHPHQLaTPa/lvxF55pAnDGZwkz3sSHFA1gZ0V39i2M/R94I0X6xOq7RiBFuHwzauQl6TgqLVhULcxZ5/2BddOvhA0Lw== X-Google-Smtp-Source: AGHT+IHXccE3iK6Hm2V3xfP5AOGVu9BzQtLYlwNHbd5hcEcSoclFloIp+1eZDAyRKSR0aGcwrgVQ X-Received: by 2002:a25:2e0a:0:b0:dc7:1a9a:11da with SMTP id u10-20020a252e0a000000b00dc71a9a11damr5712522ybu.38.1707326848206; Wed, 07 Feb 2024 09:27:28 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707326848; cv=pass; d=google.com; s=arc-20160816; b=NPyqx+wadiQuKdQgRwQuedtEBTY+ZXV/nv1XIZdtfmgoy46HMUTayjrZczLzTTgcZ5 k6g8+fu0uQO2b6G42sFzTiMPaakkqLITuSp902eK4+GY8IjyHBVAm4+wV4eJsK0mlv55 sP0ct9EGJ/0ke1VNKtk9xJlSHX8VOTQtrtd549/gdftGgLANgvpcPLWEOtwyIxqhC+oK cYX+8sL4Xo2oS89IphLEzvlyrSHJu0Jrl+ARvcbceJlZfyHl6f8csMW6TW5LfTgBsm8I aOOsvn5ehudi8ODNCKHJlP1InZjG1+JI0sZbf6SyfD6Ge9E0PHMriM7d8f08AVi+4GQo d6EQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=bDBJE4gcwFZrq6ivYi5ox7oR3CtXkLa4Qg7MgIQJowA=; fh=mdlpj8Kjk/Ebv2mawKsRga0EV1MdGI0dua26cB8RUlI=; b=T+uhySev1ZXf1YEtb8nX1UvdlU9cLx65eg5P/jrP7utqkPkOd1UVk/5PgGWjNN2wv6 F+tMGW2iXfrIPXMT+Mj6TxDDfzhYEyno7SSoAPT5lFjh7jibedP4OubTW9pUoksMaCqd SnaQODQIObyd1nFSLS8Al7gpFXMTjLglSm5K5B9F2EmYqfsyl+pMPKmPaAPg6gw/J5Wu /RlJXaTqXXx7hiS5Fpy3ERXsUU/8Uw6QYOquMT2hzEZbWjgH/KzjPis8bR6YHZvOCdro tEMrJp11vXp3G+5Bcg5lbM8d2C0D0XUwZQd4zg+6I68mBFQo0P1d/d5qPL3J75ftMsai 4Q/g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="jzM/DvIF"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-56827-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-56827-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org X-Forwarded-Encrypted: i=2; AJvYcCUj1fDGrCy7FzAyjtH1l8Sr7cm407bBf1McMq1n+bBbRKqUr0kx3duLrLEerXD7xW0R052hAfg7JG0CvXFyAYFWLGhss0E1/MQuykff6g== Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id y3-20020a0ceac3000000b0068caf3955a8si1482315qvp.441.2024.02.07.09.27.28 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Feb 2024 09:27:28 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-56827-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="jzM/DvIF"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-56827-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-56827-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id E9D271C20DC4 for ; Wed, 7 Feb 2024 17:27:27 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DAA868289A; Wed, 7 Feb 2024 17:27:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="jzM/DvIF" 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 F0FB181ACE; Wed, 7 Feb 2024 17:27:17 +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=1707326838; cv=none; b=hprdayeTYc+OVUmGmgsP6u4hFxfHX1GgTOtrm1K8pd3b1yWxE1UigxyMsHjWuf2+Pv6x+dca987oDj3woIBRrSOsdjK8qQiyBOQaBrrSX+Ma9GOuLNnZL1w7R4quBRbMhr6aKFFe2gY6nti6CLYG3v0FfjJCmppoTj3uSEy9x4w= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707326838; c=relaxed/simple; bh=7wyYdg/OPZRMNK0CWvLZGY+pFUjlnvWuYHOfq6M3Yfs=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=PleHySX9OVK38ta9GfHYC5bHjTBqKrDd0o6FtVlX1LvX+8Wb6BySNdLycKhFk1gALCQHdZ5A3cHraCczmB44p0QD22tA/sUCuI4PRtc2IWvW92E9xIqwS9C/EhcOWduZesSXUZ9ALcNcm4m+pRCSJOZiMTrhMF7uJmicvVkr2/4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=jzM/DvIF; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id F2E92C433C7; Wed, 7 Feb 2024 17:27:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1707326837; bh=7wyYdg/OPZRMNK0CWvLZGY+pFUjlnvWuYHOfq6M3Yfs=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=jzM/DvIFAg3I+QTeCC20Viunolxcz4TZyhwmZ2Vue+9jA0xmlBEkge0XQhZoCMOjM uyu3VeAQg91K4jIeOmd99QgFwZQfjnjEENmKpcdcKLauBStHNMfaMC5sTKy9bBbmrv lEZ3clyhhqUdoA0ZUrdfCim2+MxIlYehLrHQ7RU25j3dSKpMa1+E9mBhqVRBHQMYO/ 9lBAKqDp/1hlVTrZQJywwrnjd9UMY4fEFSU1bXrj1+Jr2EHQ6Ia0p1BclrnvkaBif8 Z+TNRcnv5JrjYjP1/D98Ep+MdQN8NvW+C8ZiVAHNSm5CFfY+xSLRBbofqynxZcJ0Jq N/ffvSYndyBEw== Date: Wed, 7 Feb 2024 17:27:12 +0000 From: Conor Dooley To: David Lechner Cc: linux-iio@vger.kernel.org, Michael Hennerich , Jonathan Cameron , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Nuno =?iso-8859-1?Q?S=E1?= , Liam Girdwood , Mark Brown , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/2] dt-bindings: iio: adc: add ad7944 ADCs Message-ID: <20240207-carat-darling-03f5a98e65da@spud> References: <20240206-ad7944-mainline-v1-0-bf115fa9474f@baylibre.com> <20240206-ad7944-mainline-v1-1-bf115fa9474f@baylibre.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="x110uJIlPRj+uj6y" Content-Disposition: inline In-Reply-To: --x110uJIlPRj+uj6y Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Feb 06, 2024 at 11:34:13AM -0600, David Lechner wrote: > On Tue, Feb 6, 2024 at 11:26=E2=80=AFAM David Lechner wrote: > > > > This adds a new binding for the Analog Devices, Inc. AD7944, AD7985, and > > AD7986 ADCs. > > > > Signed-off-by: David Lechner > > --- > > .../devicetree/bindings/iio/adc/adi,ad7944.yaml | 231 +++++++++++++= ++++++++ > > MAINTAINERS | 8 + > > 2 files changed, 239 insertions(+) > > > > diff --git a/Documentation/devicetree/bindings/iio/adc/adi,ad7944.yaml = b/Documentation/devicetree/bindings/iio/adc/adi,ad7944.yaml > > new file mode 100644 > > index 000000000000..a023adbeba42 > > --- /dev/null > > +++ b/Documentation/devicetree/bindings/iio/adc/adi,ad7944.yaml >=20 > ... >=20 >=20 > + adi,reference: > + $ref: /schemas/types.yaml#/definitions/string > + enum: [ internal, internal-buffer, external ] > + default: internal >=20 > ... >=20 > > +allOf: > > + # ref-supply is only used for external reference voltage > > + - if: > > + not: > > + required: > > + - adi,reference > > + then: > > + properties: > > + ref-supply: false > > + else: > > + if: > > + properties: > > + adi,reference: > > + const: external > > + then: > > + required: > > + - ref-supply > > + else: > > + properties: > > + ref-supply: false >=20 > This seems like something that could potentially be improved in the > dtschema tooling. Since adi,reference has a default of "internal", I > would expect: Oh god, Rob will probably have to remind us how this works. I talked with him about trying to do some conditional stuff like this a while back, but I was not able to find any logs for IRC from then. > if: > properties: > adi,reference: > const: external > then: > required: > - ref-supply > else: > properties: > ref-supply: false >=20 > to be sufficient here. However, currently, if the adi,reference > property is omitted from the dts/dtb, the condition here evaluates to > true and unexpectedly (incorrectly?) the validator requires the > ref-supply property. But I was trying to do something like you are here, and was also surprised that this evaluated to true when the property was not present. I ended up doing something completely different, so I have no example to show you of how things ended up being. --x110uJIlPRj+uj6y Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQRh246EGq/8RLhDjO14tDGHoIJi0gUCZcO9cAAKCRB4tDGHoIJi 0nleAP9nmX07gBI9U1z0W95doO2LL4c6cqMPv9K6RCD9pvnqbgEA8H1q3EmcoLxn o0hU6apWmTvd+VJL+ba4PuLVOlUbygM= =9TQ/ -----END PGP SIGNATURE----- --x110uJIlPRj+uj6y--