summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShengjiu Wang <shengjiu.wang@nxp.com>2018-10-11 18:00:08 +0800
committerJason Liu <jason.hui.liu@nxp.com>2019-02-12 10:34:34 +0800
commita52c88bc3932a4a7530705e2929984026f80f53a (patch)
tree96066d383056aa79b0ddaa60248c53d071d76df2
parent2bf5f970478549963727cf2a8a33f1859682fe82 (diff)
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: Shengjiu Wang <shengjiu.wang@nxp.com>
-rw-r--r--sound/soc/fsl/imx-wm8960.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/sound/soc/fsl/imx-wm8960.c b/sound/soc/fsl/imx-wm8960.c
index a72b70007962..0ad91e3925fd 100644
--- a/sound/soc/fsl/imx-wm8960.c
+++ b/sound/soc/fsl/imx-wm8960.c
@@ -448,6 +448,8 @@ static int imx_wm8960_probe(struct platform_device *pdev)
struct imx_wm8960_data *data;
struct platform_device *asrc_pdev = NULL;
struct device_node *asrc_np;
+ struct snd_soc_dai_link_component dlc = { 0 };
+ struct snd_soc_dai *codec_dai;
u32 width;
int ret;
@@ -537,6 +539,12 @@ static int imx_wm8960_probe(struct platform_device *pdev)
if (data->is_codec_rpmsg) {
imx_wm8960_dai[0].codec_name = "rpmsg-audio-codec-wm8960";
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
imx_wm8960_dai[0].codec_of_node = codec_np;