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