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: ssi: Check runtime channel number rather than hw_params" to the asoc tree
Date: Mon,  3 Sep 2018 14:45:45 +0100 (BST)	[thread overview]
Message-ID: <20180903134545.354BF11227AE@debutante.sirena.org.uk> (raw)
In-Reply-To: <8736urf4ks.wl-kuninori.morimoto.gx@renesas.com>

The patch

   ASoC: rsnd: ssi: Check runtime channel number rather than hw_params

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 599da084e041b877ef89211dcbb4c7bd8380049d Mon Sep 17 00:00:00 2001
From: Jiada Wang <jiada_wang@mentor.com>
Date: Mon, 3 Sep 2018 07:07:26 +0000
Subject: [PATCH] ASoC: rsnd: ssi: Check runtime channel number rather than
 hw_params

The number of channel handled by SSI maybe differs from the one set
in hw_params, currently SSI checks hw_params's channel number,
and constrains to use same channel number, when it is being
used by multiple clients.

This patch corrects to check runtime channel number rather
than channel number set in hw_params.

Signed-off-by: Jiada Wang <jiada_wang@mentor.com>
Signed-off-by: Timo Wischer <twischer@de.adit-jv.com>
[kuninori: adjust to upstreaming]
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/ssi.c | 27 +++++++--------------------
 1 file changed, 7 insertions(+), 20 deletions(-)

diff --git a/sound/soc/sh/rcar/ssi.c b/sound/soc/sh/rcar/ssi.c
index 89cc433e2fc9..3f6dd9f07bc6 100644
--- a/sound/soc/sh/rcar/ssi.c
+++ b/sound/soc/sh/rcar/ssi.c
@@ -307,6 +307,11 @@ static int rsnd_ssi_master_clk_start(struct rsnd_mod *mod,
 			return -EINVAL;
 		}
 
+		if (ssi->chan != chan) {
+			dev_err(dev, "SSI parent/child should use same chan\n");
+			return -EINVAL;
+		}
+
 		return 0;
 	}
 
@@ -334,6 +339,7 @@ static int rsnd_ssi_master_clk_start(struct rsnd_mod *mod,
 			SCKD | SWSD | CKDV(idx);
 	ssi->wsr = CONT;
 	ssi->rate = rate;
+	ssi->chan = chan;
 
 	dev_dbg(dev, "%s[%d] outputs %u Hz\n",
 		rsnd_mod_name(mod),
@@ -359,6 +365,7 @@ static void rsnd_ssi_master_clk_stop(struct rsnd_mod *mod,
 
 	ssi->cr_clk	= 0;
 	ssi->rate	= 0;
+	ssi->chan	= 0;
 
 	rsnd_adg_ssi_clk_stop(mod);
 }
@@ -511,9 +518,7 @@ static int rsnd_ssi_hw_params(struct rsnd_mod *mod,
 			      struct snd_pcm_substream *substream,
 			      struct snd_pcm_hw_params *params)
 {
-	struct rsnd_ssi *ssi = rsnd_mod_to_ssi(mod);
 	struct rsnd_dai *rdai = rsnd_io_to_rdai(io);
-	int chan = params_channels(params);
 	unsigned int fmt_width = snd_pcm_format_width(params_format(params));
 
 	if (fmt_width > rdai->chan_width) {
@@ -524,24 +529,6 @@ static int rsnd_ssi_hw_params(struct rsnd_mod *mod,
 		return -EINVAL;
 	}
 
-	/*
-	 * snd_pcm_ops::hw_params will be called *before*
-	 * snd_soc_dai_ops::trigger. Thus, ssi->usrcnt is 0
-	 * in 1st call.
-	 */
-	if (ssi->usrcnt) {
-		/*
-		 * Already working.
-		 * It will happen if SSI has parent/child connection.
-		 * it is error if child <-> parent SSI uses
-		 * different channels.
-		 */
-		if (ssi->chan != chan)
-			return -EIO;
-	}
-
-	ssi->chan = chan;
-
 	return 0;
 }
 
-- 
2.19.0.rc1

  reply	other threads:[~2018-09-03 13:45 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   ` Applied "ASoC: rsnd: remove is_play parameter from hw_rule function" to the asoc tree Mark Brown
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   ` Mark Brown [this message]
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=20180903134545.354BF11227AE@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.