From patchwork Sun Jun 4 18:53:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maksim Kiselev X-Patchwork-Id: 689557 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7D51EC7EE23 for ; Sun, 4 Jun 2023 18:55:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232316AbjFDSzE (ORCPT ); Sun, 4 Jun 2023 14:55:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42352 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232349AbjFDSzC (ORCPT ); Sun, 4 Jun 2023 14:55:02 -0400 Received: from mail-wr1-x42e.google.com (mail-wr1-x42e.google.com [IPv6:2a00:1450:4864:20::42e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B10F8F2; Sun, 4 Jun 2023 11:54:57 -0700 (PDT) Received: by mail-wr1-x42e.google.com with SMTP id ffacd0b85a97d-30ad99fa586so4062722f8f.2; Sun, 04 Jun 2023 11:54:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1685904896; x=1688496896; 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=rzwo7MuRNtXcUZRiLMVdnWkiH+vug12Y5tIMzd06xkc=; b=dtN7wjZaTsNocuP8paje8z4jh1t3o0zPEL3lUe7icfmKJdzzwEkLu3ZlOkLep+5h7A nQPAFEOZHswTycVAzk7lBOzxGo3fehL6FpUEajH5Xm2/+1BCoBC/AHPzAu/j4bdz/102 7+Di/Xcd29LGaB5a84q5Lz7TmgDR+53IVZbDDrAUjcH/oxOJVC9daVopBFcRYZj0LTaX 6m9zQ8SAK6EE4mS35EPZBfvvLLc++pnEWeOjG1OBLxZT+boOPJki3dUAFT7LsY3+IFUh gJQKjNfn+E/KUE1SkcLGCqrIVPFP+YSqB1hF/qaRaQVte9rvkejtlieRxSHc2vAg+uDQ DGsw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685904896; x=1688496896; 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=rzwo7MuRNtXcUZRiLMVdnWkiH+vug12Y5tIMzd06xkc=; b=C8nVLgO3D4JZRm6nGHh5UTyu5/8snZUgJI667+f3xcY3u6urX+sCWV00TGXP8RN09/ fNYpaHWm0GT2BTlNqptGwWqdlY1X7O+riKTtQQNpNgKW4PTOfwOxr4LSkFTjBu6Qy38P APRyp/9ZnsEHMoJbTkKHcnuXqR73MQGt9ZLORix5Z68ahDSDyCkzQR5Xf5B/VHK4grM0 6+w1fB2PFbwn4mnqN8908bQZ/6qip0vwGAg8gpO1XIO0L+kItQgwUK8Al9WsTSBRX9Po GJRLKwLjWWyuTIpqsyGQYXl6cR4+NB+YzeTFZE/VphsRzqdgACllcNp9FBthp8/fuzFv n7/w== X-Gm-Message-State: AC+VfDxEp6RXWeoCMxlrNmHb2PQar2LteqWJskCqaBdxtD2qWpP1MjYK q5FVgyofV0ukhy+9jlN2zC/yO7z9s2OXAmhv X-Google-Smtp-Source: ACHHUZ6WPc41MHqJ5k7vxlqwfogl5pFyEWUQthcw6x2G2C2ELZojXFFKjeH8EGTKwra3U2mEHKzb3Q== X-Received: by 2002:a5d:65c2:0:b0:30a:edc0:c960 with SMTP id e2-20020a5d65c2000000b0030aedc0c960mr4366494wrw.26.1685904895665; Sun, 04 Jun 2023 11:54:55 -0700 (PDT) Received: from user-PC.. ([178.134.198.138]) by smtp.gmail.com with ESMTPSA id l8-20020a5d4108000000b00304adbeeabbsm7636433wrp.99.2023.06.04.11.54.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 04 Jun 2023 11:54:55 -0700 (PDT) From: Maksim Kiselev To: linux-iio@vger.kernel.org Cc: Maxim Kiselev , Jonathan Cameron , Lars-Peter Clausen , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , Paul Walmsley , Palmer Dabbelt , Albert Ou , Philipp Zabel , Cristian Ciocaltea , Andre Przywara , Andy Shevchenko , Cosmin Tanislav , ChiYuan Huang , Miquel Raynal , Arnd Bergmann , Mike Looijmans , Ramona Bolboaca , Ibrahim Tilki , Caleb Connolly , William Breathitt Gray , AngeloGioacchino Del Regno , ChiaEn Wu , =?utf-8?q?Leonard_G=C3=B6hrs?= , Haibo Chen , 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 v3 2/3] dt-bindings: iio: adc: Add Allwinner D1/T113s/R329/T507 SoCs GPADC Date: Sun, 4 Jun 2023 21:53:15 +0300 Message-Id: <20230604185336.1943889-3-bigunclemax@gmail.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230604185336.1943889-1-bigunclemax@gmail.com> References: <20230604185336.1943889-1-bigunclemax@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org From: Maxim Kiselev 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 --- .../iio/adc/allwinner,sun20i-d1-gpadc.yaml | 90 +++++++++++++++++++ 1 file changed, 90 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..8850cd296e6d --- /dev/null +++ b/Documentation/devicetree/bindings/iio/adc/allwinner,sun20i-d1-gpadc.yaml @@ -0,0 +1,90 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%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: + compatible: + enum: + - allwinner,sun20i-d1-gpadc + + "#io-channel-cells": + const: 1 + + "#address-cells": + const: 1 + + "#size-cells": + const: 0 + + clocks: + maxItems: 1 + + interrupts: + maxItems: 1 + + reg: + maxItems: 1 + + resets: + maxItems: 1 + +patternProperties: + "^channel@([0-15])$": + $ref: adc.yaml + type: object + description: + Represents the internal channels of the ADC. + + properties: + reg: + items: + minimum: 0 + maximum: 15 + + required: + - reg + + additionalProperties: false + +required: + - "#io-channel-cells" + - clocks + - compatible + - interrupts + - reg + - resets + +additionalProperties: false + +examples: + - | + #include + #include + #include + #define SOC_PERIPHERAL_IRQ(nr) (nr + 16) + + gpadc: adc@2009000 { + compatible = "allwinner,sun20i-d1-gpadc"; + reg = <0x2009000 0x1000>; + clocks = <&ccu CLK_BUS_GPADC>; + resets = <&ccu RST_BUS_GPADC>; + interrupts = ; + #io-channel-cells = <1>; + + #address-cells = <1>; + #size-cells = <0>; + + channel@0 { + reg = <0>; + }; + + channel@1 { + reg = <1>; + }; + }; + +...