Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=b9ed4f2b68dc47b0c35c1a3ae8ae97c2517d5177
Commit:     b9ed4f2b68dc47b0c35c1a3ae8ae97c2517d5177
Parent:     90fd5ce5f67968d3250eeab9bc1f6822644347ef
Author:     Takashi Iwai <[EMAIL PROTECTED]>
AuthorDate: Mon Jul 23 15:41:34 2007 +0200
Committer:  Jaroslav Kysela <[EMAIL PROTECTED]>
CommitDate: Tue Oct 16 15:57:44 2007 +0200

    [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 <[EMAIL PROTECTED]>
    Signed-off-by: Jaroslav Kysela <[EMAIL PROTECTED]>
---
 include/sound/control.h |    8 ++++++++
 sound/core/control.c    |   27 +++++++++++++++++++++++++++
 2 files changed, 35 insertions(+), 0 deletions(-)

diff --git a/include/sound/control.h b/include/sound/control.h
index 72e759f..b26d463 100644
--- a/include/sound/control.h
+++ b/include/sound/control.h
@@ -161,4 +161,12 @@ static inline struct snd_ctl_elem_id 
*snd_ctl_build_ioff(struct snd_ctl_elem_id
        return dst_id;
 }
 
+/*
+ * Frequently used control callbacks
+ */
+int snd_ctl_boolean_mono_info(struct snd_kcontrol *kcontrol,
+                             struct snd_ctl_elem_info *uinfo);
+int snd_ctl_boolean_stereo_info(struct snd_kcontrol *kcontrol,
+                               struct snd_ctl_elem_info *uinfo);
+
 #endif /* __SOUND_CONTROL_H */
diff --git a/sound/core/control.c b/sound/core/control.c
index 1f1ab9c..396e98e 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);
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to