Commit 4763ebe2 authored by Xiubo Li's avatar Xiubo Li Committed by Mark Brown

ASoC: simple-card: fix __asoc_simple_card_dai_init

If the CPU/CODEC DAI set_sysclk() is not support, the -ENOTSUPP will returnd.
Here do the check like set_fmt().
Signed-off-by: default avatarXiubo Li <Li.Xiubo@freescale.com>
Signed-off-by: default avatarMark Brown <broonie@linaro.org>
parent b367a325
...@@ -27,21 +27,29 @@ static int __asoc_simple_card_dai_init(struct snd_soc_dai *dai, ...@@ -27,21 +27,29 @@ static int __asoc_simple_card_dai_init(struct snd_soc_dai *dai,
struct asoc_simple_dai *set, struct asoc_simple_dai *set,
unsigned int daifmt) unsigned int daifmt)
{ {
int ret = 0; int ret;
daifmt |= set->fmt; daifmt |= set->fmt;
if (daifmt) if (daifmt) {
ret = snd_soc_dai_set_fmt(dai, daifmt); ret = snd_soc_dai_set_fmt(dai, daifmt);
if (ret && ret != -ENOTSUPP) {
if (ret == -ENOTSUPP) { dev_err(dai->dev, "simple-card: set_fmt error\n");
dev_dbg(dai->dev, "ASoC: set_fmt is not supported\n"); goto err;
ret = 0; }
} }
if (!ret && set->sysclk) if (set->sysclk) {
ret = snd_soc_dai_set_sysclk(dai, 0, set->sysclk, 0); ret = snd_soc_dai_set_sysclk(dai, 0, set->sysclk, 0);
if (ret && ret != -ENOTSUPP) {
dev_err(dai->dev, "simple-card: set_sysclk error\n");
goto err;
}
}
ret = 0;
err:
return ret; return ret;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment