aboutsummaryrefslogtreecommitdiffstats
path: root/include/sound
diff options
context:
space:
mode:
authorPeter Ujfalusi <peter.ujfalusi@nokia.com>2010-05-07 07:05:49 -0400
committerMark Brown <broonie@opensource.wolfsonmicro.com>2010-05-07 11:41:33 -0400
commit637d3847ba0ca2c7780e6521cbe75568d19ff0db (patch)
tree6a9b76e2d0365cabba43f7a273feceb66710bf4c /include/sound
parent305787649826d6c84a6f9f71bc3318460610aba4 (diff)
ASoC: core: Support for limiting the volume
Add support for the core to limit the maximum volume on an existing control. The function will modify the soc_mixer_control.max value of the given control. The new value must be lower than the original one (chip maximum) If there is a need for limiting a gain on a given control, than machine drivers can do the following in their snd_soc_dai_link.init function: snd_soc_limit_volume(codec, "TPA6140A2 Headphone Playback Volume", 21); This will modify the original 31 (chip maximum) to 21, so user space will not be able to set the gain higher than this. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@nokia.com> Acked-by: Liam Girdwood <lrg@slimlogic.co.uk> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'include/sound')
-rw-r--r--include/sound/soc.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/sound/soc.h b/include/sound/soc.h
index 01e9c66ddc6d..9f306f0710df 100644
--- a/include/sound/soc.h
+++ b/include/sound/soc.h
@@ -326,6 +326,8 @@ int snd_soc_get_volsw_s8(struct snd_kcontrol *kcontrol,
326 struct snd_ctl_elem_value *ucontrol); 326 struct snd_ctl_elem_value *ucontrol);
327int snd_soc_put_volsw_s8(struct snd_kcontrol *kcontrol, 327int snd_soc_put_volsw_s8(struct snd_kcontrol *kcontrol,
328 struct snd_ctl_elem_value *ucontrol); 328 struct snd_ctl_elem_value *ucontrol);
329int snd_soc_limit_volume(struct snd_soc_codec *codec,
330 const char *name, int max);
329 331
330/** 332/**
331 * struct snd_soc_jack_pin - Describes a pin to update based on jack detection 333 * struct snd_soc_jack_pin - Describes a pin to update based on jack detection