Commit 97463e19 authored by Kuninori Morimoto's avatar Kuninori Morimoto Committed by Mark Brown

ASoC: rsnd: add .fallback callback

Current R-Car sound has PIO fallback support if it couldn't use DMA.
This fallback is done in .remove callback, but, it should have
.fallback callback. Otherwise, normal .remove callback will have
strange behavior. This patch adds .fallback callback.
Signed-off-by: default avatarKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 56ba98ac
...@@ -368,7 +368,7 @@ int rsnd_dma_init(struct rsnd_priv *priv, struct rsnd_dma *dma, ...@@ -368,7 +368,7 @@ int rsnd_dma_init(struct rsnd_priv *priv, struct rsnd_dma *dma,
/* /*
* DMA failed. try to PIO mode * DMA failed. try to PIO mode
* see * see
* rsnd_ssi_dma_remove() * rsnd_ssi_fallback()
* rsnd_rdai_continuance_probe() * rsnd_rdai_continuance_probe()
*/ */
return -EAGAIN; return -EAGAIN;
...@@ -1023,7 +1023,7 @@ static int rsnd_rdai_continuance_probe(struct rsnd_priv *priv, ...@@ -1023,7 +1023,7 @@ static int rsnd_rdai_continuance_probe(struct rsnd_priv *priv,
* SSI will be switch to PIO mode if it was DMA mode * SSI will be switch to PIO mode if it was DMA mode
* see * see
* rsnd_dma_init() * rsnd_dma_init()
* rsnd_ssi_dma_remove() * rsnd_ssi_fallback()
*/ */
rsnd_dai_call(remove, io, rdai); rsnd_dai_call(remove, io, rdai);
...@@ -1033,6 +1033,11 @@ static int rsnd_rdai_continuance_probe(struct rsnd_priv *priv, ...@@ -1033,6 +1033,11 @@ static int rsnd_rdai_continuance_probe(struct rsnd_priv *priv,
rsnd_path_break(priv, io, src); rsnd_path_break(priv, io, src);
rsnd_path_break(priv, io, dvc); rsnd_path_break(priv, io, dvc);
/*
* fallback
*/
rsnd_dai_call(fallback, io, rdai);
/* /*
* retry to "probe". * retry to "probe".
* DAI has SSI which is PIO mode only now. * DAI has SSI which is PIO mode only now.
......
...@@ -206,6 +206,8 @@ struct rsnd_mod_ops { ...@@ -206,6 +206,8 @@ struct rsnd_mod_ops {
int (*pcm_new)(struct rsnd_mod *mod, int (*pcm_new)(struct rsnd_mod *mod,
struct rsnd_dai *rdai, struct rsnd_dai *rdai,
struct snd_soc_pcm_runtime *rtd); struct snd_soc_pcm_runtime *rtd);
int (*fallback)(struct rsnd_mod *mod,
struct rsnd_dai *rdai);
}; };
struct rsnd_dai_stream; struct rsnd_dai_stream;
......
...@@ -464,12 +464,18 @@ static int rsnd_ssi_dma_probe(struct rsnd_mod *mod, ...@@ -464,12 +464,18 @@ static int rsnd_ssi_dma_probe(struct rsnd_mod *mod,
static int rsnd_ssi_dma_remove(struct rsnd_mod *mod, static int rsnd_ssi_dma_remove(struct rsnd_mod *mod,
struct rsnd_dai *rdai) struct rsnd_dai *rdai)
{
rsnd_dma_quit(rsnd_mod_to_priv(mod), rsnd_mod_to_dma(mod));
return 0;
}
static int rsnd_ssi_fallback(struct rsnd_mod *mod,
struct rsnd_dai *rdai)
{ {
struct rsnd_priv *priv = rsnd_mod_to_priv(mod); struct rsnd_priv *priv = rsnd_mod_to_priv(mod);
struct device *dev = rsnd_priv_to_dev(priv); struct device *dev = rsnd_priv_to_dev(priv);
rsnd_dma_quit(rsnd_mod_to_priv(mod), rsnd_mod_to_dma(mod));
/* /*
* fallback to PIO * fallback to PIO
* *
...@@ -541,6 +547,7 @@ static struct rsnd_mod_ops rsnd_ssi_dma_ops = { ...@@ -541,6 +547,7 @@ static struct rsnd_mod_ops rsnd_ssi_dma_ops = {
.quit = rsnd_ssi_quit, .quit = rsnd_ssi_quit,
.start = rsnd_ssi_dma_start, .start = rsnd_ssi_dma_start,
.stop = rsnd_ssi_dma_stop, .stop = rsnd_ssi_dma_stop,
.fallback = rsnd_ssi_fallback,
}; };
/* /*
......
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