mirror of
https://github.com/raspberrypi/linux.git
synced 2025-12-06 10:00:17 +00:00
overlays: Add overlay pwm1
pwm1 enables the second PWM interface found on BCM2711. It can only be mapped to GPIOs 40 & 41. See: https://forums.raspberrypi.com/viewtopic.php?t=342458 Signed-off-by: Phil Elwell <phil@raspberrypi.com>
This commit is contained in:
@@ -183,6 +183,7 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \
|
||||
pwm.dtbo \
|
||||
pwm-2chan.dtbo \
|
||||
pwm-ir-tx.dtbo \
|
||||
pwm1.dtbo \
|
||||
qca7000.dtbo \
|
||||
qca7000-uart0.dtbo \
|
||||
ramoops.dtbo \
|
||||
|
||||
@@ -3216,6 +3216,24 @@ Params: gpio_pin Output GPIO (default 18)
|
||||
func Pin function (default 2 = Alt5)
|
||||
|
||||
|
||||
Name: pwm1
|
||||
Info: Configures one or two PWM channel on PWM1 (BCM2711 only)
|
||||
N.B.:
|
||||
1) The onboard analogue audio output uses both PWM channels.
|
||||
2) So be careful mixing audio and PWM.
|
||||
Note that even when only one pin is enabled, both channels are available
|
||||
from the PWM driver, so be careful to use the correct one.
|
||||
Load: dtoverlay=pwm1,<param>=<val>
|
||||
Params: clock PWM clock frequency (informational)
|
||||
pins_40 Enable channel 0 (PWM1_0) on GPIO 40
|
||||
pins_41 Enable channel 1 (PWM1_1) on GPIO 41
|
||||
pins_40_41 Enable channels 0 (PWM1_0) and 1 (PW1_1) on
|
||||
GPIOs 40 and 41 (default)
|
||||
pull_up Enable pull-ups on the PWM pins (default)
|
||||
pull_down Enable pull-downs on the PWM pins
|
||||
pull_off Disable pulls on the PWM pins
|
||||
|
||||
|
||||
Name: qca7000
|
||||
Info: in-tech's Evaluation Board for PLC Stamp micro
|
||||
This uses spi0 and a separate GPIO interrupt to connect the QCA7000.
|
||||
|
||||
@@ -77,6 +77,10 @@
|
||||
renamed = "miniuart-bt";
|
||||
};
|
||||
|
||||
pwm1 {
|
||||
bcm2711;
|
||||
};
|
||||
|
||||
ramoops {
|
||||
bcm2835;
|
||||
bcm2711 = "ramoops-pi4";
|
||||
|
||||
60
arch/arm/boot/dts/overlays/pwm1-overlay.dts
Normal file
60
arch/arm/boot/dts/overlays/pwm1-overlay.dts
Normal file
@@ -0,0 +1,60 @@
|
||||
/dts-v1/;
|
||||
/plugin/;
|
||||
|
||||
#include <dt-bindings/pinctrl/bcm2835.h>
|
||||
|
||||
/ {
|
||||
compatible = "brcm,bcm2711";
|
||||
|
||||
fragment@0 {
|
||||
target = <&pins>;
|
||||
__overlay__ {
|
||||
brcm,pins = <40 41>;
|
||||
};
|
||||
};
|
||||
|
||||
fragment@1 {
|
||||
target = <&pins>;
|
||||
__dormant__ {
|
||||
brcm,pins = <40>;
|
||||
};
|
||||
};
|
||||
|
||||
fragment@2 {
|
||||
target = <&pins>;
|
||||
__dormant__ {
|
||||
brcm,pins = <41>;
|
||||
};
|
||||
};
|
||||
|
||||
fragment@3 {
|
||||
target = <&gpio>;
|
||||
__overlay__ {
|
||||
pins: pwm1_overlay_pins {
|
||||
brcm,pins = <40 41>;
|
||||
brcm,function = <BCM2835_FSEL_ALT0>;
|
||||
brcm,pull = <BCM2835_PUD_UP>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
fragment@4 {
|
||||
target = <&pwm1>;
|
||||
pwm: __overlay__ {
|
||||
status = "okay";
|
||||
assigned-clock-rates = <100000000>;
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&pins>;
|
||||
};
|
||||
};
|
||||
|
||||
__overrides__ {
|
||||
clock = <&pwm>, "assigned-clock-rates:0";
|
||||
pins_40_41 = <0>,"+0-1-2";
|
||||
pins_40 = <0>,"-0+1-2";
|
||||
pins_41 = <0>,"-0-1+2";
|
||||
pull_up = <&pins>, "brcm,pull:0=", <BCM2835_PUD_UP>;
|
||||
pull_down = <&pins>, "brcm,pull:0=", <BCM2835_PUD_DOWN>;
|
||||
pull_off = <&pins>, "brcm,pull:0=", <BCM2835_PUD_OFF>;
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user