ALSA: powermac - Lineout detection on G4 DA
authorRisto Suominen <Risto.Suominen@gmail.com>
Sun, 4 Apr 2010 05:00:00 +0000 (08:00 +0300)
committerTakashi Iwai <tiwai@suse.de>
Sun, 4 Apr 2010 10:25:55 +0000 (12:25 +0200)
Lineout (Pro Speaker) detection on PowerMac G4 Digital Audio (Tumbler).

Signed-off-by: Risto Suominen <Risto.Suominen@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/ppc/tumbler.c

index 3b7471c344b455d1cc6cfa2d462e3289b17db761..696280c3c05a5b9c0b298231a9a3199e3dc1a204 100644 (file)
@@ -1137,7 +1137,8 @@ static long tumbler_find_device(const char *device, const char *platform,
                gp->inactive_val = (*base) ? 0x4 : 0x5;
        } else {
                const u32 *prop = NULL;
-               gp->active_state = IS_G4DA && !strcmp(device, "keywest-gpio15");
+               gp->active_state = IS_G4DA
+                               && !strncmp(device, "keywest-gpio1", 13);
                gp->active_val = 0x4;
                gp->inactive_val = 0x5;
                /* Here are some crude hacks to extract the GPIO polarity and
@@ -1315,6 +1316,9 @@ static int __devinit tumbler_init(struct snd_pmac *chip)
        if (irq <= NO_IRQ)
                irq = tumbler_find_device("line-output-detect",
                                          NULL, &mix->line_detect, 1);
+       if (IS_G4DA && irq <= NO_IRQ)
+               irq = tumbler_find_device("keywest-gpio16",
+                                         NULL, &mix->line_detect, 1);
        mix->lineout_irq = irq;
 
        tumbler_reset_audio(chip);