brcm63xx: rename target to bcm63xx
[openwrt/staging/mkresin.git] / target / linux / brcm2708 / patches-4.19 / 950-0369-Maxim-MAX98357A-I2S-DAC-overlay-2935.patch
1 From 5962d99b5efed4297ed5c1807d21b406ab86aef1 Mon Sep 17 00:00:00 2001
2 From: wavelet2 <20504977+wavelet2@users.noreply.github.com>
3 Date: Mon, 15 Apr 2019 10:00:20 +0100
4 Subject: [PATCH] Maxim MAX98357A I2S DAC overlay (#2935)
5
6 Add overlay for Maxim MAX98357A I2S DAC.
7
8 Signed-off-by: Richard Steedman <richard.steedman@gmail.com>
9 ---
10 arch/arm/boot/dts/overlays/Makefile | 1 +
11 arch/arm/boot/dts/overlays/README | 9 ++
12 .../boot/dts/overlays/max98357a-overlay.dts | 84 +++++++++++++++++++
13 3 files changed, 94 insertions(+)
14 create mode 100644 arch/arm/boot/dts/overlays/max98357a-overlay.dts
15
16 --- a/arch/arm/boot/dts/overlays/Makefile
17 +++ b/arch/arm/boot/dts/overlays/Makefile
18 @@ -75,6 +75,7 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \
19 justboom-dac.dtbo \
20 justboom-digi.dtbo \
21 ltc294x.dtbo \
22 + max98357a.dtbo \
23 mbed-dac.dtbo \
24 mcp23017.dtbo \
25 mcp23s17.dtbo \
26 --- a/arch/arm/boot/dts/overlays/README
27 +++ b/arch/arm/boot/dts/overlays/README
28 @@ -1276,6 +1276,15 @@ Params: ltc2941 Select t
29 See the datasheet for more information.
30
31
32 +Name: max98357a
33 +Info: Configures the Maxim MAX98357A I2S DAC
34 +Load: dtoverlay=max98357a,<param>=<val>
35 +Params: no-sdmode Driver does not manage the state of the DAC's
36 + SD_MODE pin (i.e. chip is always on).
37 + sdmode-pin integer, GPIO pin connected to the SD_MODE input
38 + of the DAC (default GPIO4 if parameter omitted).
39 +
40 +
41 Name: mbed-dac
42 Info: Configures the mbed AudioCODEC (TLV320AIC23B)
43 Load: dtoverlay=mbed-dac
44 --- /dev/null
45 +++ b/arch/arm/boot/dts/overlays/max98357a-overlay.dts
46 @@ -0,0 +1,84 @@
47 +// Overlay for Maxim MAX98357A audio DAC
48 +
49 +// dtparams:
50 +// no-sdmode - SD_MODE pin not managed by driver.
51 +// sdmode-pin - Specify GPIO pin to which SD_MODE is connected (default 4).
52 +
53 +/dts-v1/;
54 +/plugin/;
55 +
56 +/ {
57 + compatible = "brcm,bcm2835", "brcm,bcm2708", "brcm,bcm2709";
58 +
59 + /* Enable I2S */
60 + fragment@0 {
61 + target = <&i2s>;
62 + __overlay__ {
63 + status = "okay";
64 + };
65 + };
66 +
67 + /* DAC whose SD_MODE pin is managed by driver (via GPIO pin) */
68 + fragment@1 {
69 + target-path = "/";
70 + __overlay__ {
71 + max98357a_dac: max98357a {
72 + compatible = "maxim,max98357a";
73 + #sound-dai-cells = <0>;
74 + sdmode-gpios = <&gpio 4 0>; /* 2nd word overwritten by sdmode-pin parameter */
75 + status = "okay";
76 + };
77 + };
78 + };
79 +
80 + /* DAC whose SD_MODE pin is not managed by driver */
81 + fragment@2 {
82 + target-path = "/";
83 + __dormant__ {
84 + max98357a_nsd: max98357a {
85 + compatible = "maxim,max98357a";
86 + #sound-dai-cells = <0>;
87 + status = "okay";
88 + };
89 + };
90 + };
91 +
92 + /* Soundcard connecting I2S to DAC with SD_MODE */
93 + fragment@3 {
94 + target = <&sound>;
95 + __overlay__ {
96 + compatible = "simple-audio-card";
97 + simple-audio-card,format = "i2s";
98 + simple-audio-card,name = "MAX98357A";
99 + status = "okay";
100 + simple-audio-card,cpu {
101 + sound-dai = <&i2s>;
102 + };
103 + simple-audio-card,codec {
104 + sound-dai = <&max98357a_dac>;
105 + };
106 + };
107 + };
108 +
109 + /* Soundcard connecting I2S to DAC without SD_MODE */
110 + fragment@4 {
111 + target = <&sound>;
112 + __dormant__ {
113 + compatible = "simple-audio-card";
114 + simple-audio-card,format = "i2s";
115 + simple-audio-card,name = "MAX98357A";
116 + status = "okay";
117 + simple-audio-card,cpu {
118 + sound-dai = <&i2s>;
119 + };
120 + simple-audio-card,codec {
121 + sound-dai = <&max98357a_nsd>;
122 + };
123 + };
124 + };
125 +
126 + __overrides__ {
127 + no-sdmode = <0>,"-1+2-3+4";
128 + sdmode-pin = <&max98357a_dac>,"sdmode-gpios:4";
129 + };
130 +};