aboutsummaryrefslogtreecommitdiffstats
path: root/sound/ppc/tumbler.c
diff options
context:
space:
mode:
authorAndreas Schwab <schwab@suse.de>2006-09-01 11:15:36 -0400
committerJaroslav Kysela <perex@suse.cz>2006-09-23 04:45:33 -0400
commit2fd53a7e9b1392f9cc3002a24f3c13b2796e70c3 (patch)
tree867ee4c5928d1f6305822740291fbc7c44607bca /sound/ppc/tumbler.c
parent927fc866025857c109219d4ed62d8c3cbc02713a (diff)
[ALSA] [PPC,SOUND] Fix audio gpio state detection
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> Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@suse.cz>
Diffstat (limited to 'sound/ppc/tumbler.c')
-rw-r--r--sound/ppc/tumbler.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sound/ppc/tumbler.c b/sound/ppc/tumbler.c
index 6ae2d5b9aa4a..cdff53e4a17e 100644
--- a/sound/ppc/tumbler.c
+++ b/sound/ppc/tumbler.c
@@ -190,7 +190,7 @@ static int check_audio_gpio(struct pmac_gpio *gp)
190 190
191 ret = do_gpio_read(gp); 191 ret = do_gpio_read(gp);
192 192
193 return (ret & 0xd) == (gp->active_val & 0xd); 193 return (ret & 0x1) == (gp->active_val & 0x1);
194} 194}
195 195
196static int read_audio_gpio(struct pmac_gpio *gp) 196static int read_audio_gpio(struct pmac_gpio *gp)
@@ -198,7 +198,8 @@ static int read_audio_gpio(struct pmac_gpio *gp)
198 int ret; 198 int ret;
199 if (! gp->addr) 199 if (! gp->addr)
200 return 0; 200 return 0;
201 ret = ((do_gpio_read(gp) & 0x02) !=0); 201 ret = do_gpio_read(gp);
202 ret = (ret & 0x02) !=0;
202 return ret == gp->active_state; 203 return ret == gp->active_state;
203} 204}
204 205