aboutsummaryrefslogtreecommitdiffstats
path: root/sound/ppc/tumbler.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/ppc/tumbler.c')
-rw-r--r--sound/ppc/tumbler.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/sound/ppc/tumbler.c b/sound/ppc/tumbler.c
index 789f44f4ac78..20afdf9772ee 100644
--- a/sound/ppc/tumbler.c
+++ b/sound/ppc/tumbler.c
@@ -30,6 +30,7 @@
30#include <linux/kmod.h> 30#include <linux/kmod.h>
31#include <linux/slab.h> 31#include <linux/slab.h>
32#include <linux/interrupt.h> 32#include <linux/interrupt.h>
33#include <linux/string.h>
33#include <sound/core.h> 34#include <sound/core.h>
34#include <asm/io.h> 35#include <asm/io.h>
35#include <asm/irq.h> 36#include <asm/irq.h>
@@ -46,6 +47,8 @@
46#define DBG(fmt...) 47#define DBG(fmt...)
47#endif 48#endif
48 49
50#define IS_G4DA (of_machine_is_compatible("PowerMac3,4"))
51
49/* i2c address for tumbler */ 52/* i2c address for tumbler */
50#define TAS_I2C_ADDR 0x34 53#define TAS_I2C_ADDR 0x34
51 54
@@ -243,6 +246,7 @@ static int tumbler_set_master_volume(struct pmac_tumbler *mix)
243 snd_printk(KERN_ERR "failed to set volume \n"); 246 snd_printk(KERN_ERR "failed to set volume \n");
244 return -EINVAL; 247 return -EINVAL;
245 } 248 }
249 DBG("(I) succeeded to set volume (%u, %u)\n", left_vol, right_vol);
246 return 0; 250 return 0;
247} 251}
248 252
@@ -353,6 +357,7 @@ static int tumbler_set_drc(struct pmac_tumbler *mix)
353 snd_printk(KERN_ERR "failed to set DRC\n"); 357 snd_printk(KERN_ERR "failed to set DRC\n");
354 return -EINVAL; 358 return -EINVAL;
355 } 359 }
360 DBG("(I) succeeded to set DRC (%u, %u)\n", val[0], val[1]);
356 return 0; 361 return 0;
357} 362}
358 363
@@ -389,6 +394,7 @@ static int snapper_set_drc(struct pmac_tumbler *mix)
389 snd_printk(KERN_ERR "failed to set DRC\n"); 394 snd_printk(KERN_ERR "failed to set DRC\n");
390 return -EINVAL; 395 return -EINVAL;
391 } 396 }
397 DBG("(I) succeeded to set DRC (%u, %u)\n", val[0], val[1]);
392 return 0; 398 return 0;
393} 399}
394 400
@@ -1134,7 +1140,8 @@ static long tumbler_find_device(const char *device, const char *platform,
1134 gp->inactive_val = (*base) ? 0x4 : 0x5; 1140 gp->inactive_val = (*base) ? 0x4 : 0x5;
1135 } else { 1141 } else {
1136 const u32 *prop = NULL; 1142 const u32 *prop = NULL;
1137 gp->active_state = 0; 1143 gp->active_state = IS_G4DA
1144 && !strncmp(device, "keywest-gpio1", 13);
1138 gp->active_val = 0x4; 1145 gp->active_val = 0x4;
1139 gp->inactive_val = 0x5; 1146 gp->inactive_val = 0x5;
1140 /* Here are some crude hacks to extract the GPIO polarity and 1147 /* Here are some crude hacks to extract the GPIO polarity and
@@ -1312,6 +1319,9 @@ static int __devinit tumbler_init(struct snd_pmac *chip)
1312 if (irq <= NO_IRQ) 1319 if (irq <= NO_IRQ)
1313 irq = tumbler_find_device("line-output-detect", 1320 irq = tumbler_find_device("line-output-detect",
1314 NULL, &mix->line_detect, 1); 1321 NULL, &mix->line_detect, 1);
1322 if (IS_G4DA && irq <= NO_IRQ)
1323 irq = tumbler_find_device("keywest-gpio16",
1324 NULL, &mix->line_detect, 1);
1315 mix->lineout_irq = irq; 1325 mix->lineout_irq = irq;
1316 1326
1317 tumbler_reset_audio(chip); 1327 tumbler_reset_audio(chip);