hc
2023-12-11 d2ccde1c8e90d38cee87a1b0309ad2827f3fd30d
kernel/include/sound/dmaengine_pcm.h
....@@ -66,6 +66,9 @@
6666 * @chan_name: Custom channel name to use when requesting DMA channel.
6767 * @fifo_size: FIFO size of the DAI controller in bytes
6868 * @flags: PCM_DAI flags, only SND_DMAENGINE_PCM_DAI_FLAG_PACK for now
69
+ * @peripheral_config: peripheral configuration for programming peripheral
70
+ * for dmaengine transfer
71
+ * @peripheral_size: peripheral configuration buffer size
6972 */
7073 struct snd_dmaengine_dai_dma_data {
7174 dma_addr_t addr;
....@@ -76,6 +79,8 @@
7679 const char *chan_name;
7780 unsigned int fifo_size;
7881 unsigned int flags;
82
+ void *peripheral_config;
83
+ size_t peripheral_size;
7984 };
8085
8186 void snd_dmaengine_pcm_set_config_from_dai_data(
....@@ -83,6 +88,11 @@
8388 const struct snd_dmaengine_dai_dma_data *dma_data,
8489 struct dma_slave_config *config);
8590
91
+int snd_dmaengine_pcm_refine_runtime_hwparams(
92
+ struct snd_pcm_substream *substream,
93
+ struct snd_dmaengine_dai_dma_data *dma_data,
94
+ struct snd_pcm_hardware *hw,
95
+ struct dma_chan *chan);
8696
8797 /*
8898 * Try to request the DMA channel using compat_request_channel or
....@@ -99,10 +109,6 @@
99109 * playback.
100110 */
101111 #define SND_DMAENGINE_PCM_FLAG_HALF_DUPLEX BIT(3)
102
-/*
103
- * The PCM streams have custom channel names specified.
104
- */
105
-#define SND_DMAENGINE_PCM_FLAG_CUSTOM_CHANNEL_NAME BIT(4)
106112
107113 /**
108114 * struct snd_dmaengine_pcm_config - Configuration data for dmaengine based PCM
....@@ -160,4 +166,15 @@
160166
161167 #define SND_DMAENGINE_PCM_DRV_NAME "snd_dmaengine_pcm"
162168
169
+struct dmaengine_pcm {
170
+ struct dma_chan *chan[SNDRV_PCM_STREAM_LAST + 1];
171
+ const struct snd_dmaengine_pcm_config *config;
172
+ struct snd_soc_component component;
173
+ unsigned int flags;
174
+};
175
+
176
+static inline struct dmaengine_pcm *soc_component_to_pcm(struct snd_soc_component *p)
177
+{
178
+ return container_of(p, struct dmaengine_pcm, component);
179
+}
163180 #endif