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: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
/*
* DMA failed. try to PIO mode
* see
- * rsnd_ssi_dma_remove()
+ * rsnd_ssi_fallback()
* rsnd_rdai_continuance_probe()
*/
return -EAGAIN;
* SSI will be switch to PIO mode if it was DMA mode
* see
* rsnd_dma_init()
- * rsnd_ssi_dma_remove()
+ * rsnd_ssi_fallback()
*/
rsnd_dai_call(remove, io, rdai);
rsnd_path_break(priv, io, src);
rsnd_path_break(priv, io, dvc);
+ /*
+ * fallback
+ */
+ rsnd_dai_call(fallback, io, rdai);
+
/*
* retry to "probe".
* DAI has SSI which is PIO mode only now.
int (*pcm_new)(struct rsnd_mod *mod,
struct rsnd_dai *rdai,
struct snd_soc_pcm_runtime *rtd);
+ int (*fallback)(struct rsnd_mod *mod,
+ struct rsnd_dai *rdai);
};
struct rsnd_dai_stream;
static int rsnd_ssi_dma_remove(struct rsnd_mod *mod,
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 device *dev = rsnd_priv_to_dev(priv);
- rsnd_dma_quit(rsnd_mod_to_priv(mod), rsnd_mod_to_dma(mod));
-
/*
* fallback to PIO
*
.quit = rsnd_ssi_quit,
.start = rsnd_ssi_dma_start,
.stop = rsnd_ssi_dma_stop,
+ .fallback = rsnd_ssi_fallback,
};
/*