18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */
28c2ecf20Sopenharmony_ci/*
38c2ecf20Sopenharmony_ci * mt8183-afe-clk.h  --  Mediatek 8183 afe clock ctrl definition
48c2ecf20Sopenharmony_ci *
58c2ecf20Sopenharmony_ci * Copyright (c) 2018 MediaTek Inc.
68c2ecf20Sopenharmony_ci * Author: KaiChieh Chuang <kaichieh.chuang@mediatek.com>
78c2ecf20Sopenharmony_ci */
88c2ecf20Sopenharmony_ci
98c2ecf20Sopenharmony_ci#ifndef _MT8183_AFE_CLK_H_
108c2ecf20Sopenharmony_ci#define _MT8183_AFE_CLK_H_
118c2ecf20Sopenharmony_ci
128c2ecf20Sopenharmony_ci/* APLL */
138c2ecf20Sopenharmony_ci#define APLL1_W_NAME "APLL1"
148c2ecf20Sopenharmony_ci#define APLL2_W_NAME "APLL2"
158c2ecf20Sopenharmony_cienum {
168c2ecf20Sopenharmony_ci	MT8183_APLL1 = 0,
178c2ecf20Sopenharmony_ci	MT8183_APLL2,
188c2ecf20Sopenharmony_ci};
198c2ecf20Sopenharmony_ci
208c2ecf20Sopenharmony_cistruct mtk_base_afe;
218c2ecf20Sopenharmony_ci
228c2ecf20Sopenharmony_ciint mt8183_init_clock(struct mtk_base_afe *afe);
238c2ecf20Sopenharmony_ciint mt8183_afe_enable_clock(struct mtk_base_afe *afe);
248c2ecf20Sopenharmony_ciint mt8183_afe_disable_clock(struct mtk_base_afe *afe);
258c2ecf20Sopenharmony_ci
268c2ecf20Sopenharmony_ciint mt8183_apll1_enable(struct mtk_base_afe *afe);
278c2ecf20Sopenharmony_civoid mt8183_apll1_disable(struct mtk_base_afe *afe);
288c2ecf20Sopenharmony_ci
298c2ecf20Sopenharmony_ciint mt8183_apll2_enable(struct mtk_base_afe *afe);
308c2ecf20Sopenharmony_civoid mt8183_apll2_disable(struct mtk_base_afe *afe);
318c2ecf20Sopenharmony_ci
328c2ecf20Sopenharmony_ciint mt8183_get_apll_rate(struct mtk_base_afe *afe, int apll);
338c2ecf20Sopenharmony_ciint mt8183_get_apll_by_rate(struct mtk_base_afe *afe, int rate);
348c2ecf20Sopenharmony_ciint mt8183_get_apll_by_name(struct mtk_base_afe *afe, const char *name);
358c2ecf20Sopenharmony_ci
368c2ecf20Sopenharmony_ciint mt8183_mck_enable(struct mtk_base_afe *afe, int mck_id, int rate);
378c2ecf20Sopenharmony_civoid mt8183_mck_disable(struct mtk_base_afe *afe, int mck_id);
388c2ecf20Sopenharmony_ci#endif
39