]> git.baikalelectronics.ru Git - uboot.git/commitdiff
bus: ti: am33xx: add pwm subsystem driver
authorDario Binacchi <dariobin@libero.it>
Tue, 29 Dec 2020 23:16:25 +0000 (00:16 +0100)
committerLokesh Vutla <lokeshvutla@ti.com>
Tue, 12 Jan 2021 05:28:05 +0000 (10:58 +0530)
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 <dariobin@libero.it>
drivers/bus/Kconfig
drivers/bus/Makefile
drivers/bus/ti-pwmss.c [new file with mode: 0644]

index 733bec5a56c44923ab756bde295f567871cff8d5..d742ed333b16de894e3bceb3f8f3ea092ba01abb 100644 (file)
@@ -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
index 875bb4ed4248b6a23e2c0865a0cf0dbc33b0162b..a2e71c7b3b529515f9dd5cf5550283489d0401a1 100644 (file)
@@ -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 (file)
index 0000000..265b4cf
--- /dev/null
@@ -0,0 +1,21 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Pulse-Width Modulation Subsystem (pwmss)
+ *
+ * Copyright (C) 2020 Dario Binacchi <dariobin@libero.it>
+ */
+
+#include <common.h>
+#include <dm.h>
+
+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,
+};