blob: 2a1da6abe0b7250b832e903143acec9200ad1f39 [file] [log] [blame]
developer91bb08d2022-09-07 18:41:59 +08001/*
2 * Copyright (c) 2023, MediaTek Inc. All rights reserved.
3 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 */
6
7#include <lpm/mt_lp_api.h>
8
9int mt_audio_update(int type)
10{
11 int ret, val;
12
13 switch (type) {
14 case AUDIO_AFE_ENTER:
15 case AUDIO_AFE_LEAVE:
16 val = (type == AUDIO_AFE_ENTER) ? 1 : 0;
17 ret = mt_lp_rm_do_update(-1, PLAT_RC_IS_FMAUDIO, &val);
18 break;
19 case AUDIO_DSP_ENTER:
20 case AUDIO_DSP_LEAVE:
21 val = (type == AUDIO_DSP_ENTER) ? 1 : 0;
22 ret = mt_lp_rm_do_update(-1, PLAT_RC_IS_ADSP, &val);
23 break;
24 default:
25 ret = -1;
26 break;
27 }
28
29 return ret;
30}
31
32int mtk_usb_update(int type)
33{
34 int ret, val;
35
36 switch (type) {
37 case LPM_USB_ENTER:
38 case LPM_USB_LEAVE:
39 val = (type == LPM_USB_ENTER) ? 1 : 0;
40 ret = mt_lp_rm_do_update(-1, PLAT_RC_IS_USB_INFRA, &val);
41 break;
42 default:
43 ret = -1;
44 break;
45 }
46
47 return ret;
48}