瀏覽代碼

[ALSA] hda-codec - Fix LFE volume/switch

HDA Codec driver
Fixed LFE volume/switch control.

Signed-off-by: Nicolas Graziano <nicolas.graziano@wanadoo.fr>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Nicolas Graziano 20 年之前
父節點
當前提交
b9f5a89c74
共有 1 個文件被更改,包括 9 次插入4 次删除
  1. 9 4
      sound/pci/hda/hda_codec.c

+ 9 - 4
sound/pci/hda/hda_codec.c

@@ -749,12 +749,14 @@ int snd_hda_mixer_amp_volume_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t
 	long *valp = ucontrol->value.integer.value;
 	long *valp = ucontrol->value.integer.value;
 	int change = 0;
 	int change = 0;
 
 
-	if (chs & 1)
+	if (chs & 1) {
 		change = snd_hda_codec_amp_update(codec, nid, 0, dir, idx,
 		change = snd_hda_codec_amp_update(codec, nid, 0, dir, idx,
 						  0x7f, *valp);
 						  0x7f, *valp);
+		valp++;
+	}
 	if (chs & 2)
 	if (chs & 2)
 		change |= snd_hda_codec_amp_update(codec, nid, 1, dir, idx,
 		change |= snd_hda_codec_amp_update(codec, nid, 1, dir, idx,
-						   0x7f, valp[1]);
+						   0x7f, *valp);
 	return change;
 	return change;
 }
 }
 
 
@@ -796,12 +798,15 @@ int snd_hda_mixer_amp_switch_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t
 	long *valp = ucontrol->value.integer.value;
 	long *valp = ucontrol->value.integer.value;
 	int change = 0;
 	int change = 0;
 
 
-	if (chs & 1)
+	if (chs & 1) {
 		change = snd_hda_codec_amp_update(codec, nid, 0, dir, idx,
 		change = snd_hda_codec_amp_update(codec, nid, 0, dir, idx,
 						  0x80, *valp ? 0 : 0x80);
 						  0x80, *valp ? 0 : 0x80);
+		valp++;
+	}
 	if (chs & 2)
 	if (chs & 2)
 		change |= snd_hda_codec_amp_update(codec, nid, 1, dir, idx,
 		change |= snd_hda_codec_amp_update(codec, nid, 1, dir, idx,
-						   0x80, valp[1] ? 0 : 0x80);
+						   0x80, *valp ? 0 : 0x80);
+	
 	return change;
 	return change;
 }
 }