Adds the DT-overlays to support Hifiberry AMP100
authorJoerg Schambacher <joerg@i2audio.com>
Fri, 29 Jan 2021 07:26:44 +0000 (08:26 +0100)
committerPhil Elwell <phil@raspberrypi.com>
Mon, 1 Feb 2021 16:37:46 +0000 (16:37 +0000)
Adds new DT-overlay to control AMP100.

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-amp100-overlay.dts [new file with mode: 0644]

index b8675fb..2db8fa6 100644 (file)
@@ -61,6 +61,7 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \
        hd44780-lcd.dtbo \
        hdmi-backlight-hwhack-gpio.dtbo \
        hifiberry-amp.dtbo \
+       hifiberry-amp100.dtbo \
        hifiberry-dac.dtbo \
        hifiberry-dacplus.dtbo \
        hifiberry-dacplusadc.dtbo \
index bc88978..e020bac 100644 (file)
@@ -1059,8 +1059,36 @@ Load:   dtoverlay=hifiberry-amp
 Params: <None>
 
 
+Name:   hifiberry-amp100
+Info:   Configures the HifiBerry AMP100 audio card
+Load:   dtoverlay=hifiberry-amp100,<param>=<val>
+Params: 24db_digital_gain       Allow gain to be applied via the PCM512x codec
+                                Digital volume control. Enable with
+                                "dtoverlay=hifiberry-amp100,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 DAC+ Pro 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 the DAC 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 card
+Info:   Configures the HifiBerry DAC audio cards
 Load:   dtoverlay=hifiberry-dac
 Params: <None>
 
diff --git a/arch/arm/boot/dts/overlays/hifiberry-amp100-overlay.dts b/arch/arm/boot/dts/overlays/hifiberry-amp100-overlay.dts
new file mode 100644 (file)
index 0000000..ebdef55
--- /dev/null
@@ -0,0 +1,64 @@
+// Definitions for HiFiBerry AMP100
+/dts-v1/;
+/plugin/;
+
+/ {
+       compatible = "brcm,bcm2835";
+
+       fragment@0 {
+               target-path = "/";
+               __overlay__ {
+                       dacpro_osc: dacpro_osc {
+                               compatible = "hifiberry,dacpro-clk";
+                               #clock-cells = <0>;
+                       };
+               };
+       };
+
+       fragment@1 {
+               target = <&i2s>;
+               __overlay__ {
+                       status = "okay";
+               };
+       };
+
+       fragment@2 {
+               target = <&i2c1>;
+               __overlay__ {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       status = "okay";
+
+                       pcm5122@4d {
+                               #sound-dai-cells = <0>;
+                               compatible = "ti,pcm5122";
+                               reg = <0x4d>;
+                               clocks = <&dacpro_osc>;
+                               AVDD-supply = <&vdd_3v3_reg>;
+                               DVDD-supply = <&vdd_3v3_reg>;
+                               CPVDD-supply = <&vdd_3v3_reg>;
+                               status = "okay";
+                       };
+               };
+       };
+
+       fragment@3 {
+               target = <&sound>;
+               hifiberry_dacplus: __overlay__ {
+                       compatible = "hifiberry,hifiberry-dacplus";
+                       i2s-controller = <&i2s>;
+                       status = "okay";
+                       mute-gpio = <&gpio 4 0>;
+                       reset-gpio = <&gpio 17 0x11>;
+               };
+       };
+
+       __overrides__ {
+               24db_digital_gain =
+                       <&hifiberry_dacplus>,"hifiberry,24db_digital_gain?";
+               slave = <&hifiberry_dacplus>,"hifiberry-dacplus,slave?";
+               leds_off = <&hifiberry_dacplus>,"hifiberry-dacplus,leds_off?";
+               mute_ext_ctl = <&hifiberry_dacplus>,"hifiberry-dacplus,mute_ext_ctl:0";
+               auto_mute = <&hifiberry_dacplus>,"hifiberry-dacplus,auto_mute?";
+       };
+};