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/ata-sd-pp.c | 27 ++++++--------------------- 1 file changed, 6 insertions(+), 21 deletions(-) (limited to 'firmware/target/arm/ata-sd-pp.c') diff --git a/firmware/target/arm/ata-sd-pp.c b/firmware/target/arm/ata-sd-pp.c index f7b4a992e4..a2dcfe518f 100644 --- a/firmware/target/arm/ata-sd-pp.c +++ b/firmware/target/arm/ata-sd-pp.c @@ -1190,27 +1190,6 @@ void sd_enable(bool on) } } -#ifdef HAVE_HOTSWAP -void card_enable_monitoring_target(bool on) -{ - if (on) - { -#ifdef SANSA_E200 - GPIO_SET_BITWISE(GPIOA_INT_EN, 0x80); -#elif defined(SANSA_C200) - GPIO_SET_BITWISE(GPIOL_INT_EN, 0x08); -#endif - } - else - { -#ifdef SANSA_E200 - GPIO_CLEAR_BITWISE(GPIOA_INT_EN, 0x80); -#elif defined(SANSA_C200) - GPIO_CLEAR_BITWISE(GPIOL_INT_EN, 0x08); -#endif - } -} -#endif int sd_init(void) { @@ -1275,6 +1254,9 @@ int sd_init(void) GPIOA_INT_LEV = (0x80 << 8) | (~GPIOA_INPUT_VAL & 0x80); GPIOA_INT_CLR = 0x80; + + /* enable the card detect interrupt */ + GPIO_SET_BITWISE(GPIOA_INT_EN, 0x80); #elif defined SANSA_C200 CPU_INT_EN = HI_MASK; CPU_HI_INT_EN = GPIO2_MASK; @@ -1282,6 +1264,9 @@ int sd_init(void) GPIOL_INT_LEV = (0x08 << 8) | (~GPIOL_INPUT_VAL & 0x08); GPIOL_INT_CLR = 0x08; + + /* enable the card detect interrupt */ + GPIO_SET_BITWISE(GPIOL_INT_EN, 0x08); #endif #endif } -- cgit v1.2.3