| From 8fee8ad26cbd2382a06df16671aa03ee53082d9d Mon Sep 17 00:00:00 2001 |
| From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> |
| Date: Mon, 15 Jun 2015 06:25:48 +0000 |
| Subject: [PATCH 121/129] ASoC: rsnd: add common interrupt handler for |
| SSI/SRC/DMA |
| |
| 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. Then, interrupt handler can't use rsnd_mod_to_io(). |
| This patch adds SSI/SRC/DMA common interrupt handler frame |
| |
| 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> |
| (cherry picked from commit f501b7a4e7ceb76a5d24cc0f75403072af5e85a0) |
| Signed-off-by: Simon Horman <horms+renesas@verge.net.au> |
| --- |
| sound/soc/sh/rcar/core.c | 23 +++++++++++++++++++++++ |
| sound/soc/sh/rcar/rsnd.h | 3 +++ |
| 2 files changed, 26 insertions(+) |
| |
| diff --git a/sound/soc/sh/rcar/core.c b/sound/soc/sh/rcar/core.c |
| index 54297d74ea1f..424d1a31c471 100644 |
| --- a/sound/soc/sh/rcar/core.c |
| +++ b/sound/soc/sh/rcar/core.c |
| @@ -172,6 +172,29 @@ void rsnd_mod_quit(struct rsnd_mod *mod) |
| clk_unprepare(mod->clk); |
| } |
| |
| +void rsnd_mod_interrupt(struct rsnd_mod *mod, |
| + void (*callback)(struct rsnd_mod *mod, |
| + struct rsnd_dai_stream *io)) |
| +{ |
| + struct rsnd_priv *priv = rsnd_mod_to_priv(mod); |
| + struct rsnd_dai_stream *io; |
| + struct rsnd_dai *rdai; |
| + int i, j; |
| + |
| + for_each_rsnd_dai(rdai, priv, j) { |
| + |
| + for (i = 0; i < RSND_MOD_MAX; i++) { |
| + io = &rdai->playback; |
| + if (mod == io->mod[i]) |
| + callback(mod, io); |
| + |
| + io = &rdai->capture; |
| + if (mod == io->mod[i]) |
| + callback(mod, io); |
| + } |
| + } |
| +} |
| + |
| int rsnd_mod_is_working(struct rsnd_mod *mod) |
| { |
| struct rsnd_dai_stream *io = rsnd_mod_to_io(mod); |
| diff --git a/sound/soc/sh/rcar/rsnd.h b/sound/soc/sh/rcar/rsnd.h |
| index fd93a6a25749..e6aad5e05fad 100644 |
| --- a/sound/soc/sh/rcar/rsnd.h |
| +++ b/sound/soc/sh/rcar/rsnd.h |
| @@ -327,6 +327,9 @@ void rsnd_mod_quit(struct rsnd_mod *mod); |
| char *rsnd_mod_name(struct rsnd_mod *mod); |
| int rsnd_mod_is_working(struct rsnd_mod *mod); |
| struct dma_chan *rsnd_mod_dma_req(struct rsnd_mod *mod); |
| +void rsnd_mod_interrupt(struct rsnd_mod *mod, |
| + void (*callback)(struct rsnd_mod *mod, |
| + struct rsnd_dai_stream *io)); |
| |
| /* |
| * R-Car sound DAI |
| -- |
| 2.6.2 |
| |