xref: /linux/sound/soc/meson/aiu-fifo.h (revision 4e9903b0861c9df3464b82db4a7025863bac1897)
1 /* SPDX-License-Identifier: (GPL-2.0 OR MIT) */
2 /*
3  * Copyright (c) 2020 BayLibre, SAS.
4  * Author: Jerome Brunet <jbrunet@baylibre.com>
5  */
6 
7 #ifndef _MESON_AIU_FIFO_H
8 #define _MESON_AIU_FIFO_H
9 
10 struct snd_pcm_hardware;
11 struct snd_soc_component_driver;
12 struct snd_soc_dai_driver;
13 struct clk;
14 struct snd_pcm_ops;
15 struct snd_pcm_substream;
16 struct snd_soc_dai;
17 struct snd_pcm_hw_params;
18 struct platform_device;
19 
20 struct aiu_fifo {
21 	const struct snd_pcm_hardware *pcm;
22 	unsigned int mem_offset;
23 	unsigned int fifo_block;
24 	struct clk *pclk;
25 	int irq;
26 };
27 
28 int aiu_fifo_dai_probe(struct snd_soc_dai *dai);
29 int aiu_fifo_dai_remove(struct snd_soc_dai *dai);
30 
31 snd_pcm_uframes_t aiu_fifo_pointer(struct snd_soc_component *component,
32 				   struct snd_pcm_substream *substream);
33 
34 int aiu_fifo_trigger(struct snd_pcm_substream *substream, int cmd,
35 		     struct snd_soc_dai *dai);
36 int aiu_fifo_prepare(struct snd_pcm_substream *substream,
37 		     struct snd_soc_dai *dai);
38 int aiu_fifo_hw_params(struct snd_pcm_substream *substream,
39 		       struct snd_pcm_hw_params *params,
40 		       struct snd_soc_dai *dai);
41 int aiu_fifo_hw_free(struct snd_pcm_substream *substream,
42 		     struct snd_soc_dai *dai);
43 int aiu_fifo_startup(struct snd_pcm_substream *substream,
44 		     struct snd_soc_dai *dai);
45 void aiu_fifo_shutdown(struct snd_pcm_substream *substream,
46 		       struct snd_soc_dai *dai);
47 int aiu_fifo_pcm_new(struct snd_soc_pcm_runtime *rtd,
48 		     struct snd_soc_dai *dai);
49 
50 #endif /* _MESON_AIU_FIFO_H */
51