Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Unverified Commit 7e7fe06d authored by Kuninori Morimoto's avatar Kuninori Morimoto Committed by Mark Brown
Browse files

ASoC: rsnd: move .get_status under rsnd_mod_ops



Each mod needs to have .get_status, but current driver is handling it
under rsnd_mod, instead of rsnd_mod_ops.
It is not any make sence. This patch moves it to rsnd_mod_ops, and
tidyup its parameter order to align to other callback functions.

Signed-off-by: default avatarKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 0900d1e6
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -613,7 +613,7 @@ int rsnd_adg_probe(struct rsnd_priv *priv)
		return -ENOMEM;

	ret = rsnd_mod_init(priv, &adg->mod, &adg_ops,
		      NULL, NULL, 0, 0);
		      NULL, 0, 0);
	if (ret)
		return ret;

+6 −5
Original line number Diff line number Diff line
@@ -120,6 +120,7 @@ static struct rsnd_mod_ops rsnd_cmd_ops = {
	.init		= rsnd_cmd_init,
	.start		= rsnd_cmd_start,
	.stop		= rsnd_cmd_stop,
	.get_status	= rsnd_mod_get_status,
};

static struct rsnd_mod *rsnd_cmd_mod_get(struct rsnd_priv *priv, int id)
@@ -162,7 +163,7 @@ int rsnd_cmd_probe(struct rsnd_priv *priv)
	for_each_rsnd_cmd(cmd, priv, i) {
		ret = rsnd_mod_init(priv, rsnd_mod_get(cmd),
				    &rsnd_cmd_ops, NULL,
				    rsnd_mod_get_status, RSND_MOD_CMD, i);
				    RSND_MOD_CMD, i);
		if (ret)
			return ret;
	}
+3 −7
Original line number Diff line number Diff line
@@ -137,8 +137,8 @@ struct dma_chan *rsnd_mod_dma_req(struct rsnd_dai_stream *io,
	return mod->ops->dma_req(io, mod);
}

u32 *rsnd_mod_get_status(struct rsnd_dai_stream *io,
			 struct rsnd_mod *mod,
u32 *rsnd_mod_get_status(struct rsnd_mod *mod,
			 struct rsnd_dai_stream *io,
			 enum rsnd_mod_type type)
{
	return &mod->status;
@@ -148,9 +148,6 @@ int rsnd_mod_init(struct rsnd_priv *priv,
		  struct rsnd_mod *mod,
		  struct rsnd_mod_ops *ops,
		  struct clk *clk,
		  u32* (*get_status)(struct rsnd_dai_stream *io,
				     struct rsnd_mod *mod,
				     enum rsnd_mod_type type),
		  enum rsnd_mod_type type,
		  int id)
{
@@ -164,7 +161,6 @@ int rsnd_mod_init(struct rsnd_priv *priv,
	mod->type	= type;
	mod->clk	= clk;
	mod->priv	= priv;
	mod->get_status	= get_status;

	return ret;
}
@@ -472,7 +468,7 @@ static int rsnd_status_update(u32 *status,
	enum rsnd_mod_type *types = rsnd_mod_sequence[is_play];		\
	for_each_rsnd_mod_arrays(i, mod, io, types, RSND_MOD_MAX) {	\
		int tmp = 0;						\
		u32 *status = mod->get_status(io, mod, types[i]);	\
		u32 *status = mod->ops->get_status(mod, io, types[i]);	\
		int func_call = rsnd_status_update(status,		\
						__rsnd_mod_shift_##fn,	\
						__rsnd_mod_add_##fn,	\
+2 −1
Original line number Diff line number Diff line
@@ -341,6 +341,7 @@ static struct rsnd_mod_ops rsnd_ctu_ops = {
	.quit		= rsnd_ctu_quit,
	.hw_params	= rsnd_ctu_hw_params,
	.pcm_new	= rsnd_ctu_pcm_new,
	.get_status	= rsnd_mod_get_status,
};

struct rsnd_mod *rsnd_ctu_mod_get(struct rsnd_priv *priv, int id)
@@ -404,7 +405,7 @@ int rsnd_ctu_probe(struct rsnd_priv *priv)
		}

		ret = rsnd_mod_init(priv, rsnd_mod_get(ctu), &rsnd_ctu_ops,
				    clk, rsnd_mod_get_status, RSND_MOD_CTU, i);
				    clk, RSND_MOD_CTU, i);
		if (ret) {
			of_node_put(np);
			goto rsnd_ctu_probe_done;
+14 −12
Original line number Diff line number Diff line
@@ -295,6 +295,7 @@ static struct rsnd_mod_ops rsnd_dmaen_ops = {
	.start		= rsnd_dmaen_start,
	.stop		= rsnd_dmaen_stop,
	.pointer	= rsnd_dmaen_pointer,
	.get_status	= rsnd_mod_get_status,
};

/*
@@ -481,6 +482,7 @@ static struct rsnd_mod_ops rsnd_dmapp_ops = {
	.start		= rsnd_dmapp_start,
	.stop		= rsnd_dmapp_stop,
	.quit		= rsnd_dmapp_stop,
	.get_status	= rsnd_mod_get_status,
};

/*
@@ -756,7 +758,7 @@ static int rsnd_dma_alloc(struct rsnd_dai_stream *io, struct rsnd_mod *mod,
	*dma_mod = rsnd_mod_get(dma);

	ret = rsnd_mod_init(priv, *dma_mod, ops, NULL,
			    rsnd_mod_get_status, type, dma_id);
			    type, dma_id);
	if (ret < 0)
		return ret;

@@ -823,5 +825,5 @@ int rsnd_dma_probe(struct rsnd_priv *priv)
	priv->dma = dmac;

	/* dummy mem mod for debug */
	return rsnd_mod_init(NULL, &mem, &mem_ops, NULL, NULL, 0, 0);
	return rsnd_mod_init(NULL, &mem, &mem_ops, NULL, 0, 0);
}
Loading