diff --git a/src/idc/idc.c b/src/idc/idc.c index 740c24e02df1..a2c19f577bdc 100644 --- a/src/idc/idc.c +++ b/src/idc/idc.c @@ -315,6 +315,25 @@ static int idc_reset(uint32_t comp_id) return ret; } +/** + * \brief Executes IDC component reset message. + * \param[in] comp_id Component id to be reset. + * \return Error code. + */ +static int idc_comp_free(uint32_t comp_id) +{ + struct ipc *ipc = ipc_get(); + struct ipc_comp_dev *icd; + int ret; + + icd = ipc_get_comp_by_id(ipc, comp_id); + if (!icd) + return -ENODEV; + + ret = ipc_comp_free(ipc, comp_id); + return ret; +} + /** * \brief Executes IDC pipeline set state message. * \param[in] ppl_id Pipeline id to be triggered. @@ -429,6 +448,9 @@ void idc_cmd(struct idc_msg *msg) case iTS(IDC_MSG_GET_ATTRIBUTE): ret = idc_get_attribute(msg->extension); break; + case iTS(IDC_MSG_FREE): + ret = idc_comp_free(msg->extension); + break; #endif case iTS(IDC_MSG_PARAMS): ret = idc_params(msg->extension); diff --git a/zephyr/include/rtos/idc.h b/zephyr/include/rtos/idc.h index 34418a320a22..30a4069f8863 100644 --- a/zephyr/include/rtos/idc.h +++ b/zephyr/include/rtos/idc.h @@ -106,6 +106,10 @@ #define IDC_MSG_UNBIND IDC_TYPE(0xE) #define IDC_MSG_GET_ATTRIBUTE IDC_TYPE(0xF) +/** \brief IDC component delete message. */ +#define IDC_MSG_FREE IDC_TYPE(0x10) +#define IDC_MSG_FREE_EXT(x) IDC_EXTENSION(x) + /** \brief IDC pipeline set state message. */ #define IDC_MSG_PPL_STATE IDC_TYPE(0xC) #define IDC_PPL_STATE_PPL_ID_SHIFT 0