All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lars-Peter Clausen <lars-Qo5EllUWu/uELgA04lAiVw@public.gmane.org>
To: Mark Brown <broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	Liam Girdwood <lgirdwood-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	Scott Jiang
	<scott.jiang.linux-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	Steven Miao <realmz6-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: uclinux-dist-devel-ZG0+EudsQA8dtHy/vicBwGD2FQJk+8+b@public.gmane.org,
	alsa-devel-K7yf7f+aM1XWsZ/bQMPhNw@public.gmane.org
Subject: [PATCH 03/10] ASoC: blackfin: bf5xx-sport: Allow setting rx and tx mask independently
Date: Tue, 28 May 2013 19:22:11 +0200	[thread overview]
Message-ID: <1369761738-29503-3-git-send-email-lars@metafoo.de> (raw)
In-Reply-To: <1369761738-29503-1-git-send-email-lars-Qo5EllUWu/uELgA04lAiVw@public.gmane.org>

Since the hardware supports it there is no need to artificially limit this to
just being able to set the same mask for both tx and rx.

Signed-off-by: Lars-Peter Clausen <lars-Qo5EllUWu/uELgA04lAiVw@public.gmane.org>
---
 sound/soc/blackfin/bf5xx-ac97.c  |  8 ++++----
 sound/soc/blackfin/bf5xx-sport.c | 10 +++++-----
 sound/soc/blackfin/bf5xx-sport.h |  2 +-
 sound/soc/blackfin/bf5xx-tdm.c   |  4 ++--
 4 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/sound/soc/blackfin/bf5xx-ac97.c b/sound/soc/blackfin/bf5xx-ac97.c
index 4902173..c66bef8 100644
--- a/sound/soc/blackfin/bf5xx-ac97.c
+++ b/sound/soc/blackfin/bf5xx-ac97.c
@@ -231,9 +231,9 @@ static int bf5xx_ac97_resume(struct snd_soc_dai *dai)
 		return 0;
 
 #if defined(CONFIG_SND_BF5XX_MULTICHAN_SUPPORT)
-	ret = sport_set_multichannel(sport, 16, 0x3FF, 1);
+	ret = sport_set_multichannel(sport, 16, 0x3FF, 0x3FF, 1);
 #else
-	ret = sport_set_multichannel(sport, 16, 0x1F, 1);
+	ret = sport_set_multichannel(sport, 16, 0x1F, 0x1F, 1);
 #endif
 	if (ret) {
 		pr_err("SPORT is busy!\n");
@@ -311,9 +311,9 @@ static int asoc_bfin_ac97_probe(struct platform_device *pdev)
 
 	/*SPORT works in TDM mode to simulate AC97 transfers*/
 #if defined(CONFIG_SND_BF5XX_MULTICHAN_SUPPORT)
-	ret = sport_set_multichannel(sport_handle, 16, 0x3FF, 1);
+	ret = sport_set_multichannel(sport_handle, 16, 0x3FF, 0x3FF, 1);
 #else
-	ret = sport_set_multichannel(sport_handle, 16, 0x1F, 1);
+	ret = sport_set_multichannel(sport_handle, 16, 0x1F, 0x1F, 1);
 #endif
 	if (ret) {
 		pr_err("SPORT is busy!\n");
diff --git a/sound/soc/blackfin/bf5xx-sport.c b/sound/soc/blackfin/bf5xx-sport.c
index 2fd9f2a..6953512 100644
--- a/sound/soc/blackfin/bf5xx-sport.c
+++ b/sound/soc/blackfin/bf5xx-sport.c
@@ -46,10 +46,10 @@
 /* note: multichannel is in units of 8 channels,
  * tdm_count is # channels NOT / 8 ! */
 int sport_set_multichannel(struct sport_device *sport,
-		int tdm_count, u32 mask, int packed)
+		int tdm_count, u32 tx_mask, u32 rx_mask, int packed)
 {
-	pr_debug("%s tdm_count=%d mask:0x%08x packed=%d\n", __func__,
-			tdm_count, mask, packed);
+	pr_debug("%s tdm_count=%d tx_mask:0x%08x rx_mask:0x%08x packed=%d\n",
+			__func__, tdm_count, tx_mask, rx_mask, packed);
 
 	if ((sport->regs->tcr1 & TSPEN) || (sport->regs->rcr1 & RSPEN))
 		return -EBUSY;
@@ -65,8 +65,8 @@ int sport_set_multichannel(struct sport_device *sport,
 		sport->regs->mcmc2 = FRAME_DELAY | MCMEN | \
 				(packed ? (MCDTXPE|MCDRXPE) : 0);
 
-		sport->regs->mtcs0 = mask;
-		sport->regs->mrcs0 = mask;
+		sport->regs->mtcs0 = tx_mask;
+		sport->regs->mrcs0 = rx_mask;
 		sport->regs->mtcs1 = 0;
 		sport->regs->mrcs1 = 0;
 		sport->regs->mtcs2 = 0;
diff --git a/sound/soc/blackfin/bf5xx-sport.h b/sound/soc/blackfin/bf5xx-sport.h
index 5ab60bd..9fc2192 100644
--- a/sound/soc/blackfin/bf5xx-sport.h
+++ b/sound/soc/blackfin/bf5xx-sport.h
@@ -128,7 +128,7 @@ void sport_done(struct sport_device *sport);
 /* note: multichannel is in units of 8 channels, tdm_count is number of channels
  *  NOT / 8 ! all channels are enabled by default */
 int sport_set_multichannel(struct sport_device *sport, int tdm_count,
-		u32 mask, int packed);
+		u32 tx_mask, u32 rx_mask, int packed);
 
 int sport_config_rx(struct sport_device *sport,
 		unsigned int rcr1, unsigned int rcr2,
diff --git a/sound/soc/blackfin/bf5xx-tdm.c b/sound/soc/blackfin/bf5xx-tdm.c
index 69e9a3e..aa08516 100644
--- a/sound/soc/blackfin/bf5xx-tdm.c
+++ b/sound/soc/blackfin/bf5xx-tdm.c
@@ -198,7 +198,7 @@ static int bf5xx_tdm_resume(struct snd_soc_dai *dai)
 	int ret;
 	struct sport_device *sport = snd_soc_dai_get_drvdata(dai);
 
-	ret = sport_set_multichannel(sport, 8, 0xFF, 1);
+	ret = sport_set_multichannel(sport, 8, 0xFF, 0xFF, 1);
 	if (ret) {
 		pr_err("SPORT is busy!\n");
 		ret = -EBUSY;
@@ -265,7 +265,7 @@ static int bfin_tdm_probe(struct platform_device *pdev)
 		return -ENODEV;
 
 	/* SPORT works in TDM mode */
-	ret = sport_set_multichannel(sport_handle, 8, 0xFF, 1);
+	ret = sport_set_multichannel(sport_handle, 8, 0xFF, 0xFF, 1);
 	if (ret) {
 		pr_err("SPORT is busy!\n");
 		ret = -EBUSY;
-- 
1.8.0

  parent reply	other threads:[~2013-05-28 17:22 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-28 17:22 [PATCH 01/10] ASoC: blackfin: Remove unused bf5xx-{i2s, tdm, ac97}-pcm.h Lars-Peter Clausen
     [not found] ` <1369761738-29503-1-git-send-email-lars-Qo5EllUWu/uELgA04lAiVw@public.gmane.org>
2013-05-28 17:22   ` [PATCH 02/10] ASoC: blackfin: bf5xx-i2s: Use dev_{err, dbg} instead of pr_{error, debug} Lars-Peter Clausen
2013-05-28 17:22   ` Lars-Peter Clausen [this message]
2013-05-28 17:22   ` [PATCH 04/10] ASoC: blackfin: bf5xx-i2s: Allocate buffer only as large as requested Lars-Peter Clausen
2013-05-28 17:22   ` [PATCH 05/10] ASoC: blackfin: bf5xx-i2s-pcm: Use snd_pcm_lib_preallocate_pages_for_all() Lars-Peter Clausen
2013-05-28 17:22   ` [PATCH 06/10] ASoC: blackfin: bf5xx-i2s: Add support for TDM mode Lars-Peter Clausen
2013-05-28 17:22   ` [PATCH 07/10] ASoC: blackfin: Switch bf5xx-ad193x from bf5xx-tdm to bf5xx-i2s Lars-Peter Clausen
2013-05-28 17:22   ` [PATCH 08/10] ASoC: blackfin: Switch bf5xx-ad1836 " Lars-Peter Clausen
2013-05-28 17:22   ` [PATCH 09/10] ASoC: blackfin: Remove bf5xx-tdm driver Lars-Peter Clausen
2013-05-28 17:22   ` [PATCH 10/10] blackfin: Remove references to the bf5x_tdm driver Lars-Peter Clausen
2013-05-29 19:27 ` [PATCH 01/10] ASoC: blackfin: Remove unused bf5xx-{i2s, tdm, ac97}-pcm.h Mark Brown
2013-05-30  7:47   ` Lars-Peter Clausen
2013-05-30 10:47     ` Mark Brown
2013-05-30 11:06       ` Lars-Peter Clausen
2013-05-30 11:34         ` Mark Brown

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=1369761738-29503-3-git-send-email-lars@metafoo.de \
    --to=lars-qo5elluwu/uelga04laivw@public.gmane.org \
    --cc=alsa-devel-K7yf7f+aM1XWsZ/bQMPhNw@public.gmane.org \
    --cc=broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=lgirdwood-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=realmz6-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=scott.jiang.linux-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=uclinux-dist-devel-ZG0+EudsQA8dtHy/vicBwGD2FQJk+8+b@public.gmane.org \
    /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.