1 From 96f25d50e2352922e16ae74bb16fd8b6985f0f66 Mon Sep 17 00:00:00 2001
2 From: Phil Elwell <phil@raspberrypi.com>
3 Date: Wed, 30 Sep 2020 12:17:48 +0100
4 Subject: [PATCH] overlays: Add ghost-amp overlay
6 Add an overlay for the Ghost amplifier.
8 Signed-off-by: Phil Elwell <phil@raspberrypi.com>
10 arch/arm/boot/dts/overlays/Makefile | 1 +
11 arch/arm/boot/dts/overlays/README | 7 ++
12 .../boot/dts/overlays/ghost-amp-overlay.dts | 119 ++++++++++++++++++
13 3 files changed, 127 insertions(+)
14 create mode 100644 arch/arm/boot/dts/overlays/ghost-amp-overlay.dts
16 --- a/arch/arm/boot/dts/overlays/Makefile
17 +++ b/arch/arm/boot/dts/overlays/Makefile
18 @@ -45,6 +45,7 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \
24 googlevoicehat-soundcard.dtbo \
26 --- a/arch/arm/boot/dts/overlays/README
27 +++ b/arch/arm/boot/dts/overlays/README
28 @@ -775,6 +775,13 @@ Load: dtoverlay=fsm-demo,<param>=<val>
29 Params: fsm_debug Enable debug logging (default off)
33 +Info: An overlay for the Ghost amplifier.
34 +Load: dtoverlay=ghost-amp,<param>=<val>
35 +Params: fsm_debug Enable debug logging of the GPIO FSM (default
40 Info: Enables I2C connected Goodix gt9271 multiple touch controller using
41 GPIOs 4 and 17 (pins 7 and 11 on GPIO header) for interrupt and reset.
43 +++ b/arch/arm/boot/dts/overlays/ghost-amp-overlay.dts
45 +// Overlay for the PCM5122-based Ghost amplifier using gpio-fsm
49 +#include <dt-bindings/gpio/gpio-fsm.h>
51 +#define ENABLE GF_SW(0)
52 +#define FAULT GF_IP(0) // GPIO5
53 +#define RELAY1 GF_OP(0) // GPIO22
54 +#define RELAY2 GF_OP(1) // GPIO23
57 + compatible = "brcm,bcm2835";
69 + #address-cells = <1>;
74 + #sound-dai-cells = <0>;
75 + compatible = "ti,pcm5122";
77 + AVDD-supply = <&vdd_3v3_reg>;
78 + DVDD-supply = <&vdd_3v3_reg>;
79 + CPVDD-supply = <&vdd_3v3_reg>;
87 + iqaudio_dac: __overlay__ {
88 + compatible = "iqaudio,iqaudio-dac";
89 + i2s-controller = <&i2s>;
90 + mute-gpios = <& 0 0>;
91 + iqaudio-dac,auto-mute-amp;
100 + compatible = "rpi,gpio-fsm";
105 + num-soft-gpios = <1>;
106 + gpio-line-names = "enable";
107 + input-gpios = <&gpio 5 1>; // FAULT (active low)
108 + output-gpios = <&gpio 22 0>, // RELAY1
109 + <&gpio 23 0>; // RELAY2
110 + shutdown-timeout-ms = <1000>;
118 + amp_on_1 = <ENABLE 1>;
124 + amp_on = <GF_DELAY 1500>;
125 + amp_off = <ENABLE 0>;
131 + amp_off_wait = <ENABLE 0>;
136 + amp_off_1 = <GF_DELAY (30*60*1000)>,
138 + amp_on = <ENABLE 1>;
144 + amp_on = <ENABLE 1>;
145 + amp_off = <GF_DELAY 100>;
149 + // Keep this a distinct state to prevent
150 + // changes and for the diagnostic output
161 + fsm_debug = <&>,"debug:0";