Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp12617992rwd; Fri, 23 Jun 2023 08:23:54 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5HjIDr9VG+OlkI1Gxs0QJvGWBkBI8/RHOYlcvOMKIOAKM0eAQUNFiNloISzjyBH8ZUTG0u X-Received: by 2002:a17:903:258e:b0:1a1:bf22:2b6e with SMTP id jb14-20020a170903258e00b001a1bf222b6emr20174141plb.43.1687533834221; Fri, 23 Jun 2023 08:23:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687533834; cv=none; d=google.com; s=arc-20160816; b=KmTduUZJ9ad7guS5ZC3C5ehdM7stvLC5DSGwTtqWE1h1/jo/gz/yLBJbSkCr8v5N/9 9M+0QQu7fdk3Gze5jE2wrgHr/ZMuGCXvm5o3Wb48y3j424IorQOn1WTgR8KdvUuyxWYE yOYKA99Hb3t4Q38VSMuhAD1fOleCnvlncecriPrglu9hRPjlPqqnpOQ5bsW0mySPiWdV qcuO88ZU39Q13brrv4dYAuKzOlZj2SJAwiMc8UVu/klGyEkbHaDsFJ2viemE54dRoJpo wZINWJ32hZzP8l+tkDHuTY2ugwFTOE29sOli1b4OkOvUpBWQ9+tb5qYuSu0cJCYzGN/Q RX/Q== 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=JmK+X4w2JDt7glvIU2n/9UBwkvorFsOPkeHF1PBbMl8=; b=NAJAjJx236KwBYKotWqM52vE8/hdRNNZYxBmbAIPsWDzF5xasLHzSd5spWyem3m6Gs dbflM5QIhfr2d3khx9RiINPH9m06BSHVHvd/yumk3GgBsBrY6OEHRS/kLO/jvOp6UFF/ v2qovWE1/uc/Qffoi5YG0s3yUrgiP7sm7lCipY25+TFCjC45ONQKyma2HJ2ScoKi5Q68 I+kJlsCwFPMS/Vds/iX7+gZK+cyTH39YStm/CGS9Of8pTlul8oi3VItRMlSoaVG7sEoi +6DZ96HChycCZVV8R6sZRn+XVvJIsaKaIg+UuFe1ZCzvNYmNiSHhVWxNrXVZ+rgu4pa/ QjMw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=IvRKddzW; 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 j14-20020a170902da8e00b001b3d5ec6739si9664034plx.481.2023.06.23.08.23.07; Fri, 23 Jun 2023 08:23:54 -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=IvRKddzW; 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 S232429AbjFWPJ4 (ORCPT + 99 others); Fri, 23 Jun 2023 11:09:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57556 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232211AbjFWPJh (ORCPT ); Fri, 23 Jun 2023 11:09:37 -0400 Received: from mail-lf1-x130.google.com (mail-lf1-x130.google.com [IPv6:2a00:1450:4864:20::130]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EA4A31BFC; Fri, 23 Jun 2023 08:09:28 -0700 (PDT) Received: by mail-lf1-x130.google.com with SMTP id 2adb3069b0e04-4f8735ac3e3so986773e87.2; Fri, 23 Jun 2023 08:09:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1687532967; x=1690124967; 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=JmK+X4w2JDt7glvIU2n/9UBwkvorFsOPkeHF1PBbMl8=; b=IvRKddzWyRQyw+xwk6MbNTRvVVi6IFdH2WsOzX+v3ReY4ucJBb4bLNrbjUhLcD2bda 5f/r9BDmvzWagtNO5tiXRcvFWZh48Yj+Gt7YKGwB808wB2FXIWpSylNrLR4Gq3/GmWEY VtdQXQaS/TbbvpRjBv878UBY4h4Ac0+OF997CbjGLi+iCwFxhzYXrTbugiIglF5Cj8Qc QR+Sb262sKTcY8bUWBZwePGJ7WleW8EzJqQDoAq6lrUYusjpGQDCHVCXzEpjAgJgGfLR 17ylwWzxLL6KrEfnh6JqARk14YqWkARMEd09K0fvqZQG1qjgebcssghv4/D/WLRIBP3r yBKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687532967; x=1690124967; 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=JmK+X4w2JDt7glvIU2n/9UBwkvorFsOPkeHF1PBbMl8=; b=A7WB+cvsyHeTf27hS6czr2nXNsEoAObpJBN97ZRy1KGoF9U/D0btcL6EcVrkS9Y0gs r6HpyHHayOZduxiFjlG59+FaZvSV3/u1B24HxJu1+B9Urrtt99FiG0fXcc88f8KjhGF3 +aH+aqBW6wLD2PYMrecQL6xrfR5J8SQqzTmMOTsdrCILI9Lrqj46fthWccaUgqtIsjvS BCeTWxkXo1/HhbfkrtLFZSJBj0+hjEQVu9pk94Qm4YGKRGuTgGkpM7MbuOdgJITv0WjC 71lS4jEKTkcrWJfv+uTRR92nNmXhH4iLmye9bFYP9EyD5M9YthhtK1WBRBMRA9TvLnky tKNw== X-Gm-Message-State: AC+VfDygnIeRegVntII/nBAkD8SiY2tvKov9gfD+GCDPcPbN0gI4CTbD xvwcbjbS5j3cFH9N62bGCO9yETP0iE5M X-Received: by 2002:a19:384a:0:b0:4f8:5637:2cd0 with SMTP id d10-20020a19384a000000b004f856372cd0mr12315046lfj.26.1687532966416; Fri, 23 Jun 2023 08:09:26 -0700 (PDT) Received: from localhost.localdomain (mail.pulsar-telecom.ru. [94.181.180.60]) by smtp.gmail.com with ESMTPSA id w25-20020a19c519000000b004f842e58d08sm1465686lfe.84.2023.06.23.08.09.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 23 Jun 2023 08:09:26 -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 v2 1/3] dt-bindings: pwm: Add binding for Allwinner D1/T113-S3/R329 PWM controller Date: Fri, 23 Jun 2023 17:59:59 +0300 Message-Id: <20230623150012.1201552-2-privatesub2@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230623150012.1201552-1-privatesub2@gmail.com> References: <20230623150012.1201552-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 | 83 +++++++++++++++++++ 1 file changed, 83 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..eec9d1dd67c2 --- /dev/null +++ b/Documentation/devicetree/bindings/pwm/allwinner,sun20i-pwm.yaml @@ -0,0 +1,83 @@ +# 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 + description: module reset + +allOf: + - $ref: pwm.yaml# + + - if: + properties: + compatible: + contains: + const: allwinner,sun20i-r329-pwm + + then: + properties: + allwinner,pwm-channels: + $ref: /schemas/types.yaml#/definitions/uint32 + description: The number of PWM channels configured for this instance + enum: [6, 9] + + required: + - allwinner,pwm-channels + +required: + - compatible + - reg + - "#pwm-cells" + - clocks + - clock-names + - resets + +additionalProperties: false + +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