DT-overlays: adds support for Hifiberry AMP4 Pro
authorJoerg Schambacher <joerg@hifiberry.com>
Fri, 19 Jan 2024 09:44:22 +0000 (10:44 +0100)
committerDom Cobley <popcornmix@gmail.com>
Mon, 19 Feb 2024 11:35:36 +0000 (11:35 +0000)
The AMP4 Pro uses a TI TAS5756 amplifier in master mode
and requires the DAC Plus card driver and the
pcm512x component driver with TAS support.

Signed-off-by: Joerg Schambacher <joerg@hifiberry.com>
arch/arm/boot/dts/overlays/Makefile
arch/arm/boot/dts/overlays/README
arch/arm/boot/dts/overlays/hifiberry-amp4pro-overlay.dts [new file with mode: 0644]

index 8028c4e..fa9072b 100644 (file)
@@ -87,6 +87,7 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \
        hifiberry-amp.dtbo \
        hifiberry-amp100.dtbo \
        hifiberry-amp3.dtbo \
+       hifiberry-amp4pro.dtbo \
        hifiberry-dac.dtbo \
        hifiberry-dacplus.dtbo \
        hifiberry-dacplusadc.dtbo \
index d96563a..64f5255 100644 (file)
@@ -1744,6 +1744,34 @@ Load:   dtoverlay=hifiberry-amp3
 Params: <None>
 
 
+Name:   hifiberry-amp4pro
+Info:   Configures the HifiBerry AMP4 Pro audio card
+Load:   dtoverlay=hifiberry-amp4pro,<param>=<val>
+Params: 24db_digital_gain       Allow gain to be applied via the TAS5756
+                                Digital volume control. Enable with
+                                "dtoverlay=hifiberry-amp4pro,24db_digital_gain"
+                                (The default behaviour is that the Digital
+                                volume control is limited to a maximum of
+                                0dB. ie. it can attenuate but not provide
+                                gain. For most users, this will be desired
+                                as it will prevent clipping. By appending
+                                the 24dB_digital_gain parameter, the Digital
+                                volume control will allow up to 24dB of
+                                gain. If this parameter is enabled, it is the
+                                responsibility of the user to ensure that
+                                the Digital volume control is set to a value
+                                that does not result in clipping/distortion!)
+        slave                   Force the amp into slave mode, using Pi as
+                                master for bit clock and frame clock.
+        leds_off                If set to 'true' the onboard indicator LEDs
+                                are switched off at all times.
+        auto_mute               If set to 'true' the amplifier is automatically
+                                muted when it is not playing.
+        mute_ext_ctl            The amplifier's HW mute control is enabled
+                                in ALSA mixer and set to <val>.
+                                Will be overwritten by ALSA user settings.
+
+
 Name:   hifiberry-dac
 Info:   Configures the HifiBerry DAC audio cards
 Load:   dtoverlay=hifiberry-dac
diff --git a/arch/arm/boot/dts/overlays/hifiberry-amp4pro-overlay.dts b/arch/arm/boot/dts/overlays/hifiberry-amp4pro-overlay.dts
new file mode 100644 (file)
index 0000000..6b211c2
--- /dev/null
@@ -0,0 +1,63 @@
+// Definitions for HiFiBerry AMP4PRO
+/dts-v1/;
+/plugin/;
+#include <dt-bindings/gpio/gpio.h>
+
+/ {
+       compatible = "brcm,bcm2835";
+
+       fragment@0 {
+               target-path = "/";
+               __overlay__ {
+                       dacpro_osc: dacpro_osc {
+                               compatible = "hifiberry,dacpro-clk";
+                               #clock-cells = <0>;
+                       };
+               };
+       };
+
+       frag1: fragment@1 {
+               target = <&i2s_clk_consumer>;
+               __overlay__ {
+                       status = "okay";
+               };
+       };
+
+       fragment@2 {
+               target = <&i2c1>;
+               __overlay__ {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       status = "okay";
+
+                       tas5756@4d {
+                               #sound-dai-cells = <0>;
+                               compatible = "ti,tas5756";
+                               reg = <0x4d>;
+                               clocks = <&dacpro_osc>;
+                               status = "okay";
+                       };
+               };
+       };
+
+       fragment@3 {
+               target = <&sound>;
+               hifiberry_dacplus: __overlay__ {
+                       compatible = "hifiberry,hifiberry-dacplus";
+                       i2s-controller = <&i2s_clk_consumer>;
+                       status = "okay";
+                       mute-gpio = <&gpio 4 GPIO_ACTIVE_LOW>;
+               };
+       };
+
+       __overrides__ {
+               24db_digital_gain =
+                       <&hifiberry_dacplus>,"hifiberry-amp4,24db_digital_gain?";
+               leds_off = <&hifiberry_dacplus>,"hifiberry-amp4,leds_off?";
+               mute_ext_ctl = <&hifiberry_dacplus>,"hifiberry-amp4,mute_ext_ctl:0";
+               auto_mute = <&hifiberry_dacplus>,"hifiberry-amp4,auto_mute?";
+               slave = <&hifiberry_dacplus>,"hifiberry-dacplus,slave?",
+                       <&frag1>,"target:0=",<&i2s_clk_producer>,
+                       <&hifiberry_dacplus>,"i2s-controller:0=",<&i2s_clk_producer>;
+       };
+};