Lines Matching +full:fifo +full:- +full:size

1 // SPDX-License-Identifier: GPL-2.0
10 #include <sound/soc-dai.h>
12 #include "aiu-fifo.h"
27 struct snd_soc_pcm_runtime *rtd = ss->private_data; in aiu_fifo_dai()
36 struct aiu_fifo *fifo = dai->playback_dma_data; in aiu_fifo_pointer() local
37 struct snd_pcm_runtime *runtime = substream->runtime; in aiu_fifo_pointer()
40 addr = snd_soc_component_read(component, fifo->mem_offset + AIU_MEM_RD); in aiu_fifo_pointer()
42 return bytes_to_frames(runtime, addr - (unsigned int)runtime->dma_addr); in aiu_fifo_pointer()
47 struct snd_soc_component *component = dai->component; in aiu_fifo_enable()
48 struct aiu_fifo *fifo = dai->playback_dma_data; in aiu_fifo_enable() local
53 fifo->mem_offset + AIU_MEM_CONTROL, in aiu_fifo_enable()
72 return -EINVAL; in aiu_fifo_trigger()
81 struct snd_soc_component *component = dai->component; in aiu_fifo_prepare()
82 struct aiu_fifo *fifo = dai->playback_dma_data; in aiu_fifo_prepare() local
85 fifo->mem_offset + AIU_MEM_CONTROL, in aiu_fifo_prepare()
89 fifo->mem_offset + AIU_MEM_CONTROL, in aiu_fifo_prepare()
98 struct snd_pcm_runtime *runtime = substream->runtime; in aiu_fifo_hw_params()
99 struct snd_soc_component *component = dai->component; in aiu_fifo_hw_params()
100 struct aiu_fifo *fifo = dai->playback_dma_data; in aiu_fifo_hw_params() local
108 /* Setup the fifo boundaries */ in aiu_fifo_hw_params()
109 end = runtime->dma_addr + runtime->dma_bytes - fifo->fifo_block; in aiu_fifo_hw_params()
110 snd_soc_component_write(component, fifo->mem_offset + AIU_MEM_START, in aiu_fifo_hw_params()
111 runtime->dma_addr); in aiu_fifo_hw_params()
112 snd_soc_component_write(component, fifo->mem_offset + AIU_MEM_RD, in aiu_fifo_hw_params()
113 runtime->dma_addr); in aiu_fifo_hw_params()
114 snd_soc_component_write(component, fifo->mem_offset + AIU_MEM_END, in aiu_fifo_hw_params()
117 /* Setup the fifo to read all the memory - no skip */ in aiu_fifo_hw_params()
119 fifo->mem_offset + AIU_MEM_MASKS, in aiu_fifo_hw_params()
145 struct aiu_fifo *fifo = dai->playback_dma_data; in aiu_fifo_startup() local
148 snd_soc_set_runtime_hwparams(substream, fifo->pcm); in aiu_fifo_startup()
151 * Make sure the buffer and period size are multiple of the fifo burst in aiu_fifo_startup()
152 * size in aiu_fifo_startup()
154 ret = snd_pcm_hw_constraint_step(substream->runtime, 0, in aiu_fifo_startup()
156 fifo->fifo_block); in aiu_fifo_startup()
160 ret = snd_pcm_hw_constraint_step(substream->runtime, 0, in aiu_fifo_startup()
162 fifo->fifo_block); in aiu_fifo_startup()
166 ret = clk_prepare_enable(fifo->pclk); in aiu_fifo_startup()
170 ret = request_irq(fifo->irq, aiu_fifo_isr, 0, dev_name(dai->dev), in aiu_fifo_startup()
173 clk_disable_unprepare(fifo->pclk); in aiu_fifo_startup()
181 struct aiu_fifo *fifo = dai->playback_dma_data; in aiu_fifo_shutdown() local
183 free_irq(fifo->irq, substream); in aiu_fifo_shutdown()
184 clk_disable_unprepare(fifo->pclk); in aiu_fifo_shutdown()
191 rtd->pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream; in aiu_fifo_pcm_new()
192 struct snd_card *card = rtd->card->snd_card; in aiu_fifo_pcm_new()
193 struct aiu_fifo *fifo = dai->playback_dma_data; in aiu_fifo_pcm_new() local
194 size_t size = fifo->pcm->buffer_bytes_max; in aiu_fifo_pcm_new() local
198 card->dev, size, size); in aiu_fifo_pcm_new()
205 struct aiu_fifo *fifo; in aiu_fifo_dai_probe() local
207 fifo = kzalloc(sizeof(*fifo), GFP_KERNEL); in aiu_fifo_dai_probe()
208 if (!fifo) in aiu_fifo_dai_probe()
209 return -ENOMEM; in aiu_fifo_dai_probe()
211 dai->playback_dma_data = fifo; in aiu_fifo_dai_probe()
218 kfree(dai->playback_dma_data); in aiu_fifo_dai_remove()