Received: by 2002:a05:6358:51dd:b0:131:369:b2a3 with SMTP id 29csp1239089rwl; Thu, 10 Aug 2023 08:19:51 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH8zQu7znaSNL6yZSt5z6H6Y3EKiKJiQdssWyawdI3GQooWY8VDCG35HTtYsTh3+a1j41YL X-Received: by 2002:a05:6a20:1455:b0:135:110c:c6de with SMTP id a21-20020a056a20145500b00135110cc6demr3697397pzi.6.1691680791065; Thu, 10 Aug 2023 08:19:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691680791; cv=none; d=google.com; s=arc-20160816; b=HIUxfSApDixCpUELw4Vs8BuTgmDmGC1PDzQz300l21qhkEsmNaP9Ip2LTq5GzeEymR m8VxRK3UriSIry+JfGC5pRaeIB0+/+KEyiNWZtRXFOpod50uxyE08+gKrqOOzzXmmzX6 rnlMebK1TmDTpSIVQfGIPB+06QXfvCLW/kZJ8lnGziJ7vKeAbeMsXqw/H7LJFP43nvf1 lZoMKP4djit1Z8Ez1E8SyemfG8WNZ6OfPNz19Y63JJb3ZjnX0igLjG0iyT4G/tfoltl6 ba+j01UVctFO9doPMu3ZeQgplG+OGNF3AKhIzt5lt+476rrQNBgykiC5nfgWP2XRo19s Takw== 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=kRxyFJghjCnQIRr0vNPfxpwI8WCKYIR4NizBfV/QeMQ=; b=0m4wYPbAgM7vtg4Ll0nF2i17llZuZwacsz0BpMY0rhAOTAs/2Me8IzeEitaYRg7+fD fdNV4Wz6sXeXNQD/5MNgiAZnFtWxnqQBMSYdorkIf7mnBG/ZdtnbflMfRS2SYLVPateQ tDFNU3yXjspE5x1NZEzbiH9T1ZtvL+CD1GpLuYi0GxqfNX5ejPKHrSXyRkWOgrPrYaz0 tk5wrGtbj6OYaHRWtaKoBHF6BxVYBhhP6rqCySOs0uMmWiBlh/fBDGwTRAF6P2bF7WfS ar2qIsdF0cxiMUSJjtZ6Yv+YUljYQqTXOgpk7wMCw/HIocLlOJCYj7bp+JD+azmwLFwu c+sw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=bJofwah3; 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 cg9-20020a056a00290900b0067bc790ce11si1680647pfb.161.2023.08.10.08.19.39; Thu, 10 Aug 2023 08:19:50 -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=bJofwah3; 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 S235943AbjHJO4G (ORCPT + 99 others); Thu, 10 Aug 2023 10:56:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33932 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235944AbjHJO4D (ORCPT ); Thu, 10 Aug 2023 10:56:03 -0400 Received: from mail-lf1-x134.google.com (mail-lf1-x134.google.com [IPv6:2a00:1450:4864:20::134]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F252C2698; Thu, 10 Aug 2023 07:56:01 -0700 (PDT) Received: by mail-lf1-x134.google.com with SMTP id 2adb3069b0e04-4fe1489ced6so1573043e87.0; Thu, 10 Aug 2023 07:56:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1691679360; x=1692284160; 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=bJofwah3+UqeRBZ9i34YD/7ICPZZ900eAwWquy0VJ8yGlbYTyopNXyS0N3UlVmG9fd EiHnBo8cOIbA8rvKu/FKLPIc7NbZG7DeeWrkvTP+zB6orKF/EOva1e3RjcQmuFSznGWG sODNX2bhMk0UWgQMtsKY9tXIQy++D3jnLYMU1BZxwEJcc53vV5V/puib2OU+GR0hlED+ 4ZWXWh6nx/RE4Vp7QcCba9fPNPA3K1Z7z0gxjYFKTq+JEkG1grZbgM2mPlbY9OPCZK9k aJl7N6iHnT0AIyCBnC5ah10/9WVT59lpVEFL7HQHaKco8BK1Fbw6y6TzN2t8OR4hFIkU 5iQA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691679360; x=1692284160; 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=SEkSQJKeVBtMxYNmHprCUskjDMzoXz2aw91qhLnns6QICaZ30TORCcLveZ3keQ7IQk zZ26voXUisLYp/3JJw2lAoC2hcy2FId/S1tyaq//jxz7yrPQ1FS8DA5Vyc2kaVrETQjW 6KEQO7UF47kF1owMYos8AzmTB9Sr3hf7o1hHofImRHPcUec0TBhV3Cdq33J56m9UlvXv T715DgHnWgKioHFTaQuBdNJE6KRxI3K1wSQh6M9ibkysGCGIAodKp15vvP1Rro+NSQIc Br5sLj/Ng626XDSeTelOh3PkkjDVdWt47t7DpqgLSJXoIlUSpAVs5woO1r8Jw1Nqz2Gs NEVA== X-Gm-Message-State: AOJu0YwDCd8sbZrbA6YoiycfWqPiZUWq4j4AI4hgN33RN0eFtncVGiO+ j5BOMQewcngxCRs/qyzn/2uYevHtT04deMY= X-Received: by 2002:a05:6512:110a:b0:4fe:55ba:d541 with SMTP id l10-20020a056512110a00b004fe55bad541mr2121757lfg.50.1691679359661; Thu, 10 Aug 2023 07:55:59 -0700 (PDT) Received: from localhost.localdomain (mail.pulsar-telecom.ru. [94.181.180.60]) by smtp.gmail.com with ESMTPSA id p12-20020ac246cc000000b004fe0de39fddsm308496lfo.290.2023.08.10.07.55.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Aug 2023 07:55:59 -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 , Heiko Stuebner , 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 v4 1/3] dt-bindings: pwm: Add binding for Allwinner D1/T113-S3/R329 PWM controller Date: Thu, 10 Aug 2023 17:54:26 +0300 Message-Id: <20230810145443.1053387-2-privatesub2@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230810145443.1053387-1-privatesub2@gmail.com> References: <20230810145443.1053387-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_BLOCKED,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 | 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