diff options
author | Thomas Martitz <kugel@rockbox.org> | 2009-11-26 00:51:09 +0000 |
---|---|---|
committer | Thomas Martitz <kugel@rockbox.org> | 2009-11-26 00:51:09 +0000 |
commit | ee7cf6c63c67222dcf9af6f40098428c577ee775 (patch) | |
tree | 3fd27260b04243d9fc3c4735c68b92d9d58faccb /firmware/target | |
parent | 82bbd1ed9f93020ef49ef91ca3282c4c29d6be88 (diff) |
Remove unused card_detect(), and make card_detect_target() static inline in each sd driver.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23757 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/target')
-rw-r--r-- | firmware/target/arm/as3525/ata_sd_as3525.c | 19 | ||||
-rw-r--r-- | firmware/target/arm/ata-sd-pp.c | 29 | ||||
-rw-r--r-- | firmware/target/arm/s3c2440/sd-s3c2440.c | 27 | ||||
-rw-r--r-- | firmware/target/arm/tcc780x/sd-tcc780x.c | 11 | ||||
-rw-r--r-- | firmware/target/mips/ingenic_jz47xx/ata-sd-jz4740.c | 2 |
5 files changed, 42 insertions, 46 deletions
diff --git a/firmware/target/arm/as3525/ata_sd_as3525.c b/firmware/target/arm/as3525/ata_sd_as3525.c index fdb39f34c2..f13f2f868d 100644 --- a/firmware/target/arm/as3525/ata_sd_as3525.c +++ b/firmware/target/arm/as3525/ata_sd_as3525.c @@ -137,6 +137,16 @@ static inline void mci_delay(void) } while (--i); } + +static inline bool card_detect_target(void) +{ +#if defined(HAVE_MULTIDRIVE) + return !(GPIOA_PIN(2)); +#else + return false; +#endif +} + #ifdef HAVE_HOTSWAP static int sd1_oneshot_callback(struct timeout *tmo) { @@ -872,15 +882,6 @@ tCardInfo *card_get_info_target(int card_no) return &card_info[card_no]; } -bool card_detect_target(void) -{ -#if defined(HAVE_MULTIDRIVE) - return !(GPIOA_PIN(2)); -#else - return false; -#endif -} - #ifdef HAVE_HOTSWAP void card_enable_monitoring_target(bool on) { diff --git a/firmware/target/arm/ata-sd-pp.c b/firmware/target/arm/ata-sd-pp.c index f2efd02e9d..fafc5f20d9 100644 --- a/firmware/target/arm/ata-sd-pp.c +++ b/firmware/target/arm/ata-sd-pp.c @@ -340,6 +340,21 @@ static int sd_wait_for_state(unsigned int state, int id) } } + +static inline bool card_detect_target(void) +{ +#ifdef HAVE_HOTSWAP +#ifdef SANSA_E200 + return (GPIOA_INPUT_VAL & 0x80) == 0; /* low active */ +#elif defined SANSA_C200 + return (GPIOL_INPUT_VAL & 0x08) != 0; /* high active */ +#endif +#else + return false; +#endif +} + + static inline void copy_read_sectors_fast(unsigned char **buf) { /* Copy one chunk of 16 words using best method for start alignment */ @@ -1278,20 +1293,6 @@ tCardInfo *card_get_info_target(int card_no) { return &card_info[card_no]; } - -bool card_detect_target(void) -{ -#ifdef HAVE_HOTSWAP -#ifdef SANSA_E200 - return (GPIOA_INPUT_VAL & 0x80) == 0; /* low active */ -#elif defined SANSA_C200 - return (GPIOL_INPUT_VAL & 0x08) != 0; /* high active */ -#endif -#else - return false; -#endif -} - #ifdef HAVE_HOTSWAP static int sd1_oneshot_callback(struct timeout *tmo) { diff --git a/firmware/target/arm/s3c2440/sd-s3c2440.c b/firmware/target/arm/s3c2440/sd-s3c2440.c index 6213cbd003..8aa53d8891 100644 --- a/firmware/target/arm/s3c2440/sd-s3c2440.c +++ b/firmware/target/arm/s3c2440/sd-s3c2440.c @@ -494,6 +494,17 @@ static int sd_init_card(const int card_no) Generic functions *****************************************************************************/ +static inline bool card_detect_target(void) +{ + /* TODO - use interrupt on change? */ +#ifdef MINI2440 + return (GPGDAT & SD_CD) == 0; +#else +#error Unsupported target +#endif +} + + /*****************************************************************************/ #ifdef HAVE_HOTSWAP @@ -512,16 +523,6 @@ static int sd1_oneshot_callback(struct timeout *tmo) return 0; } -bool card_detect_target(void) -{ - /* TODO - use interrupt on change? */ -#ifdef MINI2440 - return (GPGDAT & SD_CD) == 0; -#else -#error Unsupported target -#endif -} - void card_enable_monitoring_target(bool on) { if (on) @@ -570,12 +571,6 @@ bool sd_present(IF_MD_NONVOID(int card_no)) /*****************************************************************************/ #else -bool card_detect_target(void) -{ - /* not applicable */ - return false; -} - bool sd_removable(IF_MD_NONVOID(int card_no)) { #ifndef HAVE_MULTIDRIVE diff --git a/firmware/target/arm/tcc780x/sd-tcc780x.c b/firmware/target/arm/tcc780x/sd-tcc780x.c index 222bb88a15..25876aa7ba 100644 --- a/firmware/target/arm/tcc780x/sd-tcc780x.c +++ b/firmware/target/arm/tcc780x/sd-tcc780x.c @@ -205,9 +205,13 @@ static void sd_card_mux(int card_no) #ifdef HAVE_HOTSWAP -bool card_detect_target(void) +static inline bool card_detect_target(void) { +#ifdef HAVE_HOTSWAP return (GPIOB & (1<<26)) == 0; /* low active */ +#else + return false; +#endif } void card_enable_monitoring_target(bool on) @@ -261,11 +265,6 @@ bool sd_present(IF_MD_NONVOID(int card_no)) #else -bool card_detect_target(void) -{ - return false; -} - bool sd_removable(IF_MD_NONVOID(int card_no)) { #ifndef HAVE_MULTIDRIVE diff --git a/firmware/target/mips/ingenic_jz47xx/ata-sd-jz4740.c b/firmware/target/mips/ingenic_jz47xx/ata-sd-jz4740.c index 544e0cf481..f3d67aec51 100644 --- a/firmware/target/mips/ingenic_jz47xx/ata-sd-jz4740.c +++ b/firmware/target/mips/ingenic_jz47xx/ata-sd-jz4740.c @@ -1200,7 +1200,7 @@ int sd_init(void) return -1; } -bool card_detect_target(void) +static inline bool card_detect_target(void) { return (jz_sd_chkcard() == 1); } |