diff --git a/arch/arm/boot/dts/overlays/Makefile b/arch/arm/boot/dts/overlays/Makefile index 21222f244c3ad7..5e43c52116c281 100644 --- a/arch/arm/boot/dts/overlays/Makefile +++ b/arch/arm/boot/dts/overlays/Makefile @@ -218,6 +218,7 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \ proto-codec.dtbo \ pwm.dtbo \ pwm-2chan.dtbo \ + pwm-gpio.dtbo \ pwm-ir-tx.dtbo \ pwm1.dtbo \ qca7000.dtbo \ diff --git a/arch/arm/boot/dts/overlays/README b/arch/arm/boot/dts/overlays/README index 12505ee70dd999..0cb2563841a3b7 100644 --- a/arch/arm/boot/dts/overlays/README +++ b/arch/arm/boot/dts/overlays/README @@ -3935,6 +3935,12 @@ Params: pin Output pin (default 18) - see table clock PWM clock frequency (informational) +Name: pwm-gpio +Info: Configures the software PWM GPIO driver +Load: dtoverlay=pwm-gpio,= +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 diff --git a/arch/arm/boot/dts/overlays/pwm-gpio-overlay.dts b/arch/arm/boot/dts/overlays/pwm-gpio-overlay.dts new file mode 100644 index 00000000000000..f5a1fb38e2578e --- /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"; + }; +};