Skip to content

Commit

Permalink
tools: plugin: common: Move plug_ctl_ipc_message() definition to comm…
Browse files Browse the repository at this point in the history
…on code

It will be used by both the PCM and the control plugin.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
  • Loading branch information
ranj063 authored and lgirdwood committed Sep 19, 2024
1 parent 08a1a84 commit ec8c6c7
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 14 deletions.
14 changes: 0 additions & 14 deletions tools/plugin/alsaplug/ctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -198,20 +198,6 @@ static int plug_ctl_get_integer_info(snd_ctl_ext_t *ext, snd_ctl_ext_key_t key,
return err;
}

static void plug_ctl_ipc_message(struct ipc4_module_large_config *config, int param_id,
size_t size, uint32_t module_id, uint32_t instance_id,
uint32_t type)
{
config->primary.r.type = type;
config->primary.r.msg_tgt = SOF_IPC4_MESSAGE_TARGET_MODULE_MSG;
config->primary.r.rsp = SOF_IPC4_MESSAGE_DIR_MSG_REQUEST;
config->primary.r.module_id = module_id;
config->primary.r.instance_id = instance_id;

config->extension.r.data_off_size = size;
config->extension.r.large_param_id = param_id;
}

static int plug_ctl_read_integer(snd_ctl_ext_t *ext, snd_ctl_ext_key_t key, long *value)
{
snd_sof_ctl_t *ctl = ext->private_data;
Expand Down
14 changes: 14 additions & 0 deletions tools/plugin/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -250,3 +250,17 @@ int plug_mq_cmd_tx_rx(struct plug_mq_desc *ipc_tx, struct plug_mq_desc *ipc_rx,

return 0;
}

void plug_ctl_ipc_message(struct ipc4_module_large_config *config, int param_id,
size_t size, uint32_t module_id, uint32_t instance_id,
uint32_t type)
{
config->primary.r.type = type;
config->primary.r.msg_tgt = SOF_IPC4_MESSAGE_TARGET_MODULE_MSG;
config->primary.r.rsp = SOF_IPC4_MESSAGE_DIR_MSG_REQUEST;
config->primary.r.module_id = module_id;
config->primary.r.instance_id = instance_id;

config->extension.r.data_off_size = size;
config->extension.r.large_param_id = param_id;
}
4 changes: 4 additions & 0 deletions tools/plugin/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -317,4 +317,8 @@ static inline void data_dump(void *vdata, size_t bytes)
printf("\n");
}

void plug_ctl_ipc_message(struct ipc4_module_large_config *config, int param_id,
size_t size, uint32_t module_id, uint32_t instance_id,
uint32_t type);

#endif

0 comments on commit ec8c6c7

Please sign in to comment.