Skip to content

Commit b7d478c

Browse files
singalsuujfalusi
authored andcommitted
ASoC: dapm: Add encoder and decoder widget types to kcontrol handling
This patch fixes the issue where encoder or decoder widget types are assigned kcontrols in a topology but get ignored. The controls were parsed successfully but were not registered as ALSA kcontrols. In dapm_create_or_share_kcontrol() the snd_soc_dapm_encoder and the snd_soc_dapm_decoder are added to the switch statement to be handled similarly as e.g. the snd_soc_dapm_effect for assigning a proper long control name. In dapm_widget_show_component() the snd_soc_dapm_encoder and the snd_soc_dapm_decoder are added to switch statement to let them to be shown in the debugfs power state output. In snd_soc_dapm_new_widgets() the snd_soc_dapm_encoder and the snd_soc_dapm_decoder are added to same switch case handling as e.g. snd_soc_dapm_effect to be registered with dapm_new_pga(). The previous operation with default in the switch statement silently ignored them. Note: Despite the function name, the dapm_new_pga() is generic utility that calls dapm_create_or_share_kcontrol() for each kcontrol of the widget. Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
1 parent ce4ed6c commit b7d478c

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

sound/soc/soc-dapm.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1201,6 +1201,8 @@ static int dapm_create_or_share_kcontrol(struct snd_soc_dapm_widget *w,
12011201
case snd_soc_dapm_pga:
12021202
case snd_soc_dapm_effect:
12031203
case snd_soc_dapm_out_drv:
1204+
case snd_soc_dapm_encoder:
1205+
case snd_soc_dapm_decoder:
12041206
wname_in_long_name = true;
12051207
kcname_in_long_name = true;
12061208
break;
@@ -2779,6 +2781,8 @@ static ssize_t dapm_widget_show_component(struct snd_soc_component *component,
27792781
case snd_soc_dapm_pga:
27802782
case snd_soc_dapm_effect:
27812783
case snd_soc_dapm_out_drv:
2784+
case snd_soc_dapm_encoder:
2785+
case snd_soc_dapm_decoder:
27822786
case snd_soc_dapm_mixer:
27832787
case snd_soc_dapm_mixer_named_ctl:
27842788
case snd_soc_dapm_supply:
@@ -3363,6 +3367,8 @@ int snd_soc_dapm_new_widgets(struct snd_soc_card *card)
33633367
case snd_soc_dapm_pga:
33643368
case snd_soc_dapm_effect:
33653369
case snd_soc_dapm_out_drv:
3370+
case snd_soc_dapm_encoder:
3371+
case snd_soc_dapm_decoder:
33663372
dapm_new_pga(w);
33673373
break;
33683374
case snd_soc_dapm_dai_link:

0 commit comments

Comments
 (0)