Skip to content

Commit

Permalink
ASoC: simple-card: fix __asoc_simple_card_dai_init
Browse files Browse the repository at this point in the history
If the CPU/CODEC DAI set_sysclk() is not support, the -ENOTSUPP will returnd.
Here do the check like set_fmt().

Signed-off-by: Xiubo Li <Li.Xiubo@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
  • Loading branch information
Xiubo Li authored and Mark Brown committed Feb 3, 2014
1 parent b367a32 commit 4763ebe
Showing 1 changed file with 15 additions and 7 deletions.
22 changes: 15 additions & 7 deletions sound/soc/generic/simple-card.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,21 +27,29 @@ static int __asoc_simple_card_dai_init(struct snd_soc_dai *dai,
struct asoc_simple_dai *set,
unsigned int daifmt)
{
int ret = 0;
int ret;

daifmt |= set->fmt;

if (daifmt)
if (daifmt) {
ret = snd_soc_dai_set_fmt(dai, daifmt);

if (ret == -ENOTSUPP) {
dev_dbg(dai->dev, "ASoC: set_fmt is not supported\n");
ret = 0;
if (ret && ret != -ENOTSUPP) {
dev_err(dai->dev, "simple-card: set_fmt error\n");
goto err;
}
}

if (!ret && set->sysclk)
if (set->sysclk) {
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;
}

Expand Down

0 comments on commit 4763ebe

Please sign in to comment.