blob: 860b6234ada9eed18df23312d59835bae5536a64 [file] [log] [blame]
xjb04a4022021-11-25 15:01:52 +08001/* SPDX-License-Identifier: GPL-2.0 */
2/*
3 * Copyright (c) 2019 MediaTek Inc.
4 * Author: Anthony Huang <anthony.huang@mediatek.com>
5 */
6#ifndef MTK_MMQOS_H
7#define MTK_MMQOS_H
8
9enum hrt_type {
10 HRT_MD,
11 HRT_CAM,
12 HRT_DISP,
13 HRT_TYPE_NUM
14};
15
16enum {
17 BW_THROTTLE_START = 1,
18 BW_THROTTLE_START_RECOVER,
19 BW_THROTTLE_END
20};
21
22#if IS_ENABLED(CONFIG_INTERCONNECT_MTK_MMQOS_COMMON)
23void mtk_mmqos_wait_throttle_done(void);
24s32 mtk_mmqos_set_hrt_bw(enum hrt_type type, u32 bw);
25s32 mtk_mmqos_get_avail_hrt_bw(enum hrt_type type);
26s32 mtk_mmqos_register_bw_throttle_notifier(struct notifier_block *nb);
27s32 mtk_mmqos_unregister_bw_throttle_notifier(struct notifier_block *nb);
28#else
29static inline void
30mtk_mmqos_wait_throttle_done(void) { return; }
31
32static inline s32
33mtk_mmqos_set_hrt_bw(enum hrt_type type, u32 bw) { return 0; }
34
35static inline s32
36mtk_mmqos_get_avail_hrt_bw(enum hrt_type type) { return -1; }
37
38static inline s32
39mtk_mmqos_register_bw_throttle_notifier(struct notifier_block *nb) { return 0; }
40
41static inline s32
42mtk_mmqos_unregister_bw_throttle_notifier(struct notifier_block *nb)
43{ return 0; }
44#endif
45
46#endif /* MTK_MMQOS_H */