Skip to content
Snippets Groups Projects
Commit 039d56b8 authored by Shengjiu Wang's avatar Shengjiu Wang Committed by Leonard Crestez
Browse files

MLK-19854-1: ASoC: imx-wm8960: fix error when m4 image is not loaded


With rpmsg sound, when the m4 image is not loaded. There is error log

[ 46.275223] imx-wm8960 sound-rpmsg-wm8960: ASoC: CODEC DAI rpmsg-wm8960-hifi not registered
[ 46.284543] imx-wm8960 sound-rpmsg-wm8960: snd_soc_register_card failed (-517)

The issue is caused by that codec is not registered, the sound
card registration will fail

So add check in probe function for codec dai is ready or not.

Signed-off-by: default avatarShengjiu Wang <shengjiu.wang@nxp.com>
(cherry picked from commit 6fab38509647529c165bb610b8a7996d6ad16307)
Signed-off-by: default avatarVipul Kumar <vipul_kumar@mentor.com>
Signed-off-by: default avatarSrikanth Krishnakar <Srikanth_Krishnakar@mentor.com>
parent db613431
No related branches found
No related tags found
No related merge requests found
...@@ -448,6 +448,8 @@ static int imx_wm8960_probe(struct platform_device *pdev) ...@@ -448,6 +448,8 @@ static int imx_wm8960_probe(struct platform_device *pdev)
struct imx_wm8960_data *data; struct imx_wm8960_data *data;
struct platform_device *asrc_pdev = NULL; struct platform_device *asrc_pdev = NULL;
struct device_node *asrc_np; struct device_node *asrc_np;
struct snd_soc_dai_link_component dlc = { 0 };
struct snd_soc_dai *codec_dai;
u32 width; u32 width;
int ret; int ret;
...@@ -537,6 +539,12 @@ static int imx_wm8960_probe(struct platform_device *pdev) ...@@ -537,6 +539,12 @@ static int imx_wm8960_probe(struct platform_device *pdev)
if (data->is_codec_rpmsg) { if (data->is_codec_rpmsg) {
imx_wm8960_dai[0].codec_name = "rpmsg-audio-codec-wm8960"; imx_wm8960_dai[0].codec_name = "rpmsg-audio-codec-wm8960";
imx_wm8960_dai[0].codec_dai_name = "rpmsg-wm8960-hifi"; imx_wm8960_dai[0].codec_dai_name = "rpmsg-wm8960-hifi";
dlc.name = "rpmsg-audio-codec-wm8960";
dlc.dai_name = "rpmsg-wm8960-hifi";
codec_dai = snd_soc_find_dai(&dlc);
if (!codec_dai)
return -ENODEV;
} else } else
imx_wm8960_dai[0].codec_of_node = codec_np; imx_wm8960_dai[0].codec_of_node = codec_np;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment