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

Commit 5ba17b42 authored by Kuninori Morimoto's avatar Kuninori Morimoto Committed by Mark Brown
Browse files

ASoC: rsnd: each mod has status again for CTU/MUX support



SSI will be used as normal SSI or as clock parent SSI. Therefor,
rsnd driver wants to control SSI and parent SSI separately. Otherwise it
can't use Playback/Capture in the same time.
And it has been done by c2dc47d5("ASoC: rsnd: rsnd_dai_stream has each
mod's status insted of rsnd_mod") before.

OTOH, rsnd driver doesn't want to control CTU/MUX/DVC/SSIU/SSI in
separately. Otherwise, these will be re-initialized during playing if
MUX merges 2 sounds.
Because of these picky reasons, this patch re-defines status on each mod,
and add new parent_ssi_status on rsnd_dai_stream.

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

	rsnd_mod_init(priv, &adg->mod, &adg_ops,
		      NULL, 0, 0);
		      NULL, NULL, 0, 0);

	rsnd_adg_get_clkin(priv, adg);
	rsnd_adg_get_clkout(priv, adg);
+2 −1
Original line number Diff line number Diff line
@@ -157,7 +157,8 @@ 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_CMD, i);
				    &rsnd_cmd_ops, NULL,
				    rsnd_mod_get_status, RSND_MOD_CMD, i);
		if (ret)
			return ret;
	}
+16 −5
Original line number Diff line number Diff line
@@ -138,10 +138,20 @@ 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,
			 enum rsnd_mod_type type)
{
	return &mod->status;
}

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)
{
@@ -155,6 +165,7 @@ int rsnd_mod_init(struct rsnd_priv *priv,
	mod->type	= type;
	mod->clk	= clk;
	mod->priv	= priv;
	mod->get_status	= get_status;

	return ret;
}
@@ -325,7 +336,7 @@ u32 rsnd_get_dalign(struct rsnd_mod *mod, struct rsnd_dai_stream *io)
	struct rsnd_priv *priv = rsnd_mod_to_priv(mod);		\
	struct rsnd_mod *mod = (io)->mod[idx];			\
	struct device *dev = rsnd_priv_to_dev(priv);		\
	u32 *status = (io)->mod_status + idx;			\
	u32 *status = mod->get_status(io, mod, idx);			\
	u32 mask = 0xF << __rsnd_mod_shift_##func;			\
	u8 val  = (*status >> __rsnd_mod_shift_##func) & 0xF;		\
	u8 add  = ((val + __rsnd_mod_add_##func) & 0xF);		\
+1 −1
Original line number Diff line number Diff line
@@ -129,7 +129,7 @@ int rsnd_ctu_probe(struct rsnd_priv *priv)
		}

		ret = rsnd_mod_init(priv, rsnd_mod_get(ctu), &rsnd_ctu_ops,
				    clk, RSND_MOD_CTU, i);
				    clk, rsnd_mod_get_status, RSND_MOD_CTU, i);
		if (ret)
			goto rsnd_ctu_probe_done;

+1 −1
Original line number Diff line number Diff line
@@ -681,7 +681,7 @@ struct rsnd_mod *rsnd_dma_attach(struct rsnd_dai_stream *io,
	dma_mod = rsnd_mod_get(dma);

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

Loading