提交 92d9587e 编写于 作者: K Kuninori Morimoto 提交者: 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: NKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: NMark Brown <broonie@linaro.org>
上级 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% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册