Skip to content

Commit 28d5a8f

Browse files
committed
ASoC: SOF: topology: add UUID token to generic comp_tokens
Add the UUID token to comp_tokens and parse UUID byte array for all types of component. Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
1 parent 04a7e7a commit 28d5a8f

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

sound/soc/sof/topology.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -492,6 +492,16 @@ static int get_token_u16(void *elem, void *object, u32 offset, u32 size)
492492
return 0;
493493
}
494494

495+
static int get_token_uuid(void *elem, void *object, u32 offset, u32 size)
496+
{
497+
struct snd_soc_tplg_vendor_uuid_elem *velem = elem;
498+
guid_t *dst = (guid_t *)((u8 *)object + offset);
499+
500+
guid_copy(dst, (guid_t *)velem->uuid);
501+
502+
return 0;
503+
}
504+
495505
static int get_token_comp_format(void *elem, void *object, u32 offset, u32 size)
496506
{
497507
struct snd_soc_tplg_vendor_string_elem *velem = elem;
@@ -638,6 +648,9 @@ static const struct sof_topology_token comp_tokens[] = {
638648
{SOF_TKN_COMP_CORE_ID,
639649
SND_SOC_TPLG_TUPLE_TYPE_WORD, get_token_u32,
640650
offsetof(struct sof_ipc_comp, core), 0},
651+
{SOF_TKN_COMP_UUID,
652+
SND_SOC_TPLG_TUPLE_TYPE_UUID, get_token_uuid,
653+
offsetof(struct sof_ipc_comp, uuid), 0},
641654
};
642655

643656
/* SSP */

0 commit comments

Comments
 (0)