summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJens Arnold <amiconn@rockbox.org>2006-11-12 14:17:49 +0000
committerJens Arnold <amiconn@rockbox.org>2006-11-12 14:17:49 +0000
commit8c3f0681b2347ff51680d61f9226c587a9cfdcee (patch)
treef59f3210aa545c3cd35c2bf42648c5b4f86753d3
parent7b30e50812294fa8d6626f4f08608730d9dcea80 (diff)
downloadrockbox-8c3f0681b2347ff51680d61f9226c587a9cfdcee.tar.gz
rockbox-8c3f0681b2347ff51680d61f9226c587a9cfdcee.tar.bz2
rockbox-8c3f0681b2347ff51680d61f9226c587a9cfdcee.zip
Get rid of ages-old interdependency between ata.c and mas.c
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11519 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--firmware/drivers/ata.c3
-rw-r--r--firmware/drivers/ata_mmc.c1
-rw-r--r--firmware/drivers/mas.c17
3 files changed, 8 insertions, 13 deletions
diff --git a/firmware/drivers/ata.c b/firmware/drivers/ata.c
index c882c22fe1..bb8eef9dd9 100644
--- a/firmware/drivers/ata.c
+++ b/firmware/drivers/ata.c
@@ -124,7 +124,6 @@ int ata_io_address; /* 0x300 or 0x200, only valid on recorder */
static volatile unsigned char* ata_control;
#endif
-bool old_recorder = false;
int ata_spinup_time = 0;
#if CONFIG_LED == LED_REAL
static bool ata_led_enabled = true;
@@ -1415,13 +1414,11 @@ static void io_address_detect(void)
if (read_hw_mask() & ATA_ADDRESS_200)
{
ata_io_address = 0x200; /* For debug purposes only */
- old_recorder = false;
ata_control = ATA_CONTROL1;
}
else
{
ata_io_address = 0x300; /* For debug purposes only */
- old_recorder = true;
ata_control = ATA_CONTROL2;
}
}
diff --git a/firmware/drivers/ata_mmc.c b/firmware/drivers/ata_mmc.c
index bf78bc84f4..30382ed36f 100644
--- a/firmware/drivers/ata_mmc.c
+++ b/firmware/drivers/ata_mmc.c
@@ -83,7 +83,6 @@
#define DT_STOP_TRAN 0xfd
/* for compatibility */
-bool old_recorder = false; /* FIXME: get rid of this cross-dependency */
int ata_spinup_time = 0;
long last_disk_activity = -1;
diff --git a/firmware/drivers/mas.c b/firmware/drivers/mas.c
index 1630255348..a8f910a426 100644
--- a/firmware/drivers/mas.c
+++ b/firmware/drivers/mas.c
@@ -24,8 +24,7 @@
#include "mas.h"
#include "kernel.h"
#include "system.h"
-
-extern bool old_recorder;
+#include "hwcompat.h"
static int mas_devread(unsigned long *dest, int len);
@@ -287,21 +286,21 @@ void mas_reset(void)
or_b(0x01, &PADRH);
sleep(HZ/5);
#elif (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
- if(old_recorder)
+ if (read_hw_mask() & ATA_ADDRESS_200)
{
- /* Older recorder models don't invert the POR signal */
- or_b(0x01, &PADRH);
- sleep(HZ/100);
and_b(~0x01, &PADRH);
+ sleep(HZ/100);
+ or_b(0x01, &PADRH);
sleep(HZ/5);
}
else
{
- and_b(~0x01, &PADRH);
- sleep(HZ/100);
+ /* Older recorder models don't invert the POR signal */
or_b(0x01, &PADRH);
+ sleep(HZ/100);
+ and_b(~0x01, &PADRH);
sleep(HZ/5);
- }
+ }
#endif
}