Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

overlays: add wm8960-soundcard overlay #4039

Merged
merged 1 commit into from
Jan 7, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion arch/arm/boot/dts/overlays/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,8 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \
w1-gpio.dtbo \
w1-gpio-pullup.dtbo \
w5500.dtbo \
wittypi.dtbo
wittypi.dtbo \
wm8960-soundcard.dtbo

targets += dtbs dtbs_install
targets += $(dtbo-y)
Expand Down
7 changes: 7 additions & 0 deletions arch/arm/boot/dts/overlays/README
Original file line number Diff line number Diff line change
Expand Up @@ -3041,6 +3041,13 @@ Params: led_gpio GPIO for LED (default "17")
"default-on")


Name: wm8960-soundcard
Info: Overlay for the Waveshare wm8960 soundcard
Load: dtoverlay=wm8960-soundcard,<param>=<val>
Params: alsaname Changes the card name in ALSA
compatible Changes the codec compatibility


Troubleshooting
===============

Expand Down
82 changes: 82 additions & 0 deletions arch/arm/boot/dts/overlays/wm8960-soundcard-overlay.dts
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
// Definitions for Waveshare WM8960 https://github.com/waveshare/WM8960-Audio-HAT
/dts-v1/;
/plugin/;

/ {
compatible = "brcm,bcm2835";

fragment@0 {
target = <&i2s>;
__overlay__ {
status = "okay";
};
};

fragment@1 {
target-path="/";
__overlay__ {
wm8960_mclk: wm8960_mclk {
compatible = "fixed-clock";
#clock-cells = <0>;
clock-frequency = <12288000>;
};
};
};
fragment@2 {
target = <&i2c1>;
__overlay__ {
#address-cells = <1>;
#size-cells = <0>;
status = "okay";

wm8960: wm8960 {
compatible = "wlf,wm8960";
reg = <0x1a>;
#sound-dai-cells = <0>;
AVDD-supply = <&vdd_5v0_reg>;
DVDD-supply = <&vdd_3v3_reg>;
};
};
};


fragment@3 {
target = <&sound>;
slave_overlay: __overlay__ {
compatible = "simple-audio-card";
simple-audio-card,format = "i2s";
simple-audio-card,name = "wm8960-soundcard";
status = "okay";

simple-audio-card,widgets =
"Microphone", "Mic Jack",
"Line", "Line In",
"Line", "Line Out",
"Speaker", "Speaker",
"Headphone", "Headphone Jack";
simple-audio-card,routing =
"Headphone Jack", "HP_L",
"Headphone Jack", "HP_R",
"Speaker", "SPK_LP",
"Speaker", "SPK_LN",
"LINPUT1", "Mic Jack",
"LINPUT3", "Mic Jack",
"RINPUT1", "Mic Jack",
"RINPUT2", "Mic Jack";

simple-audio-card,cpu {
sound-dai = <&i2s>;
};
dailink0_slave: simple-audio-card,codec {
sound-dai = <&wm8960>;
clocks = <&wm8960_mclk>;
clock-names = "mclk";
};
};
};

__overrides__ {
alsaname = <&slave_overlay>,"simple-audio-card,name";
compatible = <&wm8960>,"compatible";
};
};