openwrt/target/linux/bcm27xx/patches-6.6/950-1355-dtoverlay-Add-a-dtoverlay-for-pwm-gpio.patch
Álvaro Fernández Rojas 3a5584e0df bcm27xx: pull 6.6 patches from RPi repo
Adds latest 6.6 patches from the Raspberry Pi repository.

These patches were generated from:
https://github.com/raspberrypi/linux/commits/rpi-6.6.y/
With the following command:
git format-patch -N v6.6.67..HEAD
(HEAD -> 811ff707533bcd67cdcd368bbd46223082009b12)

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
(cherry picked from commit 692205305db14deeff1a2dc4a6d7f87e19fc418b)
2024-12-28 14:11:52 +01:00

80 lines
2.2 KiB
Diff

From ff0fe12ab875d587348b6f2b9e73ae928049ebee Mon Sep 17 00:00:00 2001
From: Tim Gover <tim.gover@raspberrypi.com>
Date: Thu, 31 Oct 2024 16:12:54 +0000
Subject: [PATCH] dtoverlay: Add a dtoverlay for pwm-gpio
Signed-off-by: Tim Gover <tim.gover@raspberrypi.com>
---
arch/arm/boot/dts/overlays/Makefile | 1 +
arch/arm/boot/dts/overlays/README | 6 +++
.../boot/dts/overlays/pwm-gpio-overlay.dts | 38 +++++++++++++++++++
3 files changed, 45 insertions(+)
create mode 100644 arch/arm/boot/dts/overlays/pwm-gpio-overlay.dts
--- a/arch/arm/boot/dts/overlays/Makefile
+++ b/arch/arm/boot/dts/overlays/Makefile
@@ -217,6 +217,7 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \
proto-codec.dtbo \
pwm.dtbo \
pwm-2chan.dtbo \
+ pwm-gpio.dtbo \
pwm-ir-tx.dtbo \
pwm1.dtbo \
qca7000.dtbo \
--- a/arch/arm/boot/dts/overlays/README
+++ b/arch/arm/boot/dts/overlays/README
@@ -3903,6 +3903,12 @@ Params: pin Output p
clock PWM clock frequency (informational)
+Name: pwm-gpio
+Info: Configures the software PWM GPIO driver
+Load: dtoverlay=pwm-gpio,<param>=<val>
+Params: gpio Output pin (default 4)
+
+
Name: pwm-ir-tx
Info: Use GPIO pin as pwm-assisted infrared transmitter output.
This is an alternative to "gpio-ir-tx". pwm-ir-tx makes use
--- /dev/null
+++ b/arch/arm/boot/dts/overlays/pwm-gpio-overlay.dts
@@ -0,0 +1,38 @@
+// Device tree overlay for software GPIO PWM.
+/dts-v1/;
+/plugin/;
+
+/ {
+ compatible = "brcm,bcm2835";
+
+ fragment@0 {
+ target = <&gpio>;
+ __overlay__ {
+ pwm_gpio_pins: pwm_gpio_pins@4 {
+ brcm,pins = <4>; /* gpio 4 */
+ brcm,function = <1>; /* output */
+ brcm,pull = <0>; /* pull-none */
+ };
+ };
+ };
+
+ fragment@1 {
+ target-path = "/";
+ __overlay__ {
+ pwm_gpio: pwm_gpio@4 {
+ compatible = "pwm-gpio";
+ pinctrl-names = "default";
+ pinctrl-0 = <&pwm_gpio_pins>;
+ gpios = <&gpio 4 0>;
+ };
+ };
+ };
+
+ __overrides__ {
+ gpio = <&pwm_gpio>,"gpios:4",
+ <&pwm_gpio_pins>,"brcm,pins:0",
+ /* modify reg values to allow multiple instantiation */
+ <&pwm_gpio>,"reg:0",
+ <&pwm_gpio_pins>,"reg:0";
+ };
+};