1 /* SPDX-License-Identifier: GPL-2.0 */
3 * mt8183-afe-common.h -- Mediatek 8183 audio driver definitions
5 * Copyright (c) 2018 MediaTek Inc.
6 * Author: KaiChieh Chuang <kaichieh.chuang@mediatek.com>
9 #ifndef _MT_8183_AFE_COMMON_H_
10 #define _MT_8183_AFE_COMMON_H_
12 #include <sound/soc.h>
13 #include <linux/list.h>
14 #include <linux/regmap.h>
15 #include "../common/mtk-base-afe.h"
28 MT8183_DAI_ADDA
= MT8183_MEMIF_NUM
,
37 MT8183_DAI_HOSTLESS_LPBK
,
38 MT8183_DAI_HOSTLESS_SPEECH
,
51 MT8183_IRQ_8
, /* hw bundle to TDM */
58 MT8183_MTKAIF_PROTOCOL_1
= 0,
59 MT8183_MTKAIF_PROTOCOL_2
,
60 MT8183_MTKAIF_PROTOCOL_2_CLK_P2
,
77 struct mt8183_afe_private
{
80 int pm_runtime_bypass_reg_ctl
;
83 void *dai_priv
[MT8183_DAI_NUM
];
87 int mtkaif_calibration_ok
;
88 int mtkaif_chosen_phase
[4];
89 int mtkaif_phase_cycle
[4];
90 int mtkaif_calibration_num_phase
;
94 int mck_rate
[MT8183_MCK_NUM
];
97 unsigned int mt8183_general_rate_transform(struct device
*dev
,
99 unsigned int mt8183_rate_transform(struct device
*dev
,
100 unsigned int rate
, int aud_blk
);
103 int mt8183_dai_adda_register(struct mtk_base_afe
*afe
);
104 int mt8183_dai_pcm_register(struct mtk_base_afe
*afe
);
105 int mt8183_dai_i2s_register(struct mtk_base_afe
*afe
);
106 int mt8183_dai_tdm_register(struct mtk_base_afe
*afe
);
107 int mt8183_dai_hostless_register(struct mtk_base_afe
*afe
);