summaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>2015-06-15 06:24:34 +0000
committerMark Brown <broonie@kernel.org>2015-06-16 12:34:02 +0100
commit5451ea443bf8889a786ea394ac90a3de5af53e24 (patch)
tree0ed8643f96c1896e823fd1fd11bf1ff3ccc48b54 /sound
parent047000278da3a17f8cfd9b2662b47500ee84338f (diff)
downloadlinux-stable-5451ea443bf8889a786ea394ac90a3de5af53e24.tar.gz
linux-stable-5451ea443bf8889a786ea394ac90a3de5af53e24.tar.bz2
linux-stable-5451ea443bf8889a786ea394ac90a3de5af53e24.zip
ASoC: rsnd: count each mod (SSI/SRC/DVC)
Each Renesas sound mod (= SSI/SRC/DVC) might be called from many paths if it supports MIXer. Then, we don't need to re-call each mod function that had been called. This patch count each mod status. 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>
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/sh/rcar/core.c17
-rw-r--r--sound/soc/sh/rcar/rsnd.h41
2 files changed, 37 insertions, 21 deletions
diff --git a/sound/soc/sh/rcar/core.c b/sound/soc/sh/rcar/core.c
index 027b04392674..50ec28c24867 100644
--- a/sound/soc/sh/rcar/core.c
+++ b/sound/soc/sh/rcar/core.c
@@ -211,15 +211,20 @@ u32 rsnd_get_adinr(struct rsnd_mod *mod)
({ \
struct rsnd_priv *priv = rsnd_mod_to_priv(mod); \
struct device *dev = rsnd_priv_to_dev(priv); \
- u32 mask = (1 << __rsnd_mod_shift_##func) & ~(1 << 31); \
- u32 call = __rsnd_mod_call_##func << __rsnd_mod_shift_##func; \
+ u32 mask = 0xF << __rsnd_mod_shift_##func; \
+ u8 val = (mod->status >> __rsnd_mod_shift_##func) & 0xF; \
+ u8 add = ((val + __rsnd_mod_add_##func) & 0xF); \
int ret = 0; \
- if ((mod->status & mask) == call) { \
- dev_dbg(dev, "%s[%d] %s\n", \
- rsnd_mod_name(mod), rsnd_mod_id(mod), #func); \
+ int called = 0; \
+ if (val == __rsnd_mod_call_##func) { \
+ called = 1; \
ret = (mod)->ops->func(mod, param); \
- mod->status = (mod->status & ~mask) | (~call & mask); \
+ mod->status = (mod->status & ~mask) + \
+ (add << __rsnd_mod_shift_##func); \
} \
+ dev_dbg(dev, "%s[%d] 0x%08x %s\n", \
+ rsnd_mod_name(mod), rsnd_mod_id(mod), mod->status, \
+ called ? #func : ""); \
ret; \
})
diff --git a/sound/soc/sh/rcar/rsnd.h b/sound/soc/sh/rcar/rsnd.h
index e37234ea18e6..8a114cb41925 100644
--- a/sound/soc/sh/rcar/rsnd.h
+++ b/sound/soc/sh/rcar/rsnd.h
@@ -259,25 +259,36 @@ struct rsnd_mod {
/*
* status
*
- * bit
- * 0 0: probe 1: remove
- * 1 0: init 1: quit
- * 2 0: start 1: stop
- * 3 0: pcm_new
- * 4 0: fallback
+ * 0xH0000CBA
*
- * 31 bit is always called (see __rsnd_mod_call)
- * 31 0: hw_params
+ * A 0: probe 1: remove
+ * B 0: init 1: quit
+ * C 0: start 1: stop
+ *
+ * H is always called (see __rsnd_mod_call)
+ * H 0: pcm_new
+ * H 0: fallback
+ * H 0: hw_params
*/
#define __rsnd_mod_shift_probe 0
#define __rsnd_mod_shift_remove 0
-#define __rsnd_mod_shift_init 1
-#define __rsnd_mod_shift_quit 1
-#define __rsnd_mod_shift_start 2
-#define __rsnd_mod_shift_stop 2
-#define __rsnd_mod_shift_pcm_new 3
-#define __rsnd_mod_shift_fallback 4
-#define __rsnd_mod_shift_hw_params 31 /* always called */
+#define __rsnd_mod_shift_init 4
+#define __rsnd_mod_shift_quit 4
+#define __rsnd_mod_shift_start 8
+#define __rsnd_mod_shift_stop 8
+#define __rsnd_mod_shift_pcm_new 28 /* always called */
+#define __rsnd_mod_shift_fallback 28 /* always called */
+#define __rsnd_mod_shift_hw_params 28 /* always called */
+
+#define __rsnd_mod_add_probe 1
+#define __rsnd_mod_add_remove -1
+#define __rsnd_mod_add_init 1
+#define __rsnd_mod_add_quit -1
+#define __rsnd_mod_add_start 1
+#define __rsnd_mod_add_stop -1
+#define __rsnd_mod_add_pcm_new 0
+#define __rsnd_mod_add_fallback 0
+#define __rsnd_mod_add_hw_params 0
#define __rsnd_mod_call_probe 0
#define __rsnd_mod_call_remove 1