Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Kuninori Morimoto <kuninori.morimoto.gx@gmail.com>
To: Mark Brown <broonie@kernel.org>
Cc: Linux-ALSA <alsa-devel@alsa-project.org>,
	Simon <horms@verge.net.au>, Liam Girdwood <lgirdwood@gmail.com>,
	Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Subject: [PATCH 8/8] ASoC: rsnd: share reg_field and reduce memory
Date: Sun, 02 Mar 2014 23:43:40 -0800 (PST)	[thread overview]
Message-ID: <87ppm3wwuu.wl%kuninori.morimoto.gx@gmail.com> (raw)
In-Reply-To: <871tyjybhr.wl%kuninori.morimoto.gx@gmail.com>

From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

Gen1/Gen2 code never be used in same time.
Thus, driver can share Gen1 only register and Gen2 only register.
It can reduce memory too.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 sound/soc/sh/rcar/rsnd.h |   81 ++++++++++++++++++++++++++++++----------------
 1 file changed, 53 insertions(+), 28 deletions(-)

diff --git a/sound/soc/sh/rcar/rsnd.h b/sound/soc/sh/rcar/rsnd.h
index e16acd2..d5afdee 100644
--- a/sound/soc/sh/rcar/rsnd.h
+++ b/sound/soc/sh/rcar/rsnd.h
@@ -32,18 +32,8 @@
  */
 enum rsnd_reg {
 	/* SRU/SCU/SSIU */
-	RSND_REG_SRC_ROUTE_SEL,		/* for Gen1 */
-	RSND_REG_SRC_TMG_SEL0,		/* for Gen1 */
-	RSND_REG_SRC_TMG_SEL1,		/* for Gen1 */
-	RSND_REG_SRC_TMG_SEL2,		/* for Gen1 */
-	RSND_REG_SRC_ROUTE_CTRL,	/* for Gen1 */
-	RSND_REG_SRC_CTRL,		/* for Gen2 */
-	RSND_REG_SSI_CTRL,		/* for Gen2 */
-	RSND_REG_SSI_BUSIF_MODE,	/* for Gen2 */
-	RSND_REG_SSI_BUSIF_ADINR,	/* for Gen2 */
 	RSND_REG_SSI_MODE0,
 	RSND_REG_SSI_MODE1,
-	RSND_REG_INT_ENABLE,		/* for Gen2 */
 	RSND_REG_SRC_BUSIF_MODE,
 	RSND_REG_SRC_ROUTE_MODE0,
 	RSND_REG_SRC_SWRSR,
@@ -52,9 +42,6 @@ enum rsnd_reg {
 	RSND_REG_SRC_IFSCR,
 	RSND_REG_SRC_IFSVR,
 	RSND_REG_SRC_SRCCR,
-	RSND_REG_SRC_MNFSR,		/* for Gen1 */
-	RSND_REG_SRC_BSDSR,		/* for Gen2 */
-	RSND_REG_SRC_BSISR,		/* for Gen2 */
 
 	/* ADG */
 	RSND_REG_BRRA,
@@ -62,21 +49,6 @@ enum rsnd_reg {
 	RSND_REG_SSICKR,
 	RSND_REG_AUDIO_CLK_SEL0,
 	RSND_REG_AUDIO_CLK_SEL1,
-	RSND_REG_AUDIO_CLK_SEL2,
-	RSND_REG_AUDIO_CLK_SEL3,	/* for Gen1 */
-	RSND_REG_AUDIO_CLK_SEL4,	/* for Gen1 */
-	RSND_REG_AUDIO_CLK_SEL5,	/* for Gen1 */
-	RSND_REG_DIV_EN,		/* for Gen2 */
-	RSND_REG_SRCIN_TIMSEL0,		/* for Gen2 */
-	RSND_REG_SRCIN_TIMSEL1,		/* for Gen2 */
-	RSND_REG_SRCIN_TIMSEL2,		/* for Gen2 */
-	RSND_REG_SRCIN_TIMSEL3,		/* for Gen2 */
-	RSND_REG_SRCIN_TIMSEL4,		/* for Gen2 */
-	RSND_REG_SRCOUT_TIMSEL0,	/* for Gen2 */
-	RSND_REG_SRCOUT_TIMSEL1,	/* for Gen2 */
-	RSND_REG_SRCOUT_TIMSEL2,	/* for Gen2 */
-	RSND_REG_SRCOUT_TIMSEL3,	/* for Gen2 */
-	RSND_REG_SRCOUT_TIMSEL4,	/* for Gen2 */
 
 	/* SSI */
 	RSND_REG_SSICR,
@@ -85,9 +57,62 @@ enum rsnd_reg {
 	RSND_REG_SSIRDR,
 	RSND_REG_SSIWSR,
 
+	/* SHARE see below */
+	RSND_REG_SHARE01,
+	RSND_REG_SHARE02,
+	RSND_REG_SHARE03,
+	RSND_REG_SHARE04,
+	RSND_REG_SHARE05,
+	RSND_REG_SHARE06,
+	RSND_REG_SHARE07,
+	RSND_REG_SHARE08,
+	RSND_REG_SHARE09,
+	RSND_REG_SHARE10,
+	RSND_REG_SHARE11,
+	RSND_REG_SHARE12,
+	RSND_REG_SHARE13,
+	RSND_REG_SHARE14,
+	RSND_REG_SHARE15,
+	RSND_REG_SHARE16,
+	RSND_REG_SHARE17,
+	RSND_REG_SHARE18,
+	RSND_REG_SHARE19,
+
 	RSND_REG_MAX,
 };
 
+/* Gen1 only */
+#define RSND_REG_SRC_ROUTE_SEL		RSND_REG_SHARE01
+#define RSND_REG_SRC_TMG_SEL0		RSND_REG_SHARE02
+#define RSND_REG_SRC_TMG_SEL1		RSND_REG_SHARE03
+#define RSND_REG_SRC_TMG_SEL2		RSND_REG_SHARE04
+#define RSND_REG_SRC_ROUTE_CTRL		RSND_REG_SHARE05
+#define RSND_REG_SRC_MNFSR		RSND_REG_SHARE06
+#define RSND_REG_AUDIO_CLK_SEL3		RSND_REG_SHARE07
+#define RSND_REG_AUDIO_CLK_SEL4		RSND_REG_SHARE08
+#define RSND_REG_AUDIO_CLK_SEL5		RSND_REG_SHARE09
+
+/* Gen2 only */
+#define RSND_REG_SRC_CTRL		RSND_REG_SHARE01
+#define RSND_REG_SSI_CTRL		RSND_REG_SHARE02
+#define RSND_REG_SSI_BUSIF_MODE		RSND_REG_SHARE03
+#define RSND_REG_SSI_BUSIF_ADINR	RSND_REG_SHARE04
+#define RSND_REG_INT_ENABLE		RSND_REG_SHARE05
+#define RSND_REG_SRC_BSDSR		RSND_REG_SHARE06
+#define RSND_REG_SRC_BSISR		RSND_REG_SHARE07
+#define RSND_REG_DIV_EN			RSND_REG_SHARE08
+#define RSND_REG_SRCIN_TIMSEL0		RSND_REG_SHARE09
+#define RSND_REG_SRCIN_TIMSEL1		RSND_REG_SHARE10
+#define RSND_REG_SRCIN_TIMSEL2		RSND_REG_SHARE11
+#define RSND_REG_SRCIN_TIMSEL3		RSND_REG_SHARE12
+#define RSND_REG_SRCIN_TIMSEL4		RSND_REG_SHARE13
+#define RSND_REG_SRCOUT_TIMSEL0		RSND_REG_SHARE14
+#define RSND_REG_SRCOUT_TIMSEL1		RSND_REG_SHARE15
+#define RSND_REG_SRCOUT_TIMSEL2		RSND_REG_SHARE16
+#define RSND_REG_SRCOUT_TIMSEL3		RSND_REG_SHARE17
+#define RSND_REG_SRCOUT_TIMSEL4		RSND_REG_SHARE18
+#define RSND_REG_AUDIO_CLK_SEL2		RSND_REG_SHARE19
+
 struct rsnd_priv;
 struct rsnd_mod;
 struct rsnd_dai;
-- 
1.7.9.5

  parent reply	other threads:[~2014-03-03  7:43 UTC|newest]

Thread overview: 68+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-25  6:13 [PATCH 0/19] ASoC: rsnd: new module path method and DT support Kuninori Morimoto
2014-02-25  6:14 ` [PATCH 01/19] ASoC: rsnd: move priv member settings to upper side Kuninori Morimoto
2014-03-03  1:19   ` Mark Brown
2014-02-25  6:14 ` [PATCH 02/19] ASoC: rsnd: move rsnd_mod_call() macro Kuninori Morimoto
2014-03-03  1:19   ` Mark Brown
2014-02-25  6:15 ` [PATCH 03/19] ASoC: rsnd: remove verbose function parameter Kuninori Morimoto
2014-03-03  1:19   ` Mark Brown
2014-02-25  6:15 ` [PATCH 04/19] ASoC: rsnd: remove verbose debug message from scu/ssi Kuninori Morimoto
2014-03-03  1:20   ` Mark Brown
2014-02-25  6:15 ` [PATCH 05/19] ASoC: rsnd: unify rdai naming Kuninori Morimoto
2014-03-03  1:20   ` Mark Brown
2014-02-25  6:15 ` [PATCH 06/19] ASoC: rsnd: add .set_sysclk on snd_soc_dai_ops Kuninori Morimoto
2014-03-03  1:18   ` Mark Brown
2014-03-03  2:08     ` Kuninori Morimoto
2014-03-03  2:12       ` Kuninori Morimoto
2014-03-03  7:45         ` Kuninori Morimoto
2014-02-25  6:15 ` [PATCH 07/19] ASoC: rsnd: tidyup RSND_SSI_xxx flags Kuninori Morimoto
2014-03-03  1:21   ` Mark Brown
2014-02-25  6:15 ` [PATCH 08/19] ASoC: rsnd: run rsnd_path_init() when probe() timing Kuninori Morimoto
2014-03-03  1:22   ` Mark Brown
2014-02-25  6:15 ` [PATCH 09/19] ASoC: rsnd: use mod array instead of list on rdai Kuninori Morimoto
2014-02-25  6:15 ` [PATCH 10/19] ASoC: rsnd: get ssi/scu from rsnd_dai_stream Kuninori Morimoto
2014-02-25  6:16 ` [PATCH 11/19] ASoC: rsnd: add struct rsnd_dai_platform_info Kuninori Morimoto
2014-02-25  6:16 ` [PATCH 12/19] ASoC: rsnd: use function pointer for each probe Kuninori Morimoto
2014-02-25  6:16 ` [PATCH 13/19] ASoC: rsnd: Get correct SCU ID Kuninori Morimoto
2014-02-25  6:16 ` [PATCH 14/19] ASoC: rsnd: add rsnd_scu_enable_ssi_irq() Kuninori Morimoto
2014-02-25  6:16 ` [PATCH 15/19] ASoC: rsnd: call rsnd_scu_ssi_mode_init() from SSI Kuninori Morimoto
2014-02-25  6:16 ` [PATCH 16/19] ASoC: rsnd: add probe/remove callback on rsnd_mod_ops Kuninori Morimoto
2014-02-25  6:16 ` [PATCH 17/19] ASoC: rsnd: use mod probe method on SCU Kuninori Morimoto
2014-02-25  6:17 ` [PATCH 18/19] ASoC: rsnd: use mod probe method on SSI Kuninori Morimoto
2014-02-25  6:17 ` [PATCH 19/19] ASoC: rsnd: add DeviceTree support Kuninori Morimoto
2014-02-27  5:08 ` [PATCH 0/19] ASoC: rsnd: new module path method and DT support Mark Brown
2014-02-27 10:18   ` Kuninori Morimoto
2014-02-27 11:47     ` Mark Brown
2014-03-03  1:29 ` Mark Brown
2014-03-03  7:42 ` Kuninori Morimoto
2014-03-03  7:42   ` [PATCH 1/8] ASoC: rsnd: run rsnd_path_init() when probe() timing Kuninori Morimoto
2014-03-04  4:13     ` Mark Brown
2014-03-03  7:42   ` [PATCH 2/8] ASoC: rsnd: use mod array instead of list on rdai Kuninori Morimoto
2014-03-03  7:43   ` [PATCH 3/8] ASoC: rsnd: get ssi/scu from rsnd_dai_stream Kuninori Morimoto
2014-03-03  7:43   ` [PATCH 4/8] ASoC: rsnd: use devm_clk_get() instead of clk_get() Kuninori Morimoto
2014-03-03  7:43   ` [PATCH 5/8] ASoC: rsnd: use function pointer for each probe Kuninori Morimoto
2014-03-03  7:43   ` [PATCH 6/8] ASoC: rsnd: remove unused SSI_CONTROL Kuninori Morimoto
2014-03-03  7:43   ` [PATCH 7/8] ASoC: rsnd: modify rsnd_adg_ssi_ws_timing_gen2() parameter Kuninori Morimoto
2014-03-03  7:43   ` Kuninori Morimoto [this message]
2014-03-04  4:49 ` [PATCH 0/19] ASoC: rsnd: new module path method and DT support Kuninori Morimoto
2014-03-04  4:49   ` [PATCH 01/11] ASoC: rsnd: add struct rsnd_dai_platform_info Kuninori Morimoto
2014-03-04  4:50   ` [PATCH 02/11] ASoC: rsnd: Get correct SCU ID Kuninori Morimoto
2014-03-04  4:50   ` [PATCH 03/11] ASoC: rsnd: add rsnd_scu_enable_ssi_irq() Kuninori Morimoto
2014-03-04  4:50   ` [PATCH 04/11] ASoC: rsnd: call rsnd_scu_ssi_mode_init() from SSI Kuninori Morimoto
2014-03-04  4:50   ` [PATCH 05/11] ASoC: rsnd: add probe/remove callback on rsnd_mod_ops Kuninori Morimoto
2014-03-04  4:50   ` [PATCH 06/11] ASoC: rsnd: use mod probe method on SCU Kuninori Morimoto
2014-03-04  4:50   ` [PATCH 07/11] ASoC: rsnd: use mod probe method on SSI Kuninori Morimoto
2014-03-04  4:51   ` [PATCH 08/11] ASoC: rsnd: nothing to do on rsnd_dai_remove() Kuninori Morimoto
2014-03-04  4:51   ` [PATCH 09/11] ASoC: rsnd: remove all rsnd_xxx_remove() Kuninori Morimoto
2014-03-04  4:51   ` [PATCH 10/11] ASoC: rsnd: rename scu to src Kuninori Morimoto
2014-03-05  6:08     ` Mark Brown
2014-03-04  4:51   ` [PATCH 11/11] ASoC: rsnd: add DeviceTree support Kuninori Morimoto
2014-03-05  6:39     ` Forward: " Kuninori Morimoto
2014-03-10 14:52       ` Ben Dooks
     [not found]         ` <20140310145254.GJ4400-SMNkleLxa3Z6Wcw2j4pizdi2O/JbrIOy@public.gmane.org>
2014-03-14  0:34           ` [alsa-devel] " Kuninori Morimoto
     [not found]             ` <87fvmlpqi1.wl%kuninori.morimoto.gx-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2014-03-18  2:29               ` [PATCH v2] " Kuninori Morimoto
     [not found]                 ` <87ob14jl2d.wl%kuninori.morimoto.gx-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2014-03-21 18:18                   ` Mark Brown
     [not found]                     ` <20140321181813.GP552-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2014-03-24  0:07                       ` Kuninori Morimoto
2014-03-24  3:29                       ` [PATCH] ASoC: rcar: subnode tidyup for renesas,rsnd.txt Kuninori Morimoto
     [not found]                         ` <87fvm8i8ah.wl%kuninori.morimoto.gx-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2014-03-25 13:04                           ` Mark Brown
2014-03-10 16:28 ` [PATCH 0/19] ASoC: rsnd: new module path method and DT support Ben Dooks
2014-03-11  0:00   ` Kuninori Morimoto

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=87ppm3wwuu.wl%kuninori.morimoto.gx@gmail.com \
    --to=kuninori.morimoto.gx@gmail.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=horms@verge.net.au \
    --cc=kuninori.morimoto.gx@renesas.com \
    --cc=lgirdwood@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox