1 // Overlay for the PCM5122-based Ghost amplifier using gpio-fsm
5 #include <dt-bindings/gpio/gpio-fsm.h>
7 #define ENABLE GF_SW(0)
8 #define FAULT GF_IP(0) // GPIO5
9 #define RELAY1 GF_OP(0) // GPIO22
10 #define RELAY2 GF_OP(1) // GPIO23
11 #define RELAYSSR GF_OP(2) // GPIO24
14 compatible = "brcm,bcm2835";
31 #sound-dai-cells = <0>;
32 compatible = "ti,pcm5122";
34 AVDD-supply = <&vdd_3v3_reg>;
35 DVDD-supply = <&vdd_3v3_reg>;
36 CPVDD-supply = <&vdd_3v3_reg>;
44 iqaudio_dac: __overlay__ {
45 compatible = "iqaudio,iqaudio-dac";
46 i2s-controller = <&i2s>;
47 mute-gpios = <& 0 0>;
48 iqaudio-dac,auto-mute-amp;
57 compatible = "rpi,gpio-fsm";
58 pinctrl-names = "default";
59 pinctrl-0 = <&ghost_amp_pins>;
65 gpio-line-names = "enable";
66 input-gpios = <&gpio 5 1>; // FAULT (active low)
67 output-gpios = <&gpio 22 0>, // RELAY1
68 <&gpio 23 0>, // RELAY2
69 <&gpio 24 0>; // RELAYSSR
70 shutdown-timeout-ms = <1000>;
79 amp_on_1 = <ENABLE 1>;
85 amp_on_2 = <GF_DELAY 1000>;
86 amp_off = <GF_SHUTDOWN 0>;
92 amp_on_wait = <ENABLE 0>;
93 amp_on = <GF_DELAY 1>;
99 amp_on_wait = <ENABLE 0>;
105 amp_off_1 = <GF_DELAY (30*60*1000)>,
114 amp_off = <GF_DELAY 100>;
118 // Keep this a distinct state to prevent
119 // changes and for the diagnostic output
134 ghost_amp_pins: ghost_amp_pins {
135 brcm,pins = <5 22 23 24>;
136 brcm,function = <0 1 1 1>; /* in out out out */
137 brcm,pull = <2 0 0 0>; /* up none none none */
143 fsm_debug = <&>,"debug:0";