From patchwork Sun Oct 11 12:21:02 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Binacchi X-Patchwork-Id: 1380337 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=EFwZo3Ln; 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 4C8LXG30C0z9sS8 for ; Sun, 11 Oct 2020 23:21:50 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id B9F6A823D4; Sun, 11 Oct 2020 14:21:47 +0200 (CEST) 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="EFwZo3Ln"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id F3D1A823D4; Sun, 11 Oct 2020 14:21:45 +0200 (CEST) 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,SPF_HELO_PASS, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.2 Received: from libero.it (smtp-34.italiaonline.it [213.209.10.34]) (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 3BD62823EA for ; Sun, 11 Oct 2020 14:21:43 +0200 (CEST) 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.31.32.113]) by smtp-34.iol.local with ESMTPA id RaLxkmSZimMFTRaMAkXVyl; Sun, 11 Oct 2020 14:21:43 +0200 x-libjamoibt: 1601 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=libero.it; s=s2014; t=1602418903; bh=Tw5v0IwQexXPDHnjnnXBPkHP95AHpZy+7Eqp2ED3+vU=; h=From; b=EFwZo3LncOTN90uARleEk0yW0Jc8NYPW8noUGfz6qe+kDzd9wMsRKUPp+9kMgjUdg f5UKKQxgHa+RJtKjkjt5luU/Mjhh0QtbOLm1LDNgKr1v1YmeyaGhB+6EpZ4nioFRWf +hgoandxGmNOkpPffuOcss9jOqN8jWneMX5rwIYdVwlJ46tVbgKzbdXnZcqxNzOQND xPcHYE1MdhAycL583WdtrrkVbvWge6jeSxJ/Y5dla9Hky0u9noSyx/2an0b2DjLBcr ProSIG6sLdqZ3X7C6s+nScaZqwBrqBVKNJW5R5/LNujZGlI69sG7TsbhAyW1YbGBew gESCrobO8OAgg== X-CNFS-Analysis: v=2.4 cv=KetsDSUD c=1 sm=1 tr=0 ts=5f82f8d7 a=9myQFBeCGQ66/mXSe6vdPA==:117 a=9myQFBeCGQ66/mXSe6vdPA==:17 a=VrzLXjR05I8Hsp708DkA:9 From: Dario Binacchi To: u-boot@lists.denx.de Cc: Dario Binacchi , Grygorii Strashko , Lokesh Vutla , Masahiro Yamada Subject: [PATCH v3 20/27] bus: ti: am33xx: add pwm subsystem driver Date: Sun, 11 Oct 2020 14:21:02 +0200 Message-Id: <20201011122109.24163-21-dariobin@libero.it> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20201011122109.24163-20-dariobin@libero.it> References: <20201011122109.24163-20-dariobin@libero.it> X-CMAE-Envelope: MS4xfO52IhqBfChMBEgV2Fa2WEuFsgxuptblmGSID8TOj0OATcXZ+dpwFHUZEtXR63CCQeP33tR4u9W4p9E9K0Le1WW/KPSbwg50BD3B1J7bsqHSy+6mgL5S 9j5kzu3GsIHQ5igSYv8uFQR3OoL2qWCOdNF7aGBRZKOU6y9yZeGqu30DM9nseiZcULKsj2MCC1cALHMs37lx4FfvbZQkKjb4A5iXQOUJvJxwujZpNtFNhz6H yiEO2F6MGZKbwqcZmH79GGK383CSSVV63UvblxSKF8cS5E0B91piknwOdTYEPLPNusFUPKbPTJLn0muqprLr/0cc6aVyss/FVXoUZYTwD7IU+3mnpXwXI1Io Kb1SkXH6C7bd7S8XrpF8a7zkSR+nzA== 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 --- 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, +};