1ddf1c9456950af620e6da6fdd50907ee1f9085d
[openwrt/staging/chunkeey.git] / target / linux / bcm27xx / patches-5.10 / 950-0450-Adds-the-DT-overlays-to-support-Hifiberry-AMP100.patch
1 From bcaa1b9dcc731ff3d7a8d36769062e9571d0738c Mon Sep 17 00:00:00 2001
2 From: Joerg Schambacher <joerg@i2audio.com>
3 Date: Fri, 29 Jan 2021 08:26:44 +0100
4 Subject: [PATCH] Adds the DT-overlays to support Hifiberry AMP100
5
6 Adds new DT-overlay to control AMP100.
7
8 Signed-off-by: Joerg Schambacher <joerg@hifiberry.com>
9 ---
10 arch/arm/boot/dts/overlays/Makefile | 1 +
11 arch/arm/boot/dts/overlays/README | 30 ++++++++-
12 .../dts/overlays/hifiberry-amp100-overlay.dts | 64 +++++++++++++++++++
13 3 files changed, 94 insertions(+), 1 deletion(-)
14 create mode 100644 arch/arm/boot/dts/overlays/hifiberry-amp100-overlay.dts
15
16 --- a/arch/arm/boot/dts/overlays/Makefile
17 +++ b/arch/arm/boot/dts/overlays/Makefile
18 @@ -61,6 +61,7 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \
19 hd44780-lcd.dtbo \
20 hdmi-backlight-hwhack-gpio.dtbo \
21 hifiberry-amp.dtbo \
22 + hifiberry-amp100.dtbo \
23 hifiberry-dac.dtbo \
24 hifiberry-dacplus.dtbo \
25 hifiberry-dacplusadc.dtbo \
26 --- a/arch/arm/boot/dts/overlays/README
27 +++ b/arch/arm/boot/dts/overlays/README
28 @@ -1059,8 +1059,36 @@ Load: dtoverlay=hifiberry-amp
29 Params: <None>
30
31
32 +Name: hifiberry-amp100
33 +Info: Configures the HifiBerry AMP100 audio card
34 +Load: dtoverlay=hifiberry-amp100,<param>=<val>
35 +Params: 24db_digital_gain Allow gain to be applied via the PCM512x codec
36 + Digital volume control. Enable with
37 + "dtoverlay=hifiberry-amp100,24db_digital_gain"
38 + (The default behaviour is that the Digital
39 + volume control is limited to a maximum of
40 + 0dB. ie. it can attenuate but not provide
41 + gain. For most users, this will be desired
42 + as it will prevent clipping. By appending
43 + the 24dB_digital_gain parameter, the Digital
44 + volume control will allow up to 24dB of
45 + gain. If this parameter is enabled, it is the
46 + responsibility of the user to ensure that
47 + the Digital volume control is set to a value
48 + that does not result in clipping/distortion!)
49 + slave Force DAC+ Pro into slave mode, using Pi as
50 + master for bit clock and frame clock.
51 + leds_off If set to 'true' the onboard indicator LEDs
52 + are switched off at all times.
53 + auto_mute If set to 'true' the amplifier is automatically
54 + muted when the DAC is not playing.
55 + mute_ext_ctl The amplifier's HW mute control is enabled
56 + in ALSA mixer and set to <val>.
57 + Will be overwritten by ALSA user settings.
58 +
59 +
60 Name: hifiberry-dac
61 -Info: Configures the HifiBerry DAC audio card
62 +Info: Configures the HifiBerry DAC audio cards
63 Load: dtoverlay=hifiberry-dac
64 Params: <None>
65
66 --- /dev/null
67 +++ b/arch/arm/boot/dts/overlays/hifiberry-amp100-overlay.dts
68 @@ -0,0 +1,64 @@
69 +// Definitions for HiFiBerry AMP100
70 +/dts-v1/;
71 +/plugin/;
72 +
73 +/ {
74 + compatible = "brcm,bcm2835";
75 +
76 + fragment@0 {
77 + target-path = "/";
78 + __overlay__ {
79 + dacpro_osc: dacpro_osc {
80 + compatible = "hifiberry,dacpro-clk";
81 + #clock-cells = <0>;
82 + };
83 + };
84 + };
85 +
86 + fragment@1 {
87 + target = <&i2s>;
88 + __overlay__ {
89 + status = "okay";
90 + };
91 + };
92 +
93 + fragment@2 {
94 + target = <&i2c1>;
95 + __overlay__ {
96 + #address-cells = <1>;
97 + #size-cells = <0>;
98 + status = "okay";
99 +
100 + pcm5122@4d {
101 + #sound-dai-cells = <0>;
102 + compatible = "ti,pcm5122";
103 + reg = <0x4d>;
104 + clocks = <&dacpro_osc>;
105 + AVDD-supply = <&vdd_3v3_reg>;
106 + DVDD-supply = <&vdd_3v3_reg>;
107 + CPVDD-supply = <&vdd_3v3_reg>;
108 + status = "okay";
109 + };
110 + };
111 + };
112 +
113 + fragment@3 {
114 + target = <&sound>;
115 + hifiberry_dacplus: __overlay__ {
116 + compatible = "hifiberry,hifiberry-dacplus";
117 + i2s-controller = <&i2s>;
118 + status = "okay";
119 + mute-gpio = <&gpio 4 0>;
120 + reset-gpio = <&gpio 17 0x11>;
121 + };
122 + };
123 +
124 + __overrides__ {
125 + 24db_digital_gain =
126 + <&hifiberry_dacplus>,"hifiberry,24db_digital_gain?";
127 + slave = <&hifiberry_dacplus>,"hifiberry-dacplus,slave?";
128 + leds_off = <&hifiberry_dacplus>,"hifiberry-dacplus,leds_off?";
129 + mute_ext_ctl = <&hifiberry_dacplus>,"hifiberry-dacplus,mute_ext_ctl:0";
130 + auto_mute = <&hifiberry_dacplus>,"hifiberry-dacplus,auto_mute?";
131 + };
132 +};