diff options
author | Xiubo Li <Li.Xiubo@freescale.com> | 2014-01-24 15:43:00 +0800 |
---|---|---|
committer | Darren Etheridge <detheridge@ti.com> | 2014-06-20 15:16:24 -0500 |
commit | 0f41f1236cf55c035f95fd32e7aa00b58b536f50 (patch) | |
tree | 539e71f23c34c218213ce3d9be489481958474f4 /sound | |
parent | eb87e0f6bbfafa5180ff3c7b9e6f3201955f97ec (diff) |
ASoC: simple-card: fix __asoc_simple_card_dai_init
[ Upstream commit 4763ebe226156db985fe75bfe930c4069d1f4207 ]
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>
Signed-off-by: Darren Etheridge <detheridge@ti.com>
Diffstat (limited to 'sound')
-rw-r--r-- | sound/soc/generic/simple-card.c | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/sound/soc/generic/simple-card.c b/sound/soc/generic/simple-card.c index 6443c87e862..6366f3fa6a3 100644 --- a/sound/soc/generic/simple-card.c +++ b/sound/soc/generic/simple-card.c @@ -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; } |