xref: /linux/sound/soc/mediatek/mt6797/mt6797-afe-common.h (revision e7d759f31ca295d589f7420719c311870bb3166f)
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/list.h>
14 #include <linux/regmap.h>
15 #include "../common/mtk-base-afe.h"
16 
17 enum {
18 	MT6797_MEMIF_DL1,
19 	MT6797_MEMIF_DL2,
20 	MT6797_MEMIF_DL3,
21 	MT6797_MEMIF_VUL,
22 	MT6797_MEMIF_AWB,
23 	MT6797_MEMIF_VUL12,
24 	MT6797_MEMIF_DAI,
25 	MT6797_MEMIF_MOD_DAI,
26 	MT6797_MEMIF_NUM,
27 	MT6797_DAI_ADDA = MT6797_MEMIF_NUM,
28 	MT6797_DAI_PCM_1,
29 	MT6797_DAI_PCM_2,
30 	MT6797_DAI_HOSTLESS_LPBK,
31 	MT6797_DAI_HOSTLESS_SPEECH,
32 	MT6797_DAI_NUM,
33 };
34 
35 enum {
36 	MT6797_IRQ_1,
37 	MT6797_IRQ_2,
38 	MT6797_IRQ_3,
39 	MT6797_IRQ_4,
40 	MT6797_IRQ_7,
41 	MT6797_IRQ_NUM,
42 };
43 
44 struct clk;
45 
46 struct mt6797_afe_private {
47 	struct clk **clk;
48 };
49 
50 unsigned int mt6797_general_rate_transform(struct device *dev,
51 					   unsigned int rate);
52 unsigned int mt6797_rate_transform(struct device *dev,
53 				   unsigned int rate, int aud_blk);
54 
55 /* dai register */
56 int mt6797_dai_adda_register(struct mtk_base_afe *afe);
57 int mt6797_dai_pcm_register(struct mtk_base_afe *afe);
58 int mt6797_dai_hostless_register(struct mtk_base_afe *afe);
59 #endif
60