^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) /* SPDX-License-Identifier: GPL-2.0 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) * mtk-afe-fe-dais.h -- Mediatek afe fe dai operator definition
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) * Copyright (c) 2016 MediaTek Inc.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) * Author: Garlic Tseng <garlic.tseng@mediatek.com>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9) #ifndef _MTK_AFE_FE_DAI_H_
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) #define _MTK_AFE_FE_DAI_H_
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) struct snd_soc_dai_ops;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) struct mtk_base_afe;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) struct mtk_base_afe_memif;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) int mtk_afe_fe_startup(struct snd_pcm_substream *substream,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) struct snd_soc_dai *dai);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) void mtk_afe_fe_shutdown(struct snd_pcm_substream *substream,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) struct snd_soc_dai *dai);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) int mtk_afe_fe_hw_params(struct snd_pcm_substream *substream,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) struct snd_pcm_hw_params *params,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) struct snd_soc_dai *dai);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) int mtk_afe_fe_hw_free(struct snd_pcm_substream *substream,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) struct snd_soc_dai *dai);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) int mtk_afe_fe_prepare(struct snd_pcm_substream *substream,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) struct snd_soc_dai *dai);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) int mtk_afe_fe_trigger(struct snd_pcm_substream *substream, int cmd,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) struct snd_soc_dai *dai);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) extern const struct snd_soc_dai_ops mtk_afe_fe_ops;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) int mtk_dynamic_irq_acquire(struct mtk_base_afe *afe);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) int mtk_dynamic_irq_release(struct mtk_base_afe *afe, int irq_id);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) int mtk_afe_suspend(struct snd_soc_component *component);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) int mtk_afe_resume(struct snd_soc_component *component);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) int mtk_memif_set_enable(struct mtk_base_afe *afe, int id);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) int mtk_memif_set_disable(struct mtk_base_afe *afe, int id);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) int mtk_memif_set_addr(struct mtk_base_afe *afe, int id,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) unsigned char *dma_area,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) dma_addr_t dma_addr,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) size_t dma_bytes);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) int mtk_memif_set_channel(struct mtk_base_afe *afe,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) int id, unsigned int channel);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) int mtk_memif_set_rate(struct mtk_base_afe *afe,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) int id, unsigned int rate);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47) int mtk_memif_set_rate_substream(struct snd_pcm_substream *substream,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48) int id, unsigned int rate);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49) int mtk_memif_set_format(struct mtk_base_afe *afe,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50) int id, snd_pcm_format_t format);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51) int mtk_memif_set_pbuf_size(struct mtk_base_afe *afe,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52) int id, int pbuf_size);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) #endif