Skip to content

Commit e308b09

Browse files
committed
topology: add uuid token handling to process components
Parse the uuid for process components, then pass the generic process component type SOF_COMP_PROCESS and the uuid entry address to the firmware for the process component creation. Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
1 parent 9f07c21 commit e308b09

1 file changed

Lines changed: 44 additions & 0 deletions

File tree

sound/soc/sof/topology.c

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -461,6 +461,16 @@ static enum sof_comp_type find_process_comp_type(enum sof_ipc_process_type type)
461461
return SOF_COMP_NONE;
462462
}
463463

464+
/* get the uuid entry address from the uuid dictionary */
465+
static int sof_get_uid_entry(guid_t *uuid)
466+
{
467+
/*
468+
* will be implemented once the uuid dictionary is available
469+
* from the FW extended manifest.
470+
*/
471+
return 0;
472+
}
473+
464474
/*
465475
* Topology Token Parsing.
466476
* New tokens should be added to headers and parsing tables below.
@@ -492,6 +502,17 @@ static int get_token_u16(void *elem, void *object, u32 offset, u32 size)
492502
return 0;
493503
}
494504

505+
static int get_token_uuid(void *elem, void *object, u32 offset, u32 size)
506+
{
507+
struct snd_soc_tplg_vendor_uuid_elem *velem = elem;
508+
u32 *val = (u32 *)((u8 *)object + offset);
509+
guid_t uuid;
510+
511+
guid_copy(&uuid, (guid_t *)velem->uuid);
512+
*val = sof_get_uid_entry(&uuid);
513+
return 0;
514+
}
515+
495516
static int get_token_comp_format(void *elem, void *object, u32 offset, u32 size)
496517
{
497518
struct snd_soc_tplg_vendor_string_elem *velem = elem;
@@ -725,6 +746,13 @@ static const struct sof_topology_token core_tokens[] = {
725746
offsetof(struct sof_ipc_comp, core), 0},
726747
};
727748

749+
/* widget */
750+
static const struct sof_topology_token uuid_tokens[] = {
751+
{SOF_TKN_COMP_UUID,
752+
SND_SOC_TPLG_TUPLE_TYPE_UUID, get_token_uuid,
753+
offsetof(struct sof_ipc_comp, uid), 0},
754+
};
755+
728756
/*
729757
* DMIC PDM Tokens
730758
* SOF_TKN_INTEL_DMIC_PDM_CTRL_ID should be the first token
@@ -2177,6 +2205,16 @@ static int sof_process_load(struct snd_soc_component *scomp, int index,
21772205
goto out;
21782206
}
21792207

2208+
/* get the process uuid token */
2209+
ret = sof_parse_tokens(scomp, &process->comp, uuid_tokens,
2210+
ARRAY_SIZE(uuid_tokens), private->array,
2211+
le32_to_cpu(private->size));
2212+
if (ret != 0) {
2213+
dev_err(scomp->dev, "error: parse process tokens failed %d\n",
2214+
le32_to_cpu(private->size));
2215+
return ret;
2216+
}
2217+
21802218
/* configure iir IPC message */
21812219
process->comp.hdr.size = ipc_size;
21822220
process->comp.hdr.cmd = SOF_IPC_GLB_TPLG_MSG | SOF_IPC_TPLG_COMP_NEW;
@@ -2185,6 +2223,12 @@ static int sof_process_load(struct snd_soc_component *scomp, int index,
21852223
process->comp.pipeline_id = index;
21862224
process->config.hdr.size = sizeof(process->config);
21872225

2226+
if (process->comp.uid) {
2227+
dev_dbg(scomp->dev, "tplg: process component, uuid address: 0x%x\n",
2228+
process->comp.uid);
2229+
process->comp.type = SOF_COMP_PROCESS;
2230+
}
2231+
21882232
ret = sof_parse_tokens(scomp, &process->config, comp_tokens,
21892233
ARRAY_SIZE(comp_tokens), private->array,
21902234
le32_to_cpu(private->size));

0 commit comments

Comments
 (0)