xref: /linux/sound/soc/meson/aiu-fifo.h (revision 7b5ce9f0c52a5885d34d46bba62e9eaedc3dd459)
16ae9ca9cSJerome Brunet /* SPDX-License-Identifier: (GPL-2.0 OR MIT) */
26ae9ca9cSJerome Brunet /*
36ae9ca9cSJerome Brunet  * Copyright (c) 2020 BayLibre, SAS.
46ae9ca9cSJerome Brunet  * Author: Jerome Brunet <jbrunet@baylibre.com>
56ae9ca9cSJerome Brunet  */
66ae9ca9cSJerome Brunet 
76ae9ca9cSJerome Brunet #ifndef _MESON_AIU_FIFO_H
86ae9ca9cSJerome Brunet #define _MESON_AIU_FIFO_H
96ae9ca9cSJerome Brunet 
106ae9ca9cSJerome Brunet struct snd_pcm_hardware;
116ae9ca9cSJerome Brunet struct snd_soc_component_driver;
126ae9ca9cSJerome Brunet struct snd_soc_dai_driver;
136ae9ca9cSJerome Brunet struct clk;
146ae9ca9cSJerome Brunet struct snd_pcm_ops;
156ae9ca9cSJerome Brunet struct snd_pcm_substream;
166ae9ca9cSJerome Brunet struct snd_soc_dai;
176ae9ca9cSJerome Brunet struct snd_pcm_hw_params;
186ae9ca9cSJerome Brunet struct platform_device;
196ae9ca9cSJerome Brunet 
206ae9ca9cSJerome Brunet struct aiu_fifo {
21*7b5ce9f0SKrzysztof Kozlowski 	const struct snd_pcm_hardware *pcm;
226ae9ca9cSJerome Brunet 	unsigned int mem_offset;
236ae9ca9cSJerome Brunet 	unsigned int fifo_block;
246ae9ca9cSJerome Brunet 	struct clk *pclk;
256ae9ca9cSJerome Brunet 	int irq;
266ae9ca9cSJerome Brunet };
276ae9ca9cSJerome Brunet 
286ae9ca9cSJerome Brunet int aiu_fifo_dai_probe(struct snd_soc_dai *dai);
296ae9ca9cSJerome Brunet int aiu_fifo_dai_remove(struct snd_soc_dai *dai);
306ae9ca9cSJerome Brunet 
316ae9ca9cSJerome Brunet snd_pcm_uframes_t aiu_fifo_pointer(struct snd_soc_component *component,
326ae9ca9cSJerome Brunet 				   struct snd_pcm_substream *substream);
336ae9ca9cSJerome Brunet 
346ae9ca9cSJerome Brunet int aiu_fifo_trigger(struct snd_pcm_substream *substream, int cmd,
356ae9ca9cSJerome Brunet 		     struct snd_soc_dai *dai);
366ae9ca9cSJerome Brunet int aiu_fifo_prepare(struct snd_pcm_substream *substream,
376ae9ca9cSJerome Brunet 		     struct snd_soc_dai *dai);
386ae9ca9cSJerome Brunet int aiu_fifo_hw_params(struct snd_pcm_substream *substream,
396ae9ca9cSJerome Brunet 		       struct snd_pcm_hw_params *params,
406ae9ca9cSJerome Brunet 		       struct snd_soc_dai *dai);
416ae9ca9cSJerome Brunet int aiu_fifo_hw_free(struct snd_pcm_substream *substream,
426ae9ca9cSJerome Brunet 		     struct snd_soc_dai *dai);
436ae9ca9cSJerome Brunet int aiu_fifo_startup(struct snd_pcm_substream *substream,
446ae9ca9cSJerome Brunet 		     struct snd_soc_dai *dai);
456ae9ca9cSJerome Brunet void aiu_fifo_shutdown(struct snd_pcm_substream *substream,
466ae9ca9cSJerome Brunet 		       struct snd_soc_dai *dai);
476ae9ca9cSJerome Brunet int aiu_fifo_pcm_new(struct snd_soc_pcm_runtime *rtd,
486ae9ca9cSJerome Brunet 		     struct snd_soc_dai *dai);
496ae9ca9cSJerome Brunet 
506ae9ca9cSJerome Brunet #endif /* _MESON_AIU_FIFO_H */
51