以下附上目前的程式碼、DTS 及線路
目前使用環境為Android 9
在 driver 上的設定開啟 config 檔案 如下 :
CONFIG_SND_SOC_IMX_WM8962=y
CONFIG_SND_SOC_WM8962=y
dts 設定如下 如附檔 imx8mm-pico-wizard.dts :
wm8962: wm8962@1a {
compatible = "wlf,wm8962";
#sound-dai-cells = <0>;
clock-names = "mclk";
wlf,shared-lrclk;
wlf,fixed-mclk;
reg = <0x1a>;
clocks = <&codec_osc>;
DCVDD-supply = <®_wm8962>;
DBVDD-supply = <®_wm8962>;
AVDD-supply = <®_wm8962>;
CPVDD-supply = <®_wm8962>;
MICVDD-supply = <®_wm8962>;
PLLVDD-supply = <®_wm8962>;
SPKVDD1-supply = <®_wm8962>;
SPKVDD2-supply = <®_wm8962>;
gpio-cfg = <
0x0000
0x0000
0x0013
0x0000
0x8014
0x0000
>;
amic-mono;
//power-domains = <&pd_mclk_out0>;
};
sound-wm8962 {
compatible = "fsl,imx6q-sabresd-wm8962",
"fsl,imx-audio-wm8962";
model = "wm8962-audio";
cpu-dai = <&sai2>;
audio-codec = <&wm8962>;
audio-routing =
"Headphone Jack", "HPOUTL",
"Headphone Jack", "HPOUTR",
"Ext Spk", "SPKOUTL",
"Ext Spk", "SPKOUTR",
"AMIC", "MICBIAS",
"IN3R", "AMIC",
"DMIC", "MICBIAS",
"DMICDAT", "DMIC",
"Playback", "CPU-Playback",
"CPU-Capture", "Capture";
codec-master;
hp-det-gpios = <&gpio5 3 1>;
mic-det-gpios = <&gpio5 4 1>;
};
目前開機啟動LOG為
pico_imx8mm:/ # dmesg | grep wm89
[ 3.950469] wm8962 2-001a: customer id 0 revision F
[ 4.183961] imx-wm8962 sound-wm8962: wm8962 <-> 30020000.sai mapping ok
[ 4.190667] imx-wm8962 sound-wm8962: ASoC: no DMI vendor name!
[ 4.448055] #0: wm8962-audio
執行 tinyplay 1kHz_44100Hz_16bit_30sec.wav 後
執行後沒有任何作動,波形如附件。