All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bryan Wu <cooloney@kernel.org>
To: broonie@sirena.org.uk, tiwai@suse.de
Cc: alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org,
	Cliff Cai <cliff.cai@analog.com>, Bryan Wu <cooloney@kernel.org>
Subject: [PATCH 4/8] ASoC: Blackfin: fix bug - AD1980/1 SOC Audio driver fails to build in case MMAP support is turned off
Date: Tue, 18 Nov 2008 16:18:18 +0800	[thread overview]
Message-ID: <1226996302-10234-5-git-send-email-cooloney@kernel.org> (raw)
In-Reply-To: <1226996302-10234-1-git-send-email-cooloney@kernel.org>

From: Cliff Cai <cliff.cai@analog.com>

clean up redudent code and correct building problem in non-mmap mode

Signed-off-by: Cliff Cai <cliff.cai@analog.com>
Signed-off-by: Bryan Wu <cooloney@kernel.org>
---
 sound/soc/blackfin/bf5xx-ac97-pcm.c |   22 +++-------------------
 1 files changed, 3 insertions(+), 19 deletions(-)

diff --git a/sound/soc/blackfin/bf5xx-ac97-pcm.c b/sound/soc/blackfin/bf5xx-ac97-pcm.c
index 4be1a49..4d25f73 100644
--- a/sound/soc/blackfin/bf5xx-ac97-pcm.c
+++ b/sound/soc/blackfin/bf5xx-ac97-pcm.c
@@ -193,8 +193,10 @@ static int bf5xx_pcm_trigger(struct snd_pcm_substream *substream, int cmd)
 	switch (cmd) {
 	case SNDRV_PCM_TRIGGER_START:
 		if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
+#if defined(CONFIG_SND_BF5XX_MMAP_SUPPORT)
 			bf5xx_mmap_copy(substream, runtime->period_size);
 			sport->tx_delay_pos = 0;
+#endif
 			sport_tx_start(sport);
 		} else
 			sport_rx_start(sport);
@@ -267,23 +269,6 @@ static int bf5xx_pcm_open(struct snd_pcm_substream *substream)
 	return ret;
 }
 
-static int bf5xx_pcm_close(struct snd_pcm_substream *substream)
-{
-	struct snd_pcm_runtime *runtime = substream->runtime;
-	struct sport_device *sport = runtime->private_data;
-
-	pr_debug("%s enter\n", __func__);
-	if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
-		sport->once = 0;
-		memset(sport->tx_dma_buf, 0, runtime->buffer_size *
-			sizeof(struct ac97_frame));
-	} else
-		memset(sport->rx_dma_buf, 0, runtime->buffer_size *
-			sizeof(struct ac97_frame));
-
-	return 0;
-}
-
 #if defined(CONFIG_SND_BF5XX_MMAP_SUPPORT)
 static int bf5xx_pcm_mmap(struct snd_pcm_substream *substream,
 	struct vm_area_struct *vma)
@@ -301,7 +286,7 @@ static	int bf5xx_pcm_copy(struct snd_pcm_substream *substream, int channel,
 		    void __user *buf, snd_pcm_uframes_t count)
 {
 	struct snd_pcm_runtime *runtime = substream->runtime;
-
+	unsigned int chan_mask = ac97_chan_mask[runtime->channels - 1];
 	pr_debug("%s copy pos:0x%lx count:0x%lx\n",
 			substream->stream ? "Capture" : "Playback", pos, count);
 
@@ -317,7 +302,6 @@ static	int bf5xx_pcm_copy(struct snd_pcm_substream *substream, int channel,
 
 struct snd_pcm_ops bf5xx_pcm_ac97_ops = {
 	.open		= bf5xx_pcm_open,
-	.close		= bf5xx_pcm_close,
 	.ioctl		= snd_pcm_lib_ioctl,
 	.hw_params	= bf5xx_pcm_hw_params,
 	.hw_free	= bf5xx_pcm_hw_free,
-- 
1.5.6.3

WARNING: multiple messages have this Message-ID (diff)
From: Bryan Wu <cooloney@kernel.org>
To: broonie@sirena.org.uk, tiwai@suse.de
Cc: Cliff Cai <cliff.cai@analog.com>,
	alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org,
	Bryan Wu <cooloney@kernel.org>
Subject: [PATCH 4/8] ASoC: Blackfin: fix bug - AD1980/1 SOC Audio driver fails to build in case MMAP support is turned off
Date: Tue, 18 Nov 2008 16:18:18 +0800	[thread overview]
Message-ID: <1226996302-10234-5-git-send-email-cooloney@kernel.org> (raw)
In-Reply-To: <1226996302-10234-1-git-send-email-cooloney@kernel.org>

From: Cliff Cai <cliff.cai@analog.com>

clean up redudent code and correct building problem in non-mmap mode

Signed-off-by: Cliff Cai <cliff.cai@analog.com>
Signed-off-by: Bryan Wu <cooloney@kernel.org>
---
 sound/soc/blackfin/bf5xx-ac97-pcm.c |   22 +++-------------------
 1 files changed, 3 insertions(+), 19 deletions(-)

diff --git a/sound/soc/blackfin/bf5xx-ac97-pcm.c b/sound/soc/blackfin/bf5xx-ac97-pcm.c
index 4be1a49..4d25f73 100644
--- a/sound/soc/blackfin/bf5xx-ac97-pcm.c
+++ b/sound/soc/blackfin/bf5xx-ac97-pcm.c
@@ -193,8 +193,10 @@ static int bf5xx_pcm_trigger(struct snd_pcm_substream *substream, int cmd)
 	switch (cmd) {
 	case SNDRV_PCM_TRIGGER_START:
 		if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
+#if defined(CONFIG_SND_BF5XX_MMAP_SUPPORT)
 			bf5xx_mmap_copy(substream, runtime->period_size);
 			sport->tx_delay_pos = 0;
+#endif
 			sport_tx_start(sport);
 		} else
 			sport_rx_start(sport);
@@ -267,23 +269,6 @@ static int bf5xx_pcm_open(struct snd_pcm_substream *substream)
 	return ret;
 }
 
-static int bf5xx_pcm_close(struct snd_pcm_substream *substream)
-{
-	struct snd_pcm_runtime *runtime = substream->runtime;
-	struct sport_device *sport = runtime->private_data;
-
-	pr_debug("%s enter\n", __func__);
-	if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
-		sport->once = 0;
-		memset(sport->tx_dma_buf, 0, runtime->buffer_size *
-			sizeof(struct ac97_frame));
-	} else
-		memset(sport->rx_dma_buf, 0, runtime->buffer_size *
-			sizeof(struct ac97_frame));
-
-	return 0;
-}
-
 #if defined(CONFIG_SND_BF5XX_MMAP_SUPPORT)
 static int bf5xx_pcm_mmap(struct snd_pcm_substream *substream,
 	struct vm_area_struct *vma)
@@ -301,7 +286,7 @@ static	int bf5xx_pcm_copy(struct snd_pcm_substream *substream, int channel,
 		    void __user *buf, snd_pcm_uframes_t count)
 {
 	struct snd_pcm_runtime *runtime = substream->runtime;
-
+	unsigned int chan_mask = ac97_chan_mask[runtime->channels - 1];
 	pr_debug("%s copy pos:0x%lx count:0x%lx\n",
 			substream->stream ? "Capture" : "Playback", pos, count);
 
@@ -317,7 +302,6 @@ static	int bf5xx_pcm_copy(struct snd_pcm_substream *substream, int channel,
 
 struct snd_pcm_ops bf5xx_pcm_ac97_ops = {
 	.open		= bf5xx_pcm_open,
-	.close		= bf5xx_pcm_close,
 	.ioctl		= snd_pcm_lib_ioctl,
 	.hw_params	= bf5xx_pcm_hw_params,
 	.hw_free	= bf5xx_pcm_hw_free,
-- 
1.5.6.3

  parent reply	other threads:[~2008-11-18  8:18 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-18  8:18 Bryan Wu
2008-11-18  8:18 ` [PATCH 1/8] ASoC: Blackfin: updates Kconfig for SPORT Bryan Wu
2008-11-18  8:18 ` [PATCH 2/8] ASoC: AD1980 codec: add multi-channel function support Bryan Wu
2008-11-18  8:18   ` Bryan Wu
2008-11-18  8:18 ` [PATCH 3/8] ASoC: Blackfin: " Bryan Wu
2008-11-18  8:18   ` Bryan Wu
2008-11-18  8:18 ` Bryan Wu [this message]
2008-11-18  8:18   ` [PATCH 4/8] ASoC: Blackfin: fix bug - AD1980/1 SOC Audio driver fails to build in case MMAP support is turned off Bryan Wu
2008-11-18 11:53   ` [alsa-devel] " Mark Brown
2008-11-18 11:53     ` Mark Brown
2008-11-18  8:18 ` [PATCH 5/8] ASoC: Fix BUGS in Blackfin AC97 DAI Bryan Wu
2008-11-18  8:18   ` Bryan Wu
2008-11-18 11:54   ` [alsa-devel] " Mark Brown
2008-11-18 11:54     ` Mark Brown
2008-11-18 11:58     ` [alsa-devel] " Hennerich, Michael
2008-11-18 11:58       ` Hennerich, Michael
2008-11-18  8:18 ` [PATCH 6/8] ASoC: Blackfin: do not force TWI bus for ssm2602 codec Bryan Wu
2008-11-18  8:18   ` Bryan Wu
2008-11-18  8:18 ` [PATCH 7/8] ASoC: Blackfin: Simplify the MMAP_SUPPORT macros protected code Bryan Wu
2008-11-18  8:18   ` Bryan Wu
2008-11-18  8:18 ` [PATCH 8/8] ASoC: Blackfin: always set a default value for that GPIO range Bryan Wu
2008-11-18  8:18   ` Bryan Wu
2008-11-18 11:45 ` [alsa-devel] (no subject) Mark Brown
2008-11-18 11:45   ` 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=1226996302-10234-5-git-send-email-cooloney@kernel.org \
    --to=cooloney@kernel.org \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@sirena.org.uk \
    --cc=cliff.cai@analog.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tiwai@suse.de \
    /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.