[PATCH] [UBUNTU:sound/ppc/] #25634: Fix gpio state detection for tumbler
crimsun at fungus.sh.nu
crimsun at fungus.sh.nu
Sun Sep 3 05:52:33 UTC 2006
From 5d6d6ed0daea4d03fbf71832d7f2ac5e60ccddee Mon Sep 17 00:00:00 2001
From: Daniel T. Chen <crimsun at garnish.localdomain>
Date: Sun, 3 Sep 2006 01:50:56 -0400
Subject: [PATCH] [UBUNTU:sound/ppc/] #25634: Fix gpio state detection for tumbler
UpstreamStatus: Added in upstream alsa-kernel hg changeset:
8a0a1ba62c91 [http://hg-mirror.alsa-project.org/alsa-kernel?cmd=changeset;node=8a0a1ba62c91ad59302db1448a73a5c02663ead7;style=raw]
From Andreas Schwab <schwab at suse.de>:
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.
This commit closes Ubuntu #25634.
Signed-off-by: Andreas Schwab <schwab at suse.de>
Signed-off-by: Daniel T Chen <crimsun at ubuntu.com>
---
sound/ppc/tumbler.c | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/sound/ppc/tumbler.c b/sound/ppc/tumbler.c
index d74bfab..719f56a 100644
--- a/sound/ppc/tumbler.c
+++ b/sound/ppc/tumbler.c
@@ -191,7 +191,7 @@ static int check_audio_gpio(pmac_gpio_t
ret = do_gpio_read(gp);
- return (ret & 0xd) == (gp->active_val & 0xd);
+ return (ret & 0x1) == (gp->active_val & 0x1);
}
static int read_audio_gpio(pmac_gpio_t *gp)
@@ -199,7 +199,8 @@ static int read_audio_gpio(pmac_gpio_t *
int ret;
if (! gp->addr)
return 0;
- ret = ((do_gpio_read(gp) & 0x02) !=0);
+ ret = do_gpio_read(gp);
+ ret = (ret & 0x02) !=0;
return ret == gp->active_state;
}
--
1.4.1
--
Daniel T. Chen crimsun at ubuntu.com
GPG key: 0xC88ABDA3
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <https://lists.ubuntu.com/archives/kernel-team/attachments/20060902/cbd5deba/attachment.sig>
More information about the kernel-team
mailing list