ASoC: rsnd: add .fallback callback
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Thu, 27 Nov 2014 08:02:43 +0000 (08:02 +0000)
committerMark Brown <broonie@kernel.org>
Wed, 3 Dec 2014 18:51:39 +0000 (18:51 +0000)
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>
sound/soc/sh/rcar/core.c
sound/soc/sh/rcar/rsnd.h
sound/soc/sh/rcar/ssi.c

index 110b99da7acdf26d8633189c1abb1602ca8dec02..0785f84b54db4c851ec0f42799a675ac49380c5c 100644 (file)
@@ -368,7 +368,7 @@ rsnd_dma_channel_err:
        /*
         * DMA failed. try to PIO mode
         * see
-        *      rsnd_ssi_dma_remove()
+        *      rsnd_ssi_fallback()
         *      rsnd_rdai_continuance_probe()
         */
        return -EAGAIN;
@@ -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
                 * see
                 *      rsnd_dma_init()
-                *      rsnd_ssi_dma_remove()
+                *      rsnd_ssi_fallback()
                 */
                rsnd_dai_call(remove, io, rdai);
 
@@ -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, dvc);
 
+               /*
+                * fallback
+                */
+               rsnd_dai_call(fallback, io, rdai);
+
                /*
                 * retry to "probe".
                 * DAI has SSI which is PIO mode only now.
index ed44ca8af05747d18f4494f51461ec5a4547b9ff..83e1066e31bf7df04502e9a32e8511b68f110bac 100644 (file)
@@ -206,6 +206,8 @@ struct rsnd_mod_ops {
        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;
index 346d3dc66d7344378d7c53bd81114f47dd1edef3..e03e70b4f843106e0f79e14003be349ed1ccb28e 100644 (file)
@@ -464,12 +464,18 @@ static int rsnd_ssi_dma_probe(struct rsnd_mod *mod,
 
 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
         *
@@ -541,6 +547,7 @@ static struct rsnd_mod_ops rsnd_ssi_dma_ops = {
        .quit   = rsnd_ssi_quit,
        .start  = rsnd_ssi_dma_start,
        .stop   = rsnd_ssi_dma_stop,
+       .fallback = rsnd_ssi_fallback,
 };
 
 /*
This page took 0.039491 seconds and 5 git commands to generate.