| xj | b04a402 | 2021-11-25 15:01:52 +0800 | [diff] [blame] | 1 | /* 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 | |
| 9 | enum hrt_type { |
| 10 | HRT_MD, |
| 11 | HRT_CAM, |
| 12 | HRT_DISP, |
| 13 | HRT_TYPE_NUM |
| 14 | }; |
| 15 | |
| 16 | enum { |
| 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) |
| 23 | void mtk_mmqos_wait_throttle_done(void); |
| 24 | s32 mtk_mmqos_set_hrt_bw(enum hrt_type type, u32 bw); |
| 25 | s32 mtk_mmqos_get_avail_hrt_bw(enum hrt_type type); |
| 26 | s32 mtk_mmqos_register_bw_throttle_notifier(struct notifier_block *nb); |
| 27 | s32 mtk_mmqos_unregister_bw_throttle_notifier(struct notifier_block *nb); |
| 28 | #else |
| 29 | static inline void |
| 30 | mtk_mmqos_wait_throttle_done(void) { return; } |
| 31 | |
| 32 | static inline s32 |
| 33 | mtk_mmqos_set_hrt_bw(enum hrt_type type, u32 bw) { return 0; } |
| 34 | |
| 35 | static inline s32 |
| 36 | mtk_mmqos_get_avail_hrt_bw(enum hrt_type type) { return -1; } |
| 37 | |
| 38 | static inline s32 |
| 39 | mtk_mmqos_register_bw_throttle_notifier(struct notifier_block *nb) { return 0; } |
| 40 | |
| 41 | static inline s32 |
| 42 | mtk_mmqos_unregister_bw_throttle_notifier(struct notifier_block *nb) |
| 43 | { return 0; } |
| 44 | #endif |
| 45 | |
| 46 | #endif /* MTK_MMQOS_H */ |