diff options
author | Johannes Berg <johannes@sipsolutions.net> | 2006-06-28 14:00:58 +0200 |
---|---|---|
committer | Jaroslav Kysela <perex@suse.cz> | 2006-06-28 19:31:35 +0200 |
commit | bd66f3bbc369191279d18c21f305341c8bc9cafe (patch) | |
tree | f429ea96daa3e120e547af01dda5b18534b0ea6d /sound/aoa | |
parent | c6feefd03ed12d89af591345fb9c26de7098764d (diff) | |
download | op-kernel-dev-bd66f3bbc369191279d18c21f305341c8bc9cafe.zip op-kernel-dev-bd66f3bbc369191279d18c21f305341c8bc9cafe.tar.gz |
[ALSA] snd-aoa: enable dual-edge in GPIOs
Apparently some firmware versions forget enabling the dual-edge bit,
snd-powermac did that too and even OSX does sometimes. This should fix
headphone plug detection on those machines.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@suse.cz>
Diffstat (limited to 'sound/aoa')
-rw-r--r-- | sound/aoa/core/snd-aoa-gpio-feature.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/sound/aoa/core/snd-aoa-gpio-feature.c b/sound/aoa/core/snd-aoa-gpio-feature.c index 2c6eb77..bab9754 100644 --- a/sound/aoa/core/snd-aoa-gpio-feature.c +++ b/sound/aoa/core/snd-aoa-gpio-feature.c @@ -207,6 +207,17 @@ static void ftr_handle_notify(void *data) mutex_unlock(¬if->mutex); } +static void gpio_enable_dual_edge(int gpio) +{ + int v; + + if (gpio == -1) + return; + v = pmac_call_feature(PMAC_FTR_READ_GPIO, NULL, gpio, 0); + v |= 0x80; /* enable dual edge */ + pmac_call_feature(PMAC_FTR_WRITE_GPIO, NULL, gpio, v); +} + static void ftr_gpio_init(struct gpio_runtime *rt) { get_gpio("headphone-mute", NULL, @@ -234,6 +245,10 @@ static void ftr_gpio_init(struct gpio_runtime *rt) &linein_detect_gpio, &linein_detect_gpio_activestate); + gpio_enable_dual_edge(headphone_detect_gpio); + gpio_enable_dual_edge(lineout_detect_gpio); + gpio_enable_dual_edge(linein_detect_gpio); + get_irq(headphone_detect_node, &headphone_detect_irq); get_irq(lineout_detect_node, &lineout_detect_irq); get_irq(linein_detect_node, &linein_detect_irq); |