clps711xfb: convert to proc_fops
[safe/jmp/linux-2.6] / sound / core / vmaster.c
index d51b198..3b9b550 100644 (file)
@@ -340,8 +340,21 @@ static void master_free(struct snd_kcontrol *kcontrol)
 }
 
 
-/*
- * Create a virtual master control with the given name
+/**
+ * snd_ctl_make_virtual_master - Create a virtual master control
+ * @name: name string of the control element to create
+ * @tlv: optional TLV int array for dB information
+ *
+ * Creates a virtual matster control with the given name string.
+ * Returns the created control element, or NULL for errors (ENOMEM).
+ *
+ * After creating a vmaster element, you can add the slave controls
+ * via snd_ctl_add_slave() or snd_ctl_add_slave_uncached().
+ *
+ * The optional argument @tlv can be used to specify the TLV information
+ * for dB scale of the master control.  It should be a single element
+ * with #SNDRV_CTL_TLVT_DB_SCALE, #SNDRV_CTL_TLV_DB_MINMAX or
+ * #SNDRV_CTL_TLVT_DB_MINMAX_MUTE type, and should be the max 0dB.
  */
 struct snd_kcontrol *snd_ctl_make_virtual_master(char *name,
                                                 const unsigned int *tlv)
@@ -372,7 +385,10 @@ struct snd_kcontrol *snd_ctl_make_virtual_master(char *name,
        kctl->private_free = master_free;
 
        /* additional (constant) TLV read */
-       if (tlv && tlv[0] == SNDRV_CTL_TLVT_DB_SCALE) {
+       if (tlv &&
+           (tlv[0] == SNDRV_CTL_TLVT_DB_SCALE ||
+            tlv[0] == SNDRV_CTL_TLVT_DB_MINMAX ||
+            tlv[0] == SNDRV_CTL_TLVT_DB_MINMAX_MUTE)) {
                kctl->vd[0].access |= SNDRV_CTL_ELEM_ACCESS_TLV_READ;
                memcpy(master->tlv, tlv, sizeof(master->tlv));
                kctl->tlv.p = master->tlv;