diff options
author | Lars-Peter Clausen <lars@metafoo.de> | 2013-04-03 05:06:02 -0400 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2013-04-03 13:12:33 -0400 |
commit | 85c9f9c5f9d09ea43daf4f1a8b81d3c7b7394d27 (patch) | |
tree | 832dd28c2f8e763d4a9fc62559db8454af04abef /include/sound/dmaengine_pcm.h | |
parent | 5fa70f71dbf33603b0d29b33d8da128b266eb733 (diff) |
ASoC: dmaengine-pcm: Add a common DAI DMA data struct
This patch adds a common DMA data struct which can be used by DAI drivers to
communicate their DMA configuration requirements to the DMA pcm driver. Having
a common data structure for this allows us to implement common functions on top
of them, which can be used by multiple platforms.
This patch also introduces a new function to initialize certain fields of a
dma_slave_config struct from the common DAI DMA data struct.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Reviewed-by: Stephen Warren <swarren@nvidia.com>
Tested-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'include/sound/dmaengine_pcm.h')
-rw-r--r-- | include/sound/dmaengine_pcm.h | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/include/sound/dmaengine_pcm.h b/include/sound/dmaengine_pcm.h index f8a70312adb8..95620428a59b 100644 --- a/include/sound/dmaengine_pcm.h +++ b/include/sound/dmaengine_pcm.h | |||
@@ -44,4 +44,28 @@ int snd_dmaengine_pcm_close(struct snd_pcm_substream *substream); | |||
44 | 44 | ||
45 | struct dma_chan *snd_dmaengine_pcm_get_chan(struct snd_pcm_substream *substream); | 45 | struct dma_chan *snd_dmaengine_pcm_get_chan(struct snd_pcm_substream *substream); |
46 | 46 | ||
47 | /** | ||
48 | * struct snd_dmaengine_dai_dma_data - DAI DMA configuration data | ||
49 | * @addr: Address of the DAI data source or destination register. | ||
50 | * @addr_width: Width of the DAI data source or destination register. | ||
51 | * @maxburst: Maximum number of words(note: words, as in units of the | ||
52 | * src_addr_width member, not bytes) that can be send to or received from the | ||
53 | * DAI in one burst. | ||
54 | * @slave_id: Slave requester id for the DMA channel. | ||
55 | * @filter_data: Custom DMA channel filter data, this will usually be used when | ||
56 | * requesting the DMA channel. | ||
57 | */ | ||
58 | struct snd_dmaengine_dai_dma_data { | ||
59 | dma_addr_t addr; | ||
60 | enum dma_slave_buswidth addr_width; | ||
61 | u32 maxburst; | ||
62 | unsigned int slave_id; | ||
63 | void *filter_data; | ||
64 | }; | ||
65 | |||
66 | void snd_dmaengine_pcm_set_config_from_dai_data( | ||
67 | const struct snd_pcm_substream *substream, | ||
68 | const struct snd_dmaengine_dai_dma_data *dma_data, | ||
69 | struct dma_slave_config *config); | ||
70 | |||
47 | #endif | 71 | #endif |