summaryrefslogtreecommitdiff
path: root/firmware/drivers/ata_mmc.c
diff options
context:
space:
mode:
authorJens Arnold <amiconn@rockbox.org>2004-10-10 19:51:11 +0000
committerJens Arnold <amiconn@rockbox.org>2004-10-10 19:51:11 +0000
commit5789ee99286a487e1764bd9b52562e1a79b5d4e7 (patch)
treee4a9eb64f5b8f58def41faa2e123e553b2bdf5d8 /firmware/drivers/ata_mmc.c
parent120d863c68a6c4489357f1ae11db3e96a0124ded (diff)
downloadrockbox-5789ee99286a487e1764bd9b52562e1a79b5d4e7.zip
rockbox-5789ee99286a487e1764bd9b52562e1a79b5d4e7.tar.gz
rockbox-5789ee99286a487e1764bd9b52562e1a79b5d4e7.tar.bz2
rockbox-5789ee99286a487e1764bd9b52562e1a79b5d4e7.tar.xz
MMC hotswap handling in USB mode
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@5247 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/drivers/ata_mmc.c')
-rw-r--r--firmware/drivers/ata_mmc.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/firmware/drivers/ata_mmc.c b/firmware/drivers/ata_mmc.c
index 7b3b8d1..faa4c1f 100644
--- a/firmware/drivers/ata_mmc.c
+++ b/firmware/drivers/ata_mmc.c
@@ -135,18 +135,21 @@ static void swapcopy_sector(const unsigned char *buf);
static int send_sector(const unsigned char *nextbuf, int timeout);
static int send_single_sector(const unsigned char *buf, int timeout);
-static bool mmc_detect(void);
static void mmc_tick(void);
/* implementation */
-static int select_card(int card_no)
+void mmc_select_clock(int card_no)
{
if (card_no == 0) /* internal */
or_b(0x10, &PADRH); /* set clock gate PA12 CHECKME: mask? */
else /* external */
and_b(~0x10, &PADRH); /* clear clock gate PA12 CHECKME: mask?*/
-
+}
+
+static int select_card(int card_no)
+{
+ mmc_select_clock(card_no);
last_disk_activity = current_tick;
if (!card_info[card_no].initialized)
@@ -760,7 +763,7 @@ void ata_spin(void)
{
}
-static bool mmc_detect(void)
+bool mmc_detect(void)
{
return adc_read(ADC_MMC_SWITCH) < 0x200 ? true : false;
}