diff mbox

[RFC] ASoC: dapm: enable kcontrols for siggen and effect type widgets

Message ID 20180524183742.4986-1-ranjani.sridharan@linux.intel.com (mailing list archive)
State Accepted
Commit d4884c9f60771ced14be7c4537139276bb034930
Headers show

Commit Message

Ranjani Sridharan May 24, 2018, 6:37 p.m. UTC
This patch proposes to enable kcontrols for siggen and effect type
dapm widgets. This will allow triggering the tone generating siggen
component and also modifying the run-time attributes such as frequency,
amplitude etc. Effect type widgets such as the equalizer could
potentially need kcontrols to pass algorithm data from the userspace.

This patch also renames the function dapm_new_pga() to
dapm_new_kcontrol() so that it does not allude that it applies only
to pga widgets.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
---
 sound/soc/soc-dapm.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)
diff mbox

Patch

diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c
index 0c0cb7713eb4..4577880f69cc 100644
--- a/sound/soc/soc-dapm.c
+++ b/sound/soc/soc-dapm.c
@@ -852,6 +852,8 @@  static int dapm_create_or_share_kcontrol(struct snd_soc_dapm_widget *w,
 			kcname_in_long_name = true;
 		} else {
 			switch (w->id) {
+			case snd_soc_dapm_siggen:
+			case snd_soc_dapm_effect:
 			case snd_soc_dapm_switch:
 			case snd_soc_dapm_mixer:
 			case snd_soc_dapm_pga:
@@ -1010,8 +1012,8 @@  static int dapm_new_mux(struct snd_soc_dapm_widget *w)
 	return 0;
 }
 
-/* create new dapm volume control */
-static int dapm_new_pga(struct snd_soc_dapm_widget *w)
+/* create new dapm kcontrol */
+static int dapm_new_kcontrol(struct snd_soc_dapm_widget *w)
 {
 	int i, ret;
 
@@ -3046,9 +3048,11 @@  int snd_soc_dapm_new_widgets(struct snd_soc_card *card)
 		case snd_soc_dapm_demux:
 			dapm_new_mux(w);
 			break;
+		case snd_soc_dapm_siggen:
+		case snd_soc_dapm_effect:
 		case snd_soc_dapm_pga:
 		case snd_soc_dapm_out_drv:
-			dapm_new_pga(w);
+			dapm_new_kcontrol(w);
 			break;
 		case snd_soc_dapm_dai_link:
 			dapm_new_dai_link(w);