| .. | .. |
|---|
| 66 | 66 | * @chan_name: Custom channel name to use when requesting DMA channel. |
|---|
| 67 | 67 | * @fifo_size: FIFO size of the DAI controller in bytes |
|---|
| 68 | 68 | * @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 |
|---|
| 69 | 72 | */ |
|---|
| 70 | 73 | struct snd_dmaengine_dai_dma_data { |
|---|
| 71 | 74 | dma_addr_t addr; |
|---|
| .. | .. |
|---|
| 76 | 79 | const char *chan_name; |
|---|
| 77 | 80 | unsigned int fifo_size; |
|---|
| 78 | 81 | unsigned int flags; |
|---|
| 82 | + void *peripheral_config; |
|---|
| 83 | + size_t peripheral_size; |
|---|
| 79 | 84 | }; |
|---|
| 80 | 85 | |
|---|
| 81 | 86 | void snd_dmaengine_pcm_set_config_from_dai_data( |
|---|
| .. | .. |
|---|
| 83 | 88 | const struct snd_dmaengine_dai_dma_data *dma_data, |
|---|
| 84 | 89 | struct dma_slave_config *config); |
|---|
| 85 | 90 | |
|---|
| 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); |
|---|
| 86 | 96 | |
|---|
| 87 | 97 | /* |
|---|
| 88 | 98 | * Try to request the DMA channel using compat_request_channel or |
|---|
| .. | .. |
|---|
| 99 | 109 | * playback. |
|---|
| 100 | 110 | */ |
|---|
| 101 | 111 | #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) |
|---|
| 106 | 112 | |
|---|
| 107 | 113 | /** |
|---|
| 108 | 114 | * struct snd_dmaengine_pcm_config - Configuration data for dmaengine based PCM |
|---|
| .. | .. |
|---|
| 160 | 166 | |
|---|
| 161 | 167 | #define SND_DMAENGINE_PCM_DRV_NAME "snd_dmaengine_pcm" |
|---|
| 162 | 168 | |
|---|
| 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 | +} |
|---|
| 163 | 180 | #endif |
|---|