Skip to content

ASoC: dapm: Add encoder and decoder widget types to kcontrol handling#5789

Open
singalsu wants to merge 1 commit into
thesofproject:topic/sof-devfrom
singalsu:fix_encoder_decoder_type_kcontrol_handling
Open

ASoC: dapm: Add encoder and decoder widget types to kcontrol handling#5789
singalsu wants to merge 1 commit into
thesofproject:topic/sof-devfrom
singalsu:fix_encoder_decoder_type_kcontrol_handling

Conversation

@singalsu
Copy link
Copy Markdown
Collaborator

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.

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>
Copilot AI review requested due to automatic review settings May 26, 2026 16:22
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds snd_soc_dapm_encoder and snd_soc_dapm_decoder widget types to three switch statements in the DAPM core so that kcontrols attached to encoder/decoder widgets in topology are properly registered, named, and exposed via debugfs—mirroring the existing handling for snd_soc_dapm_effect.

Changes:

  • Include encoder/decoder cases in dapm_create_or_share_kcontrol() for proper long control name composition.
  • Include encoder/decoder cases in dapm_widget_show_component() for debugfs power state output.
  • Include encoder/decoder cases in snd_soc_dapm_new_widgets() so dapm_new_pga() is invoked to register their kcontrols.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@singalsu
Copy link
Copy Markdown
Collaborator Author

Note: This is needed for thesofproject/sof#10814 to setup the SOF MFCC module for desired operation mode and provide the switch control notifications for VAD status change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants