From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=95.215.58.144 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795011565; b=iK9PxhCidfjDOGQroSY781EUkaKxBiBz+DOtp2GEuhycwyWjyuNW7ayuLypSGADzqDjs VVG4kCLRIpVcDFrK8+Q1X3vhL3HcPXRka8oV6UzVIgSBCqGIdbdBcodU1Bzvasz45Qjf3 3TkYZNVe8uDyHjRxWPL1xITo6pbklTcvfTsAWVB4IhDdGNMZeXbhhd8uNgc5k8HUj3xiI vBXRrrhCkToTDjmwE6QPq/idjZuRBYqI4i/jxezGdIFZGqeyDbDsYwv/P22tlsxBTkqzx iPihG0qMjCS1qTpk54XNAERIglG/UP49Cw6FIs8Ti/XquFi5zT7Y0hsIm2R0zX7RaYQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795011565; h=DMARC-Filter:X-Envelope-To:DKIM-Signature:X-Envelope-To:Received: X-Mizu-Trace-ID:X-Migadu-Flow:Date:From:To:Cc:Subject:Message-ID: Reply-To:References:MIME-Version:Content-Type:Content-Disposition: In-Reply-To; bh=Ghqi8if3Bs1YW0S7JoLfzeRAWiWoPJXcZKJAFnFQ6PM=; b=JreR5pCm7q5OqFwv8gQ5RMmQvCaxiTHFXh33d5CLh2XstHRn8Glu0VOkzqV8eOFZXnu/ D/EBBycdbslenhASRMLFuTlYJ5HR1eDd8IcEAZ7tEYwYIvQ4J6cvT4tOmU4eo25jS555c 2wTRbs9l3HxrglS1MtB8GuwPFBHtlis4+3mh3CcXh5PGsWw7jm4b9DYOsXH0XjmJ+zoYk 0sN6dCnHzuugXBcJRW809vO+6rt1TBKrJiErKO+gvT67zVlrxxZBpvoqyCOSz3W+ULHK2 +FaqOaIVhPEqiws1iQwy0lyHYGO8zlwo5VkQuSrlvcQfyaAysI/wLZRjPgweUDkUgVw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256 header.s=key1 header.b=pIZK346X; arc=none smtp.remote-ip=95.215.58.144 Received: from mta1.migadu.com (out-144.mta1.migadu.com [95.215.58.144]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E48E060A261B for ; Wed, 18 Nov 2026 14:19:19 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org E48E060A261B Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key, unprotected) header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256 header.s=key1 header.b=pIZK346X X-Envelope-To: linux-kernel@vger.kernel.org DKIM-Signature: a=rsa-sha256; bh=9KmHjtdnXwXJ1w3kCzrUC66exrS1n7IIqBjE+hCq/yE=; c=simple/simple; d=linux.dev; h=from:to:subject:date:message-id:mime-version:content-type; s=key1; t=1795011557; v=1; x=1795616357; b=pIZK346XxOkXizfuJqsQPLb5LyslAxxVomOAP2Hs5ITu+ybEVumrQtMdKTCGiBBcBnF3WRsO QVC9neDuMMlXZ0jxIO/PCCHylSGkx8RZr9JY9Tk/BGpI7nLWAQI49jepXyKMQ4a33N0IYuiFKnL RoyEyaFlefbBio1bcqXyuTYs= X-Envelope-To: linux-kernel@vger.kernel.org Received: by mta11.migadu.com with ESMTPS id 0787a3dd2c003c2f; Wed, 18 Nov 2026 14:19:17 +0000 X-Mizu-Trace-ID: 0787a3dd2c003c2f X-Migadu-Flow: FLOW_OUT Date: Wed, 18 Nov 2026 16:19:11 +0200 From: Matti Vaittinen To: Matti Vaittinen , Matti Vaittinen , Matti Vaittinen Cc: Jonathan Cameron , David Lechner , Nuno =?iso-8859-1?Q?S=E1?= , Andy Shevchenko , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Matti Vaittinen , Marcelo Schmitt , Joshua Crofts , Radu Sabau , Janani Sunil , Salih Erim , Jishnu Prakash , Antoniu Miclaus , Jakub Szczudlo , linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/2] dt-bindings: iio: Support ROHM BD79111 Message-ID: Reply-To: Matti Vaittinen References: X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="KnfmTtM03YGVjooE" Content-Disposition: inline In-Reply-To: --KnfmTtM03YGVjooE Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable =46rom: Matti Vaittinen ROHM BD79111 is very similar to the BD79112. Both are ADC/GPIO devices, where pins can be configured to be either used as GPIO or ADC inputs. ADCs are 12-bit SAR ADCs and GPIOs support input/output but not being IRQ sources. The main difference is amount of channels/GPIOs. The BD79112 has 32 pins for this use, the BD79111 has 16. Furthermore, the BD79111 data-sheet promises 0.5 MSPS sample rate with maximum of 10 MHz SPI clock, whereas the BD79112 data-sheet mentioned 1MSPS rate with maximum of 20 MHz SPI clock. Signed-off-by: Matti Vaittinen --- Note, I had to change the 'root-level' additionalProperties: false to unevaluatedProperties: false in order to allow the properties in the new allOf: - if: ... section. It seems to me this is what a few other bindings in IIO do, but I suppose it makes this "less strict". Well, since I am terrible with writing bindings, I'd better point this out and ask if it's ok, or if there are better way(s) to handle this? --- .../bindings/iio/adc/rohm,bd79112.yaml | 72 +++++++++++++------ 1 file changed, 50 insertions(+), 22 deletions(-) diff --git a/Documentation/devicetree/bindings/iio/adc/rohm,bd79112.yaml b/= Documentation/devicetree/bindings/iio/adc/rohm,bd79112.yaml index aa8b07c3fac1..4f105124ee6f 100644 --- a/Documentation/devicetree/bindings/iio/adc/rohm,bd79112.yaml +++ b/Documentation/devicetree/bindings/iio/adc/rohm,bd79112.yaml @@ -4,18 +4,21 @@ $id: http://devicetree.org/schemas/iio/adc/rohm,bd79112.yaml# $schema: http://devicetree.org/meta-schemas/core.yaml# =20 -title: ROHM BD79112 ADC/GPO +title: ROHM BD79111 and BD79112 ADC/GPIO =20 maintainers: - Matti Vaittinen =20 description: | - The ROHM BD79112 is a 12-bit, 32-channel, SAR ADC. ADC input pins can be - also configured as general purpose inputs/outputs. SPI should use MODE 3. + The ROHM BD79112 is a 12-bit, 32-channel, SAR ADC. The ROHM BD79111 is + a 12-bit, 16-channel, SAR ADC. ADC input pins can be also configured as + general purpose inputs/outputs. SPI should use MODE 3. =20 properties: compatible: - const: rohm,bd79112 + enum: + - rohm,bd79111 + - rohm,bd79112 =20 reg: maxItems: 1 @@ -37,23 +40,6 @@ properties: "#size-cells": const: 0 =20 -patternProperties: - "^channel@([0-9]|[12][0-9]|3[01])$": - type: object - $ref: /schemas/iio/adc/adc.yaml# - description: Represents ADC channel. Omitted channels' inputs are GPIO= s. - - properties: - reg: - description: AIN pin number - minimum: 0 - maximum: 31 - - required: - - reg - - additionalProperties: false - required: - compatible - reg @@ -62,7 +48,49 @@ required: - spi-cpha - spi-cpol =20 -additionalProperties: false +unevaluatedProperties: false + +allOf: + - if: + properties: + compatible: + contains: + const: rohm,bd79112 + then: + patternProperties: + "^channel@([0-9]|[12][0-9]|3[01])$": + type: object + $ref: /schemas/iio/adc/adc.yaml# + description: Represents ADC channel. Omitted channels' inputs ar= e GPIOs. + + properties: + reg: + description: AIN pin number + minimum: 0 + maximum: 31 + + required: + - reg + + additionalProperties: false + else: + # BD79111 has only 16 channels + patternProperties: + "^channel@([0-9]|1[0-5])$": + type: object + $ref: /schemas/iio/adc/adc.yaml# + description: Represents ADC channel. Omitted channels' inputs ar= e GPIOs. + + properties: + reg: + description: AIN pin number + minimum: 0 + maximum: 15 + + required: + - reg + + additionalProperties: false =20 examples: - | --=20 2.56.1 --KnfmTtM03YGVjooE Content-Type: application/pgp-signature; name=signature.asc -----BEGIN PGP SIGNATURE----- iQEzBAEBCgAdFiEEIx+f8wZb28fLKEhTeFA3/03aocUFAmr9s98ACgkQeFA3/03a ocV6twgAsWdB8QQP52f5xj3Jq+eNA6bXmVFPSzcKLM4cSRONcMW7HVOPq8Uh65c1 2oxUnO3GgsPL1n5P6w2h3CiqvNN7c64W7VnVDbM+AfpeAot0/jJYmDzZ5yqjZ4Sy 952GvITt0EyQTmNaW7245Q+IzV6cKmTmmfTH8JJOBe+GQbXhfhSfhXR2aLQA62af eCFyEjV9pUCwb3/PLGTx60wcnJZ27wwM2HdK5lwyJ7aSU7RfKEjqsJJgHRcCMjCD lBZie0PbOgiHTnXFUvJ1m30KoaEIK5TJkXYH/Toj/ZQv3ws+1Temfdwfjp8YKGkp 3a0PAltOTJ6q1rWtNNyOTi+MYSqtYA== =w+r8 -----END PGP SIGNATURE----- --KnfmTtM03YGVjooE--