18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */
28c2ecf20Sopenharmony_ci/*
38c2ecf20Sopenharmony_ci * mtk-afe-fe-dais.h  --  Mediatek afe fe dai operator definition
48c2ecf20Sopenharmony_ci *
58c2ecf20Sopenharmony_ci * Copyright (c) 2016 MediaTek Inc.
68c2ecf20Sopenharmony_ci * Author: Garlic Tseng <garlic.tseng@mediatek.com>
78c2ecf20Sopenharmony_ci */
88c2ecf20Sopenharmony_ci
98c2ecf20Sopenharmony_ci#ifndef _MTK_AFE_FE_DAI_H_
108c2ecf20Sopenharmony_ci#define _MTK_AFE_FE_DAI_H_
118c2ecf20Sopenharmony_ci
128c2ecf20Sopenharmony_cistruct snd_soc_dai_ops;
138c2ecf20Sopenharmony_cistruct mtk_base_afe;
148c2ecf20Sopenharmony_cistruct mtk_base_afe_memif;
158c2ecf20Sopenharmony_ci
168c2ecf20Sopenharmony_ciint mtk_afe_fe_startup(struct snd_pcm_substream *substream,
178c2ecf20Sopenharmony_ci		       struct snd_soc_dai *dai);
188c2ecf20Sopenharmony_civoid mtk_afe_fe_shutdown(struct snd_pcm_substream *substream,
198c2ecf20Sopenharmony_ci			 struct snd_soc_dai *dai);
208c2ecf20Sopenharmony_ciint mtk_afe_fe_hw_params(struct snd_pcm_substream *substream,
218c2ecf20Sopenharmony_ci			 struct snd_pcm_hw_params *params,
228c2ecf20Sopenharmony_ci			 struct snd_soc_dai *dai);
238c2ecf20Sopenharmony_ciint mtk_afe_fe_hw_free(struct snd_pcm_substream *substream,
248c2ecf20Sopenharmony_ci		       struct snd_soc_dai *dai);
258c2ecf20Sopenharmony_ciint mtk_afe_fe_prepare(struct snd_pcm_substream *substream,
268c2ecf20Sopenharmony_ci		       struct snd_soc_dai *dai);
278c2ecf20Sopenharmony_ciint mtk_afe_fe_trigger(struct snd_pcm_substream *substream, int cmd,
288c2ecf20Sopenharmony_ci		       struct snd_soc_dai *dai);
298c2ecf20Sopenharmony_ci
308c2ecf20Sopenharmony_ciextern const struct snd_soc_dai_ops mtk_afe_fe_ops;
318c2ecf20Sopenharmony_ci
328c2ecf20Sopenharmony_ciint mtk_dynamic_irq_acquire(struct mtk_base_afe *afe);
338c2ecf20Sopenharmony_ciint mtk_dynamic_irq_release(struct mtk_base_afe *afe, int irq_id);
348c2ecf20Sopenharmony_ciint mtk_afe_suspend(struct snd_soc_component *component);
358c2ecf20Sopenharmony_ciint mtk_afe_resume(struct snd_soc_component *component);
368c2ecf20Sopenharmony_ci
378c2ecf20Sopenharmony_ciint mtk_memif_set_enable(struct mtk_base_afe *afe, int id);
388c2ecf20Sopenharmony_ciint mtk_memif_set_disable(struct mtk_base_afe *afe, int id);
398c2ecf20Sopenharmony_ciint mtk_memif_set_addr(struct mtk_base_afe *afe, int id,
408c2ecf20Sopenharmony_ci		       unsigned char *dma_area,
418c2ecf20Sopenharmony_ci		       dma_addr_t dma_addr,
428c2ecf20Sopenharmony_ci		       size_t dma_bytes);
438c2ecf20Sopenharmony_ciint mtk_memif_set_channel(struct mtk_base_afe *afe,
448c2ecf20Sopenharmony_ci			  int id, unsigned int channel);
458c2ecf20Sopenharmony_ciint mtk_memif_set_rate(struct mtk_base_afe *afe,
468c2ecf20Sopenharmony_ci		       int id, unsigned int rate);
478c2ecf20Sopenharmony_ciint mtk_memif_set_rate_substream(struct snd_pcm_substream *substream,
488c2ecf20Sopenharmony_ci				 int id, unsigned int rate);
498c2ecf20Sopenharmony_ciint mtk_memif_set_format(struct mtk_base_afe *afe,
508c2ecf20Sopenharmony_ci			 int id, snd_pcm_format_t format);
518c2ecf20Sopenharmony_ciint mtk_memif_set_pbuf_size(struct mtk_base_afe *afe,
528c2ecf20Sopenharmony_ci			    int id, int pbuf_size);
538c2ecf20Sopenharmony_ci#endif
54