From patchwork Thu Dec 24 07:33:59 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Binacchi X-Patchwork-Id: 1420423 X-Patchwork-Delegate: lokeshvutla@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=quarantine dis=none) header.from=libero.it Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=libero.it header.i=@libero.it header.a=rsa-sha256 header.s=s2014 header.b=gdKx9Mfs; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4D1hhl6pZmz9sRR for ; Thu, 24 Dec 2020 18:36:23 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 0C8E88276B; Thu, 24 Dec 2020 08:35:33 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=libero.it Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=libero.it header.i=@libero.it header.b="gdKx9Mfs"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 36DC9826F3; Thu, 24 Dec 2020 08:35:06 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FORGED_SPF_HELO,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_PASS autolearn=no autolearn_force=no version=3.4.2 Received: from libero.it (smtp-18.italiaonline.it [213.209.10.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id ADC4482700 for ; Thu, 24 Dec 2020 08:34:53 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=libero.it Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=dariobin@libero.it Received: from passgat-Modern-14-A10M.homenet.telecomitalia.it ([79.54.115.44]) by smtp-18.iol.local with ESMTPA id sL93kry9c7QU9sL9BkXNCT; Thu, 24 Dec 2020 08:34:53 +0100 x-libjamoibt: 1601 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=libero.it; s=s2014; t=1608795293; bh=2VYBmx7RCXSEO55o6KEzh1+WBnY2bAS2GUgBMCgvR8E=; h=From; b=gdKx9MfstNgMgdMIMOzfwAcjHnR4kyD9rtxA6Dl3aTDRxkEl8gVt1SFQAPNKeUU1G xeRA0ue7tR3TUIO+bpbaLOzMLeIPYaogdgiILcmXsE+9ax6sdQnU16OdAQZlmFmH6H oNareNqlozUVIrLuGMbpwWpY7skD8/7YMC3BPiK83KfiHBlGXXERlr4nRKHbHDeRgU hUP4IB2X2LxskgcDoeo39N5DpR1gU2MroCg7TF7tqxFNqZKS0qu42CFTq3Br+aoM/j GOZP6ilYCU7pyf9ZBSavYrwOwooXwBCJsbAB5e9Hce2NRIfKMGcv+7l2idSbDD9nD0 Td8B0TjaiRDVQ== X-CNFS-Analysis: v=2.4 cv=Y+c9DjSN c=1 sm=1 tr=0 ts=5fe4449d cx=a_exe a=4XFUYcG0DNokufVEFeBjWw==:117 a=4XFUYcG0DNokufVEFeBjWw==:17 a=VrzLXjR05I8Hsp708DkA:9 From: Dario Binacchi To: u-boot@lists.denx.de Cc: Lokesh Vutla , Dario Binacchi , Masahiro Yamada Subject: [PATCH v7 21/28] bus: ti: am33xx: add pwm subsystem driver Date: Thu, 24 Dec 2020 08:33:59 +0100 Message-Id: <20201224073406.16764-22-dariobin@libero.it> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20201224073406.16764-15-dariobin@libero.it> References: <20201224073406.16764-15-dariobin@libero.it> X-CMAE-Envelope: MS4xfEfV7htzBasg4nzL/+CvzMJCfbqh3zNQkFJGDdUQahxxLrvC7pDaZkfX0L9GPXjLGaPvtFpKjvHtTQDVxXWQCVYmMze12snY1AtRzg49/zClQCS5J97u wxsNy8QKyueDSg5Wd09RGy+73RgLVR3OHX8DeRU5mwbSihAZDicMm1x+Wn9r0tupwJ/TRQBDEt7DuSGQz1dUvsWQJChkrYDA/Ufva+RzS/VBXXRhGBojyiot HgijDcaoll3uYYhfHjUnBPsGohfVxMp42neu9V54CXzbNhwHYnRsIfAmAOb30KecleiWvqUGxKD2lu+iMlsi1atRB0BnHno1ibV/PlCoWbs= X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.3 at phobos.denx.de X-Virus-Status: Clean The TI PWMSS driver is a simple bus driver for providing clock and power management for the PWM peripherals on TI AM33xx SoCs, namely eCAP, eHRPWM and eQEP. For DT binding details see Linux doc: - Documentation/devicetree/bindings/pwm/pwm-tipwmss.txt Signed-off-by: Dario Binacchi --- (no changes since v3) Changes in v3: - Move Kconfig symbol from drivers/pwm to drivers/bus. - Remove the domain clock reference from the pwmss nodes of the device tree in am33xx.dtsi. The resync of am33xx.dtsi with Linux 5.9-rc7 already contains such references. - Remove domain clock enabling/disabling. Enabling the domain clock is performed by the sysc interconnect target module driver during the pwm device probing. - Remove doc/device-tree-bindings/pwm/ti,pwmss.txt. - Add to commit message the references to linux kernel dt binding documentation. drivers/bus/Kconfig | 6 ++++++ drivers/bus/Makefile | 1 + drivers/bus/ti-pwmss.c | 21 +++++++++++++++++++++ 3 files changed, 28 insertions(+) create mode 100644 drivers/bus/ti-pwmss.c diff --git a/drivers/bus/Kconfig b/drivers/bus/Kconfig index 733bec5a56..d742ed333b 100644 --- a/drivers/bus/Kconfig +++ b/drivers/bus/Kconfig @@ -5,6 +5,12 @@ menu "Bus devices" +config TI_PWMSS + bool + default y if ARCH_OMAP2PLUS && PWM_TI_EHRPWM + help + PWM Subsystem driver support for AM33xx SOC. + config TI_SYSC bool "TI sysc interconnect target module driver" depends on ARCH_OMAP2PLUS diff --git a/drivers/bus/Makefile b/drivers/bus/Makefile index 875bb4ed42..a2e71c7b3b 100644 --- a/drivers/bus/Makefile +++ b/drivers/bus/Makefile @@ -3,5 +3,6 @@ # Makefile for the bus drivers. # +obj-$(CONFIG_TI_PWMSS) += ti-pwmss.o obj-$(CONFIG_TI_SYSC) += ti-sysc.o obj-$(CONFIG_UNIPHIER_SYSTEM_BUS) += uniphier-system-bus.o diff --git a/drivers/bus/ti-pwmss.c b/drivers/bus/ti-pwmss.c new file mode 100644 index 0000000000..265b4cf83b --- /dev/null +++ b/drivers/bus/ti-pwmss.c @@ -0,0 +1,21 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Pulse-Width Modulation Subsystem (pwmss) + * + * Copyright (C) 2020 Dario Binacchi + */ + +#include +#include + +static const struct udevice_id ti_pwmss_ids[] = { + {.compatible = "ti,am33xx-pwmss"}, + {} +}; + +U_BOOT_DRIVER(ti_pwmss) = { + .name = "ti_pwmss", + .id = UCLASS_SIMPLE_BUS, + .of_match = ti_pwmss_ids, + .bind = dm_scan_fdt_dev, +};