mt_lp_api.c 829 B

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