Skip to content

Commit 9233a9b

Browse files
wavelet2Phil Elwell
authored and
Phil Elwell
committed
Maxim MAX98357A I2S DAC overlay (#2935)
Add overlay for Maxim MAX98357A I2S DAC. Signed-off-by: Richard Steedman <[email protected]>
1 parent 44dc9ba commit 9233a9b

File tree

3 files changed

+94
-0
lines changed

3 files changed

+94
-0
lines changed

arch/arm/boot/dts/overlays/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \
7373
justboom-dac.dtbo \
7474
justboom-digi.dtbo \
7575
ltc294x.dtbo \
76+
max98357a.dtbo \
7677
mbed-dac.dtbo \
7778
mcp23017.dtbo \
7879
mcp23s17.dtbo \

arch/arm/boot/dts/overlays/README

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1250,6 +1250,15 @@ Params: ltc2941 Select the ltc2941 device
12501250
See the datasheet for more information.
12511251

12521252

1253+
Name: max98357a
1254+
Info: Configures the Maxim MAX98357A I2S DAC
1255+
Load: dtoverlay=max98357a,<param>=<val>
1256+
Params: no-sdmode Driver does not manage the state of the DAC's
1257+
SD_MODE pin (i.e. chip is always on).
1258+
sdmode-pin integer, GPIO pin connected to the SD_MODE input
1259+
of the DAC (default GPIO4 if parameter omitted).
1260+
1261+
12531262
Name: mbed-dac
12541263
Info: Configures the mbed AudioCODEC (TLV320AIC23B)
12551264
Load: dtoverlay=mbed-dac
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
// Overlay for Maxim MAX98357A audio DAC
2+
3+
// dtparams:
4+
// no-sdmode - SD_MODE pin not managed by driver.
5+
// sdmode-pin - Specify GPIO pin to which SD_MODE is connected (default 4).
6+
7+
/dts-v1/;
8+
/plugin/;
9+
10+
/ {
11+
compatible = "brcm,bcm2835", "brcm,bcm2708", "brcm,bcm2709";
12+
13+
/* Enable I2S */
14+
fragment@0 {
15+
target = <&i2s>;
16+
__overlay__ {
17+
status = "okay";
18+
};
19+
};
20+
21+
/* DAC whose SD_MODE pin is managed by driver (via GPIO pin) */
22+
fragment@1 {
23+
target-path = "/";
24+
__overlay__ {
25+
max98357a_dac: max98357a {
26+
compatible = "maxim,max98357a";
27+
#sound-dai-cells = <0>;
28+
sdmode-gpios = <&gpio 4 0>; /* 2nd word overwritten by sdmode-pin parameter */
29+
status = "okay";
30+
};
31+
};
32+
};
33+
34+
/* DAC whose SD_MODE pin is not managed by driver */
35+
fragment@2 {
36+
target-path = "/";
37+
__dormant__ {
38+
max98357a_nsd: max98357a {
39+
compatible = "maxim,max98357a";
40+
#sound-dai-cells = <0>;
41+
status = "okay";
42+
};
43+
};
44+
};
45+
46+
/* Soundcard connecting I2S to DAC with SD_MODE */
47+
fragment@3 {
48+
target = <&sound>;
49+
__overlay__ {
50+
compatible = "simple-audio-card";
51+
simple-audio-card,format = "i2s";
52+
simple-audio-card,name = "MAX98357A";
53+
status = "okay";
54+
simple-audio-card,cpu {
55+
sound-dai = <&i2s>;
56+
};
57+
simple-audio-card,codec {
58+
sound-dai = <&max98357a_dac>;
59+
};
60+
};
61+
};
62+
63+
/* Soundcard connecting I2S to DAC without SD_MODE */
64+
fragment@4 {
65+
target = <&sound>;
66+
__dormant__ {
67+
compatible = "simple-audio-card";
68+
simple-audio-card,format = "i2s";
69+
simple-audio-card,name = "MAX98357A";
70+
status = "okay";
71+
simple-audio-card,cpu {
72+
sound-dai = <&i2s>;
73+
};
74+
simple-audio-card,codec {
75+
sound-dai = <&max98357a_nsd>;
76+
};
77+
};
78+
};
79+
80+
__overrides__ {
81+
no-sdmode = <0>,"-1+2-3+4";
82+
sdmode-pin = <&max98357a_dac>,"sdmode-gpios:4";
83+
};
84+
};

0 commit comments

Comments
 (0)