redchenjs / mt762x-wm8960

MT762X WM8960 ALSA SoC machine driver
GNU General Public License v2.0
27 stars 22 forks source link
alsa asoc dts kernel mt7620 mt7621 mt7628 mt762x mt7688 mt76x8 openwrt sound wm8960

MT762X WM8960 ALSA SoC machine driver

ALSA SoC machine driver for MT762X SoCs with WM8960 CODEC chip.

Requirements

Preparing

WM8960 MCLK

WM8960 can get MCLK from an externel clock source or the refclk output of MT762X SoCs (12MHz). To enable the refclk output, you can modify the dts file as follows:

refclk {
    groups = "refclk";
    function = "refclk";
};

WM8960 ADCLRC

WM8960 can internally get ADCLRC from DACLRC and the ADCLRC pin can be used as GPIO1. It is useful for some boards that only have the DACLRC pin connected and the ADCLRC pin is left floating. To enable this feature, modify the dts file as follows:

codec: wm8960@1a {
    compatible = "wlf,wm8960";
    reg = <0x1a>;
    wlf,shared-lrclk;
    wlf,hp-cfg = <0 0 0>;
    wlf,gpio-cfg = <1 0>;
};

Configuring the OpenWrt

make menuconfig

Kernel modules:

Userspace tools:

Building the image

make -j9 V=s

Settings

Examples of /etc/asound.conf:

After restarting, the output of WM8960 is muted. Use these commands to set the volume.

amixer sset "Headphone" 90
amixer sset "Speaker" 90

Playback

amixer sset "Left Output Mixer PCM" on
amixer sset "Right Output Mixer PCM" on

Capture

amixer sset "Left Input Mixer Boost" on
amixer sset "Right Input Mixer Boost" on
amixer sset "ALC Function" "Stereo"

References

WM8960 block diagram