Skip to content

Commit 44de36b

Browse files
jsarhaJyri Sarha
authored andcommitted
ASoC: dapm: Add a flag for not having widget name in kcontrol name
The existing soc-dapm code may add a prefix to control names, which in some cases is useful but in others leads to long and confusing kcontrol names such as "gain 2.1 Main Playback Volume". This patch suggests an added flag to prevent the widget name prefix from being added. That flag will be set in the topology file on a per-widget basis. The flag no_wname_in_kcontrol_name is added to struct snd_soc_dapm_widget, and the logic in dapm_create_or_share_kcontrol() is changed to not to add widget name if the flag is set. Signed-off-by: Jyri Sarha <jyri.sarha@intel.com>
1 parent 2776754 commit 44de36b

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

include/sound/soc-dapm.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -604,6 +604,7 @@ struct snd_soc_dapm_widget {
604604
unsigned char power_checked:1; /* power checked this run */
605605
unsigned char is_supply:1; /* Widget is a supply type widget */
606606
unsigned char is_ep:2; /* Widget is a endpoint type widget */
607+
unsigned char no_wname_in_kcontrol_name:1; /* No widget name prefix in kcontrol name */
607608
int subseq; /* sort within widget type */
608609

609610
int (*power_check)(struct snd_soc_dapm_widget *w);

sound/soc/soc-dapm.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -916,6 +916,8 @@ static int dapm_create_or_share_kcontrol(struct snd_soc_dapm_widget *w,
916916
return -EINVAL;
917917
}
918918
}
919+
if (w->no_wname_in_kcontrol_name)
920+
wname_in_long_name = false;
919921

920922
if (wname_in_long_name && kcname_in_long_name) {
921923
/*

0 commit comments

Comments
 (0)