linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PPC,SOUND] Fix audio gpio state detection
@ 2006-02-11 16:10 Andreas Schwab
  2006-02-12 22:35 ` Benjamin Herrenschmidt
  0 siblings, 1 reply; 13+ messages in thread
From: Andreas Schwab @ 2006-02-11 16:10 UTC (permalink / raw)
  To: alsa-devel; +Cc: linuxppc-dev

When booting with line out or headphone plugged, you won't hear anything.
The problem is that after reset all channels are muted, but the actual
value of the gpio port doesn't exactly match the active_val settings as
expected by check_audio_gpio.  For example, the line_mute port is set to
7, but check_audio_gpio would expect 0xd or 0xf, thus its return value
indicates that it is not active, even though it is.  AFAICS only looking
at the low bit is enough to determine whether the port is active.

Signed-off-by: Andreas Schwab <schwab@suse.de>

Index: linux-2.6.16-rc2/sound/ppc/tumbler.c
===================================================================
--- linux-2.6.16-rc2.orig/sound/ppc/tumbler.c	2006-02-03 19:43:50.000000000 +0100
+++ linux-2.6.16-rc2/sound/ppc/tumbler.c	2006-02-11 03:46:30.000000000 +0100
@@ -207,7 +207,7 @@ static int check_audio_gpio(struct pmac_
 
 	ret = do_gpio_read(gp);
 
-	return (ret & 0xd) == (gp->active_val & 0xd);
+	return (ret & 0x1) == (gp->active_val & 0x1);
 }
 
 static int read_audio_gpio(struct pmac_gpio *gp)

Andreas.

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2006-03-02  0:04 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-02-11 16:10 [PPC,SOUND] Fix audio gpio state detection Andreas Schwab
2006-02-12 22:35 ` Benjamin Herrenschmidt
2006-02-12 22:46   ` Ben Collins
2006-02-12 23:27     ` Benjamin Herrenschmidt
2006-02-26 17:39   ` Olaf Hering
2006-02-26 19:19     ` [Alsa-devel] " Lee Revell
2006-02-26 19:26       ` Olaf Hering
2006-03-01 22:30     ` Olaf Hering
2006-03-01 23:09       ` Benjamin Herrenschmidt
2006-03-01 23:49         ` Ben Collins
2006-03-02  0:00           ` Olaf Hering
2006-03-02  0:04             ` Benjamin Herrenschmidt
2006-03-02  0:04           ` Benjamin Herrenschmidt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).