From patchwork Thu Nov 24 19:16:38 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Biju Das X-Patchwork-Id: 13055326 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1DDDDC433FE for ; Thu, 24 Nov 2022 19:16:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229790AbiKXTQz (ORCPT ); Thu, 24 Nov 2022 14:16:55 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59020 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229724AbiKXTQx (ORCPT ); Thu, 24 Nov 2022 14:16:53 -0500 Received: from relmlie5.idc.renesas.com (relmlor1.renesas.com [210.160.252.171]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id F2AF7898D4; Thu, 24 Nov 2022 11:16:50 -0800 (PST) X-IronPort-AV: E=Sophos;i="5.96,190,1665414000"; d="scan'208";a="141120249" Received: from unknown (HELO relmlir6.idc.renesas.com) ([10.200.68.152]) by relmlie5.idc.renesas.com with ESMTP; 25 Nov 2022 04:16:50 +0900 Received: from localhost.localdomain (unknown [10.226.92.56]) by relmlir6.idc.renesas.com (Postfix) with ESMTP id 0F00740C6811; Fri, 25 Nov 2022 04:16:45 +0900 (JST) From: Biju Das To: Thierry Reding , Rob Herring , Krzysztof Kozlowski , Michael Turquette , Stephen Boyd , Philipp Zabel Cc: Biju Das , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Geert Uytterhoeven , Magnus Damm , linux-pwm@vger.kernel.org, devicetree@vger.kernel.org, linux-renesas-soc@vger.kernel.org, linux-clk@vger.kernel.org, Fabrizio Castro Subject: [PATCH v2 0/5] Add RZ/V2{M, MA} PWM driver support Date: Thu, 24 Nov 2022 19:16:38 +0000 Message-Id: <20221124191643.3193423-1-biju.das.jz@bp.renesas.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-clk@vger.kernel.org The RZ/V2{M, MA} PWM Timer (PWM) is composed of 16 channels. Linux is only allowed access to channels 8 to 14 on RZ/V2M, while there is no restriction for RZ/V2MA. The RZ/V2{M, MA} PWM Timer (PWM) supports the following functions: * The PWM has 24-bit counters which operate at PWM_CLK (48 MHz). * The frequency division ratio for internal counter operation is selectable as PWM_CLK divided by 1, 16, 256, or 2048. * The period as well as the duty cycle is adjustable. * The low-level and high-level order of the PWM signals can be inverted. * The duty cycle of the PWM signal is selectable in the range from 0 to 100%. * The minimum resolution is 20.83 ns. * Three interrupt sources: Rising and falling edges of the PWM signal and clearing of the counter * Counter operation and the bus interface are asynchronous and both can operate independently of the magnitude relationship of the respective clock periods. v1->v2: * Updated commit description * Replaced pwm8_15_pclk->cperi_grpf * Added reset entry R9A09G011_PWM_GPF_PRESETN * Added Rb tag from Krzysztof for bindings and the keep the Rb tag as the below changes are trivial * Updated the description for APB clock * Added resets required property * Updated the example with resets property * Replaced devm_reset_control_get_optional_shared->devm_reset_control_get_shared * Added resets property in pwm nodes. Note: Hardware manual for this IP can be found here https://www.renesas.com/in/en/document/mah/rzv2m-users-manual-hardware?language=en Biju Das (5): clk: renesas: r9a09g011: Add PWM clock and reset entries dt-bindings: pwm: Add RZ/V2M PWM binding pwm: Add support for RZ/V2M PWM driver arm64: dts: renesas: r9a09g011: Add pwm nodes arm64: dts: renesas: rzv2m evk: Enable pwm .../bindings/pwm/renesas,rzv2m-pwm.yaml | 90 ++++ .../boot/dts/renesas/r9a09g011-v2mevk2.dts | 70 ++++ arch/arm64/boot/dts/renesas/r9a09g011.dtsi | 98 +++++ drivers/clk/renesas/r9a09g011-cpg.c | 10 + drivers/pwm/Kconfig | 11 + drivers/pwm/Makefile | 1 + drivers/pwm/pwm-rzv2m.c | 390 ++++++++++++++++++ 7 files changed, 670 insertions(+) create mode 100644 Documentation/devicetree/bindings/pwm/renesas,rzv2m-pwm.yaml create mode 100644 drivers/pwm/pwm-rzv2m.c