All of lore.kernel.org
 help / color / mirror / Atom feed
From: Philipp Zabel <philipp.zabel@gmail.com>
To: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: alsa-devel@alsa-project.org, Philipp Zabel <philipp.zabel@gmail.com>
Subject: [PATCH 2/4] ASoC: UDA1380: DATAI is slave only
Date: Tue,  3 Mar 2009 16:10:52 +0100	[thread overview]
Message-ID: <1236093054-1952-2-git-send-email-philipp.zabel@gmail.com> (raw)
In-Reply-To: <1236093054-1952-1-git-send-email-philipp.zabel@gmail.com>

Only allow SND_SOC_DAIFMT_CBS_CFS for the playback DAI.

Signed-off-by: Philipp Zabel <philipp.zabel@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

  reply	other threads:[~2009-03-03 15:11 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-03 15:10 [PATCH 1/4] ASoC: Use network mode with 2 slots for 16-bit stereo in pxa-ssp/Zylonite Philipp Zabel
2009-03-03 15:10 ` Philipp Zabel [this message]
2009-03-03 15:50   ` [PATCH 2/4] ASoC: UDA1380: DATAI is slave only Mark Brown
2009-03-03 15:56     ` pHilipp Zabel
2009-03-03 15:58       ` Mark Brown
2009-03-03 15:10 ` [PATCH 3/4] ASoC: Remove version display from the UDA1380 driver Philipp Zabel
2009-03-03 15:52   ` Mark Brown
2009-03-03 15:10 ` [PATCH 4/4] ASoC: UDA1380: change decimator/interpolator register handling Philipp Zabel
2009-03-03 15:48 ` [PATCH 1/4] ASoC: Use network mode with 2 slots for 16-bit stereo in pxa-ssp/Zylonite Mark Brown
2009-03-04  1:34 ` Daniel Mack
2009-03-04 14:29   ` Mark Brown
2009-03-04 20:45   ` pHilipp Zabel
2009-03-05 16:06     ` pHilipp Zabel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1236093054-1952-2-git-send-email-philipp.zabel@gmail.com \
    --to=philipp.zabel@gmail.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@opensource.wolfsonmicro.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.