From patchwork Thu Mar 15 16:25:09 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Harald Geyer X-Patchwork-Id: 10285151 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 27F8A60291 for ; Thu, 15 Mar 2018 16:27:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 163C628770 for ; Thu, 15 Mar 2018 16:27:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0AD7828A78; Thu, 15 Mar 2018 16:27:47 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 64F2E28770 for ; Thu, 15 Mar 2018 16:27:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=4HpxVGziI1txR10q3pzCiri/vgTjdnLWJxMPumizEag=; b=krIDQyQXRLy91/IKMj0PVhscjW F9JdA57xWgr197F5bYRGagpCnhd9kGpwalmmBXvKwOR1XFfn+UK+vTzM8RovgOcL7VGemiH0mcYDk mQgZvkCtQd4a4zCNd+WHTMw4oEbtHKEkj4w4Ve1qPzSbK46fvNSfk36yi3MCnNWRiElA3KJhi9NCk SxvoerF9OKfhrnKRwmTWRP6H0jR0vHf1XDvwYDyb0/sp1p9/u9Wdt87iZmZuCglgNH8oHS29oIjN7 ISdTmOW4EYthqk9KwnsvdkFmxB8c/wx0Piufph8pGyimaZHVRKx+9ytDnKogaN2YuVCaTnkcxbhzj XHLMwduA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1ewVj8-0001GT-9m; Thu, 15 Mar 2018 16:27:38 +0000 Received: from h1.radempa.de ([176.9.142.194] helo=mail.cosmopool.net) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1ewVhF-0008QS-Nv for linux-arm-kernel@lists.infradead.org; Thu, 15 Mar 2018 16:25:45 +0000 Received: from localhost (localhost [127.0.0.1]) by mail.cosmopool.net (Postfix) with ESMTP id 6741B903599; Thu, 15 Mar 2018 17:25:31 +0100 (CET) Received: from mail.cosmopool.net ([127.0.0.1]) by localhost (mail.your-server.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id KLqiFTY_ZFtx; Thu, 15 Mar 2018 17:25:31 +0100 (CET) Received: from huygens.ccbib.org (unknown [10.0.10.106]) by mail.cosmopool.net (Postfix) with SMTP id F0DE89012D0; Thu, 15 Mar 2018 17:25:29 +0100 (CET) Received: by huygens.ccbib.org (sSMTP sendmail emulation); Thu, 15 Mar 2018 16:25:29 +0000 From: Harald Geyer To: Maxime Ripard , Chen-Yu Tsai Subject: [PATCHv2 4/5] arm64: dts: allwinner: a64: Add pwm device Date: Thu, 15 Mar 2018 16:25:09 +0000 Message-Id: <20180315162510.11669-5-harald@ccbib.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180315162510.11669-1-harald@ccbib.org> References: <20180315162510.11669-1-harald@ccbib.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180315_092542_043855_EDDB64B8 X-CRM114-Status: GOOD ( 15.47 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , devicetree@vger.kernel.org, info@olimex.com, Catalin Marinas , Harald Geyer , Will Deacon , linux-kernel@vger.kernel.org, Rob Herring , Andre Przywara , linux-arm-kernel@lists.infradead.org, Icenowy Zheng MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP This device is compatible with A13, so no new driver is needed. A new compatible string is reserved in the binding documentation, to be used together with the proper fall back. Tested on Teres-I. Signed-off-by: Harald Geyer Reviewed-by: Rob Herring --- changes since v1: * add and use an A64 specific compatible string * claim the full memory range I saw that Andre Przywara has been working on A64 pwm too and has submitted some patches a few days ago. I think his patches are functionally equivalent to this one here, but clean up things a bit and additionally add support for r_pwm and thus are preferable. See: https://groups.google.com/forum/#!topic/linux-sunxi/hQFeteP591k I'm including my patch here mostly to have a consistent series for others to test. OTOH you might merge the device tree changes here and pick up the cleanup patches from him. Either way should work fine. Documentation/devicetree/bindings/pwm/pwm-sun4i.txt | 1 + arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi | 14 ++++++++++++++ 2 files changed, 15 insertions(+) diff --git a/Documentation/devicetree/bindings/pwm/pwm-sun4i.txt b/Documentation/devicetree/bindings/pwm/pwm-sun4i.txt index 51ff54c8b8ef..5986a3b2a504 100644 --- a/Documentation/devicetree/bindings/pwm/pwm-sun4i.txt +++ b/Documentation/devicetree/bindings/pwm/pwm-sun4i.txt @@ -5,6 +5,7 @@ Required properties: - "allwinner,sun4i-a10-pwm" - "allwinner,sun5i-a10s-pwm" - "allwinner,sun5i-a13-pwm" + - "allwinner,sun50i-a64-pwm","allwinner,sun5i-a13-pwm" - "allwinner,sun7i-a20-pwm" - "allwinner,sun8i-h3-pwm" - reg: physical base address and length of the controller's registers diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi index 1b2ef28c42bd..7e72eadd07b1 100644 --- a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi +++ b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi @@ -364,6 +364,11 @@ bias-pull-up; }; + pwm_pin: pwm_pin { + pins = "PD22"; + function = "pwm"; + }; + rmii_pins: rmii_pins { pins = "PD10", "PD11", "PD13", "PD14", "PD17", "PD18", "PD19", "PD20", "PD22", "PD23"; @@ -629,6 +634,15 @@ #interrupt-cells = <3>; }; + pwm: pwm@1c21400 { + compatible = "allwinner,sun50i-a64-pwm", + "allwinner,sun5i-a13-pwm"; + reg = <0x01c21400 0x400>; + clocks = <&osc24M>; + #pwm-cells = <3>; + status = "disabled"; + }; + rtc: rtc@1f00000 { compatible = "allwinner,sun6i-a31-rtc"; reg = <0x01f00000 0x54>;