您好!
请问imx8mm sai3上接wm8960 dts怎么配置?我的软件版本是imx-p9.0.0_2.3.0 linux是4.14.98
我目前的配置如下:
wm8960: wm8960@1a {
compatible = "wlf,wm8960";
reg = <0x1a>;
clocks = <&clk IMX8MM_CLK_SAI3_ROOT>;
clock-names = "mclk";
wlf,shared-lrclk;
status = "okay";
};
sound-wm8960 {
compatible = "fsl,imx7d-evk-wm8960",
"fsl,imx-audio-wm8960";
model = "wm8960-audio";
cpu-dai = <&sai3>;
audio-codec = <&wm8960>;
//codec-rpmsg;
codec-master;
/*
* hp-det = <hp-det-pin hp-det-polarity>;
* hp-det-pin: JD1 JD2 or JD3
* hp-det-polarity = 0: hp detect high for headphone
* hp-det-polarity = 1: hp detect high for speaker
*/
//hp-det = <2 0>;
//hp-det-gpios = <&gpio1 13 0>;
//mic-det-gpios = <&gpio1 13 0>;
audio-routing =
"Headphone Jack", "HP_L",
"Headphone Jack", "HP_R",
"Ext Spk", "SPK_LP",
"Ext Spk", "SPK_LN",
"Ext Spk", "SPK_RP",
"Ext Spk", "SPK_RN",
"LINPUT2", "Mic Jack",
"LINPUT3", "Mic Jack",
"RINPUT1", "Main MIC",
"RINPUT2", "Main MIC",
"Mic Jack", "MICB",
"Main MIC", "MICB";
status = "okay";
};
pinctrl_sai3: sai3grp {
fsl,pins = <
MX8MM_IOMUXC_SAI3_TXFS_SAI3_TX_SYNC 0xd6
MX8MM_IOMUXC_SAI3_TXC_SAI3_TX_BCLK 0xd6
MX8MM_IOMUXC_SAI3_MCLK_SAI3_MCLK 0xd6
MX8MM_IOMUXC_SAI3_TXD_SAI3_TX_DATA0 0xd6
MX8MM_IOMUXC_SAI3_RXD_SAI3_RX_DATA0 0xd6
>;
};
&sai3 {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_sai3>;
assigned-clocks = <&clk IMX8MM_CLK_SAI3>;
assigned-clock-parents = <&clk IMX8MM_AUDIO_PLL1_OUT>;
assigned-clock-rates = <24576000>; //12288000 24576000 12289600
fsl,sai-asynchronous;
status = "okay";
};
以上配置,
tinyplay 播放wav文件 始终没有输出,并且有提示播放采样率错误
[ 891.073461] wm8960_set_dai_sysclk 1277
[ 891.077774] wm8960_hw_params 802
[ 891.081543] wm8960_hw_params 830 wm8960->lrclk=16000
[ 891.087233] wm8960_configure_clocking 738 wm8960->freq_in=24576000
[ 891.093883] wm8960_configure_sysclk 640 bclk=512000 lrclk=16000
Playing sample: 2 ch, 16000 hz, 16 bit
[ 891.102622] wm8960_set_bias_level_out3 888
[ 891.110270] wm8960_configure_clocking 738 wm8960->freq_in=24576000
[ 891.116979] [wm8960_configure_sysclk 640 bclk=512000 lrclk=16000
[ 891.124857] wm8960_mute 868 mute = 0
Error playing sample
[ 901.221110] wm8960_mute 868 mute = 1
evk_8mm:/storage/emulated/0/Download # [ 905.696469] healthd: battery l=85 v=3 t=35.0 h=2 st=2 c=400 fc=4000000 cc=32 chg=a
[ 905.832237] healthd: battery l=85 v=3 t=35.0 h=2 st=2 c=400 fc=4000000 cc=32 chg=a
[ 906.341049] wm8960_set_bias_level_out3 888
[ 906.345724] wm8960_set_bias_level_out3 914
[ 906.352038] wm8960_set_bias_level_out3 929
You can refer to this to porting https://community.nxp.com/docs/DOC-106295