audio.c 931 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /*
  2. * Copyright (c) 2022, MediaTek Inc. All rights reserved.
  3. *
  4. * SPDX-License-Identifier: BSD-3-Clause
  5. */
  6. #include <errno.h>
  7. #include <stdbool.h>
  8. #include <common/debug.h>
  9. #include <audio.h>
  10. #include <mtk_sip_svc.h>
  11. #define MODULE_TAG "[AUDIO]"
  12. static u_register_t audio_smc_handler(u_register_t x1, u_register_t x2,
  13. u_register_t x3, u_register_t x4,
  14. void *handle, struct smccc_res *smccc_ret)
  15. {
  16. uint32_t request_ops;
  17. int ret;
  18. request_ops = (uint32_t)x1;
  19. switch (request_ops) {
  20. case MTK_AUDIO_SMC_OP_DOMAIN_SIDEBANDS:
  21. ret = set_audio_domain_sidebands();
  22. break;
  23. default:
  24. ERROR("%s: %s: Unsupported request_ops %x\n",
  25. MODULE_TAG, __func__, request_ops);
  26. ret = -EIO;
  27. break;
  28. }
  29. VERBOSE("%s: %s, request_ops = %x, ret = %d\n",
  30. MODULE_TAG, __func__, request_ops, ret);
  31. return ret;
  32. }
  33. /* Register SiP SMC service */
  34. DECLARE_SMC_HANDLER(MTK_SIP_AUDIO_CONTROL, audio_smc_handler);