Received: by 2002:a05:7412:bb8d:b0:d7:7d3a:4fe2 with SMTP id js13csp1549rdb; Mon, 14 Aug 2023 07:55:53 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHhgz+3ZqQKGImlV0jJSSxsoJ5B1/jWaxOGJnI7kGN6EA+0vSGHdpFbZx9QQxqGSlRATQoa X-Received: by 2002:a05:6a20:158d:b0:137:2d73:707f with SMTP id h13-20020a056a20158d00b001372d73707fmr11438357pzj.5.1692024953410; Mon, 14 Aug 2023 07:55:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692024953; cv=none; d=google.com; s=arc-20160816; b=mr8kb92fmUw063F32S2SiLIYQwBBndhYnq81664SGSHgItut0y2QfmIbUAGY5E10xH NhojY6RpGeJ0FFBk+bZDdLPzlk8YbFVZOtL5xLzNUQPVzwls8GmemPI77E7FJFdL5IGd phyH4dIWzOFrXlJ4BwiXU0BKvXzNAitpkV2e3+cGwcPAzeCUah7L8snFtm1SPRuhZIyE lLvsmf1jwSQqt8HN9Ig29YvV7ADP5ip4Ht0x+9oXH2sLp9CTXnWIqTZNjYNYn6W3LICN HzaD1bl7r/JOk6OeZz7wADwkMoJuwxP95LgrzpYRuo2JCg8++S5WMxoUp7K8ekoxqaP6 LoGw== 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=CaHw6FSzB6D/cmI2sFQa1bF3mX4riXTCludXEuBTPcs=; fh=Gvn+ALr7vLO8yO+NiEr3DY21menzJBkEZiCmf4Gj6Y4=; b=OMs3jm+1WXC5NvdB8gioh4Fo1mYvkY3gxunGkz2ZJvhtBSJR0KHQ2ZiMpdtcUrpBMa XTpqmbUW4UaGYGZTgUzrHRr5D8k2TNZty4QbL3euwrfb0fb8ym8srpe2c8B9F6zSci4a c+n9ACgNoKR0BtYor/LMAmbBvZef0KxeskGIOs3bE7MmaGfygKzW//AQp4xVtLIlkL5W 8wmcS8W6eXyxqqVdeuVdhvpPvG4v55Zc/M/4w0NDpI/KStW4P5LI1VIZnwaYgWdj17qR 527yZ5tQfGTobrww0i1yfac3kOukUaH7Bk7t7hulX8oHVHK/uRYJknERYbfOJTEYPrH8 f1/A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=AYV7B5rt; 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 k196-20020a636fcd000000b00565bcc6a256si1793931pgc.821.2023.08.14.07.55.41; Mon, 14 Aug 2023 07:55:53 -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=AYV7B5rt; 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 S231441AbjHNNdm (ORCPT + 99 others); Mon, 14 Aug 2023 09:33:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43788 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231488AbjHNNdN (ORCPT ); Mon, 14 Aug 2023 09:33:13 -0400 Received: from mail-lf1-x12f.google.com (mail-lf1-x12f.google.com [IPv6:2a00:1450:4864:20::12f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A579918B; Mon, 14 Aug 2023 06:33:11 -0700 (PDT) Received: by mail-lf1-x12f.google.com with SMTP id 2adb3069b0e04-4fe8c3b5ca0so6919385e87.1; Mon, 14 Aug 2023 06:33:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1692019989; x=1692624789; 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=CaHw6FSzB6D/cmI2sFQa1bF3mX4riXTCludXEuBTPcs=; b=AYV7B5rtspunDbyD7cEzXMshN/+tnd10OyL0GTD9Vs668yn0stRIpfUbuxr4MDTV/g 6MZbJmbwDchn/I/EX/9FSLiQeiCRJ3yx+ooLJmMa5k1HFAzcyQc+NK7LXOiLW7by+hip f888wDLhPmnJjnWetRhnegs1QB6/IitY8HZfxYGxapLJTKuKMLUi0SpJJPI/rZupoe2o aWoTTv/lh6mZHk7JInvlW2CxHMGU8v2BUkRuQ7rS+U9CN8bWMOqYIh1YXDklHhgEnzEw oKZJ721a22pMuRRWOu0ZQIED02SG2JJoJNVhMCQPxG1znldctuIjpeS0sK52GwDCeEM4 I6gg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692019989; x=1692624789; 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=CaHw6FSzB6D/cmI2sFQa1bF3mX4riXTCludXEuBTPcs=; b=b7DpexkVe5CMVTScZme4BL3oDHuGiEc/Su4S3UYP0fEXNwvhoz8rHQlTNBnyCQc1ps shaRit8Ct8ZvV0HYibmV43wzjq+PRGEEHZbX3xHCDtvHz5bLg+NEJqOFQb2eUaeK6MvI 4udGeDopZd78xmvT4Ga6hJKnQQ0BaGaWAB2PWqDtS8PpF39j9nUD3Vi4FdxU9RFqnRTN lS8N6sv8kiaVKtO/j8kVUabSWUkVExccLgKcfklx55609wGKjD2PmGVLwUpDmrba52MA Ag9DKdXTK+6QizRkabvnVthDL7RvAx1hNaeLIl54zfFYRY5O9yY+Mo24rJ6A8NK9uvi1 bznA== X-Gm-Message-State: AOJu0YwoBjrjoQhIPCVTMtk1HRKLLH7shXWMftT6bJHZzcS6e7uDwPuS lO4j1pvQPqXmHa3wH9jWEPa+dK15+2td5f0= X-Received: by 2002:a05:6512:15a7:b0:4f9:6842:afc with SMTP id bp39-20020a05651215a700b004f968420afcmr8011655lfb.64.1692019989211; Mon, 14 Aug 2023 06:33:09 -0700 (PDT) Received: from localhost.localdomain (mail.pulsar-telecom.ru. [94.181.180.60]) by smtp.gmail.com with ESMTPSA id eo12-20020a056512480c00b004f858249932sm1990566lfb.90.2023.08.14.06.33.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Aug 2023 06:33:08 -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 , 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 v5 1/3] dt-bindings: pwm: Add binding for Allwinner D1/T113-S3/R329 PWM controller Date: Mon, 14 Aug 2023 16:32:16 +0300 Message-Id: <20230814133238.741950-2-privatesub2@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230814133238.741950-1-privatesub2@gmail.com> References: <20230814133238.741950-1-privatesub2@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.8 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 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 | 85 +++++++++++++++++++ 1 file changed, 85 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..9512d4bed322 --- /dev/null +++ b/Documentation/devicetree/bindings/pwm/allwinner,sun20i-pwm.yaml @@ -0,0 +1,85 @@ +# 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: + properties: + allwinner,pwm-channels: false + +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