Received: by 2002:a05:7412:bbc7:b0:fc:a2b0:25d7 with SMTP id kh7csp3191265rdb; Tue, 6 Feb 2024 09:37:08 -0800 (PST) X-Google-Smtp-Source: AGHT+IHsZy8aUgd51/lT3tedAqTa03MiLoK6BfVNrXyqDaTaIpqH8KI2L14l8Nh/tSDzmPN/ZtqF X-Received: by 2002:a17:906:af14:b0:a36:fc06:6f7b with SMTP id lx20-20020a170906af1400b00a36fc066f7bmr2440864ejb.44.1707241028147; Tue, 06 Feb 2024 09:37:08 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCX0gabhV/5FhnhGAkQ5Nlcr4AdqHZ9UfxPcRn3Fl7i40lu8a7eDYg/E48hdqP+uxnImh5KKGOZdTfBA/Cp6GgLrT3UiPqbFuqyUAz/5cg== Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id h3-20020a1709063c0300b00a383673aaa8si725558ejg.84.2024.02.06.09.37.08 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Feb 2024 09:37:08 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-55393-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@baylibre-com.20230601.gappssmtp.com header.s=20230601 header.b=14eBsMkD; arc=fail (body hash mismatch); spf=pass (google.com: domain of linux-kernel+bounces-55393-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-55393-linux.lists.archive=gmail.com@vger.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 am.mirrors.kernel.org (Postfix) with ESMTPS id 3BC271F24E48 for ; Tue, 6 Feb 2024 17:36:54 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2287DD518; Tue, 6 Feb 2024 17:34:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b="14eBsMkD" Received: from mail-lj1-f182.google.com (mail-lj1-f182.google.com [209.85.208.182]) (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 97587D51C for ; Tue, 6 Feb 2024 17:34:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.182 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707240869; cv=none; b=RRKP00Rg/nEpj5nqryN1QfqYJatJyMINTFRjB3zgcStKqdfrX0ToCgqRoezqLT7djtS9pymR+vgkv3bzw4EZ3tl6tf0RIY1Tm8RrdNiQkgaj5reT+gImmzKm5CVeFRg6eECChR7a2rWcj3XFt8BBLKOXpLkd2fJ784DzG0h93Tw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707240869; c=relaxed/simple; bh=BGYgn4pwip7xm8wZ1TGqp7QgodhzA/a+8J+7CXk661c=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=DH7udH1nV34uxBrT6HYoJGdrvCvSTetQB3dZ7uRTDiA+AQBzyEP4jE6er+f7nN8SpKHLdRnQksFEz1McmMjayQ6CWI3gNut4qOKpMftuEIKijm+d2qW4M1SCxqhsnjG+1cW5KBjcvUxQl9LFK2p1MGLZurEoQvSCWE4wDMgphCs= 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=14eBsMkD; arc=none smtp.client-ip=209.85.208.182 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 Received: by mail-lj1-f182.google.com with SMTP id 38308e7fff4ca-2d0a96bad85so40719921fa.1 for ; Tue, 06 Feb 2024 09:34:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1707240864; x=1707845664; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=ZpmnZurxd3Ncre4ry66TEipTMru+C8BAh2dBgzUnWpc=; b=14eBsMkDUc9gezEe/s8BYcTt157KxEyD121V8Bt8QksVs/mHnTugZXycIC7lJ3TPjP Bv9YoMeD0n6/Gn9r6f+0ZgHJm42UdNHfIhU7c4iDmFy7a8U6mLPrKauwKPsB/f2bWSHJ xlnJk4UFM4Kxs7l0Efh1F8WApCuVMbQvu8Adp2dSxKq62fZbgKkAPqkxgmc1bx9g2AaX QdXYcgodDN+vs6EoiTZ7l69svRWOW8JoqfCTDLGXpTwJkaneynIK0z915zPcx1FWOdxT 75qfpKagLmOzfu6W0+tq+2XvMekdrwtqZFVuFdHLHLis8Nte3KINVcKw95SM2ljL40v5 zLjg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707240864; x=1707845664; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ZpmnZurxd3Ncre4ry66TEipTMru+C8BAh2dBgzUnWpc=; b=aKiY5MDAhJBxlR0hS8YZ3G+dEa81VCs9zBS4Z6O+/I6W98INzS1dhATlXatyLTfsB9 Q/Uyznby1kLQgG9vLqkiBew7PxEx9gR+eswqsBzDPDu7AEjLM9dVKFTVRf16XnbM8lMX tKFYtxGPHMLL7Q7DRbESmFlrG2oidwfcOhYbCLzDFwcctuiW3KhMNQzqT5f7xtiu/8Bp +k7rZi+AsUFrGHRkKqoGA1sClM27pXRWr2Zm/uQima5Cc6+sF8npgK8PRSGF3IGfpw5Z BJ+kn9EJY2wssVmE1yNSDru4dIx8ucvuT+khcNB2BbQUtTv7cV9flvFj0yhQ2igSocEb I77Q== X-Gm-Message-State: AOJu0YzYL4nqSkYRsS6aQINDtg8sNaPQpZByCl1VoKebYoYEr+oJrmM+ WE2Yg7Aub11CH/MnawtAB4wep1eQg+lCygc4gTQMJr8ylRGX3HtwVULtoqqHtEsqf3le8Ku/E74 ddDMB1HVjZsfi6gHvl5GPwgBReCiPW1LoCEhGnkLpD7PGaSwfWEM= X-Received: by 2002:a05:651c:23c:b0:2d0:a464:747 with SMTP id z28-20020a05651c023c00b002d0a4640747mr2286725ljn.49.1707240864576; Tue, 06 Feb 2024 09:34:24 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240206-ad7944-mainline-v1-0-bf115fa9474f@baylibre.com> <20240206-ad7944-mainline-v1-1-bf115fa9474f@baylibre.com> In-Reply-To: <20240206-ad7944-mainline-v1-1-bf115fa9474f@baylibre.com> From: David Lechner Date: Tue, 6 Feb 2024 11:34:13 -0600 Message-ID: Subject: Re: [PATCH 1/2] dt-bindings: iio: adc: add ad7944 ADCs To: linux-iio@vger.kernel.org Cc: Michael Hennerich , Jonathan Cameron , Rob Herring , Krzysztof Kozlowski , Conor Dooley , =?UTF-8?B?TnVubyBTw6E=?= , Liam Girdwood , Mark Brown , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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 .. + adi,reference: + $ref: /schemas/types.yaml#/definitions/string + enum: [ internal, internal-buffer, external ] + default: internal .. > +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 This seems like something that could potentially be improved in the dtschema tooling. Since adi,reference has a default of "internal", I would expect: if: properties: adi,reference: const: external then: required: - ref-supply else: properties: ref-supply: false 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.