Skip to content

Commit 84be886

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 84be886

2 files changed

Lines changed: 47 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: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
// Definitions for Waveshare WM8960 https://github.com/waveshare/WM8960-Audio-HAT
2+
// Extended with EDATEC media board support via the "media" parameter.
23
/dts-v1/;
34
/plugin/;
45

@@ -75,8 +76,48 @@
7576
};
7677
};
7778

79+
/* EDATEC media board: 24MHz MCLK oscillator */
80+
fragment@4 {
81+
target = <&wm8960_mclk>;
82+
__dormant__ {
83+
clock-frequency = <24000000>;
84+
};
85+
};
86+
87+
/* EDATEC media board: enable headphone jack detection */
88+
fragment@5 {
89+
target = <&wm8960>;
90+
__dormant__ {
91+
wlf,hp-cfg = <2 2 3>;
92+
};
93+
};
94+
95+
/* EDATEC media board: on-board mic + dual speakers sound card */
96+
fragment@6 {
97+
target = <&sound>;
98+
__dormant__ {
99+
simple-audio-card,widgets =
100+
"Microphone", "On Board Mic",
101+
"Line", "Line In",
102+
"Line", "Line Out",
103+
"Speaker", "Speaker",
104+
"Headphone", "Headphone Jack";
105+
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+
};
116+
78117
__overrides__ {
79118
alsaname = <&slave_overlay>,"simple-audio-card,name";
80119
compatible = <&wm8960>,"compatible";
120+
mclk = <&wm8960_mclk>,"clock-frequency:0";
121+
media = <0>, "=4=5=6";
81122
};
82123
};

0 commit comments

Comments
 (0)