Skip to content

Commit 1f085de

Browse files
shawajpelwell
authored andcommitted
overlays: add wm8960-soundcard overlay
add overlay for waveshare wm8960 simple-audio-card Change-type: patch Signed-off-by: Aaron Shaw <[email protected]>
1 parent abdf918 commit 1f085de

File tree

3 files changed

+91
-1
lines changed

3 files changed

+91
-1
lines changed

arch/arm/boot/dts/overlays/Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,8 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \
211211
w1-gpio.dtbo \
212212
w1-gpio-pullup.dtbo \
213213
w5500.dtbo \
214-
wittypi.dtbo
214+
wittypi.dtbo \
215+
wm8960-soundcard.dtbo
215216

216217
targets += dtbs dtbs_install
217218
targets += $(dtbo-y)

arch/arm/boot/dts/overlays/README

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3095,6 +3095,13 @@ Params: led_gpio GPIO for LED (default "17")
30953095
"default-on")
30963096

30973097

3098+
Name: wm8960-soundcard
3099+
Info: Overlay for the Waveshare wm8960 soundcard
3100+
Load: dtoverlay=wm8960-soundcard,<param>=<val>
3101+
Params: alsaname Changes the card name in ALSA
3102+
compatible Changes the codec compatibility
3103+
3104+
30983105
Troubleshooting
30993106
===============
31003107

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
// Definitions for Waveshare WM8960 https://github.com/waveshare/WM8960-Audio-HAT
2+
/dts-v1/;
3+
/plugin/;
4+
5+
/ {
6+
compatible = "brcm,bcm2835";
7+
8+
fragment@0 {
9+
target = <&i2s>;
10+
__overlay__ {
11+
status = "okay";
12+
};
13+
};
14+
15+
fragment@1 {
16+
target-path="/";
17+
__overlay__ {
18+
wm8960_mclk: wm8960_mclk {
19+
compatible = "fixed-clock";
20+
#clock-cells = <0>;
21+
clock-frequency = <12288000>;
22+
};
23+
};
24+
};
25+
fragment@2 {
26+
target = <&i2c1>;
27+
__overlay__ {
28+
#address-cells = <1>;
29+
#size-cells = <0>;
30+
status = "okay";
31+
32+
wm8960: wm8960 {
33+
compatible = "wlf,wm8960";
34+
reg = <0x1a>;
35+
#sound-dai-cells = <0>;
36+
AVDD-supply = <&vdd_5v0_reg>;
37+
DVDD-supply = <&vdd_3v3_reg>;
38+
};
39+
};
40+
};
41+
42+
43+
fragment@3 {
44+
target = <&sound>;
45+
slave_overlay: __overlay__ {
46+
compatible = "simple-audio-card";
47+
simple-audio-card,format = "i2s";
48+
simple-audio-card,name = "wm8960-soundcard";
49+
status = "okay";
50+
51+
simple-audio-card,widgets =
52+
"Microphone", "Mic Jack",
53+
"Line", "Line In",
54+
"Line", "Line Out",
55+
"Speaker", "Speaker",
56+
"Headphone", "Headphone Jack";
57+
simple-audio-card,routing =
58+
"Headphone Jack", "HP_L",
59+
"Headphone Jack", "HP_R",
60+
"Speaker", "SPK_LP",
61+
"Speaker", "SPK_LN",
62+
"LINPUT1", "Mic Jack",
63+
"LINPUT3", "Mic Jack",
64+
"RINPUT1", "Mic Jack",
65+
"RINPUT2", "Mic Jack";
66+
67+
simple-audio-card,cpu {
68+
sound-dai = <&i2s>;
69+
};
70+
dailink0_slave: simple-audio-card,codec {
71+
sound-dai = <&wm8960>;
72+
clocks = <&wm8960_mclk>;
73+
clock-names = "mclk";
74+
};
75+
};
76+
};
77+
78+
__overrides__ {
79+
alsaname = <&slave_overlay>,"simple-audio-card,name";
80+
compatible = <&wm8960>,"compatible";
81+
};
82+
};

0 commit comments

Comments
 (0)