From 8c3f0681b2347ff51680d61f9226c587a9cfdcee Mon Sep 17 00:00:00 2001 From: Jens Arnold Date: Sun, 12 Nov 2006 14:17:49 +0000 Subject: [PATCH] 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 --- firmware/drivers/ata.c | 3 --- firmware/drivers/ata_mmc.c | 1 - firmware/drivers/mas.c | 19 +++++++++---------- 3 files changed, 9 insertions(+), 14 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,7 +286,14 @@ 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) + { + and_b(~0x01, &PADRH); + sleep(HZ/100); + or_b(0x01, &PADRH); + sleep(HZ/5); + } + else { /* Older recorder models don't invert the POR signal */ or_b(0x01, &PADRH); @@ -295,13 +301,6 @@ void mas_reset(void) and_b(~0x01, &PADRH); sleep(HZ/5); } - else - { - and_b(~0x01, &PADRH); - sleep(HZ/100); - or_b(0x01, &PADRH); - sleep(HZ/5); - } #endif }