]> git.karo-electronics.de Git - mv-sheeva.git/commitdiff
ALSA: powermac - Reverse HP detection on G4 DA
authorRisto Suominen <Risto.Suominen@gmail.com>
Sun, 4 Apr 2010 04:59:30 +0000 (07:59 +0300)
committerTakashi Iwai <tiwai@suse.de>
Sun, 4 Apr 2010 10:25:02 +0000 (12:25 +0200)
Reverse headphone detection bit 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 789f44f4ac78ba98b6e0f06bbff9858ca6d10959..3b7471c344b455d1cc6cfa2d462e3289b17db761 100644 (file)
@@ -30,6 +30,7 @@
 #include <linux/kmod.h>
 #include <linux/slab.h>
 #include <linux/interrupt.h>
+#include <linux/string.h>
 #include <sound/core.h>
 #include <asm/io.h>
 #include <asm/irq.h>
@@ -46,6 +47,8 @@
 #define DBG(fmt...)
 #endif
 
+#define IS_G4DA (machine_is_compatible("PowerMac3,4"))
+
 /* i2c address for tumbler */
 #define TAS_I2C_ADDR   0x34
 
@@ -1134,7 +1137,7 @@ 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 = 0;
+               gp->active_state = IS_G4DA && !strcmp(device, "keywest-gpio15");
                gp->active_val = 0x4;
                gp->inactive_val = 0x5;
                /* Here are some crude hacks to extract the GPIO polarity and