diff options
author | Thomas Martitz <kugel@rockbox.org> | 2010-04-27 10:11:52 +0000 |
---|---|---|
committer | Thomas Martitz <kugel@rockbox.org> | 2010-04-27 10:11:52 +0000 |
commit | 249aae587a1f35f5df55613c6765ae763db39107 (patch) | |
tree | dcc7f100fcdc7af8b09a7e3daa96b852a1986c74 /firmware/target/arm/as3525/sd-as3525v2.c | |
parent | ee291a5e9b12651ffa658bef15e09902a82285f9 (diff) | |
download | rockbox-249aae587a1f35f5df55613c6765ae763db39107.tar.gz rockbox-249aae587a1f35f5df55613c6765ae763db39107.zip |
FS#11172 - Fuzev2: Read the scrollwheel scrollwheel via IRQ
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25736 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/target/arm/as3525/sd-as3525v2.c')
-rw-r--r-- | firmware/target/arm/as3525/sd-as3525v2.c | 20 |
1 files changed, 10 insertions, 10 deletions
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; | |||
342 | 342 | ||
343 | #if defined(HAVE_MULTIDRIVE) | 343 | #if defined(HAVE_MULTIDRIVE) |
344 | int active_card = 0; | 344 | int active_card = 0; |
345 | #define EXT_SD_BITS (1<<2) | ||
345 | #endif | 346 | #endif |
346 | 347 | ||
347 | static inline void mci_delay(void) { udelay(1000); } | 348 | static inline void mci_delay(void) { udelay(1000); } |
@@ -687,14 +688,12 @@ int sd_init(void) | |||
687 | wakeup_init(&transfer_completion_signal); | 688 | wakeup_init(&transfer_completion_signal); |
688 | 689 | ||
689 | #ifdef HAVE_MULTIDRIVE | 690 | #ifdef HAVE_MULTIDRIVE |
690 | /* setup isr for microsd monitoring */ | ||
691 | VIC_INT_ENABLE = (INTERRUPT_GPIOA); | ||
692 | /* clear previous irq */ | 691 | /* clear previous irq */ |
693 | GPIOA_IC = (1<<2); | 692 | GPIOA_IC = EXT_SD_BITS; |
694 | /* enable edge detecting */ | 693 | /* enable edge detecting */ |
695 | GPIOA_IS &= ~(1<<2); | 694 | GPIOA_IS &= ~EXT_SD_BITS; |
696 | /* detect both raising and falling edges */ | 695 | /* detect both raising and falling edges */ |
697 | GPIOA_IBE |= (1<<2); | 696 | GPIOA_IBE |= EXT_SD_BITS; |
698 | /* Configure XPD for SD-MCI interface */ | 697 | /* Configure XPD for SD-MCI interface */ |
699 | CCU_IO |= (1<<2); | 698 | CCU_IO |= (1<<2); |
700 | #endif | 699 | #endif |
@@ -961,20 +960,21 @@ static int sd1_oneshot_callback(struct timeout *tmo) | |||
961 | return 0; | 960 | return 0; |
962 | } | 961 | } |
963 | 962 | ||
964 | void INT_GPIOA(void) | 963 | void sd_gpioa_isr(void) |
965 | { | 964 | { |
966 | static struct timeout sd1_oneshot; | 965 | static struct timeout sd1_oneshot; |
966 | if (GPIOA_MIS & EXT_SD_BITS) | ||
967 | timeout_register(&sd1_oneshot, sd1_oneshot_callback, (3*HZ/10), 0); | ||
967 | /* acknowledge interrupt */ | 968 | /* acknowledge interrupt */ |
968 | GPIOA_IC = (1<<2); | 969 | GPIOA_IC = EXT_SD_BITS; |
969 | timeout_register(&sd1_oneshot, sd1_oneshot_callback, (3*HZ/10), 0); | ||
970 | } | 970 | } |
971 | 971 | ||
972 | void card_enable_monitoring_target(bool on) | 972 | void card_enable_monitoring_target(bool on) |
973 | { | 973 | { |
974 | if (on) /* enable interrupt */ | 974 | if (on) /* enable interrupt */ |
975 | GPIOA_IE |= (1<<2); | 975 | GPIOA_IE |= EXT_SD_BITS; |
976 | else /* disable interrupt */ | 976 | else /* disable interrupt */ |
977 | GPIOA_IE &= ~(1<<2); | 977 | GPIOA_IE &= ~EXT_SD_BITS; |
978 | } | 978 | } |
979 | #endif /* HAVE_HOTSWAP */ | 979 | #endif /* HAVE_HOTSWAP */ |
980 | 980 | ||