Commit 92d9587e authored by Kuninori Morimoto's avatar Kuninori Morimoto Committed by Mark Brown

ASoC: rsnd: cleanup debug information method

rsnd_mod debug information is implemented
in each callback functions now.
But, it can be implemented in rsnd_mod_call(),
and share this code.
This patch adds it
Signed-off-by: default avatarKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: default avatarMark Brown <broonie@linaro.org>
parent 0290d2a4
......@@ -152,10 +152,19 @@ struct rsnd_mod {
#define rsnd_mod_id(mod) ((mod)->id)
#define for_each_rsnd_mod(pos, n, io) \
list_for_each_entry_safe(pos, n, &(io)->head, list)
#define __rsnd_mod_call(mod, func, rdai, io) \
({ \
struct rsnd_priv *priv = rsnd_mod_to_priv(mod); \
struct device *dev = rsnd_priv_to_dev(priv); \
dev_dbg(dev, "%s-%d-%s\n", \
rsnd_mod_name(mod), rsnd_mod_id(mod), #func); \
(mod)->ops->func(mod, rdai, io); \
})
#define rsnd_mod_call(mod, func, rdai, io) \
(!(mod) ? -ENODEV : \
!((mod)->ops->func) ? 0 : \
(mod)->ops->func(mod, rdai, io))
__rsnd_mod_call(mod, func, rdai, io))
void rsnd_mod_init(struct rsnd_priv *priv,
struct rsnd_mod *mod,
......
......@@ -300,8 +300,6 @@ static int rsnd_scu_start(struct rsnd_mod *mod,
if (ret < 0)
return ret;
dev_dbg(dev, "%s%d start\n", rsnd_mod_name(mod), rsnd_mod_id(mod));
return 0;
}
......
......@@ -324,7 +324,6 @@ static int rsnd_ssi_init(struct rsnd_mod *mod,
{
struct rsnd_ssi *ssi = rsnd_mod_to_ssi(mod);
struct rsnd_priv *priv = rsnd_mod_to_priv(mod);
struct device *dev = rsnd_priv_to_dev(priv);
struct snd_pcm_runtime *runtime = rsnd_io_to_runtime(io);
u32 cr;
......@@ -371,8 +370,6 @@ static int rsnd_ssi_init(struct rsnd_mod *mod,
rsnd_ssi_mode_set(priv, rdai, ssi);
dev_dbg(dev, "%s.%d init\n", rsnd_mod_name(mod), rsnd_mod_id(mod));
return 0;
}
......@@ -384,8 +381,6 @@ static int rsnd_ssi_quit(struct rsnd_mod *mod,
struct rsnd_priv *priv = rsnd_mod_to_priv(mod);
struct device *dev = rsnd_priv_to_dev(priv);
dev_dbg(dev, "%s.%d quit\n", rsnd_mod_name(mod), rsnd_mod_id(mod));
if (ssi->err > 0)
dev_warn(dev, "ssi under/over flow err = %d\n", ssi->err);
......@@ -450,7 +445,6 @@ static int rsnd_ssi_pio_start(struct rsnd_mod *mod,
{
struct rsnd_priv *priv = rsnd_mod_to_priv(mod);
struct rsnd_ssi *ssi = rsnd_mod_to_ssi(mod);
struct device *dev = rsnd_priv_to_dev(priv);
/* enable PIO IRQ */
ssi->cr_etc = UIEN | OIEN | DIEN;
......@@ -461,8 +455,6 @@ static int rsnd_ssi_pio_start(struct rsnd_mod *mod,
rsnd_ssi_hw_start(ssi, rdai, io);
dev_dbg(dev, "%s.%d start\n", rsnd_mod_name(mod), rsnd_mod_id(mod));
return 0;
}
......@@ -470,12 +462,8 @@ static int rsnd_ssi_pio_stop(struct rsnd_mod *mod,
struct rsnd_dai *rdai,
struct rsnd_dai_stream *io)
{
struct rsnd_priv *priv = rsnd_mod_to_priv(mod);
struct device *dev = rsnd_priv_to_dev(priv);
struct rsnd_ssi *ssi = rsnd_mod_to_ssi(mod);
dev_dbg(dev, "%s.%d stop\n", rsnd_mod_name(mod), rsnd_mod_id(mod));
ssi->cr_etc = 0;
rsnd_ssi_hw_stop(ssi, rdai);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment