mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-15 16:36:42 +07:00
ASoC: rsnd: Parent SSI attach is not needed if not clock master
Parent SSI is needed if it is PIN sharing and clock master, otherwise, not needed. But, whether clockk master is judged on .set_fmt, thus, it can't call rsnd_ssi_parent_attach() on .probe. Now, .pcm_new will be called after .set_fmt, so this patch reuses it at this point. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
0dc6bf7502
commit
098bd8911a
@ -545,12 +545,17 @@ static irqreturn_t rsnd_ssi_interrupt(int irq, void *data)
|
|||||||
* SSI PIO
|
* SSI PIO
|
||||||
*/
|
*/
|
||||||
static void rsnd_ssi_parent_attach(struct rsnd_mod *mod,
|
static void rsnd_ssi_parent_attach(struct rsnd_mod *mod,
|
||||||
struct rsnd_dai_stream *io,
|
struct rsnd_dai_stream *io)
|
||||||
struct rsnd_priv *priv)
|
|
||||||
{
|
{
|
||||||
|
struct rsnd_dai *rdai = rsnd_io_to_rdai(io);
|
||||||
|
struct rsnd_priv *priv = rsnd_mod_to_priv(mod);
|
||||||
|
|
||||||
if (!__rsnd_ssi_is_pin_sharing(mod))
|
if (!__rsnd_ssi_is_pin_sharing(mod))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (!rsnd_rdai_is_clk_master(rdai))
|
||||||
|
return;
|
||||||
|
|
||||||
switch (rsnd_mod_id(mod)) {
|
switch (rsnd_mod_id(mod)) {
|
||||||
case 1:
|
case 1:
|
||||||
case 2:
|
case 2:
|
||||||
@ -565,6 +570,20 @@ static void rsnd_ssi_parent_attach(struct rsnd_mod *mod,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int rsnd_ssi_pcm_new(struct rsnd_mod *mod,
|
||||||
|
struct rsnd_dai_stream *io,
|
||||||
|
struct snd_soc_pcm_runtime *rtd)
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
* rsnd_rdai_is_clk_master() will be enabled after set_fmt,
|
||||||
|
* and, pcm_new will be called after it.
|
||||||
|
* This function reuse pcm_new at this point.
|
||||||
|
*/
|
||||||
|
rsnd_ssi_parent_attach(mod, io);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
static int rsnd_ssi_common_probe(struct rsnd_mod *mod,
|
static int rsnd_ssi_common_probe(struct rsnd_mod *mod,
|
||||||
struct rsnd_dai_stream *io,
|
struct rsnd_dai_stream *io,
|
||||||
struct rsnd_priv *priv)
|
struct rsnd_priv *priv)
|
||||||
@ -580,7 +599,10 @@ static int rsnd_ssi_common_probe(struct rsnd_mod *mod,
|
|||||||
if (rsnd_ssi_is_multi_slave(mod, io))
|
if (rsnd_ssi_is_multi_slave(mod, io))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
rsnd_ssi_parent_attach(mod, io, priv);
|
/*
|
||||||
|
* It can't judge ssi parent at this point
|
||||||
|
* see rsnd_ssi_pcm_new()
|
||||||
|
*/
|
||||||
|
|
||||||
ret = rsnd_ssiu_attach(io, mod);
|
ret = rsnd_ssiu_attach(io, mod);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
@ -602,6 +624,7 @@ static struct rsnd_mod_ops rsnd_ssi_pio_ops = {
|
|||||||
.start = rsnd_ssi_start,
|
.start = rsnd_ssi_start,
|
||||||
.stop = rsnd_ssi_stop,
|
.stop = rsnd_ssi_stop,
|
||||||
.irq = rsnd_ssi_irq,
|
.irq = rsnd_ssi_irq,
|
||||||
|
.pcm_new = rsnd_ssi_pcm_new,
|
||||||
.hw_params = rsnd_ssi_hw_params,
|
.hw_params = rsnd_ssi_hw_params,
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -691,6 +714,7 @@ static struct rsnd_mod_ops rsnd_ssi_dma_ops = {
|
|||||||
.start = rsnd_ssi_start,
|
.start = rsnd_ssi_start,
|
||||||
.stop = rsnd_ssi_stop,
|
.stop = rsnd_ssi_stop,
|
||||||
.irq = rsnd_ssi_irq,
|
.irq = rsnd_ssi_irq,
|
||||||
|
.pcm_new = rsnd_ssi_pcm_new,
|
||||||
.fallback = rsnd_ssi_fallback,
|
.fallback = rsnd_ssi_fallback,
|
||||||
.hw_params = rsnd_ssi_hw_params,
|
.hw_params = rsnd_ssi_hw_params,
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user