aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>2015-06-15 02:27:47 -0400
committerMark Brown <broonie@kernel.org>2015-06-16 07:34:04 -0400
commitd5bbe7de563ccce62765f1183561218b6dbdbe1e (patch)
treeb6612b2eda4b14c879d43d15fb0bf0a86cad60fe
parentb65a7cccb58ce5acfed579e1ca10f8a4d3d0dd04 (diff)
ASoC: rsnd: move rsnd_mod_is_working() to rsnd_io_is_working()
Each Renesas sound mod (= SSI/SRC/DVC) might be called from many paths if it supports MIXer. In such case, mod <-> io is no longer 1:1 relationship. This patch checks module working status via io instead of mod Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Tested-by: Keita Kobayashi <keita.kobayashi.ym@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r--sound/soc/sh/rcar/core.c4
-rw-r--r--sound/soc/sh/rcar/dma.c2
-rw-r--r--sound/soc/sh/rcar/rsnd.h3
-rw-r--r--sound/soc/sh/rcar/src.c2
-rw-r--r--sound/soc/sh/rcar/ssi.c2
5 files changed, 5 insertions, 8 deletions
diff --git a/sound/soc/sh/rcar/core.c b/sound/soc/sh/rcar/core.c
index 266b24ae621d..1eca85ff3e91 100644
--- a/sound/soc/sh/rcar/core.c
+++ b/sound/soc/sh/rcar/core.c
@@ -196,10 +196,8 @@ void rsnd_mod_interrupt(struct rsnd_mod *mod,
196 } 196 }
197} 197}
198 198
199int rsnd_mod_is_working(struct rsnd_mod *mod) 199int rsnd_io_is_working(struct rsnd_dai_stream *io)
200{ 200{
201 struct rsnd_dai_stream *io = rsnd_mod_to_io(mod);
202
203 /* see rsnd_dai_stream_init/quit() */ 201 /* see rsnd_dai_stream_init/quit() */
204 return !!io->substream; 202 return !!io->substream;
205} 203}
diff --git a/sound/soc/sh/rcar/dma.c b/sound/soc/sh/rcar/dma.c
index 6ee34fcc0d68..375a9dc33bca 100644
--- a/sound/soc/sh/rcar/dma.c
+++ b/sound/soc/sh/rcar/dma.c
@@ -52,7 +52,7 @@ static void __rsnd_dmaen_complete(struct rsnd_mod *mod,
52 */ 52 */
53 spin_lock_irqsave(&priv->lock, flags); 53 spin_lock_irqsave(&priv->lock, flags);
54 54
55 if (rsnd_mod_is_working(mod)) 55 if (rsnd_io_is_working(io))
56 elapsed = rsnd_dai_pointer_update(io, io->byte_per_period); 56 elapsed = rsnd_dai_pointer_update(io, io->byte_per_period);
57 57
58 spin_unlock_irqrestore(&priv->lock, flags); 58 spin_unlock_irqrestore(&priv->lock, flags);
diff --git a/sound/soc/sh/rcar/rsnd.h b/sound/soc/sh/rcar/rsnd.h
index fdb443b4f183..756930bc1914 100644
--- a/sound/soc/sh/rcar/rsnd.h
+++ b/sound/soc/sh/rcar/rsnd.h
@@ -326,7 +326,6 @@ int rsnd_mod_init(struct rsnd_priv *priv,
326 int id); 326 int id);
327void rsnd_mod_quit(struct rsnd_mod *mod); 327void rsnd_mod_quit(struct rsnd_mod *mod);
328char *rsnd_mod_name(struct rsnd_mod *mod); 328char *rsnd_mod_name(struct rsnd_mod *mod);
329int rsnd_mod_is_working(struct rsnd_mod *mod);
330struct dma_chan *rsnd_mod_dma_req(struct rsnd_dai_stream *io, 329struct dma_chan *rsnd_mod_dma_req(struct rsnd_dai_stream *io,
331 struct rsnd_mod *mod); 330 struct rsnd_mod *mod);
332void rsnd_mod_interrupt(struct rsnd_mod *mod, 331void rsnd_mod_interrupt(struct rsnd_mod *mod,
@@ -356,7 +355,7 @@ struct rsnd_dai_stream {
356#define rsnd_io_is_play(io) (&rsnd_io_to_rdai(io)->playback == io) 355#define rsnd_io_is_play(io) (&rsnd_io_to_rdai(io)->playback == io)
357#define rsnd_io_to_runtime(io) ((io)->substream ? \ 356#define rsnd_io_to_runtime(io) ((io)->substream ? \
358 (io)->substream->runtime : NULL) 357 (io)->substream->runtime : NULL)
359 358int rsnd_io_is_working(struct rsnd_dai_stream *io);
360 359
361struct rsnd_dai { 360struct rsnd_dai {
362 char name[RSND_DAI_NAME_SIZE]; 361 char name[RSND_DAI_NAME_SIZE];
diff --git a/sound/soc/sh/rcar/src.c b/sound/soc/sh/rcar/src.c
index 67db69686515..c61c17180142 100644
--- a/sound/soc/sh/rcar/src.c
+++ b/sound/soc/sh/rcar/src.c
@@ -684,7 +684,7 @@ static void __rsnd_src_interrupt_gen2(struct rsnd_mod *mod,
684 spin_lock(&priv->lock); 684 spin_lock(&priv->lock);
685 685
686 /* ignore all cases if not working */ 686 /* ignore all cases if not working */
687 if (!rsnd_mod_is_working(mod)) 687 if (!rsnd_io_is_working(io))
688 goto rsnd_src_interrupt_gen2_out; 688 goto rsnd_src_interrupt_gen2_out;
689 689
690 if (rsnd_src_error_record_gen2(mod)) { 690 if (rsnd_src_error_record_gen2(mod)) {
diff --git a/sound/soc/sh/rcar/ssi.c b/sound/soc/sh/rcar/ssi.c
index fa1f2e5b9070..2fbe59f7f9b5 100644
--- a/sound/soc/sh/rcar/ssi.c
+++ b/sound/soc/sh/rcar/ssi.c
@@ -432,7 +432,7 @@ static void __rsnd_ssi_interrupt(struct rsnd_mod *mod,
432 spin_lock(&priv->lock); 432 spin_lock(&priv->lock);
433 433
434 /* ignore all cases if not working */ 434 /* ignore all cases if not working */
435 if (!rsnd_mod_is_working(mod)) 435 if (!rsnd_io_is_working(io))
436 goto rsnd_ssi_interrupt_out; 436 goto rsnd_ssi_interrupt_out;
437 437
438 status = rsnd_mod_read(mod, SSISR); 438 status = rsnd_mod_read(mod, SSISR);