ASoC: UDA1380: DATAI is slave only

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Linux Kernel Mailing List
Date: Thursday, March 26, 2009 - 12:09 pm

Gitweb:     http://git.kernel.org/linus/5f2a9384a9291d898b4bf85c4fbf497eef582977
Commit:     5f2a9384a9291d898b4bf85c4fbf497eef582977
Parent:     aa4ef01de5f2e7ed948b88f9f1cfc93c8e0c3f25
Author:     Philipp Zabel <philipp.zabel@gmail.com>
AuthorDate: Tue Mar 3 16:10:52 2009 +0100
Committer:  Mark Brown <broonie@opensource.wolfsonmicro.com>
CommitDate: Tue Mar 3 15:58:51 2009 +0000

    ASoC: UDA1380: DATAI is slave only
    
    Only allow SND_SOC_DAIFMT_CBS_CFS for the playback DAI.
    
    Signed-off-by: Philipp Zabel <philipp.zabel@gmail.com>
    Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
---
 sound/soc/codecs/uda1380.c |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/sound/soc/codecs/uda1380.c b/sound/soc/codecs/uda1380.c
index 1c9d2a7..1b10f48 100644
--- a/sound/soc/codecs/uda1380.c
+++ b/sound/soc/codecs/uda1380.c
@@ -399,8 +399,9 @@ static int uda1380_set_dai_fmt_both(struct snd_soc_dai *codec_dai,
 		iface |= R01_SFORI_MSB | R01_SFORO_MSB;
 	}
 
-	if ((fmt & SND_SOC_DAIFMT_MASTER_MASK) == SND_SOC_DAIFMT_CBM_CFM)
-		iface |= R01_SIM;
+	/* DATAI is slave only, so in single-link mode, this has to be slave */
+	if ((fmt & SND_SOC_DAIFMT_MASTER_MASK) != SND_SOC_DAIFMT_CBS_CFS)
+		return -EINVAL;
 
 	uda1380_write(codec, UDA1380_IFACE, iface);
 
@@ -428,6 +429,10 @@ static int uda1380_set_dai_fmt_playback(struct snd_soc_dai *codec_dai,
 		iface |= R01_SFORI_MSB;
 	}
 
+	/* DATAI is slave only, so this has to be slave */
+	if ((fmt & SND_SOC_DAIFMT_MASTER_MASK) != SND_SOC_DAIFMT_CBS_CFS)
+		return -EINVAL;
+
 	uda1380_write(codec, UDA1380_IFACE, iface);
 
 	return 0;
--
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
ASoC: UDA1380: DATAI is slave only, Linux Kernel Mailing ..., (Thu Mar 26, 12:09 pm)