summaryrefslogtreecommitdiffstats
path: root/sound/core/control.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2007-07-23 15:41:34 +0200
committerJaroslav Kysela <perex@perex.cz>2007-10-16 15:57:44 +0200
commitb9ed4f2b68dc47b0c35c1a3ae8ae97c2517d5177 (patch)
treec967e895a8955cf5852d8155185e82316dd0beec /sound/core/control.c
parent90fd5ce5f67968d3250eeab9bc1f6822644347ef (diff)
downloadtalos-op-linux-b9ed4f2b68dc47b0c35c1a3ae8ae97c2517d5177.tar.gz
talos-op-linux-b9ed4f2b68dc47b0c35c1a3ae8ae97c2517d5177.zip
[ALSA] Add helper functions for frequently used callbacks
Added helper functions for frequenty used callbacks: snd_ctl_boolean_mono_info() and snd_ctl_boolean_stereo_info() Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@suse.cz>
Diffstat (limited to 'sound/core/control.c')
-rw-r--r--sound/core/control.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/sound/core/control.c b/sound/core/control.c
index 1f1ab9c1b668..396e98ed086a 100644
--- a/sound/core/control.c
+++ b/sound/core/control.c
@@ -1486,3 +1486,30 @@ int snd_ctl_create(struct snd_card *card)
snd_assert(card != NULL, return -ENXIO);
return snd_device_new(card, SNDRV_DEV_CONTROL, card, &ops);
}
+
+/*
+ * Frequently used control callbacks
+ */
+int snd_ctl_boolean_mono_info(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_info *uinfo)
+{
+ uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN;
+ uinfo->count = 1;
+ uinfo->value.integer.min = 0;
+ uinfo->value.integer.max = 1;
+ return 0;
+}
+
+EXPORT_SYMBOL(snd_ctl_boolean_mono_info);
+
+int snd_ctl_boolean_stereo_info(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_info *uinfo)
+{
+ uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN;
+ uinfo->count = 2;
+ uinfo->value.integer.min = 0;
+ uinfo->value.integer.max = 1;
+ return 0;
+}
+
+EXPORT_SYMBOL(snd_ctl_boolean_stereo_info);
OpenPOWER on IntegriCloud