Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp17382005rwd; Tue, 27 Jun 2023 02:07:26 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6J00pezIDDea5Hiut/u2fdDSFdUjML3SFe/Ax61oCnma7dsMc5ofqVpo8GMPApHL8eOVMy X-Received: by 2002:a05:6402:2d1:b0:51c:d01d:ce7 with SMTP id b17-20020a05640202d100b0051cd01d0ce7mr6684227edx.33.1687856846298; Tue, 27 Jun 2023 02:07:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687856846; cv=none; d=google.com; s=arc-20160816; b=O388dKws66YXBvaCivcZLPrV8d1yJV0o9qzqLuT7QPPoVdSkvrtyu+gort1QZsf0Uv DMCc0KzjeMVPob1En6rTuCpo5Ih94K0m4PkqdAA/Zno0xp7S2lyzEu4X8/PfjquoSlWW mbNP/+SxcAnD2v7zapfGg2gmN8Cb7oWMw/abXImGHEWZWetdlvT+dupZ1+eHnyuAi4j0 4+0rpRzj9cNA1JqhMIL6FqzmpuVSqc03ZKvV9AxEAAHp+Tvj1yWIihYRdk22qL7Hg34/ POW/PRUSgDE/I6xaRxCoU0CxqYmF6sbYksSc/L47khRhQcHUNds7AVWNUh3G6GB4XrV1 t2hw== 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=UR637DGW7U+8J1v52/3DiqPM0xg6ESr2sC1jjmXcP0A=; fh=wWekuIEMBAGBRQn6DxIze36UBbje5RlANV3hihWlpCA=; b=YMOsx2bPsEcZp+W1exGSX0d0eYAxvsN0BzuRQTzJ6wZ6ucMjDbKNE5+zfVmZEdkI2Y +nPx2dxPvdhZGwM2N2ZWZjcjYhQiw4/mTle2lAvCPOJQL/NZqKlGEHs60yPPZr8VNFch a8j7aghGojsdVDW9s61i4o+muO+d2JVQyN4evO4byTAtaMAkP6vK7IfvJ9PuxcRSlTRS oNCNpG9hcGFU95y7l/u3USS950N+x/WP5Sais3VoRWFkg3HJQ1CdrfYc/w5lsj7NuuKR qsKrSRiVo327DoLUrIQ+fs/eBY/sEdo/ZjpcrWBldNS8+LlX4xYwu0O9dYFo/Cc0/7fU OUHA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=BLDWoUFt; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id be17-20020a0564021a3100b0051d802660e7si3937307edb.647.2023.06.27.02.07.01; Tue, 27 Jun 2023 02:07:26 -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=BLDWoUFt; 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 S231781AbjF0IYt (ORCPT + 99 others); Tue, 27 Jun 2023 04:24:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33544 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231770AbjF0IYg (ORCPT ); Tue, 27 Jun 2023 04:24:36 -0400 Received: from mail-lf1-x133.google.com (mail-lf1-x133.google.com [IPv6:2a00:1450:4864:20::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BEA78270F; Tue, 27 Jun 2023 01:24:04 -0700 (PDT) Received: by mail-lf1-x133.google.com with SMTP id 2adb3069b0e04-4fb7769f15aso2543476e87.0; Tue, 27 Jun 2023 01:24:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1687854242; x=1690446242; 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=UR637DGW7U+8J1v52/3DiqPM0xg6ESr2sC1jjmXcP0A=; b=BLDWoUFtt3Bo7ljQfBO5wWhIJ0UQ+3mJWwUnIuj1QstxE8M9wCvdk6Jwe7Jexayq6s NOaJj0eh7j+IfOFIGatQd7NG8+2z5bbNyq0V19seJ+Umk7Tt+PnycA+dYggdsH58q6gq xRhpDRXCfASOONUgw7UqeoY+fYWrQzPqUlBScflYOUPXb4KRr580QFiaWzwOiWFMH2Bh 41iGVHf4sWkdAkkC3onjqB8hNJ9kaS8Bp8VQc4K24+1xN+4qC3fVxiX9GzQmaSuMI6hf FqYY1+S8qhrDbuBaabF+blZVJq48f21E8x536x7kQSe00BMrkvxHzZ0/eAtp0L2f7J+R Yrrw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687854242; x=1690446242; 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=UR637DGW7U+8J1v52/3DiqPM0xg6ESr2sC1jjmXcP0A=; b=PxBpQa0Yq3K8K+97UBMRTXgfPIQGQZoxCBS9kWt5x96eiypXbEi0iDS3PGISo21xA1 mKCmG6IPbMI8WrvzLWRvxUwDrOl3YyXafiLlGU1WJ6sQY1X2UJymyrHM3hOHGQUElNIt uxh6u79Uio+I6ToHXjKc+zBlZoOCaF1V9UjxLnMIyGpTAK8uhTLzEHO1CCjwbI0oHcdl +MXCFmRxMiLstwmuK7BtWU4GlXVpi1BBIIrFb948OOj07aQand8xY3qqVGmIE9Wlv2g+ Nki6z9aMKMayeozMcXynwQNCVxwC80GK2oasnEdTOB8ttApU3CZ19stjqLNCqTQKT6HT W6/w== X-Gm-Message-State: AC+VfDyL1Tjnj0rWna2V+Bpgg66qg7m7sROLadi8qPdnlFPAOnw/NhzM yyEH/pXIX98wnDqMBQ5NjATpLZH2MLp8W6o= X-Received: by 2002:a19:5057:0:b0:4f9:5396:ed1b with SMTP id z23-20020a195057000000b004f95396ed1bmr12121804lfj.28.1687854242296; Tue, 27 Jun 2023 01:24:02 -0700 (PDT) Received: from localhost.localdomain (mail.pulsar-telecom.ru. [94.181.180.60]) by smtp.gmail.com with ESMTPSA id i12-20020a056512006c00b004eb12329053sm1420673lfo.256.2023.06.27.01.24.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Jun 2023 01:24:01 -0700 (PDT) From: Aleksandr Shubin To: linux-kernel@vger.kernel.org Cc: Aleksandr Shubin , Thierry Reding , =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= , 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 , linux-pwm@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-riscv@lists.infradead.org Subject: [PATCH v3 1/3] dt-bindings: pwm: Add binding for Allwinner D1/T113-S3/R329 PWM controller Date: Tue, 27 Jun 2023 11:23:24 +0300 Message-Id: <20230627082334.1253020-2-privatesub2@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230627082334.1253020-1-privatesub2@gmail.com> References: <20230627082334.1253020-1-privatesub2@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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: X-Mailing-List: linux-kernel@vger.kernel.org Allwinner's D1, T113-S3 and R329 SoCs have a new pwm controller witch is different from the previous pwm-sun4i. The D1 and T113 are identical in terms of peripherals, they differ only in the architecture of the CPU core, and even share the majority of their DT. Because of that, using the same compatible makes sense. The R329 is a different SoC though, and should have a different compatible string added, especially as there is a difference in the number of channels. D1 and T113s SoCs have one PWM controller with 8 channels. R329 SoC has two PWM controllers in both power domains, one of them has 9 channels (CPUX one) and the other has 6 (CPUS one). Add a device tree binding for them. Signed-off-by: Aleksandr Shubin --- .../bindings/pwm/allwinner,sun20i-pwm.yaml | 86 +++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 Documentation/devicetree/bindings/pwm/allwinner,sun20i-pwm.yaml diff --git a/Documentation/devicetree/bindings/pwm/allwinner,sun20i-pwm.yaml b/Documentation/devicetree/bindings/pwm/allwinner,sun20i-pwm.yaml new file mode 100644 index 000000000000..4e6eaa18f342 --- /dev/null +++ b/Documentation/devicetree/bindings/pwm/allwinner,sun20i-pwm.yaml @@ -0,0 +1,86 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/pwm/allwinner,sun20i-pwm.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Allwinner D1, T113-S3 and R329 PWM + +maintainers: + - Aleksandr Shubin + +properties: + compatible: + oneOf: + - const: allwinner,sun20i-d1-pwm + - items: + - const: allwinner,sun20i-r329-pwm + - const: allwinner,sun20i-d1-pwm + + reg: + maxItems: 1 + + "#pwm-cells": + const: 3 + + clocks: + items: + - description: 24 MHz oscillator + - description: Bus Clock + + clock-names: + items: + - const: hosc + - const: bus + + resets: + maxItems: 1 + + allwinner,pwm-channels: + $ref: /schemas/types.yaml#/definitions/uint32 + description: The number of PWM channels configured for this instance + enum: [6, 9] + +allOf: + - $ref: pwm.yaml# + + - if: + properties: + compatible: + contains: + const: allwinner,sun20i-r329-pwm + + then: + required: + - allwinner,pwm-channels + + else: + not: + required: + - allwinner,pwm-channels + +unevaluatedProperties: false + +required: + - compatible + - reg + - "#pwm-cells" + - clocks + - clock-names + - resets + +examples: + - | + #include + #include + + pwm: pwm@2000c00 { + compatible = "allwinner,sun20i-d1-pwm"; + reg = <0x02000c00 0x400>; + clocks = <&dcxo>, <&ccu CLK_BUS_PWM>; + clock-names = "hosc", "bus"; + resets = <&ccu RST_BUS_PWM>; + #pwm-cells = <0x3>; + }; + +... -- 2.25.1