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
1 change: 1 addition & 0 deletions include/sound/soc-dapm.h
Original file line number Diff line number Diff line change
Expand Up @@ -604,6 +604,7 @@ struct snd_soc_dapm_widget {
unsigned char power_checked:1; /* power checked this run */
unsigned char is_supply:1; /* Widget is a supply type widget */
unsigned char is_ep:2; /* Widget is a endpoint type widget */
unsigned char no_wname_in_kcontrol_name:1; /* No widget name prefix in kcontrol name */
int subseq; /* sort within widget type */

int (*power_check)(struct snd_soc_dapm_widget *w);
Expand Down
6 changes: 5 additions & 1 deletion include/uapi/sound/sof/tokens.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,11 @@
#define SOF_TKN_COMP_OUTPUT_PIN_BINDING_WNAME 414
#define SOF_TKN_COMP_NUM_INPUT_AUDIO_FORMATS 415
#define SOF_TKN_COMP_NUM_OUTPUT_AUDIO_FORMATS 416

/*
* The token value is copied to the dapm_widget's
* no_wname_in_kcontrol_name.
*/
#define SOF_TKN_COMP_NO_WNAME_IN_KCONTROL_NAME 417

/* SSP */
#define SOF_TKN_INTEL_SSP_CLKS_CONTROL 500
Expand Down
2 changes: 2 additions & 0 deletions sound/soc/soc-dapm.c
Original file line number Diff line number Diff line change
Expand Up @@ -916,6 +916,8 @@ static int dapm_create_or_share_kcontrol(struct snd_soc_dapm_widget *w,
return -EINVAL;
}
}
if (w->no_wname_in_kcontrol_name)
wname_in_long_name = false;

if (wname_in_long_name && kcname_in_long_name) {
/*
Expand Down
22 changes: 22 additions & 0 deletions sound/soc/sof/topology.c
Original file line number Diff line number Diff line change
Expand Up @@ -1366,6 +1366,20 @@ static int sof_parse_pin_binding(struct snd_sof_widget *swidget,
return ret;
}

static int get_w_no_wname_in_long_name(void *elem, void *object, u32 offset)
{
struct snd_soc_tplg_vendor_value_elem *velem = elem;
struct snd_soc_dapm_widget *w = object;

w->no_wname_in_kcontrol_name = !!le32_to_cpu(velem->value);
return 0;
}

static const struct sof_topology_token dapm_widget_tokens[] = {
{SOF_TKN_COMP_NO_WNAME_IN_KCONTROL_NAME, SND_SOC_TPLG_TUPLE_TYPE_BOOL,
get_w_no_wname_in_long_name, 0}
};

/* external widget init - used for any driver specific init */
static int sof_widget_ready(struct snd_soc_component *scomp, int index,
struct snd_soc_dapm_widget *w,
Expand Down Expand Up @@ -1396,6 +1410,14 @@ static int sof_widget_ready(struct snd_soc_component *scomp, int index,
ida_init(&swidget->output_queue_ida);
ida_init(&swidget->input_queue_ida);

ret = sof_parse_tokens(scomp, w, dapm_widget_tokens, ARRAY_SIZE(dapm_widget_tokens),
priv->array, le32_to_cpu(priv->size));
if (ret < 0) {
dev_err(scomp->dev, "failed to parse dapm widget tokens for %s\n",
w->name);
goto widget_free;
}

ret = sof_parse_tokens(scomp, swidget, comp_pin_tokens,
ARRAY_SIZE(comp_pin_tokens), priv->array,
le32_to_cpu(priv->size));
Expand Down