Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions include/uapi/sound/sof/tokens.h
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,8 @@
*/
#define SOF_TKN_COMP_NO_WNAME_IN_KCONTROL_NAME 417

#define SOF_TKN_COMP_SCHED_DOMAIN 418

/* SSP */
#define SOF_TKN_INTEL_SSP_CLKS_CONTROL 500
#define SOF_TKN_INTEL_SSP_MCLK_ID 501
Expand Down
44 changes: 43 additions & 1 deletion sound/soc/sof/ipc4-topology.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,36 @@ MODULE_PARM_DESC(ipc4_ignore_cpc,
static DEFINE_IDA(alh_group_ida);
static DEFINE_IDA(pipeline_ida);

struct sof_comp_domains {
const char *name;
enum sof_comp_domain domain;
};

static const struct sof_comp_domains sof_domains[] = {
{ "LL", SOF_COMP_DOMAIN_LL, },
{ "DP", SOF_COMP_DOMAIN_DP, }
};

static enum sof_comp_domain find_domain(const char *name)
{
int i;

for (i = 0; i < ARRAY_SIZE(sof_domains); i++) {
if (strcmp(name, sof_domains[i].name) == 0)
return sof_domains[i].domain;
}
/* No valid value found, fall back to manifest value */
return SOF_COMP_DOMAIN_UNSET;
}

static int get_token_comp_domain(void *elem, void *object, u32 offset)
{
u32 *val = (u32 *)((u8 *)object + offset);

*val = find_domain((const char *)elem);
return 0;
}

static const struct sof_topology_token ipc4_sched_tokens[] = {
{SOF_TKN_SCHED_LP_MODE, SND_SOC_TPLG_TUPLE_TYPE_WORD, get_token_u32,
offsetof(struct sof_ipc4_pipeline, lp_mode)},
Expand Down Expand Up @@ -127,6 +157,8 @@ static const struct sof_topology_token comp_ext_tokens[] = {
offsetof(struct snd_sof_widget, uuid)},
{SOF_TKN_COMP_CORE_ID, SND_SOC_TPLG_TUPLE_TYPE_WORD, get_token_u32,
offsetof(struct snd_sof_widget, core)},
{SOF_TKN_COMP_SCHED_DOMAIN, SND_SOC_TPLG_TUPLE_TYPE_STRING, get_token_comp_domain,
offsetof(struct snd_sof_widget, comp_domain)},
};

static const struct sof_topology_token gain_tokens[] = {
Expand Down Expand Up @@ -497,7 +529,17 @@ static int sof_ipc4_widget_setup_msg(struct snd_sof_widget *swidget, struct sof_

msg->extension = SOF_IPC4_MOD_EXT_CORE_ID(swidget->core);

type = (fw_module->man4_module_entry.type & SOF_IPC4_MODULE_DP) ? 1 : 0;
switch (swidget->comp_domain) {
case SOF_COMP_DOMAIN_LL:
type = 0;
break;
case SOF_COMP_DOMAIN_DP:
type = 1;
break;
default:
type = (fw_module->man4_module_entry.type & SOF_IPC4_MODULE_DP) ? 1 : 0;
break;
}
msg->extension |= SOF_IPC4_MOD_EXT_DOMAIN(type);

return 0;
Expand Down
7 changes: 7 additions & 0 deletions sound/soc/sof/ipc4-topology.h
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,13 @@ enum sof_ipc4_copier_module_config_params {
SOF_IPC4_COPIER_MODULE_CFG_ATTENUATION,
};

/* Scheduling domain, unset, Low Latency, or Data Processing */
enum sof_comp_domain {
SOF_COMP_DOMAIN_UNSET = 0, /* Take domain value from manifest */
SOF_COMP_DOMAIN_LL, /* Low Latency scheduling domain */
SOF_COMP_DOMAIN_DP, /* Data Processing scheduling domain */
};

struct sof_ipc4_copier_config_set_sink_format {
/* Id of sink */
u32 sink_id;
Expand Down
3 changes: 3 additions & 0 deletions sound/soc/sof/sof-audio.h
Original file line number Diff line number Diff line change
Expand Up @@ -456,6 +456,9 @@ struct snd_sof_widget {
*/
bool dynamic_pipeline_widget;

/* Scheduling domain (enum sof_comp_domain), unset, Low Latency, or Data Processing */
u32 comp_domain;

struct snd_soc_dapm_widget *widget;
struct list_head list; /* list in sdev widget list */
struct snd_sof_pipeline *spipe;
Expand Down
Loading