Skip to content

Commit

Permalink
idc: ipv4: Add idc_comp_free operation
Browse files Browse the repository at this point in the history
New IDC request idc_comp_free() is required to delete
component located on different core than the pipline to which
the module belongs.

 Signed-off-by: Jaroslaw Stelter <Jaroslaw.Stelter@intel.com>
  • Loading branch information
jxstelter committed Oct 30, 2023
1 parent d63a67e commit fb8b713
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
22 changes: 22 additions & 0 deletions src/idc/idc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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);
Expand Down
4 changes: 4 additions & 0 deletions zephyr/include/rtos/idc.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit fb8b713

Please sign in to comment.