18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: (GPL-2.0 OR MIT) */
28c2ecf20Sopenharmony_ci/*
38c2ecf20Sopenharmony_ci * Copyright (c) 2020 BayLibre, SAS.
48c2ecf20Sopenharmony_ci * Author: Jerome Brunet <jbrunet@baylibre.com>
58c2ecf20Sopenharmony_ci */
68c2ecf20Sopenharmony_ci
78c2ecf20Sopenharmony_ci#ifndef _MESON_AIU_FIFO_H
88c2ecf20Sopenharmony_ci#define _MESON_AIU_FIFO_H
98c2ecf20Sopenharmony_ci
108c2ecf20Sopenharmony_cistruct snd_pcm_hardware;
118c2ecf20Sopenharmony_cistruct snd_soc_component_driver;
128c2ecf20Sopenharmony_cistruct snd_soc_dai_driver;
138c2ecf20Sopenharmony_cistruct clk;
148c2ecf20Sopenharmony_cistruct snd_pcm_ops;
158c2ecf20Sopenharmony_cistruct snd_pcm_substream;
168c2ecf20Sopenharmony_cistruct snd_soc_dai;
178c2ecf20Sopenharmony_cistruct snd_pcm_hw_params;
188c2ecf20Sopenharmony_cistruct platform_device;
198c2ecf20Sopenharmony_ci
208c2ecf20Sopenharmony_cistruct aiu_fifo {
218c2ecf20Sopenharmony_ci	struct snd_pcm_hardware *pcm;
228c2ecf20Sopenharmony_ci	unsigned int mem_offset;
238c2ecf20Sopenharmony_ci	unsigned int fifo_block;
248c2ecf20Sopenharmony_ci	struct clk *pclk;
258c2ecf20Sopenharmony_ci	int irq;
268c2ecf20Sopenharmony_ci};
278c2ecf20Sopenharmony_ci
288c2ecf20Sopenharmony_ciint aiu_fifo_dai_probe(struct snd_soc_dai *dai);
298c2ecf20Sopenharmony_ciint aiu_fifo_dai_remove(struct snd_soc_dai *dai);
308c2ecf20Sopenharmony_ci
318c2ecf20Sopenharmony_cisnd_pcm_uframes_t aiu_fifo_pointer(struct snd_soc_component *component,
328c2ecf20Sopenharmony_ci				   struct snd_pcm_substream *substream);
338c2ecf20Sopenharmony_ci
348c2ecf20Sopenharmony_ciint aiu_fifo_trigger(struct snd_pcm_substream *substream, int cmd,
358c2ecf20Sopenharmony_ci		     struct snd_soc_dai *dai);
368c2ecf20Sopenharmony_ciint aiu_fifo_prepare(struct snd_pcm_substream *substream,
378c2ecf20Sopenharmony_ci		     struct snd_soc_dai *dai);
388c2ecf20Sopenharmony_ciint aiu_fifo_hw_params(struct snd_pcm_substream *substream,
398c2ecf20Sopenharmony_ci		       struct snd_pcm_hw_params *params,
408c2ecf20Sopenharmony_ci		       struct snd_soc_dai *dai);
418c2ecf20Sopenharmony_ciint aiu_fifo_hw_free(struct snd_pcm_substream *substream,
428c2ecf20Sopenharmony_ci		     struct snd_soc_dai *dai);
438c2ecf20Sopenharmony_ciint aiu_fifo_startup(struct snd_pcm_substream *substream,
448c2ecf20Sopenharmony_ci		     struct snd_soc_dai *dai);
458c2ecf20Sopenharmony_civoid aiu_fifo_shutdown(struct snd_pcm_substream *substream,
468c2ecf20Sopenharmony_ci		       struct snd_soc_dai *dai);
478c2ecf20Sopenharmony_ciint aiu_fifo_pcm_new(struct snd_soc_pcm_runtime *rtd,
488c2ecf20Sopenharmony_ci		     struct snd_soc_dai *dai);
498c2ecf20Sopenharmony_ci
508c2ecf20Sopenharmony_ci#endif /* _MESON_AIU_FIFO_H */
51