Message ID | 20230601223104.1243871-3-bigunclemax@gmail.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp657402vqr; Thu, 1 Jun 2023 15:44:17 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6NktrWaIUdR/WjMpnp9dsIlX/MPHK9jxPCYdyWVzFgWeqY0QncYZEA7MTlrq48kutoQHe+ X-Received: by 2002:a05:6a00:1144:b0:649:93a7:571b with SMTP id b4-20020a056a00114400b0064993a7571bmr12874274pfm.13.1685659456764; Thu, 01 Jun 2023 15:44:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685659456; cv=none; d=google.com; s=arc-20160816; b=C3HzDsiY2SsTP7F/RbLWg6xJMgftQuLAN1BecNUJmjDScR81Z5Pv0M0zL4Dkwg1gV4 capDooBqMq4oW2YxChbs/4nHNImIQfOl4SgiUg5+/wJs8u8UgTsfKoQPpLPt25/dhtiR bKxhcQ20Racaz9jcnJIDDpLoPxsq/wHP0j4tvj2RqIybKqhZxj8PMHzZ7OmoKb6N3WkK KrO1qUo7RQqf8IqSXuWgmptpZhtMtuSkcuFC1EehzxbFIdg72sHyCiTTHo3gY4LsBdVl +J73EW+a64lkdD7khBHQEWxbACbwIf0CdMpceWWi+KpkvCK1obwTRDiQAPJvGBRleh/k XFkA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=RDQovBoms3FLau58BysfqmyJWkZDGP+mDWm5zuqZL/Y=; b=Lsl1kPIjK9hYZJeRK7Z1S4loewP8MfUm1fxYOH16bHb/CFRIReBrXA7g9uOfMvMOBA Iq2BenE3dsGXpHggpY6I/YUyTBDxmKKu224lFGI8dZr2euPO/fo3aO+qbBfhA9ZXqPH3 uqiwcdnRS2LlkKnhDKCsJuTQwRsVN1y8lX/Gm5yAG/Er2wSCqmsQo3/N1KPcUhotyLgj MqQRyK9tCUXhOgDrJJHbJJcARCJJvvTRs5iwC481Epwk2BdTYbnWa2Hdcre3wPPM7QZ6 2LYXPvU+o8Q/BFP9VgdVv4Z3bw6S92gSzr3zZ3OXMtBuwoCHkfBPyc39uY5Sf6mUZ5p0 Vw8Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b="nJ5nrB/K"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j13-20020a63cf0d000000b0053477bf60e1si3402462pgg.630.2023.06.01.15.44.02; Thu, 01 Jun 2023 15:44:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b="nJ5nrB/K"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232307AbjFAWcS (ORCPT <rfc822;limurcpp@gmail.com> + 99 others); Thu, 1 Jun 2023 18:32:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48180 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229498AbjFAWcQ (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 1 Jun 2023 18:32:16 -0400 Received: from mail-wr1-x435.google.com (mail-wr1-x435.google.com [IPv6:2a00:1450:4864:20::435]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 63A14136; Thu, 1 Jun 2023 15:32:13 -0700 (PDT) Received: by mail-wr1-x435.google.com with SMTP id ffacd0b85a97d-30ae141785bso1382194f8f.3; Thu, 01 Jun 2023 15:32:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1685658731; x=1688250731; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=RDQovBoms3FLau58BysfqmyJWkZDGP+mDWm5zuqZL/Y=; b=nJ5nrB/K65xBQKeS4GK49exb8oASXvkB07wZO02wNCVCzxUG+fXPDtEcDX1berfUJd +Dnim0ocLAx6/xp4BqZHLDSdO5QS9me/pYMaRIrhky0TGnpJbxDqO7aDu8BcOELRIMIV T1FMGnigqZwePfryfBXqE8S6Um91z4H7ji7M6+YlBlSeaJxylPSlgpsSFbnmXAeNQ/H+ WzpMtM1IbWpS4PUsNYMkWRN6+G7FtIdvkbA4F1Fd2UWBP8woALbMjNjERKg2hovSBsH3 0y0YkI4wO8qI2MI3pKH5oA+nA+L6qGqsRXDsSiH58FHQshYUIdHAxwdUS2TU9nh2dsMa exYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685658731; x=1688250731; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=RDQovBoms3FLau58BysfqmyJWkZDGP+mDWm5zuqZL/Y=; b=Ms0yKumrEMSmJ+b9jOl4IyTYQMMs8p7ggZL3O9UQH1qpsfsIhzM8O+BUJ0N0vsS+Bi rKGE1RtzY0xT5vrkNjhFZojYPpDHzZehEtpr3B/m5DbfObXl68t7sVgnl38o8Ek+Vlis hzkr0B7E1CFjzgFKiGjHCssPEj0FIE3ibqTpgASuND7eeA6e0rG/UxvjZLXutMQKGEc0 8eB/M3YLKQVypAEsrLuQa3GnCOI/R3bYMoosXOmg8bqLef+z6IjlvzbULq/+c/xRl8Jo w4Dbh4+JbbeqoNE2EDNwFRT+9+tDhcn4589beNQK6mYT8dUgWY8+SCW552+iW1s5xDH+ 1J0Q== X-Gm-Message-State: AC+VfDyUDVjWGQ4CxjktjdRhXbRJZzraTGqwY6xOkfYVfdp9Ef9XegzQ cspgHSm+tfoK/W3EnRwERt5kaMTGy3m4Gdtu X-Received: by 2002:a05:6000:1191:b0:300:cb8c:fd8f with SMTP id g17-20020a056000119100b00300cb8cfd8fmr2588538wrx.54.1685658731484; Thu, 01 Jun 2023 15:32:11 -0700 (PDT) Received: from user-PC.. ([178.134.198.138]) by smtp.gmail.com with ESMTPSA id b7-20020a5d4d87000000b0030af8da022dsm8619149wru.44.2023.06.01.15.32.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Jun 2023 15:32:11 -0700 (PDT) From: Maksim Kiselev <bigunclemax@gmail.com> To: linux-iio@vger.kernel.org Cc: Maxim Kiselev <bigunclemax@gmail.com>, Jonathan Cameron <jic23@kernel.org>, Lars-Peter Clausen <lars@metafoo.de>, Rob Herring <robh+dt@kernel.org>, Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>, Conor Dooley <conor+dt@kernel.org>, Chen-Yu Tsai <wens@csie.org>, Jernej Skrabec <jernej.skrabec@gmail.com>, Samuel Holland <samuel@sholland.org>, Paul Walmsley <paul.walmsley@sifive.com>, Palmer Dabbelt <palmer@dabbelt.com>, Albert Ou <aou@eecs.berkeley.edu>, Philipp Zabel <p.zabel@pengutronix.de>, Cristian Ciocaltea <cristian.ciocaltea@collabora.com>, Heiko Stuebner <heiko.stuebner@vrull.eu>, Andy Shevchenko <andriy.shevchenko@linux.intel.com>, Cosmin Tanislav <demonsingur@gmail.com>, Stephen Boyd <sboyd@kernel.org>, Arnd Bergmann <arnd@arndb.de>, William Breathitt Gray <william.gray@linaro.org>, Hugo Villeneuve <hvilleneuve@dimonoff.com>, Mike Looijmans <mike.looijmans@topic.nl>, ChiYuan Huang <cy_huang@richtek.com>, Ramona Bolboaca <ramona.bolboaca@analog.com>, Ibrahim Tilki <Ibrahim.Tilki@analog.com>, Caleb Connolly <caleb.connolly@linaro.org>, AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>, ChiaEn Wu <chiaen_wu@richtek.com>, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org Subject: [PATCH v2 2/3] dt-bindings: iio: adc: Add Allwinner D1/T113s/R329/T507 SoCs GPADC Date: Fri, 2 Jun 2023 01:30:40 +0300 Message-Id: <20230601223104.1243871-3-bigunclemax@gmail.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230601223104.1243871-1-bigunclemax@gmail.com> References: <20230601223104.1243871-1-bigunclemax@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1767542050745555606?= X-GMAIL-MSGID: =?utf-8?q?1767542050745555606?= |
Series |
Add support for Allwinner GPADC on D1/T113s/R329/T507 SoCs
|
|
Commit Message
Maxim Kiselev
June 1, 2023, 10:30 p.m. UTC
From: Maxim Kiselev <bigunclemax@gmail.com> Allwinner's D1/T113s/R329/T507 SoCs have a new general purpose ADC. This ADC is the same for all of this SoCs. The only difference is the number of available channels. Signed-off-by: Maxim Kiselev <bigunclemax@gmail.com> --- .../iio/adc/allwinner,sun20i-d1-gpadc.yaml | 79 +++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 Documentation/devicetree/bindings/iio/adc/allwinner,sun20i-d1-gpadc.yaml
Comments
On Fri, 02 Jun 2023 01:30:40 +0300, Maksim Kiselev wrote: > From: Maxim Kiselev <bigunclemax@gmail.com> > > Allwinner's D1/T113s/R329/T507 SoCs have a new general purpose ADC. > This ADC is the same for all of this SoCs. The only difference is > the number of available channels. > > Signed-off-by: Maxim Kiselev <bigunclemax@gmail.com> > --- > .../iio/adc/allwinner,sun20i-d1-gpadc.yaml | 79 +++++++++++++++++++ > 1 file changed, 79 insertions(+) > create mode 100644 Documentation/devicetree/bindings/iio/adc/allwinner,sun20i-d1-gpadc.yaml > My bot found errors running 'make DT_CHECKER_FLAGS=-m dt_binding_check' on your patch (DT_CHECKER_FLAGS is new in v5.13): yamllint warnings/errors: dtschema/dtc warnings/errors: /builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/iio/adc/allwinner,sun20i-d1-gpadc.yaml: 'maintainers' is a required property hint: Metaschema for devicetree binding documentation from schema $id: http://devicetree.org/meta-schemas/base.yaml# Documentation/devicetree/bindings/iio/adc/allwinner,sun20i-d1-gpadc.example.dts:33.15-25: Warning (reg_format): /example-0/adc@2009000/channel@0:reg: property has invalid length (4 bytes) (#address-cells == 2, #size-cells == 1) Documentation/devicetree/bindings/iio/adc/allwinner,sun20i-d1-gpadc.example.dts:37.15-25: Warning (reg_format): /example-0/adc@2009000/channel@1:reg: property has invalid length (4 bytes) (#address-cells == 2, #size-cells == 1) Documentation/devicetree/bindings/iio/adc/allwinner,sun20i-d1-gpadc.example.dtb: Warning (pci_device_reg): Failed prerequisite 'reg_format' Documentation/devicetree/bindings/iio/adc/allwinner,sun20i-d1-gpadc.example.dtb: Warning (pci_device_bus_num): Failed prerequisite 'reg_format' Documentation/devicetree/bindings/iio/adc/allwinner,sun20i-d1-gpadc.example.dtb: Warning (simple_bus_reg): Failed prerequisite 'reg_format' Documentation/devicetree/bindings/iio/adc/allwinner,sun20i-d1-gpadc.example.dtb: Warning (i2c_bus_reg): Failed prerequisite 'reg_format' Documentation/devicetree/bindings/iio/adc/allwinner,sun20i-d1-gpadc.example.dtb: Warning (spi_bus_reg): Failed prerequisite 'reg_format' Documentation/devicetree/bindings/iio/adc/allwinner,sun20i-d1-gpadc.example.dts:32.23-34.15: Warning (avoid_default_addr_size): /example-0/adc@2009000/channel@0: Relying on default #address-cells value Documentation/devicetree/bindings/iio/adc/allwinner,sun20i-d1-gpadc.example.dts:32.23-34.15: Warning (avoid_default_addr_size): /example-0/adc@2009000/channel@0: Relying on default #size-cells value Documentation/devicetree/bindings/iio/adc/allwinner,sun20i-d1-gpadc.example.dts:36.23-38.15: Warning (avoid_default_addr_size): /example-0/adc@2009000/channel@1: Relying on default #address-cells value Documentation/devicetree/bindings/iio/adc/allwinner,sun20i-d1-gpadc.example.dts:36.23-38.15: Warning (avoid_default_addr_size): /example-0/adc@2009000/channel@1: Relying on default #size-cells value Documentation/devicetree/bindings/iio/adc/allwinner,sun20i-d1-gpadc.example.dtb: Warning (unique_unit_address_if_enabled): Failed prerequisite 'avoid_default_addr_size' doc reference errors (make refcheckdocs): See https://patchwork.ozlabs.org/project/devicetree-bindings/patch/20230601223104.1243871-3-bigunclemax@gmail.com 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.
On 02/06/2023 00:30, Maksim Kiselev wrote: > From: Maxim Kiselev <bigunclemax@gmail.com> > > Allwinner's D1/T113s/R329/T507 SoCs have a new general purpose ADC. > This ADC is the same for all of this SoCs. The only difference is > the number of available channels. Except that it wasn't tested... > > Signed-off-by: Maxim Kiselev <bigunclemax@gmail.com> > --- > .../iio/adc/allwinner,sun20i-d1-gpadc.yaml | 79 +++++++++++++++++++ > 1 file changed, 79 insertions(+) > create mode 100644 Documentation/devicetree/bindings/iio/adc/allwinner,sun20i-d1-gpadc.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 > new file mode 100644 > index 000000000000..94f15bb48231 > --- /dev/null > +++ b/Documentation/devicetree/bindings/iio/adc/allwinner,sun20i-d1-gpadc.yaml > @@ -0,0 +1,79 @@ > +# SPDX-License-Identifier: GPL-2.0 dual license Please run scripts/checkpatch.pl and fix reported warnings. Some warnings can be ignored, but the code here looks like it needs a fix. Feel free to get in touch if the warning is not clear. > +%YAML 1.2 > +--- > +$id: http://devicetree.org/schemas/iio/adc/allwinner,sun20i-d1-gpadc.yaml# > +$schema: http://devicetree.org/meta-schemas/core.yaml# > + > +title: Allwinner D1 General Purpose ADC > + > +properties: > + "#io-channel-cells": > + const: 1 > + > + clocks: > + maxItems: 1 > + > + compatible: > + enum: > + - allwinner,sun20i-d1-gpadc compatible is first property > + > + interrupts: > + maxItems: 1 > + > + reg: > + maxItems: 1 > + > + resets: > + maxItems: 1 > + > +required: > + - "#io-channel-cells" > + - clocks > + - compatible > + - interrupts > + - reg > + - resets required: block goes after all properties. > + > +patternProperties: > + "^channel@([0-15])$": > + $ref: adc.yaml > + type: object > + description: | Do not need '|' unless you need to preserve formatting. > + Represents the internal channels of the ADC. > + > + properties: > + reg: > + description: | Do not need '|' unless you need to preserve formatting. > + The channel number. > + Up to 16 channels, numbered from 0 to 15. Don't repeat constraints in free form text. > + items: > + minimum: 0 > + maximum: 15 > + > + required: > + - reg > + > + additionalProperties: false Hm? So you do not allow anything from adc.yaml related? Are you sure this is your intention? > + > +additionalProperties: false > + > +examples: > + - | > + gpadc: adc@2009000 { > + compatible = "allwinner,sun20i-d1-gpadc"; > + reg = <0x2009000 0x1000>; > + clocks = <&ccu 80>; > + resets = <&ccu 32>; > + interrupts = <0 57 4>; Use proper defines > + #io-channel-cells = <1>; > + > + channel@0 { > + reg = <0>; Broken indentation. Use 4 spaces for example indentation. > + }; > + > + channel@1 { > + reg = <1>; > + }; > + }; > + > +... Best regards, Krzysztof
пт, 2 июн. 2023 г. в 11:38, Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>: Hi Krzysztof, > > On 02/06/2023 00:30, Maksim Kiselev wrote: > > From: Maxim Kiselev <bigunclemax@gmail.com> > > > > Allwinner's D1/T113s/R329/T507 SoCs have a new general purpose ADC. > > This ADC is the same for all of this SoCs. The only difference is > > the number of available channels. > > Except that it wasn't tested... Yes, you are right. I tested it only on the T113s board. And I will be glad if someone tests it on another SoC. ... > Please run scripts/checkpatch.pl and fix reported warnings. Some > warnings can be ignored, but the code here looks like it needs a fix. > Feel free to get in touch if the warning is not clear. I got a warning about required maintainer property. Should I do anything with this? If yes, then who should be a maintainer? ... > Hm? So you do not allow anything from adc.yaml related? Are you sure > this is your intention? I'm not sure about it. I looked at other ADC bindings and didn't find another driver with 'additionalProperties: true'
On Sun, Jun 04, 2023 at 11:20:43PM +0300, Maxim Kiselev wrote: > пт, 2 июн. 2023 г. в 11:38, Krzysztof Kozlowski > <krzysztof.kozlowski@linaro.org>: > > On 02/06/2023 00:30, Maksim Kiselev wrote: > > > From: Maxim Kiselev <bigunclemax@gmail.com> > > > > > > Allwinner's D1/T113s/R329/T507 SoCs have a new general purpose ADC. > > > This ADC is the same for all of this SoCs. The only difference is > > > the number of available channels. > > > > Except that it wasn't tested... > > Yes, you are right. I tested it only on the T113s board. And I will be glad if > someone tests it on another SoC. I would imagine Krzysztof meant testing the binding w/ dt_binding_check etc, rather than testing the ADC itself. > > Please run scripts/checkpatch.pl and fix reported warnings. Some > > warnings can be ignored, but the code here looks like it needs a fix. > > Feel free to get in touch if the warning is not clear. > > I got a warning about required maintainer property. Should I do > anything with this? Yes, you should! > If yes, then who should be a maintainer? You, preferably. > > Hm? So you do not allow anything from adc.yaml related? Are you sure > > this is your intention? > > I'm not sure about it. I looked at other ADC bindings and didn't find > another driver with 'additionalProperties: true' Try `unevaluatedProperties: false` instead. Cheers, Conor.
On 04/06/2023 22:20, Maxim Kiselev wrote: > пт, 2 июн. 2023 г. в 11:38, Krzysztof Kozlowski > <krzysztof.kozlowski@linaro.org>: > Hi Krzysztof, >> >> On 02/06/2023 00:30, Maksim Kiselev wrote: >>> From: Maxim Kiselev <bigunclemax@gmail.com> >>> >>> Allwinner's D1/T113s/R329/T507 SoCs have a new general purpose ADC. >>> This ADC is the same for all of this SoCs. The only difference is >>> the number of available channels. >> >> Except that it wasn't tested... > > Yes, you are right. I tested it only on the T113s board. And I will be glad if > someone tests it on another SoC. Please show me the commands how you tested bindings on T113s board. I really would like to see them... > > ... > >> Please run scripts/checkpatch.pl and fix reported warnings. Some >> warnings can be ignored, but the code here looks like it needs a fix. >> Feel free to get in touch if the warning is not clear. > > I got a warning about required maintainer property. Should I do > anything with this? You should do something because sending broken code is not correct. > If yes, then who should be a maintainer? Someone responsible for this hardware. > > ... > >> Hm? So you do not allow anything from adc.yaml related? Are you sure >> this is your intention? > > I'm not sure about it. I looked at other ADC bindings and didn't find > another driver with 'additionalProperties: true' I didn't write about additionalProperties:true, but about missing ref to adc.yaml. Best regards, Krzysztof
diff --git a/Documentation/devicetree/bindings/iio/adc/allwinner,sun20i-d1-gpadc.yaml b/Documentation/devicetree/bindings/iio/adc/allwinner,sun20i-d1-gpadc.yaml new file mode 100644 index 000000000000..94f15bb48231 --- /dev/null +++ b/Documentation/devicetree/bindings/iio/adc/allwinner,sun20i-d1-gpadc.yaml @@ -0,0 +1,79 @@ +# SPDX-License-Identifier: GPL-2.0 +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/iio/adc/allwinner,sun20i-d1-gpadc.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Allwinner D1 General Purpose ADC + +properties: + "#io-channel-cells": + const: 1 + + clocks: + maxItems: 1 + + compatible: + enum: + - allwinner,sun20i-d1-gpadc + + interrupts: + maxItems: 1 + + reg: + maxItems: 1 + + resets: + maxItems: 1 + +required: + - "#io-channel-cells" + - clocks + - compatible + - interrupts + - reg + - resets + +patternProperties: + "^channel@([0-15])$": + $ref: adc.yaml + type: object + description: | + Represents the internal channels of the ADC. + + properties: + reg: + description: | + The channel number. + Up to 16 channels, numbered from 0 to 15. + items: + minimum: 0 + maximum: 15 + + required: + - reg + + additionalProperties: false + +additionalProperties: false + +examples: + - | + gpadc: adc@2009000 { + compatible = "allwinner,sun20i-d1-gpadc"; + reg = <0x2009000 0x1000>; + clocks = <&ccu 80>; + resets = <&ccu 32>; + interrupts = <0 57 4>; + #io-channel-cells = <1>; + + channel@0 { + reg = <0>; + }; + + channel@1 { + reg = <1>; + }; + }; + +...