From patchwork Sun Nov 22 16:16:29 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Binacchi X-Patchwork-Id: 1404521 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=2a01:238:438b:c500:173d:9f52:ddab:ee01; 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=TWns89l8; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (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 4CfFqH4Gwrz9sRK for ; Mon, 23 Nov 2020 03:19:39 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id D51EA82608; Sun, 22 Nov 2020 17:17: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=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="TWns89l8"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 0D29C825CA; Sun, 22 Nov 2020 17:17:33 +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.3 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,FREEMAIL_FROM,KHOP_HELO_FCRDNS,T_SPF_HELO_TEMPERROR autolearn=no autolearn_force=no version=3.4.2 Received: from libero.it (smtp-31.italiaonline.it [213.209.10.31]) (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 0E9B9825A6 for ; Sun, 22 Nov 2020 17:17:12 +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 ([87.2.94.187]) by smtp-31.iol.local with ESMTPA id gs31kH3pbQgqqgs35knAxy; Sun, 22 Nov 2020 17:17:11 +0100 x-libjamoibt: 1601 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=libero.it; s=s2014; t=1606061831; bh=2VYBmx7RCXSEO55o6KEzh1+WBnY2bAS2GUgBMCgvR8E=; h=From; b=TWns89l8t4RJ/wucnmCNwFYxP120BxpXtfBY5xDCrviu4fGBj4RQFApPLEQTUOfYk MQbrLSjBs4P97g1P3n1iWpFjtYT07mu9ax0URXRA0qzVHR+EauD6r0lbY3u377QCzr py5q5K+Bc5IPXkFn6ywZseYVD4sgL8s7LlDE0pDjsIhxEpGmJZEUI7Dno4qREsa/Nd OZmq+7oxY+Wv0qkUspux5gFuRqLUNlply3NgoDIhPPbUBYyxJEMeMiLUX4VhJO4rJb JsQcrD/GtOPg0EsDilUM5uk13HXhmbn3MZMBTzW/gTJSP9NhXJtzcq244zsDjWWDGc uAVNMSmLIR0PA== X-CNFS-Analysis: v=2.4 cv=K4fnowaI c=1 sm=1 tr=0 ts=5fba8f07 a=/8YHF75YQ9f7f3UrJFxoKA==:117 a=/8YHF75YQ9f7f3UrJFxoKA==:17 a=VrzLXjR05I8Hsp708DkA:9 From: Dario Binacchi To: u-boot@lists.denx.de Cc: Dario Binacchi , Masahiro Yamada Subject: [PATCH v6 21/28] bus: ti: am33xx: add pwm subsystem driver Date: Sun, 22 Nov 2020 17:16:29 +0100 Message-Id: <20201122161636.14587-22-dariobin@libero.it> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20201122161636.14587-19-dariobin@libero.it> References: <20201122161636.14587-19-dariobin@libero.it> X-CMAE-Envelope: MS4xfATJa6t/8jUHubyCpCOhQQJx3mMkwOsveMM7je8tMx6sAZmJVdRcBWOBczoshL//5XhOJL5MngDjDt+JiGsdxgr0SmYXN9oHUHc92J2ZxNlBCUUEBEhd 4RCETuI4phf3bugaeqhvznR5xYXug/XMAUvaS6r5seNC5NdZxT//71XWpI8dLLg7mN3IZRCYPZJiVTbWYXGIMgid2q1VDUNgluMQ8QfGAQ6xnW0hNedv/nXB YFEI/88/oVrM6o0qItckOo9qlFO/LsOX3jKvLu3zDQUPMgThfQ3dffmrtE2d+P9J 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, +};