diff options
Diffstat (limited to 'target/linux/bcm27xx/patches-5.4/950-0987-overlays-Add-fsm-demo-overlay.patch')
-rw-r--r-- | target/linux/bcm27xx/patches-5.4/950-0987-overlays-Add-fsm-demo-overlay.patch | 151 |
1 files changed, 151 insertions, 0 deletions
diff --git a/target/linux/bcm27xx/patches-5.4/950-0987-overlays-Add-fsm-demo-overlay.patch b/target/linux/bcm27xx/patches-5.4/950-0987-overlays-Add-fsm-demo-overlay.patch new file mode 100644 index 0000000000..7b56627447 --- /dev/null +++ b/target/linux/bcm27xx/patches-5.4/950-0987-overlays-Add-fsm-demo-overlay.patch @@ -0,0 +1,151 @@ +From d27d1447e49bc6ffa92f787f7bc5c2eea29ba7d2 Mon Sep 17 00:00:00 2001 +From: Phil Elwell <phil@raspberrypi.com> +Date: Wed, 30 Sep 2020 12:08:08 +0100 +Subject: [PATCH] overlays: Add fsm-demo overlay + +fsm-demo demonstrates the usage of the gpio-fsm driver. It is +designed to be used with a set of "traffic light" LEDs on GPIOs +7, 8 and 25. + +Signed-off-by: Phil Elwell <phil@raspberrypi.com> +--- + arch/arm/boot/dts/overlays/Makefile | 1 + + arch/arm/boot/dts/overlays/README | 8 ++ + .../boot/dts/overlays/fsm-demo-overlay.dts | 104 ++++++++++++++++++ + 3 files changed, 113 insertions(+) + create mode 100644 arch/arm/boot/dts/overlays/fsm-demo-overlay.dts + +--- a/arch/arm/boot/dts/overlays/Makefile ++++ b/arch/arm/boot/dts/overlays/Makefile +@@ -44,6 +44,7 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \ + enc28j60-spi2.dtbo \ + exc3000.dtbo \ + fe-pi-audio.dtbo \ ++ fsm-demo.dtbo \ + goodix.dtbo \ + googlevoicehat-soundcard.dtbo \ + gpio-fan.dtbo \ +--- a/arch/arm/boot/dts/overlays/README ++++ b/arch/arm/boot/dts/overlays/README +@@ -767,6 +767,14 @@ Load: dtoverlay=fe-pi-audio + Params: <None> + + ++Name: fsm-demo ++Info: A demonstration of the gpio-fsm driver. The GPIOs are chosen to work ++ nicely with a "traffic-light" display of red, amber and green LEDs on ++ GPIOs 7, 8 and 25 respectively. ++Load: dtoverlay=fsm-demo,<param>=<val> ++Params: fsm_debug Enable debug logging (default off) ++ ++ + Name: goodix + Info: Enables I2C connected Goodix gt9271 multiple touch controller using + GPIOs 4 and 17 (pins 7 and 11 on GPIO header) for interrupt and reset. +--- /dev/null ++++ b/arch/arm/boot/dts/overlays/fsm-demo-overlay.dts +@@ -0,0 +1,104 @@ ++// Demo overlay for the gpio-fsm driver ++/dts-v1/; ++/plugin/; ++ ++#include <dt-bindings/gpio/gpio-fsm.h> ++ ++#define BUTTON1 GF_IP(0) ++#define BUTTON2 GF_SW(0) ++#define RED GF_OP(0) // GPIO7 ++#define AMBER GF_OP(1) // GPIO8 ++#define GREEN GF_OP(2) // GPIO25 ++ ++/{ ++ compatible = "brcm,bcm2835"; ++ ++ fragment@0 { ++ target-path = "/"; ++ __overlay__ { ++ fsm_demo: fsm-demo { ++ compatible = "rpi,gpio-fsm"; ++ ++ debug = <0>; ++ gpio-controller; ++ #gpio-cells = <2>; ++ num-soft-gpios = <1>; ++ gpio-line-names = "button2"; ++ input-gpios = <&gpio 6 1>; // BUTTON1 (active-low) ++ output-gpios = <&gpio 7 0>, // RED ++ <&gpio 8 0>, // AMBER ++ <&gpio 25 0>; // GREEN ++ shutdown-timeout-ms = <2000>; ++ ++ start { ++ start_state; ++ set = <RED 1>, <AMBER 0>, <GREEN 0>; ++ start2 = <GF_DELAY 250>; ++ }; ++ ++ start2 { ++ set = <RED 0>, <AMBER 1>; ++ go = <GF_DELAY 250>; ++ }; ++ ++ go { ++ set = <RED 0>, <AMBER 0>, <GREEN 1>; ++ ready_wait = <BUTTON1 0>; ++ shutdown1 = <GF_SHUTDOWN 0>; ++ }; ++ ++ ready_wait { ++ // Clear the soft GPIO ++ set = <BUTTON2 0>; ++ ready = <GF_DELAY 1000>; ++ shutdown1 = <GF_SHUTDOWN 0>; ++ }; ++ ++ ready { ++ stopping = <BUTTON1 1>, <BUTTON2 1>; ++ shutdown1 = <GF_SHUTDOWN 0>; ++ }; ++ ++ stopping { ++ set = <GREEN 0>, <AMBER 1>; ++ stopped = <GF_DELAY 1000>; ++ }; ++ ++ stopped { ++ set = <AMBER 0>, <RED 1>; ++ get_set = <GF_DELAY 3000>; ++ shutdown1 = <GF_SHUTDOWN 0>; ++ }; ++ ++ get_set { ++ set = <AMBER 1>; ++ go = <GF_DELAY 1000>; ++ }; ++ ++ shutdown1 { ++ set = <RED 0>, <AMBER 0>, <GREEN 1>; ++ shutdown2 = <GF_SHUTDOWN 250>; ++ }; ++ ++ shutdown2 { ++ set = <AMBER 1>, <GREEN 0>; ++ shutdown3 = <GF_SHUTDOWN 250>; ++ }; ++ ++ shutdown3 { ++ set = <RED 1>, <AMBER 0>; ++ shutdown4 = <GF_SHUTDOWN 250>; ++ }; ++ ++ shutdown4 { ++ shutdown_state; ++ set = <RED 0>; ++ }; ++ }; ++ }; ++ }; ++ ++ __overrides__ { ++ fsm_debug = <&fsm_demo>,"debug:0"; ++ }; ++}; |