diff mbox series

Applied "ASoC: omap-mcbsp: Simplify the mcbsp_start/_stop function parameters" to the asoc tree

Message ID 20181113183327.14874440078@finisterre.ee.mobilebroadband
State Accepted
Commit 59d177f65f50df07f5f0b461c968d2fab7597af1
Headers show
Series Applied "ASoC: omap-mcbsp: Simplify the mcbsp_start/_stop function parameters" to the asoc tree | expand

Commit Message

Mark Brown Nov. 13, 2018, 6:33 p.m. UTC
The patch

   ASoC: omap-mcbsp: Simplify the mcbsp_start/_stop function parameters

has been applied to the asoc tree at

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git 

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

From 59d177f65f50df07f5f0b461c968d2fab7597af1 Mon Sep 17 00:00:00 2001
From: Peter Ujfalusi <peter.ujfalusi@ti.com>

Date: Thu, 8 Nov 2018 09:29:56 +0200
Subject: [PATCH] ASoC: omap-mcbsp: Simplify the mcbsp_start/_stop function
 parameters

We either start/stop TX or RX, never both. Move the tx/rx direction
selection within the functions.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>

Acked-by: Jarkko Nikula <jarkko.nikula@bitmer.com>

Tested-by: Jarkko Nikula <jarkko.nikula@bitmer.com>

Signed-off-by: Mark Brown <broonie@kernel.org>

---
 sound/soc/omap/mcbsp.c      | 8 ++++++--
 sound/soc/omap/mcbsp.h      | 4 ++--
 sound/soc/omap/omap-mcbsp.c | 9 ++++-----
 3 files changed, 12 insertions(+), 9 deletions(-)

-- 
2.19.1

_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
diff mbox series

Patch

diff --git a/sound/soc/omap/mcbsp.c b/sound/soc/omap/mcbsp.c
index fca0b0e9186b..7ff22561f00f 100644
--- a/sound/soc/omap/mcbsp.c
+++ b/sound/soc/omap/mcbsp.c
@@ -637,8 +637,10 @@  void omap_mcbsp_free(struct omap_mcbsp *mcbsp)
  * If no transmitter or receiver is active prior calling, then sample-rate
  * generator and frame sync are started.
  */
-void omap_mcbsp_start(struct omap_mcbsp *mcbsp, int tx, int rx)
+void omap_mcbsp_start(struct omap_mcbsp *mcbsp, int stream)
 {
+	int tx = (stream == SNDRV_PCM_STREAM_PLAYBACK);
+	int rx = !tx;
 	int enable_srg = 0;
 	u16 w;
 
@@ -694,8 +696,10 @@  void omap_mcbsp_start(struct omap_mcbsp *mcbsp, int tx, int rx)
 	omap_mcbsp_dump_reg(mcbsp);
 }
 
-void omap_mcbsp_stop(struct omap_mcbsp *mcbsp, int tx, int rx)
+void omap_mcbsp_stop(struct omap_mcbsp *mcbsp, int stream)
 {
+	int tx = (stream == SNDRV_PCM_STREAM_PLAYBACK);
+	int rx = !tx;
 	int idle;
 	u16 w;
 
diff --git a/sound/soc/omap/mcbsp.h b/sound/soc/omap/mcbsp.h
index 46ae1269a698..92472c6ef358 100644
--- a/sound/soc/omap/mcbsp.h
+++ b/sound/soc/omap/mcbsp.h
@@ -339,8 +339,8 @@  u16 omap_mcbsp_get_rx_delay(struct omap_mcbsp *mcbsp);
 int omap_mcbsp_get_dma_op_mode(struct omap_mcbsp *mcbsp);
 int omap_mcbsp_request(struct omap_mcbsp *mcbsp);
 void omap_mcbsp_free(struct omap_mcbsp *mcbsp);
-void omap_mcbsp_start(struct omap_mcbsp *mcbsp, int tx, int rx);
-void omap_mcbsp_stop(struct omap_mcbsp *mcbsp, int tx, int rx);
+void omap_mcbsp_start(struct omap_mcbsp *mcbsp, int stream);
+void omap_mcbsp_stop(struct omap_mcbsp *mcbsp, int stream);
 
 /* McBSP functional clock source changing function */
 int omap2_mcbsp_set_clks_src(struct omap_mcbsp *mcbsp, u8 fck_src_id);
diff --git a/sound/soc/omap/omap-mcbsp.c b/sound/soc/omap/omap-mcbsp.c
index caa24c463b3e..a18b7ecc3a2e 100644
--- a/sound/soc/omap/omap-mcbsp.c
+++ b/sound/soc/omap/omap-mcbsp.c
@@ -201,27 +201,26 @@  static int omap_mcbsp_dai_trigger(struct snd_pcm_substream *substream, int cmd,
 				  struct snd_soc_dai *cpu_dai)
 {
 	struct omap_mcbsp *mcbsp = snd_soc_dai_get_drvdata(cpu_dai);
-	int err = 0, play = (substream->stream == SNDRV_PCM_STREAM_PLAYBACK);
 
 	switch (cmd) {
 	case SNDRV_PCM_TRIGGER_START:
 	case SNDRV_PCM_TRIGGER_RESUME:
 	case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
 		mcbsp->active++;
-		omap_mcbsp_start(mcbsp, play, !play);
+		omap_mcbsp_start(mcbsp, substream->stream);
 		break;
 
 	case SNDRV_PCM_TRIGGER_STOP:
 	case SNDRV_PCM_TRIGGER_SUSPEND:
 	case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
-		omap_mcbsp_stop(mcbsp, play, !play);
+		omap_mcbsp_stop(mcbsp, substream->stream);
 		mcbsp->active--;
 		break;
 	default:
-		err = -EINVAL;
+		return -EINVAL;
 	}
 
-	return err;
+	return 0;
 }
 
 static snd_pcm_sframes_t omap_mcbsp_dai_delay(