summaryrefslogtreecommitdiffstats
path: root/sound/soc/sh/rcar/src.c
diff options
context:
space:
mode:
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>2015-10-26 08:38:26 +0000
committerMark Brown <broonie@kernel.org>2015-11-16 10:09:29 +0000
commit232c00b6e55558c216cbf50358549a1967ee1419 (patch)
tree319673419b3a2aad8e89f73457db56607a7de68b /sound/soc/sh/rcar/src.c
parent8005c49d9aea74d382f474ce11afbbc7d7130bec (diff)
downloadop-kernel-dev-232c00b6e55558c216cbf50358549a1967ee1419.zip
op-kernel-dev-232c00b6e55558c216cbf50358549a1967ee1419.tar.gz
ASoC: rsnd: DMA become SSI/SRC member
Renesas sound needs many devices (SSI/SSIU/SRC/CTU/MIX/DVC/CMD/AudioDMAC/AudioDMACpp). SSI/SRC/CTU/MIX/DVC are implemented as module. SSI parent, SSIU are implemented as part of SSI CMD is implemented as part of CTU/MIX/DVC AudioDMAC/AudioDMACpp are implemented as part of SSI/SRC It is nice sense that these all devices are implemented as mod. Current rsnd_mod is member of rsnd_mod. But the DMA user is only SSI/SRC. This DMA will be implemented as module. As 1st step, DMA become SSI/SRC member by this patch. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/sh/rcar/src.c')
-rw-r--r--sound/soc/sh/rcar/src.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/sound/soc/sh/rcar/src.c b/sound/soc/sh/rcar/src.c
index 261b502..3296f1e 100644
--- a/sound/soc/sh/rcar/src.c
+++ b/sound/soc/sh/rcar/src.c
@@ -22,6 +22,7 @@
struct rsnd_src {
struct rsnd_src_platform_info *info; /* rcar_snd.h */
struct rsnd_mod mod;
+ struct rsnd_dma *dma;
struct rsnd_kctrl_cfg_s sen; /* sync convert enable */
struct rsnd_kctrl_cfg_s sync; /* sync convert */
u32 convert_rate; /* sampling rate convert */
@@ -30,6 +31,7 @@ struct rsnd_src {
#define RSND_SRC_NAME_SIZE 16
+#define rsnd_src_to_dma(src) ((src)->dma)
#define rsnd_src_nr(priv) ((priv)->src_nr)
#define rsnd_enable_sync_convert(src) ((src)->sen.val)
#define rsnd_src_of_node(priv) \
@@ -839,9 +841,9 @@ static int rsnd_src_probe_gen2(struct rsnd_mod *mod,
return ret;
}
- ret = rsnd_dma_init(io,
- rsnd_mod_to_dma(mod),
- src->info->dma_id);
+ src->dma = rsnd_dma_init(io, mod, src->info->dma_id);
+ if (IS_ERR(src->dma))
+ return PTR_ERR(src->dma);
return ret;
}
@@ -850,7 +852,9 @@ static int rsnd_src_remove_gen2(struct rsnd_mod *mod,
struct rsnd_dai_stream *io,
struct rsnd_priv *priv)
{
- rsnd_dma_quit(io, rsnd_mod_to_dma(mod));
+ struct rsnd_src *src = rsnd_mod_to_src(mod);
+
+ rsnd_dma_quit(io, rsnd_src_to_dma(src));
return 0;
}
@@ -880,7 +884,9 @@ static int rsnd_src_start_gen2(struct rsnd_mod *mod,
struct rsnd_dai_stream *io,
struct rsnd_priv *priv)
{
- rsnd_dma_start(io, rsnd_mod_to_dma(mod));
+ struct rsnd_src *src = rsnd_mod_to_src(mod);
+
+ rsnd_dma_start(io, rsnd_src_to_dma(src));
return _rsnd_src_start_gen2(mod, io);
}
@@ -889,11 +895,12 @@ static int rsnd_src_stop_gen2(struct rsnd_mod *mod,
struct rsnd_dai_stream *io,
struct rsnd_priv *priv)
{
+ struct rsnd_src *src = rsnd_mod_to_src(mod);
int ret;
ret = _rsnd_src_stop_gen2(mod);
- rsnd_dma_stop(io, rsnd_mod_to_dma(mod));
+ rsnd_dma_stop(io, rsnd_src_to_dma(src));
return ret;
}
OpenPOWER on IntegriCloud