From 249aae587a1f35f5df55613c6765ae763db39107 Mon Sep 17 00:00:00 2001 From: Thomas Martitz Date: Tue, 27 Apr 2010 10:11:52 +0000 Subject: FS#11172 - Fuzev2: Read the scrollwheel scrollwheel via IRQ git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25736 a1c6a512-1295-4272-9138-f99709370657 --- firmware/target/arm/as3525/sd-as3525v2.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'firmware/target/arm/as3525/sd-as3525v2.c') diff --git a/firmware/target/arm/as3525/sd-as3525v2.c b/firmware/target/arm/as3525/sd-as3525v2.c index 2f263f7378..65fc13feae 100644 --- a/firmware/target/arm/as3525/sd-as3525v2.c +++ b/firmware/target/arm/as3525/sd-as3525v2.c @@ -342,6 +342,7 @@ static volatile bool retry; #if defined(HAVE_MULTIDRIVE) int active_card = 0; +#define EXT_SD_BITS (1<<2) #endif static inline void mci_delay(void) { udelay(1000); } @@ -687,14 +688,12 @@ int sd_init(void) wakeup_init(&transfer_completion_signal); #ifdef HAVE_MULTIDRIVE - /* setup isr for microsd monitoring */ - VIC_INT_ENABLE = (INTERRUPT_GPIOA); /* clear previous irq */ - GPIOA_IC = (1<<2); + GPIOA_IC = EXT_SD_BITS; /* enable edge detecting */ - GPIOA_IS &= ~(1<<2); + GPIOA_IS &= ~EXT_SD_BITS; /* detect both raising and falling edges */ - GPIOA_IBE |= (1<<2); + GPIOA_IBE |= EXT_SD_BITS; /* Configure XPD for SD-MCI interface */ CCU_IO |= (1<<2); #endif @@ -961,20 +960,21 @@ static int sd1_oneshot_callback(struct timeout *tmo) return 0; } -void INT_GPIOA(void) +void sd_gpioa_isr(void) { static struct timeout sd1_oneshot; + if (GPIOA_MIS & EXT_SD_BITS) + timeout_register(&sd1_oneshot, sd1_oneshot_callback, (3*HZ/10), 0); /* acknowledge interrupt */ - GPIOA_IC = (1<<2); - timeout_register(&sd1_oneshot, sd1_oneshot_callback, (3*HZ/10), 0); + GPIOA_IC = EXT_SD_BITS; } void card_enable_monitoring_target(bool on) { if (on) /* enable interrupt */ - GPIOA_IE |= (1<<2); + GPIOA_IE |= EXT_SD_BITS; else /* disable interrupt */ - GPIOA_IE &= ~(1<<2); + GPIOA_IE &= ~EXT_SD_BITS; } #endif /* HAVE_HOTSWAP */ -- cgit v1.2.3