[alsa-devel] [PATCH 2/4] ASoC: UDA1380: DATAI is slave only
Philipp Zabel
philipp.zabel at gmail.com
Tue Mar 3 16:10:52 CET 2009
Only allow SND_SOC_DAIFMT_CBS_CFS for the playback DAI.
Signed-off-by: Philipp Zabel <philipp.zabel at gmail.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 5242b81..1e3769d 100644
--- a/sound/soc/codecs/uda1380.c
+++ b/sound/soc/codecs/uda1380.c
@@ -377,8 +377,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);
@@ -406,6 +407,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;
--
1.6.1.3
More information about the Alsa-devel
mailing list