1 /* SPDX-License-Identifier: GPL-2.0 */
2 /*
3  * mt6797-afe-common.h  --  Mediatek 6797 audio driver definitions
4  *
5  * Copyright (c) 2018 MediaTek Inc.
6  * Author: KaiChieh Chuang <kaichieh.chuang@mediatek.com>
7  */
8 
9 #ifndef _MT_6797_AFE_COMMON_H_
10 #define _MT_6797_AFE_COMMON_H_
11 
12 #include <sound/soc.h>
13 #include <linux/regmap.h>
14 #include "../common/mtk-base-afe.h"
15 
16 enum {
17 	MT6797_MEMIF_DL1,
18 	MT6797_MEMIF_DL2,
19 	MT6797_MEMIF_DL3,
20 	MT6797_MEMIF_VUL,
21 	MT6797_MEMIF_AWB,
22 	MT6797_MEMIF_VUL12,
23 	MT6797_MEMIF_DAI,
24 	MT6797_MEMIF_MOD_DAI,
25 	MT6797_MEMIF_NUM,
26 	MT6797_DAI_ADDA = MT6797_MEMIF_NUM,
27 	MT6797_DAI_PCM_1,
28 	MT6797_DAI_PCM_2,
29 	MT6797_DAI_HOSTLESS_LPBK,
30 	MT6797_DAI_HOSTLESS_SPEECH,
31 	MT6797_DAI_NUM,
32 };
33 
34 enum {
35 	MT6797_IRQ_1,
36 	MT6797_IRQ_2,
37 	MT6797_IRQ_3,
38 	MT6797_IRQ_4,
39 	MT6797_IRQ_7,
40 	MT6797_IRQ_NUM,
41 };
42 
43 struct clk;
44 
45 struct mt6797_afe_private {
46 	struct clk **clk;
47 };
48 
49 unsigned int mt6797_general_rate_transform(struct device *dev,
50 					   unsigned int rate);
51 unsigned int mt6797_rate_transform(struct device *dev,
52 				   unsigned int rate, int aud_blk);
53 
54 /* dai register */
55 int mt6797_dai_adda_register(struct mtk_base_afe *afe);
56 int mt6797_dai_pcm_register(struct mtk_base_afe *afe);
57 int mt6797_dai_hostless_register(struct mtk_base_afe *afe);
58 #endif
59