All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mark Brown <broonie@kernel.org>
To: Jiada Wang <jiada_wang@mentor.com>
Cc: Dragos Tarcatu <dragos_tarcatu@mentor.com>,
	Timo Wischer <twischer@de.adit-jv.com>,
	alsa-devel@alsa-project.org,
	Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>,
	Mark Brown <broonie@kernel.org>,
	Hiroyuki Yokoyama <hiroyuki.yokoyama.vx@renesas.com>
Subject: Applied "ASoC: rsnd: remove is_play parameter from hw_rule function" to the asoc tree
Date: Mon,  3 Sep 2018 14:46:04 +0100 (BST)	[thread overview]
Message-ID: <20180903134604.AC4EA11227AE@debutante.sirena.org.uk> (raw)
In-Reply-To: <875zznf4lv.wl-kuninori.morimoto.gx@renesas.com>

The patch

   ASoC: rsnd: remove is_play parameter from hw_rule function

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 b735662fa473c0e3618a4d645ce797d31e0c9192 Mon Sep 17 00:00:00 2001
From: Jiada Wang <jiada_wang@mentor.com>
Date: Mon, 3 Sep 2018 07:06:50 +0000
Subject: [PATCH] ASoC: rsnd: remove is_play parameter from hw_rule function

Currently rsnd_dai_stream *io is set to either &rdai->playback or
&rdai->capture based on whether it is a playback or capture stream,
in __rsnd_soc_hw_rule_* functions, but this is not necessary,
rsnd_dai_stream *io handler can be get from rule->private.

This patch removes 'is_play' parameter from hw_rule function.

Signed-off-by: Jiada Wang <jiada_wang@mentor.com>
Signed-off-by: Timo Wischer <twischer@de.adit-jv.com>
[Kuninori: tidyup for upstream]
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Tested-by: Hiroyuki Yokoyama <hiroyuki.yokoyama.vx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 sound/soc/sh/rcar/core.c | 54 +++++++++-------------------------------
 1 file changed, 12 insertions(+), 42 deletions(-)

diff --git a/sound/soc/sh/rcar/core.c b/sound/soc/sh/rcar/core.c
index cd0ff1eef463..c66b3dade947 100644
--- a/sound/soc/sh/rcar/core.c
+++ b/sound/soc/sh/rcar/core.c
@@ -819,16 +819,14 @@ static int rsnd_soc_hw_rule(struct rsnd_dai *rdai,
 	return snd_interval_refine(iv, &p);
 }
 
-static int __rsnd_soc_hw_rule_rate(struct snd_pcm_hw_params *params,
-				   struct snd_pcm_hw_rule *rule,
-				   int is_play)
+static int rsnd_soc_hw_rule_rate(struct snd_pcm_hw_params *params,
+				 struct snd_pcm_hw_rule *rule)
 {
 	struct snd_interval *ic_ = hw_param_interval(params, SNDRV_PCM_HW_PARAM_CHANNELS);
 	struct snd_interval *ir = hw_param_interval(params, SNDRV_PCM_HW_PARAM_RATE);
 	struct snd_interval ic;
-	struct snd_soc_dai *dai = rule->private;
-	struct rsnd_dai *rdai = rsnd_dai_to_rdai(dai);
-	struct rsnd_dai_stream *io = is_play ? &rdai->playback : &rdai->capture;
+	struct rsnd_dai_stream *io = rule->private;
+	struct rsnd_dai *rdai = rsnd_io_to_rdai(io);
 
 	/*
 	 * possible sampling rate limitation is same as
@@ -844,28 +842,14 @@ static int __rsnd_soc_hw_rule_rate(struct snd_pcm_hw_params *params,
 				&ic, ir);
 }
 
-static int rsnd_soc_hw_rule_rate_playback(struct snd_pcm_hw_params *params,
-				 struct snd_pcm_hw_rule *rule)
-{
-	return __rsnd_soc_hw_rule_rate(params, rule, 1);
-}
-
-static int rsnd_soc_hw_rule_rate_capture(struct snd_pcm_hw_params *params,
-					  struct snd_pcm_hw_rule *rule)
-{
-	return __rsnd_soc_hw_rule_rate(params, rule, 0);
-}
-
-static int __rsnd_soc_hw_rule_channels(struct snd_pcm_hw_params *params,
-				       struct snd_pcm_hw_rule *rule,
-				       int is_play)
+static int rsnd_soc_hw_rule_channels(struct snd_pcm_hw_params *params,
+				     struct snd_pcm_hw_rule *rule)
 {
 	struct snd_interval *ic_ = hw_param_interval(params, SNDRV_PCM_HW_PARAM_CHANNELS);
 	struct snd_interval *ir = hw_param_interval(params, SNDRV_PCM_HW_PARAM_RATE);
 	struct snd_interval ic;
-	struct snd_soc_dai *dai = rule->private;
-	struct rsnd_dai *rdai = rsnd_dai_to_rdai(dai);
-	struct rsnd_dai_stream *io = is_play ? &rdai->playback : &rdai->capture;
+	struct rsnd_dai_stream *io = rule->private;
+	struct rsnd_dai *rdai = rsnd_io_to_rdai(io);
 
 	/*
 	 * possible sampling rate limitation is same as
@@ -881,18 +865,6 @@ static int __rsnd_soc_hw_rule_channels(struct snd_pcm_hw_params *params,
 				ir, &ic);
 }
 
-static int rsnd_soc_hw_rule_channels_playback(struct snd_pcm_hw_params *params,
-					      struct snd_pcm_hw_rule *rule)
-{
-	return __rsnd_soc_hw_rule_channels(params, rule, 1);
-}
-
-static int rsnd_soc_hw_rule_channels_capture(struct snd_pcm_hw_params *params,
-					     struct snd_pcm_hw_rule *rule)
-{
-	return __rsnd_soc_hw_rule_channels(params, rule, 0);
-}
-
 static const struct snd_pcm_hardware rsnd_pcm_hardware = {
 	.info =		SNDRV_PCM_INFO_INTERLEAVED	|
 			SNDRV_PCM_INFO_MMAP		|
@@ -949,14 +921,12 @@ static int rsnd_soc_dai_startup(struct snd_pcm_substream *substream,
 		int is_play = substream->stream == SNDRV_PCM_STREAM_PLAYBACK;
 
 		snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_RATE,
-				    is_play ? rsnd_soc_hw_rule_rate_playback :
-					      rsnd_soc_hw_rule_rate_capture,
-				    dai,
+				    rsnd_soc_hw_rule_rate,
+				    is_play ? &rdai->playback : &rdai->capture,
 				    SNDRV_PCM_HW_PARAM_CHANNELS, -1);
 		snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_CHANNELS,
-				    is_play ? rsnd_soc_hw_rule_channels_playback :
-					      rsnd_soc_hw_rule_channels_capture,
-				    dai,
+				    rsnd_soc_hw_rule_channels,
+				    is_play ? &rdai->playback : &rdai->capture,
 				    SNDRV_PCM_HW_PARAM_RATE, -1);
 	}
 
-- 
2.19.0.rc1

  reply	other threads:[~2018-09-03 13:46 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-03  7:04 [PATCH 00/13] ASoC: add full BUSIF support Kuninori Morimoto
2018-09-03  7:05 ` [PATCH 01/13] ASoC: rsnd: add warning message to rsnd_kctrl_accept_runtime() Kuninori Morimoto
2018-09-03 13:46   ` Applied "ASoC: rsnd: add warning message to rsnd_kctrl_accept_runtime()" to the asoc tree Mark Brown
2018-09-03  7:05 ` [PATCH 02/13] ASoC: rsnd: add support for 16/24 bit slot widths Kuninori Morimoto
2018-09-03 13:46   ` Applied "ASoC: rsnd: add support for 16/24 bit slot widths" to the asoc tree Mark Brown
2018-09-03  7:06 ` [PATCH 03/13] ASoC: rsnd: add support for the DSP_A/DSP_B formats Kuninori Morimoto
2018-09-03 13:46   ` Applied "ASoC: rsnd: add support for the DSP_A/DSP_B formats" to the asoc tree Mark Brown
2018-09-03  7:06 ` [PATCH 04/13] ASoC: rsnd: add support for 8 bit S8 format Kuninori Morimoto
2018-09-03 13:46   ` Applied "ASoC: rsnd: add support for 8 bit S8 format" to the asoc tree Mark Brown
2018-09-03  7:06 ` [PATCH 05/13] ASoC: rsnd: remove is_play parameter from hw_rule function Kuninori Morimoto
2018-09-03 13:46   ` Mark Brown [this message]
2018-09-03  7:07 ` [PATCH 06/13] ASoC: rsnd: ssi: Fix issue in dma data address assignment Kuninori Morimoto
2018-09-03 13:45   ` Applied "ASoC: rsnd: ssi: Fix issue in dma data address assignment" to the asoc tree Mark Brown
2018-09-03  7:07 ` [PATCH 07/13] ASoC: rsnd: ssi: Check runtime channel number rather than hw_params Kuninori Morimoto
2018-09-03 13:45   ` Applied "ASoC: rsnd: ssi: Check runtime channel number rather than hw_params" to the asoc tree Mark Brown
2018-09-03  7:07 ` [PATCH 08/13] ASoc: rsnd: dma: Calculate dma address with consider of BUSIF Kuninori Morimoto
2018-09-03 13:45   ` Applied "ASoc: rsnd: dma: Calculate dma address with consider of BUSIF" to the asoc tree Mark Brown
2018-09-03  7:08 ` [PATCH 09/13] ASoc: rsnd: dma: Calculate PDMACHCRE with consider of BUSIF Kuninori Morimoto
2018-09-03 13:45   ` Applied "ASoc: rsnd: dma: Calculate PDMACHCRE with consider of BUSIF" to the asoc tree Mark Brown
2018-09-03  7:08 ` [PATCH 10/13] ASoC: rsnd: ssiu: Support BUSIF other than BUSIF0 Kuninori Morimoto
2018-09-03 13:45   ` Applied "ASoC: rsnd: ssiu: Support BUSIF other than BUSIF0" to the asoc tree Mark Brown
2018-09-03  7:08 ` [PATCH 11/13] ASoC: rsnd: ssiu: Support to init different BUSIF instance Kuninori Morimoto
2018-09-03 13:45   ` Applied "ASoC: rsnd: ssiu: Support to init different BUSIF instance" to the asoc tree Mark Brown
2018-09-03  7:08 ` [PATCH 12/13] ASoC: rsnd: fixup not to call clk_get/set under non-atomic Kuninori Morimoto
2018-09-03 13:36   ` Mark Brown
2018-09-04  0:15     ` Kuninori Morimoto
2018-09-03 13:46   ` Applied "ASoC: rsnd: fixup not to call clk_get/set under non-atomic" to the asoc tree Mark Brown
2018-09-03 13:46     ` Mark Brown
2018-09-03  7:09 ` [PATCH 13/13] ASoC: rsnd: merge .nolock_start and .prepare Kuninori Morimoto
2018-09-03 13:44   ` Applied "ASoC: rsnd: merge .nolock_start and .prepare" to the asoc tree 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=20180903134604.AC4EA11227AE@debutante.sirena.org.uk \
    --to=broonie@kernel.org \
    --cc=alsa-devel@alsa-project.org \
    --cc=dragos_tarcatu@mentor.com \
    --cc=hiroyuki.yokoyama.vx@renesas.com \
    --cc=jiada_wang@mentor.com \
    --cc=kuninori.morimoto.gx@renesas.com \
    --cc=twischer@de.adit-jv.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.