Skip to content

Commit afe77b8

Browse files
committed
overlays: wm8960-soundcard: Add media parameter
Add optional media board support to the wm8960-soundcard overlay: - mclk: Overrides the MCLK clock frequency (default 12.288 MHz) - media: Switches to the media board configuration: 24 MHz MCLK, enables headphone jack detection (wlf,hp-cfg) and an on-board microphone / dual speaker sound card. The parameters are implemented as dormant fragments and have no effect unless explicitly activated, preserving full backward compatibility with existing configurations. Tested on Raspberry Pi 5 (EDATEC media board) with: dtoverlay=wm8960-soundcard,media=on Signed-off-by: zjzhao <zjzhao@edatec.cn>
1 parent 6549564 commit afe77b8

2 files changed

Lines changed: 55 additions & 0 deletions

File tree

arch/arm/boot/dts/overlays/README

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6379,6 +6379,12 @@ Info: Overlay for the Waveshare wm8960 soundcard
63796379
Load: dtoverlay=wm8960-soundcard,<param>=<val>
63806380
Params: alsaname Changes the card name in ALSA
63816381
compatible Changes the codec compatibility
6382+
mclk Sets the MCLK clock frequency in Hz (default
6383+
12.288 MHz)
6384+
media Uses the media board configuration: 24 MHz
6385+
MCLK, enables headphone jack detection
6386+
(wlf,hp-cfg) and an on-board microphone /
6387+
dual speaker sound card
63826388

63836389

63846390
Name: ws2812-pio

arch/arm/boot/dts/overlays/wm8960-soundcard-overlay.dts

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,57 @@
7575
};
7676
};
7777

78+
fragment@4 {
79+
target = <&wm8960_mclk>;
80+
__dormant__ {
81+
clock-frequency = <24000000>;
82+
};
83+
};
84+
85+
fragment@5 {
86+
target = <&wm8960>;
87+
__dormant__ {
88+
wlf,hp-cfg = <2 2 3>;
89+
};
90+
};
91+
92+
fragment@6 {
93+
target = <&sound>;
94+
__dormant__ {
95+
compatible = "simple-audio-card";
96+
simple-audio-card,format = "i2s";
97+
simple-audio-card,name = "wm8960-soundcard";
98+
status = "okay";
99+
100+
simple-audio-card,widgets =
101+
"Microphone", "On Board Mic",
102+
"Line", "Line In",
103+
"Line", "Line Out",
104+
"Speaker", "Speaker",
105+
"Headphone", "Headphone Jack";
106+
simple-audio-card,routing =
107+
"Headphone Jack", "HP_L",
108+
"Headphone Jack", "HP_R",
109+
"Speaker", "SPK_LP",
110+
"Speaker", "SPK_LN",
111+
"Speaker", "SPK_RP",
112+
"Speaker", "SPK_RN",
113+
"LINPUT2", "Headphone Jack";
114+
115+
simple-audio-card,cpu {
116+
sound-dai = <&i2s_clk_producer>;
117+
};
118+
119+
simple-audio-card,codec {
120+
sound-dai = <&wm8960>;
121+
};
122+
};
123+
};
124+
78125
__overrides__ {
79126
alsaname = <&slave_overlay>,"simple-audio-card,name";
80127
compatible = <&wm8960>,"compatible";
128+
mclk = <&wm8960_mclk>,"clock-frequency:0";
129+
media = <0>, "=4=5=6!3";
81130
};
82131
};

0 commit comments

Comments
 (0)