All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mark Brown <broonie@kernel.org>
To: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>,
	Keita Kobayashi <keita.kobayashi.ym@renesas.com>,
	Mark Brown <broonie@kernel.org>
Cc: alsa-devel@alsa-project.org
Subject: Applied "ASoC: rsnd: add rsnd_path_parse() for CTU/MIX/DVC route setting" to the asoc tree
Date: Thu, 16 Jul 2015 22:30:03 +0100	[thread overview]
Message-ID: <E1ZFqjD-0004l8-Cf@finisterre> (raw)
In-Reply-To: <87oajdvqug.wl%kuninori.morimoto.gx@renesas.com>

The patch

   ASoC: rsnd: add rsnd_path_parse() for CTU/MIX/DVC route setting

has been applied to the asoc tree at

   git://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 e2c08416196bd10a6575057fdd1347a307ce3a15 Mon Sep 17 00:00:00 2001
From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Date: Wed, 15 Jul 2015 07:13:10 +0000
Subject: [PATCH] ASoC: rsnd: add rsnd_path_parse() for CTU/MIX/DVC route
 setting

Current sound data route settings is done in dvc.c, and it doesn't care
about CTU/MIX at this poinnt, but we need to care about these.
OTOH, rsnd driver already has rsnd_path_xxx() functions for data path which
are good match for CTU/MIX/DVC path selectio.
This patch adds new rsnd_path_parse() to select sound data route which will
care about CTU/MIX/DVC path.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Tested-by: Keita Kobayashi <keita.kobayashi.ym@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 sound/soc/sh/rcar/core.c | 22 ++++++++++++++++++++++
 sound/soc/sh/rcar/dvc.c  | 40 +++++++++-------------------------------
 sound/soc/sh/rcar/rsnd.h |  2 ++
 3 files changed, 33 insertions(+), 31 deletions(-)

diff --git a/sound/soc/sh/rcar/core.c b/sound/soc/sh/rcar/core.c
index 93fed50..cb82067 100644
--- a/sound/soc/sh/rcar/core.c
+++ b/sound/soc/sh/rcar/core.c
@@ -537,6 +537,28 @@ static const struct snd_soc_dai_ops rsnd_soc_dai_ops = {
 	}							\
 }
 
+void rsnd_path_parse(struct rsnd_priv *priv,
+		     struct rsnd_dai_stream *io)
+{
+	struct rsnd_mod *src = rsnd_io_to_mod_src(io);
+	struct rsnd_mod *dvc = rsnd_io_to_mod_dvc(io);
+	int src_id = rsnd_mod_id(src);
+	u32 path[] = {
+		[0] = 0x30000,
+		[1] = 0x30001,
+		[2] = 0x40000,
+		[3] = 0x10000,
+		[4] = 0x20000,
+		[5] = 0x40100
+	};
+
+	/* Gen1 is not supported */
+	if (rsnd_is_gen1(priv))
+		return;
+
+	rsnd_mod_write(dvc, CMD_ROUTE_SLCT, path[src_id]);
+}
+
 static int rsnd_path_init(struct rsnd_priv *priv,
 			  struct rsnd_dai *rdai,
 			  struct rsnd_dai_stream *io)
diff --git a/sound/soc/sh/rcar/dvc.c b/sound/soc/sh/rcar/dvc.c
index 24d0763..9392507 100644
--- a/sound/soc/sh/rcar/dvc.c
+++ b/sound/soc/sh/rcar/dvc.c
@@ -142,48 +142,26 @@ static int rsnd_dvc_remove_gen2(struct rsnd_mod *mod,
 	return 0;
 }
 
-static int rsnd_dvc_init(struct rsnd_mod *dvc_mod,
+static int rsnd_dvc_init(struct rsnd_mod *mod,
 			 struct rsnd_dai_stream *io,
 			 struct rsnd_priv *priv)
 {
-	struct rsnd_mod *src_mod = rsnd_io_to_mod_src(io);
-	struct device *dev = rsnd_priv_to_dev(priv);
-	int dvc_id = rsnd_mod_id(dvc_mod);
-	int src_id = rsnd_mod_id(src_mod);
-	u32 route[] = {
-		[0] = 0x30000,
-		[1] = 0x30001,
-		[2] = 0x40000,
-		[3] = 0x10000,
-		[4] = 0x20000,
-		[5] = 0x40100
-	};
-
-	if (src_id >= ARRAY_SIZE(route)) {
-		dev_err(dev, "DVC%d isn't connected to SRC%d\n", dvc_id, src_id);
-		return -EINVAL;
-	}
-
-	rsnd_mod_hw_start(dvc_mod);
+	rsnd_mod_hw_start(mod);
 
-	rsnd_dvc_soft_reset(dvc_mod);
+	rsnd_dvc_soft_reset(mod);
 
-	/*
-	 * fixme
-	 * it doesn't support CTU/MIX
-	 */
-	rsnd_mod_write(dvc_mod, CMD_ROUTE_SLCT, route[src_id]);
+	rsnd_path_parse(priv, io);
 
-	rsnd_mod_write(dvc_mod, DVC_DVUIR, 1);
+	rsnd_mod_write(mod, DVC_DVUIR, 1);
 
-	rsnd_mod_write(dvc_mod, DVC_ADINR, rsnd_get_adinr(dvc_mod, io));
+	rsnd_mod_write(mod, DVC_ADINR, rsnd_get_adinr(mod, io));
 
 	/* ch0/ch1 Volume */
-	rsnd_dvc_volume_update(io, dvc_mod);
+	rsnd_dvc_volume_update(io, mod);
 
-	rsnd_mod_write(dvc_mod, DVC_DVUIR, 0);
+	rsnd_mod_write(mod, DVC_DVUIR, 0);
 
-	rsnd_adg_set_cmd_timsel_gen2(dvc_mod, io);
+	rsnd_adg_set_cmd_timsel_gen2(mod, io);
 
 	return 0;
 }
diff --git a/sound/soc/sh/rcar/rsnd.h b/sound/soc/sh/rcar/rsnd.h
index c8d2029..6a87757 100644
--- a/sound/soc/sh/rcar/rsnd.h
+++ b/sound/soc/sh/rcar/rsnd.h
@@ -170,6 +170,8 @@ void rsnd_force_write(struct rsnd_priv *priv, struct rsnd_mod *mod,
 void rsnd_bset(struct rsnd_priv *priv, struct rsnd_mod *mod, enum rsnd_reg reg,
 		    u32 mask, u32 data);
 u32 rsnd_get_adinr(struct rsnd_mod *mod, struct rsnd_dai_stream *io);
+void rsnd_path_parse(struct rsnd_priv *priv,
+		     struct rsnd_dai_stream *io);
 
 /*
  *	R-Car DMA
-- 
2.1.4

  reply	other threads:[~2015-07-16 21:30 UTC|newest]

Thread overview: 68+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-15  7:06 [PATCH 0/35] ASoC: rsnd: add CTU/MIX prototype support Kuninori Morimoto
2015-07-15  7:07 ` [PATCH 01/35] ASoC: core: add snd_soc_of_parse_audio_prefix() Kuninori Morimoto
2015-07-16 21:01   ` Applied "ASoC: core: add snd_soc_of_parse_audio_prefix()" to the asoc tree Mark Brown
2015-07-15  7:08 ` [PATCH 02/35] ASoC: rsrc-card: use snd_soc_of_parse_audio_route/prefix for routing Kuninori Morimoto
2015-07-16 21:11   ` Applied "ASoC: rsrc-card: use snd_soc_of_parse_audio_route/prefix for routing" to the asoc tree Mark Brown
2015-07-15  7:08 ` [PATCH 03/35] ASoC: rsnd: remove unnecessary 'out of memory' message from SSI Kuninori Morimoto
2015-07-16 21:11   ` Applied "ASoC: rsnd: remove unnecessary 'out of memory' message from SSI" to the asoc tree Mark Brown
2015-07-15  7:08 ` [PATCH 04/35] ASoC: rsnd: remove unnecessary 'out of memory' message from SRC Kuninori Morimoto
2015-07-16 21:11   ` Applied "ASoC: rsnd: remove unnecessary 'out of memory' message from SRC" to the asoc tree Mark Brown
2015-07-15  7:09 ` [PATCH 05/35] ASoC: rsnd: remove unnecessary 'out of memory' message from DVC Kuninori Morimoto
2015-07-16 21:11   ` Applied "ASoC: rsnd: remove unnecessary 'out of memory' message from DVC" to the asoc tree Mark Brown
2015-07-15  7:09 ` [PATCH 06/35] ASoC: rsnd: rename BUSIF_DALIGN to SSI_BUSIF_DALIGN Kuninori Morimoto
2015-07-16 21:11   ` Applied "ASoC: rsnd: rename BUSIF_DALIGN to SSI_BUSIF_DALIGN" to the asoc tree Mark Brown
2015-07-15  7:09 ` [PATCH 07/35] ASoC: rsnd: rename INT_ENABLE to SSI_INT_ENABLE Kuninori Morimoto
2015-07-16 21:11   ` Applied "ASoC: rsnd: rename INT_ENABLE to SSI_INT_ENABLE" to the asoc tree Mark Brown
2015-07-15  7:10 ` [PATCH 08/35] ASoC: rsnd: fixup each module counter on __rsnd_mod_call() Kuninori Morimoto
2015-07-16 21:11   ` Applied "ASoC: rsnd: fixup each module counter on __rsnd_mod_call()" to the asoc tree Mark Brown
2015-07-15  7:10 ` [PATCH 09/35] ASoC: rsnd: add workaround for SRC sync convert + DVC Kuninori Morimoto
2015-07-16 21:11   ` Applied "ASoC: rsnd: add workaround for SRC sync convert + DVC" to the asoc tree Mark Brown
2015-07-15  7:10 ` [PATCH 10/35] ASoC: rsnd: rsnd_mod_id() return -1 if mod was NULL Kuninori Morimoto
2015-07-16 21:11   ` Applied "ASoC: rsnd: rsnd_mod_id() return -1 if mod was NULL" to the asoc tree Mark Brown
2015-07-15  7:11 ` [PATCH 11/35] ASoC: rsnd: move DVC specific macro into dvc.c Kuninori Morimoto
2015-07-16 21:11   ` Applied "ASoC: rsnd: move DVC specific macro into dvc.c" to the asoc tree Mark Brown
2015-07-15  7:11 ` [PATCH 12/35] ASoC: rsnd: move SRC specific macro into src.c Kuninori Morimoto
2015-07-16 21:11   ` Applied "ASoC: rsnd: move SRC specific macro into src.c" to the asoc tree Mark Brown
2015-07-15  7:12 ` [PATCH 13/35] ASoC: rsnd: dvc: make sure DVC soft reset Kuninori Morimoto
2015-07-16 21:30   ` Applied "ASoC: rsnd: dvc: make sure DVC soft reset" to the asoc tree Mark Brown
2015-07-15  7:12 ` [PATCH 14/35] ASoC: rsnd: src: make sure SRC soft reset Kuninori Morimoto
2015-07-16 21:30   ` Applied "ASoC: rsnd: src: make sure SRC soft reset" to the asoc tree Mark Brown
2015-07-15  7:12 ` [PATCH 15/35] ASoC: rsnd: enable module multi connection Kuninori Morimoto
2015-07-16 21:30   ` Applied "ASoC: rsnd: enable module multi connection" to the asoc tree Mark Brown
2015-07-15  7:12 ` [PATCH 16/35] ASoC: rsnd: rename rsnd_path_parse/break() into add/remove Kuninori Morimoto
2015-07-16 21:30   ` Applied "ASoC: rsnd: rename rsnd_path_parse/break() into add/remove" to the asoc tree Mark Brown
2015-07-15  7:13 ` [PATCH 17/35] ASoC: rsnd: add rsnd_path_parse() for CTU/MIX/DVC route setting Kuninori Morimoto
2015-07-16 21:30   ` Mark Brown [this message]
2015-07-15  7:13 ` [PATCH 18/35] ASoC: rsnd: add rsnd_dvc_initialize_lock/unlock() Kuninori Morimoto
2015-07-16 21:30   ` Applied "ASoC: rsnd: add rsnd_dvc_initialize_lock/unlock()" to the asoc tree Mark Brown
2015-07-15  7:13 ` [PATCH 19/35] ASoC: rsnd: add rsnd_src_initialize_lock/unlock() Kuninori Morimoto
2015-07-16 21:30   ` Applied "ASoC: rsnd: add rsnd_src_initialize_lock/unlock()" to the asoc tree Mark Brown
2015-07-15  7:14 ` [PATCH 20/35] ASoC: rsnd: tidyup ADINR function name Kuninori Morimoto
2015-07-16 21:29   ` Applied "ASoC: rsnd: tidyup ADINR function name" to the asoc tree Mark Brown
2015-07-15  7:14 ` [PATCH 21/35] ASoC: rsnd: add rsnd_get_adinr_chan() Kuninori Morimoto
2015-07-16 21:29   ` Applied "ASoC: rsnd: add rsnd_get_adinr_chan()" to the asoc tree Mark Brown
2015-07-15  7:14 ` [PATCH 22/35] ASoC: rsnd: tidyup data align position Kuninori Morimoto
2015-07-16 21:29   ` Applied "ASoC: rsnd: tidyup data align position" to the asoc tree Mark Brown
2015-07-15  7:15 ` [PATCH 23/35] ASoC: rsnd: show debug message for SSI/SRC/DVC connection Kuninori Morimoto
2015-07-16 21:29   ` Applied "ASoC: rsnd: show debug message for SSI/SRC/DVC connection" to the asoc tree Mark Brown
2015-07-15  7:15 ` [PATCH 24/35] ASoC: rsnd: tidyup rsnd_dma_ops definition place Kuninori Morimoto
2015-07-16 21:29   ` Applied "ASoC: rsnd: tidyup rsnd_dma_ops definition place" to the asoc tree Mark Brown
2015-07-15  7:15 ` [PATCH 25/35] ASoC: rsnd: check the Gen1 at the beginning of DVC probe Kuninori Morimoto
2015-07-16 21:29   ` Applied "ASoC: rsnd: check the Gen1 at the beginning of DVC probe" to the asoc tree Mark Brown
2015-07-15  7:16 ` [PATCH 26/35] ASoC: rsnd: dma: add DMA name on .ops Kuninori Morimoto
2015-07-16 21:29   ` Applied "ASoC: rsnd: dma: add DMA name on .ops" to the asoc tree Mark Brown
2015-07-15  7:16 ` [PATCH 27/35] ASoC: rsnd: add rsnd_io_to_mod() Kuninori Morimoto
2015-07-16 21:29   ` Applied "ASoC: rsnd: add rsnd_io_to_mod()" to the asoc tree Mark Brown
2015-07-15  7:16 ` [PATCH 28/35] ASoC: rsnd: tidyup SRC position on each code Kuninori Morimoto
2015-07-16 21:29   ` Applied "ASoC: rsnd: tidyup SRC position on each code" to the asoc tree Mark Brown
2015-07-15  7:16 ` [PATCH 29/35] ASoC: rsnd: update Audio DMA path search method Kuninori Morimoto
2015-07-17 18:26   ` Applied "ASoC: rsnd: update Audio DMA path search method" to the asoc tree Mark Brown
2015-07-15  7:17 ` [PATCH 30/35] ASoC: rsnd: add CTU (Channel Transfer Unit) prototype support Kuninori Morimoto
2015-07-17 18:26   ` Applied "ASoC: rsnd: add CTU (Channel Transfer Unit) prototype support" to the asoc tree Mark Brown
2015-07-15  7:17 ` [PATCH 31/35] ASoC: rsnd: add MIX (Mixer) support Kuninori Morimoto
2015-07-17 18:26   ` Applied "ASoC: rsnd: add MIX (Mixer) support" to the asoc tree Mark Brown
2015-07-15  7:17 ` [PATCH 32/35] ARM: shmobile: r8a7790: Add Audio CTU support on DTSI Kuninori Morimoto
2015-07-15  7:18 ` [PATCH 33/35] ARM: shmobile: r8a7790: Add Audio MIX " Kuninori Morimoto
2015-07-15  7:18 ` [PATCH 34/35] ARM: shmobile: r8a7791: Add Audio CTU " Kuninori Morimoto
2015-07-15  7:18 ` [PATCH 35/35] ARM: shmobile: r8a7791: Add Audio MIX " Kuninori Morimoto
2015-07-16 21:19 ` [PATCH 0/35] ASoC: rsnd: add CTU/MIX prototype support 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=E1ZFqjD-0004l8-Cf@finisterre \
    --to=broonie@kernel.org \
    --cc=alsa-devel@alsa-project.org \
    --cc=keita.kobayashi.ym@renesas.com \
    --cc=kuninori.morimoto.gx@renesas.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.