aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/sh/rcar/rsnd.h
diff options
context:
space:
mode:
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>2013-07-28 21:58:50 -0400
committerMark Brown <broonie@linaro.org>2013-08-06 12:56:13 -0400
commit0a4d94c07ce782e645a8c0484d52221758b4c398 (patch)
tree06b9b94e4da866f625d5754a94dcd199687798f4 /sound/soc/sh/rcar/rsnd.h
parent4b4dab82340d969521f4f86108441cb597c8595d (diff)
ASoC: rsnd: add common DMAEngine method
R-Car Sound driver will support DMA transfer in the future, then, SSI/SRU/SRC will use it. Current R-Car can't use soc-dmaengine-pcm.c since its DMAEngine doesn't support dmaengine_prep_dma_cyclic(), and SSI needs double plane transfer (which needs special submit) on DMAC. This patch adds common DMAEngine method for it Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@linaro.org>
Diffstat (limited to 'sound/soc/sh/rcar/rsnd.h')
-rw-r--r--sound/soc/sh/rcar/rsnd.h32
1 files changed, 32 insertions, 0 deletions
diff --git a/sound/soc/sh/rcar/rsnd.h b/sound/soc/sh/rcar/rsnd.h
index 9243e387104c..15dccd598960 100644
--- a/sound/soc/sh/rcar/rsnd.h
+++ b/sound/soc/sh/rcar/rsnd.h
@@ -13,9 +13,12 @@
13 13
14#include <linux/clk.h> 14#include <linux/clk.h>
15#include <linux/device.h> 15#include <linux/device.h>
16#include <linux/dma-mapping.h>
16#include <linux/io.h> 17#include <linux/io.h>
17#include <linux/list.h> 18#include <linux/list.h>
18#include <linux/module.h> 19#include <linux/module.h>
20#include <linux/sh_dma.h>
21#include <linux/workqueue.h>
19#include <sound/rcar_snd.h> 22#include <sound/rcar_snd.h>
20#include <sound/soc.h> 23#include <sound/soc.h>
21#include <sound/pcm_params.h> 24#include <sound/pcm_params.h>
@@ -79,6 +82,32 @@ void rsnd_bset(struct rsnd_priv *priv, struct rsnd_mod *mod, enum rsnd_reg reg,
79 u32 mask, u32 data); 82 u32 mask, u32 data);
80 83
81/* 84/*
85 * R-Car DMA
86 */
87struct rsnd_dma {
88 struct rsnd_priv *priv;
89 struct sh_dmae_slave slave;
90 struct work_struct work;
91 struct dma_chan *chan;
92 enum dma_data_direction dir;
93 int (*inquiry)(struct rsnd_dma *dma, dma_addr_t *buf, int *len);
94 int (*complete)(struct rsnd_dma *dma);
95
96 int submit_loop;
97};
98
99void rsnd_dma_start(struct rsnd_dma *dma);
100void rsnd_dma_stop(struct rsnd_dma *dma);
101int rsnd_dma_available(struct rsnd_dma *dma);
102int rsnd_dma_init(struct rsnd_priv *priv, struct rsnd_dma *dma,
103 int is_play, int id,
104 int (*inquiry)(struct rsnd_dma *dma, dma_addr_t *buf, int *len),
105 int (*complete)(struct rsnd_dma *dma));
106void rsnd_dma_quit(struct rsnd_priv *priv,
107 struct rsnd_dma *dma);
108
109
110/*
82 * R-Car sound mod 111 * R-Car sound mod
83 */ 112 */
84 113
@@ -103,9 +132,12 @@ struct rsnd_mod {
103 struct rsnd_priv *priv; 132 struct rsnd_priv *priv;
104 struct rsnd_mod_ops *ops; 133 struct rsnd_mod_ops *ops;
105 struct list_head list; /* connect to rsnd_dai playback/capture */ 134 struct list_head list; /* connect to rsnd_dai playback/capture */
135 struct rsnd_dma dma;
106}; 136};
107 137
108#define rsnd_mod_to_priv(mod) ((mod)->priv) 138#define rsnd_mod_to_priv(mod) ((mod)->priv)
139#define rsnd_mod_to_dma(mod) (&(mod)->dma)
140#define rsnd_dma_to_mod(_dma) container_of((_dma), struct rsnd_mod, dma)
109#define rsnd_mod_id(mod) ((mod)->id) 141#define rsnd_mod_id(mod) ((mod)->id)
110#define for_each_rsnd_mod(pos, n, io) \ 142#define for_each_rsnd_mod(pos, n, io) \
111 list_for_each_entry_safe(pos, n, &(io)->head, list) 143 list_for_each_entry_safe(pos, n, &(io)->head, list)