From 9c43b2ce17cbc1f88b825ab8a5021575cee46dd7 Mon Sep 17 00:00:00 2001 From: Frank Gevaerts Date: Sun, 6 Jun 2010 13:20:47 +0000 Subject: Remove card_enable_monitoring() and use a mutex instead. The card_enable_monitoring() method actually didn't eliminate the possible race conditions it was meant to fix. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26627 a1c6a512-1295-4272-9138-f99709370657 --- firmware/target/arm/as3525/sd-as3525.c | 12 ++---------- firmware/target/arm/as3525/sd-as3525v2.c | 11 +++-------- 2 files changed, 5 insertions(+), 18 deletions(-) (limited to 'firmware/target/arm/as3525') diff --git a/firmware/target/arm/as3525/sd-as3525.c b/firmware/target/arm/as3525/sd-as3525.c index 9c0b4124ac..8aaae55cf4 100644 --- a/firmware/target/arm/as3525/sd-as3525.c +++ b/firmware/target/arm/as3525/sd-as3525.c @@ -508,6 +508,8 @@ static void init_pl180_controller(const int drive) GPIOA_IS &= ~EXT_SD_BITS; /* detect both raising and falling edges */ GPIOA_IBE |= EXT_SD_BITS; + /* enable the card detect interrupt */ + GPIOA_IE |= EXT_SD_BITS; #else VIC_INT_ENABLE = INTERRUPT_NAND; @@ -922,16 +924,6 @@ tCardInfo *card_get_info_target(int card_no) return &card_info[card_no]; } -#ifdef HAVE_HOTSWAP -void card_enable_monitoring_target(bool on) -{ - if (on) /* enable interrupt */ - GPIOA_IE |= EXT_SD_BITS; - else /* disable interrupt */ - GPIOA_IE &= ~EXT_SD_BITS; -} -#endif /* HAVE_HOTSWAP */ - #endif /* !BOOTLOADER */ #ifdef CONFIG_STORAGE_MULTI diff --git a/firmware/target/arm/as3525/sd-as3525v2.c b/firmware/target/arm/as3525/sd-as3525v2.c index ccc88be25d..1a555e745d 100644 --- a/firmware/target/arm/as3525/sd-as3525v2.c +++ b/firmware/target/arm/as3525/sd-as3525v2.c @@ -731,6 +731,9 @@ int sd_init(void) GPIOA_IS &= ~EXT_SD_BITS; /* detect both raising and falling edges */ GPIOA_IBE |= EXT_SD_BITS; + /* enable the card detect interrupt */ + GPIOA_IE |= EXT_SD_BITS; + /* Configure XPD for SD-MCI interface */ CCU_IO |= (1<<2); #endif @@ -989,14 +992,6 @@ void sd_gpioa_isr(void) /* acknowledge interrupt */ GPIOA_IC = EXT_SD_BITS; } - -void card_enable_monitoring_target(bool on) -{ - if (on) /* enable interrupt */ - GPIOA_IE |= EXT_SD_BITS; - else /* disable interrupt */ - GPIOA_IE &= ~EXT_SD_BITS; -} #endif /* HAVE_HOTSWAP */ #ifdef CONFIG_STORAGE_MULTI -- cgit v1.2.3