[alsa-devel] [PATCH v2 1/2] ASoC: export dapm_kcontrol_set/get_value functions

Vinod Koul vinod.koul at intel.com
Thu May 29 12:03:36 CEST 2014

The DSPs like Intel ones use the DPCM to represent the DSP toplogy. So when DAPM
triggers the widget, the DSP needs to know the kcontrol values and pass on to DSP
firmware, so export these for driver use

Signed-off-by: Vinod Koul <vinod.koul at intel.com>
 include/sound/soc-dapm.h |    3 +++
 sound/soc/soc-dapm.c     |    6 ++++--
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/include/sound/soc-dapm.h b/include/sound/soc-dapm.h
index 75020f5..abda467 100644
--- a/include/sound/soc-dapm.h
+++ b/include/sound/soc-dapm.h
@@ -368,6 +368,9 @@ int dapm_regulator_event(struct snd_soc_dapm_widget *w,
 			 struct snd_kcontrol *kcontrol, int event);
 int dapm_clock_event(struct snd_soc_dapm_widget *w,
 			 struct snd_kcontrol *kcontrol, int event);
+bool dapm_kcontrol_set_value(const struct snd_kcontrol *kcontrol,
+			unsigned int value);
+unsigned int dapm_kcontrol_get_value(const struct snd_kcontrol *kcontrol);
 /* dapm controls */
 int snd_soc_dapm_put_volsw(struct snd_kcontrol *kcontrol,
diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c
index 98c1dc6..d831e73 100644
--- a/sound/soc/soc-dapm.c
+++ b/sound/soc/soc-dapm.c
@@ -327,14 +327,15 @@ static struct list_head *dapm_kcontrol_get_path_list(
 	list_for_each_entry(path, dapm_kcontrol_get_path_list(kcontrol), \
-static unsigned int dapm_kcontrol_get_value(const struct snd_kcontrol *kcontrol)
+unsigned int dapm_kcontrol_get_value(const struct snd_kcontrol *kcontrol)
 	struct dapm_kcontrol_data *data = snd_kcontrol_chip(kcontrol);
 	return data->value;
-static bool dapm_kcontrol_set_value(const struct snd_kcontrol *kcontrol,
+bool dapm_kcontrol_set_value(const struct snd_kcontrol *kcontrol,
 	unsigned int value)
 	struct dapm_kcontrol_data *data = snd_kcontrol_chip(kcontrol);
@@ -349,6 +350,7 @@ static bool dapm_kcontrol_set_value(const struct snd_kcontrol *kcontrol,
 	return true;
  * snd_soc_dapm_kcontrol_codec() - Returns the codec associated to a kcontrol

More information about the Alsa-devel mailing list