]> err.no Git - linux-2.6/blobdiff - sound/pci/ice1712/wtm.c
Merge branch 'release' of git://lm-sensors.org/kernel/mhoffman/hwmon-2.6
[linux-2.6] / sound / pci / ice1712 / wtm.c
index 4a706b16a0b9ba683501a9c92c0946d68182c740..a08d17c7e6515f5ede5066097f712b89f2101448 100644 (file)
@@ -25,7 +25,6 @@
 
 
 
-#include <sound/driver.h>
 #include <asm/io.h>
 #include <linux/delay.h>
 #include <linux/interrupt.h>
@@ -71,14 +70,7 @@ static inline unsigned char stac9460_2_get(struct snd_ice1712 *ice, int reg)
 /*
  *     DAC mute control
  */
-static int stac9460_dac_mute_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;
-       return 0;
-}
+#define stac9460_dac_mute_info         snd_ctl_boolean_mono_info
 
 static int stac9460_dac_mute_get(struct snd_kcontrol *kcontrol,
                                struct snd_ctl_elem_value *ucontrol)
@@ -185,7 +177,7 @@ static int stac9460_dac_vol_put(struct snd_kcontrol *kcontrol,
 
        if (kcontrol->private_value) {
                idx = STAC946X_MASTER_VOLUME;
-               nvol = ucontrol->value.integer.value[0];
+               nvol = ucontrol->value.integer.value[0] & 0x7f;
                tmp = stac9460_get(ice, idx);
                ovol = 0x7f - (tmp & 0x7f);
                change = (ovol != nvol);
@@ -196,7 +188,7 @@ static int stac9460_dac_vol_put(struct snd_kcontrol *kcontrol,
        } else {
                id = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id);
                idx = id + STAC946X_LF_VOLUME;
-               nvol = ucontrol->value.integer.value[0];
+               nvol = ucontrol->value.integer.value[0] & 0x7f;
                if (id < 6)
                        tmp = stac9460_get(ice, idx);
                else 
@@ -218,15 +210,7 @@ static int stac9460_dac_vol_put(struct snd_kcontrol *kcontrol,
 /*
  * ADC mute control
  */
-static int stac9460_adc_mute_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;
-}
+#define stac9460_adc_mute_info         snd_ctl_boolean_stereo_info
 
 static int stac9460_adc_mute_get(struct snd_kcontrol *kcontrol,
                                struct snd_ctl_elem_value *ucontrol)
@@ -332,7 +316,7 @@ static int stac9460_adc_vol_put(struct snd_kcontrol *kcontrol,
        if (id == 0) {
                for (i = 0; i < 2; ++i) {
                        reg = STAC946X_MIC_L_VOLUME + i;
-                       nvol = ucontrol->value.integer.value[i];
+                       nvol = ucontrol->value.integer.value[i] & 0x0f;
                        ovol = 0x0f - stac9460_get(ice, reg);
                        change = ((ovol & 0x0f) != nvol);
                        if (change)
@@ -342,7 +326,7 @@ static int stac9460_adc_vol_put(struct snd_kcontrol *kcontrol,
        } else {
                for (i = 0; i < 2; ++i) {
                        reg = STAC946X_MIC_L_VOLUME + i;
-                       nvol = ucontrol->value.integer.value[i];
+                       nvol = ucontrol->value.integer.value[i] & 0x0f;
                        ovol = 0x0f - stac9460_2_get(ice, reg);
                        change = ((ovol & 0x0f) != nvol);
                        if (change)
@@ -357,15 +341,7 @@ static int stac9460_adc_vol_put(struct snd_kcontrol *kcontrol,
  * MIC / LINE switch fonction
  */
 
-static int stac9460_mic_sw_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;
-}
+#define stac9460_mic_sw_info           snd_ctl_boolean_mono_info
 
 static int stac9460_mic_sw_get(struct snd_kcontrol *kcontrol,
                        struct snd_ctl_elem_value *ucontrol)
@@ -409,7 +385,7 @@ static int stac9460_mic_sw_put(struct snd_kcontrol *kcontrol,
 /*
  * Control tabs
  */
-static const struct snd_kcontrol_new stac9640_controls[] __devinitdata = {
+static struct snd_kcontrol_new stac9640_controls[] __devinitdata = {
        {
                .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
                .name = "Master Playback Switch",