ALSA: cs5535audio: check OLPC's Analog Input status vis GPIO
authorAndres Salomon <dilinger@queued.net>
Thu, 6 Nov 2008 21:49:55 +0000 (16:49 -0500)
committerTakashi Iwai <tiwai@suse.de>
Wed, 10 Dec 2008 16:14:44 +0000 (17:14 +0100)
Checking the HPF register is irrelevant; HPF is secondary to the AI mode.
Instead, check for Analog Input mode via GPIO.

Signed-off-by: Andres Salomon <dilinger@debian.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/pci/cs5535audio/cs5535audio_olpc.c

index 6c0c0db..7f26cfb 100644 (file)
@@ -43,13 +43,8 @@ static int olpc_dc_info(struct snd_kcontrol *kctl,
 
 static int olpc_dc_get(struct snd_kcontrol *kctl, struct snd_ctl_elem_value *v)
 {
-       struct cs5535audio *cs5535au = snd_kcontrol_chip(kctl);
-       u8 val;
-
-       val = snd_ac97_read(cs5535au->ac97, AC97_AD_TEST2);
-       val >>= AC97_AD_HPFD_SHIFT;
-       v->value.integer.value[0] = val & 0x1;
-
+       v->value.integer.value[0] = geode_gpio_isset(OLPC_GPIO_MIC_AC,
+                       GPIO_OUTPUT_VAL);
        return 0;
 }