| Message ID | 20260510-sunxi-a523-gpadc-v1-1-4f6b0f4000fb@mmpsystems.pl (mailing list archive) |
|---|---|
| State | New |
| Headers |
Return-Path: <linux-sunxi+bounces-23242-sunxi=pue.re@lists.linux.dev> X-Original-To: noreply@patchwork.local Delivered-To: noreply@patchwork.local Received: from sto.lore.kernel.org (sto.lore.kernel.org [172.232.135.74]) by mxe881.netcup.net (Postfix) with ESMTPS id 9F3201C06A8 for <noreply@patchwork.local>; Sun, 10 May 2026 15:02:55 +0200 (CEST) Authentication-Results: mxe881; dkim=fail header.d=mmpsystems.pl; spf=pass (sender IP is 172.232.135.74) smtp.mailfrom=linux-sunxi+bounces-23242-noreply=patchwork.local@lists.linux.dev smtp.helo=sto.lore.kernel.org Received-SPF: pass (mxe881: domain of lists.linux.dev designates 172.232.135.74 as permitted sender) client-ip=172.232.135.74; envelope-from=linux-sunxi+bounces-23242-noreply=patchwork.local@lists.linux.dev; helo=sto.lore.kernel.org; Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1]) by sto.lore.kernel.org (Postfix) with ESMTP id D4DB03002305 for <noreply@patchwork.local>; Sun, 10 May 2026 13:02:54 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6205F37BE6C; Sun, 10 May 2026 13:02:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=mmpsystems.pl header.i=@mmpsystems.pl header.b="JXtnoFOT" X-Original-To: linux-sunxi@lists.linux.dev Received: from s106b.cyber-folks.pl (s106b.cyber-folks.pl [195.78.66.88]) (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 83687DDCD; Sun, 10 May 2026 13:02:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.78.66.88 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778418171; cv=none; b=p9XnIB+lj27gcbw027ZHJQHWg4FztVnKFy1G3QMAEjgE1ESpzwyeH2cEbwXftjHGqD05i1BtI+NjXJGDn7LaTitYNBTPJgu9G300UGxh1J7AiW4ttHaN10y5nrOLV0ayuAxTl0WGQrRJUvxIYKYlCS2f8ERwV1uPaT7MKz+ZRlA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778418171; c=relaxed/simple; bh=xdbmT5ZW7GBoQzuCduM7GoLy1ivg6Gv7iVshcr4SKOE=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=BqxqDkpThDW/EaIUyrRtGD0ug1Q5ylI2h3l+a0QckhPzuKC8X9gf8a8G5nPaSdFFTb1LrDTAQQ7Ywj/8I+koJojc65dnBS0OkGIuUIHqM7IB30oCiYiN0UBalBd2xfi0WP7SYjXHkO8LqbfJKeSYdx5k/REIPQFrPKZDGgiWhWw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=mmpsystems.pl; spf=pass smtp.mailfrom=mmpsystems.pl; dkim=pass (2048-bit key) header.d=mmpsystems.pl header.i=@mmpsystems.pl header.b=JXtnoFOT; arc=none smtp.client-ip=195.78.66.88 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=mmpsystems.pl Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=mmpsystems.pl DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mmpsystems.pl; s=x; h=Cc:To:In-Reply-To:References:Message-Id: Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date:From:Sender: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=sQf9HV1kJe9QuSV63atEChSm9EINfgHOzkniR1z+XIk=; b=JXtnoFOTyvcCFbcT5mx3MDXD1j fi/m5EU3GBPzTFUFimzzNUeohg8xvNmoXOASWvb2MKR7KHo1XdiuEwYrnY+enjjKKX/juVRBxQMTh 8Mnf86+/og/CSuMp/8vKqCee39VBfK6BHuyeEyoG5b2qfHGlG0qyUffRWmlq6qinguG0Qusdcdywv DrDaPp1W1p3j+0iMFUfn1V+wp/Ni8+BH5MuIAdrJHUP2OJT5skvMS2stgJ8pyaXyV8SYsPfEAwiLN 5R9gR2+waAyuvpjfNgh20AyYZQbR6mD3l2KasZTt1Kgx2YaH5hfKPqOLxTl97cabM4A0ujsQZncMp Dw8nZCAA==; Received: from user-188-33-36-99.play-internet.pl ([188.33.36.99] helo=localhost) by s106.cyber-folks.pl with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from <michal.piekos@mmpsystems.pl>) id 1wM3nS-0000000DQb8-2khN; Sun, 10 May 2026 15:02:14 +0200 From: Michal Piekos <michal.piekos@mmpsystems.pl> Date: Sun, 10 May 2026 14:57:22 +0200 Subject: [PATCH 1/3] dt-bindings: iio: adc: Add GPADC for Allwinner A523 Precedence: bulk X-Mailing-List: linux-sunxi@lists.linux.dev List-Id: <linux-sunxi.lists.linux.dev> List-Subscribe: <mailto:linux-sunxi+subscribe@lists.linux.dev> List-Unsubscribe: <mailto:linux-sunxi+unsubscribe@lists.linux.dev> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20260510-sunxi-a523-gpadc-v1-1-4f6b0f4000fb@mmpsystems.pl> References: <20260510-sunxi-a523-gpadc-v1-0-4f6b0f4000fb@mmpsystems.pl> In-Reply-To: <20260510-sunxi-a523-gpadc-v1-0-4f6b0f4000fb@mmpsystems.pl> To: Jonathan Cameron <jic23@kernel.org>, David Lechner <dlechner@baylibre.com>, =?utf-8?q?Nuno_S=C3=A1?= <nuno.sa@analog.com>, Andy Shevchenko <andy@kernel.org>, Rob Herring <robh@kernel.org>, Krzysztof Kozlowski <krzk+dt@kernel.org>, Conor Dooley <conor+dt@kernel.org>, Chen-Yu Tsai <wens@kernel.org>, Jernej Skrabec <jernej.skrabec@gmail.com>, Samuel Holland <samuel@sholland.org>, Maksim Kiselev <bigunclemax@gmail.com> Cc: linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org, Michal Piekos <michal.piekos@mmpsystems.pl> X-Mailer: b4 0.15.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1778417853; l=1939; i=michal.piekos@mmpsystems.pl; s=20260301; h=from:subject:message-id; bh=xdbmT5ZW7GBoQzuCduM7GoLy1ivg6Gv7iVshcr4SKOE=; b=+fLEdNfcGSL6q7kzk+Ig5Sr2kuXJVWe3+SHYOmbUDS87rrnQ6fhMO9DC/AKCCxgCFF3Q10qPu X+6KaQkpiD+AIwZYYzl51hk38WXOrIVbGw13bG+w05h71LjATWN5uwv X-Developer-Key: i=michal.piekos@mmpsystems.pl; a=ed25519; pk=Aixyx03If7ZDamiKKN0lsa+0mtA+WjIuIf2ZQVYNBqg= X-Authenticated-Id: michal.piekos@mmpsystems.pl X-Rspamd-Server: rspamd-worker-8404 X-Spamd-Result: default: False [-0.16 / 15.00]; BAYES_HAM(-5.50)[99.99%]; RBL_SENDERSCORE(2.00)[172.232.135.74:from]; SUSPICIOUS_RECIPS(1.50)[]; R_DKIM_REJECT(1.00)[mmpsystems.pl:s=x]; DMARC_POLICY_SOFTFAIL(1.00)[mmpsystems.pl : SPF not aligned (relaxed),none]; MAILLIST(-0.15)[generic]; MIME_GOOD(-0.10)[text/plain]; BAD_REP_POLICIES(0.10)[]; HAS_LIST_UNSUB(-0.01)[]; PRECEDENCE_BULK(0.00)[]; TAGGED_RCPT(0.00)[dt]; RCPT_COUNT_TWELVE(0.00)[17]; FUZZY_BLOCKED(0.00)[rspamd.com]; DBL_BLOCKED_OPENRESOLVER(0.00)[sto.lore.kernel.org:rdns,sto.lore.kernel.org:helo]; FORGED_SENDER_MAILLIST(0.00)[]; FROM_HAS_DN(0.00)[]; RCVD_COUNT_FIVE(0.00)[5]; FROM_NEQ_ENVFROM(0.00)[michal.piekos@mmpsystems.pl,linux-sunxi@lists.linux.dev]; DKIM_TRACE(0.00)[mmpsystems.pl:-]; FREEMAIL_TO(0.00)[kernel.org,baylibre.com,analog.com,gmail.com,sholland.org]; R_SPF_ALLOW(0.00)[+ip4:172.232.135.74]; TO_DN_SOME(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; FORGED_RECIPIENTS_MAILLIST(0.00)[]; RCVD_TLS_LAST(0.00)[]; ARC_ALLOW(0.00)[subspace.kernel.org:s=arc-20240116:i=1]; MIME_TRACE(0.00)[0:+]; TAGGED_FROM(0.00)[bounces-23242-noreply=patchwork.local]; ASN(0.00)[asn:63949, ipnet:172.232.128.0/19, country:SG]; RCVD_VIA_SMTP_AUTH(0.00)[] X-Rspamd-Queue-Id: 9F3201C06A8 X-MORS-Enabled: yes X-MORS-DOMAIN: patchwork.local X-MORS-HOSTING: hosting172546 X-MORS-USER: hosting172546 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= |
| Series |
Add GPADC support for A523
|
|
Commit Message
Michal Piekos
May 10, 2026, 12:57 p.m. UTC
Add support for the GPADC for the Allwinner A523. It differs from the
D1/T113s/R329/T507 by having two clocks.
Signed-off-by: Michal Piekos <michal.piekos@mmpsystems.pl>
---
.../iio/adc/allwinner,sun20i-d1-gpadc.yaml | 37 +++++++++++++++++++++-
1 file changed, 36 insertions(+), 1 deletion(-)
Comments
On Sun, 10 May 2026 14:57:22 +0200, Michal Piekos wrote: > Add support for the GPADC for the Allwinner A523. It differs from the > D1/T113s/R329/T507 by having two clocks. > > Signed-off-by: Michal Piekos <michal.piekos@mmpsystems.pl> > --- > .../iio/adc/allwinner,sun20i-d1-gpadc.yaml | 37 +++++++++++++++++++++- > 1 file changed, 36 insertions(+), 1 deletion(-) > My bot found errors running 'make dt_binding_check' on your patch: yamllint warnings/errors: dtschema/dtc warnings/errors: /builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/iio/adc/allwinner,sun20i-d1-gpadc.yaml: allOf:0:then:properties:clocks: {'minItems': 2, 'maxItems': 2, 'items': [{'description': 'Bus clock'}, {'description': 'Module clock'}]} should not be valid under {'required': ['maxItems']} hint: "maxItems" is not needed with an "items" list from schema $id: http://devicetree.org/meta-schemas/items.yaml /builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/iio/adc/allwinner,sun20i-d1-gpadc.yaml: allOf:0:then:properties:clocks: 'oneOf' conditional failed, one must be fixed: False schema does not allow 2 [{'description': 'Bus clock'}, {'description': 'Module clock'}] is too long [{'description': 'Bus clock'}, {'description': 'Module clock'}] is too short 1 was expected hint: "minItems" is only needed if less than the "items" list length from schema $id: http://devicetree.org/meta-schemas/items.yaml /builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/iio/adc/allwinner,sun20i-d1-gpadc.yaml: allOf:0:then:properties:clock-names: {'minItems': 2, 'maxItems': 2, 'items': [{'const': 'bus'}, {'const': 'mod'}]} should not be valid under {'required': ['maxItems']} hint: "maxItems" is not needed with an "items" list from schema $id: http://devicetree.org/meta-schemas/items.yaml /builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/iio/adc/allwinner,sun20i-d1-gpadc.yaml: allOf:0:then:properties:clock-names: 'oneOf' conditional failed, one must be fixed: False schema does not allow 2 [{'const': 'bus'}, {'const': 'mod'}] is too long [{'const': 'bus'}, {'const': 'mod'}] is too short 1 was expected hint: "minItems" is only needed if less than the "items" list length from schema $id: http://devicetree.org/meta-schemas/items.yaml doc reference errors (make refcheckdocs): See https://patchwork.kernel.org/project/devicetree/patch/20260510-sunxi-a523-gpadc-v1-1-4f6b0f4000fb@mmpsystems.pl The base for the series is generally the latest rc1. A different dependency should be noted in *this* patch. If you already ran 'make dt_binding_check' and didn't see the above error(s), then make sure 'yamllint' is installed and dt-schema is up to date: pip3 install dtschema --upgrade Please check and re-submit after running the above command yourself. Note that DT_SCHEMA_FILES can be set to your schema file to speed up checking your schema. However, it must be unset to test all examples with your schema.
Dne nedelja, 10. maj 2026 ob 14:57:22 Srednjeevropski poletni čas je Michal Piekos napisal(a): > Add support for the GPADC for the Allwinner A523. It differs from the > D1/T113s/R329/T507 by having two clocks. > > Signed-off-by: Michal Piekos <michal.piekos@mmpsystems.pl> > --- > .../iio/adc/allwinner,sun20i-d1-gpadc.yaml | 37 +++++++++++++++++++++- > 1 file changed, 36 insertions(+), 1 deletion(-) > > diff --git a/Documentation/devicetree/bindings/iio/adc/allwinner,sun20i-d1-gpadc.yaml b/Documentation/devicetree/bindings/iio/adc/allwinner,sun20i-d1-gpadc.yaml > index da605a051b94..89da96cd705f 100644 > --- a/Documentation/devicetree/bindings/iio/adc/allwinner,sun20i-d1-gpadc.yaml > +++ b/Documentation/devicetree/bindings/iio/adc/allwinner,sun20i-d1-gpadc.yaml > @@ -17,6 +17,7 @@ properties: > - items: > - enum: > - allwinner,sun50i-h616-gpadc > + - allwinner,sun55i-a523-gpadc It shouldn't be combined if it has different number of clocks. Best regards, Jernej > - const: allwinner,sun20i-d1-gpadc > > "#io-channel-cells": > @@ -29,7 +30,12 @@ properties: > const: 0 > > clocks: > - maxItems: 1 > + minItems: 1 > + maxItems: 2 > + > + clock-names: > + minItems: 1 > + maxItems: 2 > > interrupts: > maxItems: 1 > @@ -40,6 +46,35 @@ properties: > resets: > maxItems: 1 > > +allOf: > + - if: > + properties: > + compatible: > + items: > + - const: allwinner,sun55i-a523-gpadc > + - const: allwinner,sun20i-d1-gpadc > + then: > + properties: > + clocks: > + minItems: 2 > + maxItems: 2 > + items: > + - description: Bus clock > + - description: Module clock > + clock-names: > + minItems: 2 > + maxItems: 2 > + items: > + - const: bus > + - const: mod > + required: > + - clock-names > + else: > + properties: > + clocks: > + maxItems: 1 > + clock-names: false > + > patternProperties: > "^channel@[0-9a-f]+$": > $ref: adc.yaml > >
Hi Michal, thanks for adding this! On 5/10/26 14:57, Michal Piekos wrote: > Add support for the GPADC for the Allwinner A523. It differs from the > D1/T113s/R329/T507 by having two clocks. > > Signed-off-by: Michal Piekos <michal.piekos@mmpsystems.pl> > --- > .../iio/adc/allwinner,sun20i-d1-gpadc.yaml | 37 +++++++++++++++++++++- > 1 file changed, 36 insertions(+), 1 deletion(-) > > diff --git a/Documentation/devicetree/bindings/iio/adc/allwinner,sun20i-d1-gpadc.yaml b/Documentation/devicetree/bindings/iio/adc/allwinner,sun20i-d1-gpadc.yaml > index da605a051b94..89da96cd705f 100644 > --- a/Documentation/devicetree/bindings/iio/adc/allwinner,sun20i-d1-gpadc.yaml > +++ b/Documentation/devicetree/bindings/iio/adc/allwinner,sun20i-d1-gpadc.yaml > @@ -17,6 +17,7 @@ properties: > - items: > - enum: > - allwinner,sun50i-h616-gpadc > + - allwinner,sun55i-a523-gpadc > - const: allwinner,sun20i-d1-gpadc As Jernej already mentioned, the A523 GPADC is not fully compatible, since it adds another clock. The question to ask is: Can a driver only knowing about the fallback device handle this new device? For which the answer here is: No, it misses a clock. So add just a single entry for the A523 (plus adding it to the driver). So looking at this I wonder if we should add some property to describe the number of supported channels, since they are slightly different between the SoCs: - The D1 manual mentions 2 channels. - The T113s manual (same die as the D1?) describes 1 channel only. - The T507 manual (same die as the H616) reports 4 channels. - The A733 has 6 channels. - The A133 has 1 channel, but it's channel 1, not 0. So all of this is somewhat covered as channels are described as child nodes, and have a reg property. Ideally non-existing channels just wouldn't be listed, but I don't know if we want to rely on that. So I am wondering if we should introduce a limit, or rather a mask (to cover the A133 oddity)? Either a DT property (channel-mask, as a single sell representing the bit mask), or derived in the driver from the compatible string. The former would avoid introducing different compatible strings just because of that, though I think this type of property is somewhat discouraged? Any thoughts? > > "#io-channel-cells": > @@ -29,7 +30,12 @@ properties: > const: 0 > > clocks: > - maxItems: 1 > + minItems: 1 > + maxItems: 2 > + > + clock-names: > + minItems: 1 > + maxItems: 2 > > interrupts: > maxItems: 1 > @@ -40,6 +46,35 @@ properties: > resets: > maxItems: 1 > > +allOf: > + - if: > + properties: > + compatible: > + items: > + - const: allwinner,sun55i-a523-gpadc > + - const: allwinner,sun20i-d1-gpadc > + then: > + properties: > + clocks: > + minItems: 2 > + maxItems: 2 > + items: > + - description: Bus clock > + - description: Module clock I am not a YAML expert, but I think you can drop the min and max properties, if you just enumerate the cases. Same for the names. Cheers, Andre > + clock-names: > + minItems: 2 > + maxItems: 2 > + items: > + - const: bus > + - const: mod > + required: > + - clock-names > + else: > + properties: > + clocks: > + maxItems: 1 > + clock-names: false > + > patternProperties: > "^channel@[0-9a-f]+$": > $ref: adc.yaml >
On Mon, May 11, 2026 at 06:02:16PM +0200, Andre Przywara wrote: > Hi Michal, > > thanks for adding this! > > On 5/10/26 14:57, Michal Piekos wrote: > > Add support for the GPADC for the Allwinner A523. It differs from the > > D1/T113s/R329/T507 by having two clocks. > > > > Signed-off-by: Michal Piekos <michal.piekos@mmpsystems.pl> > > --- > > .../iio/adc/allwinner,sun20i-d1-gpadc.yaml | 37 +++++++++++++++++++++- > > 1 file changed, 36 insertions(+), 1 deletion(-) > > > > diff --git a/Documentation/devicetree/bindings/iio/adc/allwinner,sun20i-d1-gpadc.yaml b/Documentation/devicetree/bindings/iio/adc/allwinner,sun20i-d1-gpadc.yaml > > index da605a051b94..89da96cd705f 100644 > > --- a/Documentation/devicetree/bindings/iio/adc/allwinner,sun20i-d1-gpadc.yaml > > +++ b/Documentation/devicetree/bindings/iio/adc/allwinner,sun20i-d1-gpadc.yaml > > @@ -17,6 +17,7 @@ properties: > > - items: > > - enum: > > - allwinner,sun50i-h616-gpadc > > + - allwinner,sun55i-a523-gpadc > > - const: allwinner,sun20i-d1-gpadc > > As Jernej already mentioned, the A523 GPADC is not fully compatible, since > it adds another clock. The question to ask is: Can a driver only knowing > about the fallback device handle this new device? For which the answer here > is: No, it misses a clock. > So add just a single entry for the A523 (plus adding it to the driver). > > So looking at this I wonder if we should add some property to describe the > number of supported channels, since they are slightly different between the > SoCs: > - The D1 manual mentions 2 channels. > - The T113s manual (same die as the D1?) describes 1 channel only. > - The T507 manual (same die as the H616) reports 4 channels. > - The A733 has 6 channels. > - The A133 has 1 channel, but it's channel 1, not 0. > > So all of this is somewhat covered as channels are described as child nodes, > and have a reg property. Ideally non-existing channels just wouldn't be > listed, but I don't know if we want to rely on that. > > So I am wondering if we should introduce a limit, or rather a mask (to cover > the A133 oddity)? > Either a DT property (channel-mask, as a single sell representing the bit > mask), or derived in the driver from the compatible string. > The former would avoid introducing different compatible strings just because > of that, though I think this type of property is somewhat discouraged? > > Any thoughts? Thanks. I have missed that sparse channels are also possible. I think in current implementation it will cause issue with lookup through <&gpadc 1> as sun20i_gpadc_alloc_channels would effectively create channels[0].channel = 1 in such scenario. I will try to verify if my logic is correct and provide separate fix if needed. Regarding DT property masking channels there is already precedence: atmel,adc-channels-used is a bitmask of muxed and enabled channels. Not sure if preferable though... Michal > > > "#io-channel-cells": > > @@ -29,7 +30,12 @@ properties: > > const: 0 > > clocks: > > - maxItems: 1 > > + minItems: 1 > > + maxItems: 2 > > + > > + clock-names: > > + minItems: 1 > > + maxItems: 2 > > interrupts: > > maxItems: 1 > > @@ -40,6 +46,35 @@ properties: > > resets: > > maxItems: 1 > > +allOf: > > + - if: > > + properties: > > + compatible: > > + items: > > + - const: allwinner,sun55i-a523-gpadc > > + - const: allwinner,sun20i-d1-gpadc > > + then: > > + properties: > > + clocks: > > + minItems: 2 > > + maxItems: 2 > > + items: > > + - description: Bus clock > > + - description: Module clock > > I am not a YAML expert, but I think you can drop the min and max properties, > if you just enumerate the cases. Same for the names. > > Cheers, > Andre I will correct that in v2. Michal. > > > + clock-names: > > + minItems: 2 > > + maxItems: 2 > > + items: > > + - const: bus > > + - const: mod > > + required: > > + - clock-names > > + else: > > + properties: > > + clocks: > > + maxItems: 1 > > + clock-names: false > > + > > patternProperties: > > "^channel@[0-9a-f]+$": > > $ref: adc.yaml > > >
diff --git a/Documentation/devicetree/bindings/iio/adc/allwinner,sun20i-d1-gpadc.yaml b/Documentation/devicetree/bindings/iio/adc/allwinner,sun20i-d1-gpadc.yaml index da605a051b94..89da96cd705f 100644 --- a/Documentation/devicetree/bindings/iio/adc/allwinner,sun20i-d1-gpadc.yaml +++ b/Documentation/devicetree/bindings/iio/adc/allwinner,sun20i-d1-gpadc.yaml @@ -17,6 +17,7 @@ properties: - items: - enum: - allwinner,sun50i-h616-gpadc + - allwinner,sun55i-a523-gpadc - const: allwinner,sun20i-d1-gpadc "#io-channel-cells": @@ -29,7 +30,12 @@ properties: const: 0 clocks: - maxItems: 1 + minItems: 1 + maxItems: 2 + + clock-names: + minItems: 1 + maxItems: 2 interrupts: maxItems: 1 @@ -40,6 +46,35 @@ properties: resets: maxItems: 1 +allOf: + - if: + properties: + compatible: + items: + - const: allwinner,sun55i-a523-gpadc + - const: allwinner,sun20i-d1-gpadc + then: + properties: + clocks: + minItems: 2 + maxItems: 2 + items: + - description: Bus clock + - description: Module clock + clock-names: + minItems: 2 + maxItems: 2 + items: + - const: bus + - const: mod + required: + - clock-names + else: + properties: + clocks: + maxItems: 1 + clock-names: false + patternProperties: "^channel@[0-9a-f]+$": $ref: adc.yaml