aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/soc-core.c
diff options
context:
space:
mode:
authorShawn Guo <shawn.guo@linaro.org>2012-03-08 11:59:40 -0500
committerMark Brown <broonie@opensource.wolfsonmicro.com>2012-03-08 13:23:46 -0500
commit5e4ba569a5aa631852ec8240f11142392116633d (patch)
treebf78bf243ebe891374300815487bf54de21a5866 /sound/soc/soc-core.c
parent33593b52ebb0d6d37d96bd5e01a31951fc3b8ddf (diff)
ASoC: core: missing set_fmt should not be complaint
Not having a DAI link set_fmt operation is perfectly normal and should not be complaint. Signed-off-by: Shawn Guo <shawn.guo@linaro.org> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc/soc-core.c')
-rw-r--r--sound/soc/soc-core.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index c90bb0110bd2..93a0daac5088 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -1531,14 +1531,14 @@ static void snd_soc_instantiate_card(struct snd_soc_card *card)
1531 if (dai_link->dai_fmt) { 1531 if (dai_link->dai_fmt) {
1532 ret = snd_soc_dai_set_fmt(card->rtd[i].codec_dai, 1532 ret = snd_soc_dai_set_fmt(card->rtd[i].codec_dai,
1533 dai_link->dai_fmt); 1533 dai_link->dai_fmt);
1534 if (ret != 0) 1534 if (ret != 0 && ret != -ENOTSUPP)
1535 dev_warn(card->rtd[i].codec_dai->dev, 1535 dev_warn(card->rtd[i].codec_dai->dev,
1536 "Failed to set DAI format: %d\n", 1536 "Failed to set DAI format: %d\n",
1537 ret); 1537 ret);
1538 1538
1539 ret = snd_soc_dai_set_fmt(card->rtd[i].cpu_dai, 1539 ret = snd_soc_dai_set_fmt(card->rtd[i].cpu_dai,
1540 dai_link->dai_fmt); 1540 dai_link->dai_fmt);
1541 if (ret != 0) 1541 if (ret != 0 && ret != -ENOTSUPP)
1542 dev_warn(card->rtd[i].cpu_dai->dev, 1542 dev_warn(card->rtd[i].cpu_dai->dev,
1543 "Failed to set DAI format: %d\n", 1543 "Failed to set DAI format: %d\n",
1544 ret); 1544 ret);
@@ -2971,10 +2971,11 @@ EXPORT_SYMBOL_GPL(snd_soc_codec_set_pll);
2971 */ 2971 */
2972int snd_soc_dai_set_fmt(struct snd_soc_dai *dai, unsigned int fmt) 2972int snd_soc_dai_set_fmt(struct snd_soc_dai *dai, unsigned int fmt)
2973{ 2973{
2974 if (dai->driver && dai->driver->ops->set_fmt) 2974 if (dai->driver == NULL)
2975 return dai->driver->ops->set_fmt(dai, fmt);
2976 else
2977 return -EINVAL; 2975 return -EINVAL;
2976 if (dai->driver->ops->set_fmt == NULL)
2977 return -ENOTSUPP;
2978 return dai->driver->ops->set_fmt(dai, fmt);
2978} 2979}
2979EXPORT_SYMBOL_GPL(snd_soc_dai_set_fmt); 2980EXPORT_SYMBOL_GPL(snd_soc_dai_set_fmt);
2980 2981