Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

ASoC: SOF: topology: simplify kcontrol names with

Merge series from Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>:

The use of the widget name as a prefix for the kcontrol name is quite
useful in the case of multiple pipelines going to the same endpoint,
but it's overkill in simpler cases.

This patchset extends the existing DAPM code to drop the widget name
prefix and make the kcontrol names simpler when there's no possible
ambiguity, e.g. "gain.2.1 Main Playback Volume" becomes just "Main
Playback Volume".

+30 -1
+1
include/sound/soc-dapm.h
··· 650 650 unsigned char power_checked:1; /* power checked this run */ 651 651 unsigned char is_supply:1; /* Widget is a supply type widget */ 652 652 unsigned char is_ep:2; /* Widget is a endpoint type widget */ 653 + unsigned char no_wname_in_kcontrol_name:1; /* No widget name prefix in kcontrol name */ 653 654 int subseq; /* sort within widget type */ 654 655 655 656 int (*power_check)(struct snd_soc_dapm_widget *w);
+5 -1
include/uapi/sound/sof/tokens.h
··· 99 99 #define SOF_TKN_COMP_OUTPUT_PIN_BINDING_WNAME 414 100 100 #define SOF_TKN_COMP_NUM_INPUT_AUDIO_FORMATS 415 101 101 #define SOF_TKN_COMP_NUM_OUTPUT_AUDIO_FORMATS 416 102 - 102 + /* 103 + * The token value is copied to the dapm_widget's 104 + * no_wname_in_kcontrol_name. 105 + */ 106 + #define SOF_TKN_COMP_NO_WNAME_IN_KCONTROL_NAME 417 103 107 104 108 /* SSP */ 105 109 #define SOF_TKN_INTEL_SSP_CLKS_CONTROL 500
+2
sound/soc/soc-dapm.c
··· 916 916 return -EINVAL; 917 917 } 918 918 } 919 + if (w->no_wname_in_kcontrol_name) 920 + wname_in_long_name = false; 919 921 920 922 if (wname_in_long_name && kcname_in_long_name) { 921 923 /*
+22
sound/soc/sof/topology.c
··· 1367 1367 return ret; 1368 1368 } 1369 1369 1370 + static int get_w_no_wname_in_long_name(void *elem, void *object, u32 offset) 1371 + { 1372 + struct snd_soc_tplg_vendor_value_elem *velem = elem; 1373 + struct snd_soc_dapm_widget *w = object; 1374 + 1375 + w->no_wname_in_kcontrol_name = !!le32_to_cpu(velem->value); 1376 + return 0; 1377 + } 1378 + 1379 + static const struct sof_topology_token dapm_widget_tokens[] = { 1380 + {SOF_TKN_COMP_NO_WNAME_IN_KCONTROL_NAME, SND_SOC_TPLG_TUPLE_TYPE_BOOL, 1381 + get_w_no_wname_in_long_name, 0} 1382 + }; 1383 + 1370 1384 /* external widget init - used for any driver specific init */ 1371 1385 static int sof_widget_ready(struct snd_soc_component *scomp, int index, 1372 1386 struct snd_soc_dapm_widget *w, ··· 1410 1396 1411 1397 ida_init(&swidget->output_queue_ida); 1412 1398 ida_init(&swidget->input_queue_ida); 1399 + 1400 + ret = sof_parse_tokens(scomp, w, dapm_widget_tokens, ARRAY_SIZE(dapm_widget_tokens), 1401 + priv->array, le32_to_cpu(priv->size)); 1402 + if (ret < 0) { 1403 + dev_err(scomp->dev, "failed to parse dapm widget tokens for %s\n", 1404 + w->name); 1405 + goto widget_free; 1406 + } 1413 1407 1414 1408 ret = sof_parse_tokens(scomp, swidget, comp_pin_tokens, 1415 1409 ARRAY_SIZE(comp_pin_tokens), priv->array,