overlays: ghost-amp: Minor tweaks
authorPhil Elwell <phil@raspberrypi.com>
Wed, 3 Mar 2021 10:31:13 +0000 (10:31 +0000)
committerPhil Elwell <phil@raspberrypi.com>
Mon, 29 Mar 2021 10:59:47 +0000 (11:59 +0100)
1. Reduce the delay between RELAY1 and RELAY2 to 1000ms.
2. Rename the states to simplify LED control by an external script.
3. Claim all the required GPIOs, enabling pull-ups on the input.

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
arch/arm/boot/dts/overlays/ghost-amp-overlay.dts

index 3c99726..f051dfb 100644 (file)
@@ -54,6 +54,8 @@
                __overlay__ {
                        amp: ghost-amp {
                                compatible = "rpi,gpio-fsm";
+                               pinctrl-names = "default";
+                               pinctrl-0 = <&ghost_amp_pins>;
 
                                debug = <0>;
                                gpio-controller;
 
                                amp_on_1 {
                                        set = <RELAY1 1>;
-                                       amp_on = <GF_DELAY 1500>;
+                                       amp_on = <GF_DELAY 1000>;
                                        amp_off = <ENABLE 0>;
                                        fault = <FAULT 1>;
                                };
 
                                amp_on {
                                        set = <RELAY2 1>;
-                                       amp_off_wait = <ENABLE 0>;
+                                       amp_on_wait = <ENABLE 0>;
                                        fault = <FAULT 1>;
                                };
 
-                               amp_off_wait {
+                               amp_on_wait {
                                        amp_off_1 = <GF_DELAY (30*60*1000)>,
                                                    <GF_SHUTDOWN 0>;
                                        amp_on = <ENABLE 1>;
                                fault {
                                        set = <RELAY2 0>,
                                              <RELAY1 0>;
+                                       amp_off = <FAULT 0>;
                                        shutdown_state;
                                };
                        };
                };
        };
 
+       fragment@4 {
+               target = <&gpio>;
+               __overlay__ {
+                       ghost_amp_pins: ghost_amp_pins {
+                               brcm,pins = <5 22 23>;
+                               brcm,function = <0 1 1>; /* in out out */
+                               brcm,pull = <2 0 0>; /* up none none */
+                       };
+               };
+       };
+
        __overrides__ {
                fsm_debug = <&amp>,"debug:0";
        };