summaryrefslogtreecommitdiffstats
path: root/sound/soc/sh/rcar/rsnd.h
diff options
context:
space:
mode:
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>2015-07-15 07:16:19 +0000
committerMark Brown <broonie@kernel.org>2015-07-16 22:29:22 +0100
commit5cbbadd3d507eeb7711266e3932f4c427cbcbd61 (patch)
tree432688d016205f3f27c39ad5568423ba99ceca17 /sound/soc/sh/rcar/rsnd.h
parentddea1b2e83c379840aa54fadc587e418cf986ccb (diff)
downloadblackbird-op-linux-5cbbadd3d507eeb7711266e3932f4c427cbcbd61.tar.gz
blackbird-op-linux-5cbbadd3d507eeb7711266e3932f4c427cbcbd61.zip
ASoC: rsnd: add rsnd_io_to_mod()
Sometimes we would like to get each module directly, especially data path searching. this patch adds rsnd_io_to_mod() macro, and existing rsnd_io_to_mod_xxx() use it. 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/soc/sh/rcar/rsnd.h')
-rw-r--r--sound/soc/sh/rcar/rsnd.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/sound/soc/sh/rcar/rsnd.h b/sound/soc/sh/rcar/rsnd.h
index 705e66f66ab8..5f5b8b1118b2 100644
--- a/sound/soc/sh/rcar/rsnd.h
+++ b/sound/soc/sh/rcar/rsnd.h
@@ -348,9 +348,10 @@ struct rsnd_dai_stream {
int byte_per_period;
int next_period_byte;
};
-#define rsnd_io_to_mod_ssi(io) ((io)->mod[RSND_MOD_SSI])
-#define rsnd_io_to_mod_src(io) ((io)->mod[RSND_MOD_SRC])
-#define rsnd_io_to_mod_dvc(io) ((io)->mod[RSND_MOD_DVC])
+#define rsnd_io_to_mod(io, i) ((i) < RSND_MOD_MAX ? (io)->mod[(i)] : NULL)
+#define rsnd_io_to_mod_ssi(io) rsnd_io_to_mod((io), RSND_MOD_SSI)
+#define rsnd_io_to_mod_src(io) rsnd_io_to_mod((io), RSND_MOD_SRC)
+#define rsnd_io_to_mod_dvc(io) rsnd_io_to_mod((io), RSND_MOD_DVC)
#define rsnd_io_to_rdai(io) ((io)->rdai)
#define rsnd_io_to_priv(io) (rsnd_rdai_to_priv(rsnd_io_to_rdai(io)))
#define rsnd_io_is_play(io) (&rsnd_io_to_rdai(io)->playback == io)
OpenPOWER on IntegriCloud