Commit 752e95e6 authored by Clemens Ladisch's avatar Clemens Ladisch Committed by Greg Kroah-Hartman

ALSA: oxygen: prevent muting of nonexistent AC97 controls

commit 3d839e5b upstream

Date: Tue, 26 Aug 2008 11:06:26 +0200
Subject: ALSA: oxygen: prevent muting of nonexistent AC97 controls

The Xonar DX does not have CD Capture controls, so we have to check that
a control actually exists before muting it.
Signed-off-by: default avatarClemens Ladisch <clemens@ladisch.de>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent a87a91ca
......@@ -512,9 +512,12 @@ static int ac97_switch_get(struct snd_kcontrol *ctl,
static void mute_ac97_ctl(struct oxygen *chip, unsigned int control)
{
unsigned int priv_idx = chip->controls[control]->private_value & 0xff;
unsigned int priv_idx;
u16 value;
if (!chip->controls[control])
return;
priv_idx = chip->controls[control]->private_value & 0xff;
value = oxygen_read_ac97(chip, 0, priv_idx);
if (!(value & 0x8000)) {
oxygen_write_ac97(chip, 0, priv_idx, value | 0x8000);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment