From 819ef70b135ba66cd1659c913255686bf931e3d4 Mon Sep 17 00:00:00 2001 From: Risto Suominen Date: Sun, 4 Apr 2010 07:59:30 +0300 Subject: ALSA: powermac - Reverse HP detection on G4 DA Reverse headphone detection bit on PowerMac G4 Digital Audio (Tumbler). Signed-off-by: Risto Suominen Signed-off-by: Takashi Iwai --- sound/ppc/tumbler.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'sound/ppc') diff --git a/sound/ppc/tumbler.c b/sound/ppc/tumbler.c index 789f44f4ac7..3b7471c344b 100644 --- a/sound/ppc/tumbler.c +++ b/sound/ppc/tumbler.c @@ -30,6 +30,7 @@ #include #include #include +#include #include #include #include @@ -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 -- cgit v1.2.3 From b6d7335001f331f2d295ff15d67e385615ceff81 Mon Sep 17 00:00:00 2001 From: Risto Suominen Date: Sun, 4 Apr 2010 08:00:00 +0300 Subject: ALSA: powermac - Lineout detection on G4 DA Lineout (Pro Speaker) detection on PowerMac G4 Digital Audio (Tumbler). Signed-off-by: Risto Suominen Signed-off-by: Takashi Iwai --- sound/ppc/tumbler.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'sound/ppc') diff --git a/sound/ppc/tumbler.c b/sound/ppc/tumbler.c index 3b7471c344b..696280c3c05 100644 --- a/sound/ppc/tumbler.c +++ b/sound/ppc/tumbler.c @@ -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); -- cgit v1.2.3 From f1b1f75e251049281cfe3d3b82d403fc2dc1e235 Mon Sep 17 00:00:00 2001 From: Risto Suominen Date: Sun, 4 Apr 2010 08:00:29 +0300 Subject: ALSA: powermac - Add debug log Add some debug log in tumbler.c. Signed-off-by: Risto Suominen Signed-off-by: Takashi Iwai --- sound/ppc/tumbler.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'sound/ppc') diff --git a/sound/ppc/tumbler.c b/sound/ppc/tumbler.c index 696280c3c05..0b69e96f0d1 100644 --- a/sound/ppc/tumbler.c +++ b/sound/ppc/tumbler.c @@ -246,6 +246,7 @@ static int tumbler_set_master_volume(struct pmac_tumbler *mix) snd_printk(KERN_ERR "failed to set volume \n"); return -EINVAL; } + DBG("(I) succeeded to set volume (%u, %u)\n", left_vol, right_vol); return 0; } @@ -356,6 +357,7 @@ static int tumbler_set_drc(struct pmac_tumbler *mix) snd_printk(KERN_ERR "failed to set DRC\n"); return -EINVAL; } + DBG("(I) succeeded to set DRC (%u, %u)\n", val[0], val[1]); return 0; } @@ -392,6 +394,7 @@ static int snapper_set_drc(struct pmac_tumbler *mix) snd_printk(KERN_ERR "failed to set DRC\n"); return -EINVAL; } + DBG("(I) succeeded to set DRC (%u, %u)\n", val[0], val[1]); return 0; } -- cgit v1.2.3 From 68c7ccb8f85801655aa681391dc0ee037a2b66d4 Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Wed, 7 Apr 2010 07:45:46 +0200 Subject: ALSA: powermac - Fix obsoleted machine_is_compatible() machine_is_compatible() was renamed to of_machine_is_compatible(). Signed-off-by: Takashi Iwai --- sound/ppc/tumbler.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sound/ppc') diff --git a/sound/ppc/tumbler.c b/sound/ppc/tumbler.c index 0b69e96f0d1..20afdf9772e 100644 --- a/sound/ppc/tumbler.c +++ b/sound/ppc/tumbler.c @@ -47,7 +47,7 @@ #define DBG(fmt...) #endif -#define IS_G4DA (machine_is_compatible("PowerMac3,4")) +#define IS_G4DA (of_machine_is_compatible("PowerMac3,4")) /* i2c address for tumbler */ #define TAS_I2C_ADDR 0x34 -- cgit v1.2.3