summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Sevakis <jethead71@rockbox.org>2008-05-05 11:21:04 +0000
committerMichael Sevakis <jethead71@rockbox.org>2008-05-05 11:21:04 +0000
commit9560ba66969c5bd7030da99acdf8f6fb34f3bfa0 (patch)
tree3f28cc39182279c1bf38aa9b9ad8cf0730b5c2e3
parent12884bd1b7fbd7f4ad25d1c629aac8fc4e38b346 (diff)
downloadrockbox-9560ba66969c5bd7030da99acdf8f6fb34f3bfa0.zip
rockbox-9560ba66969c5bd7030da99acdf8f6fb34f3bfa0.tar.gz
rockbox-9560ba66969c5bd7030da99acdf8f6fb34f3bfa0.tar.bz2
rockbox-9560ba66969c5bd7030da99acdf8f6fb34f3bfa0.tar.xz
Mind repeat calls to ata_device_init.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17373 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--firmware/target/arm/imx31/gigabeat-s/ata-imx31.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/firmware/target/arm/imx31/gigabeat-s/ata-imx31.c b/firmware/target/arm/imx31/gigabeat-s/ata-imx31.c
index 92c2300..965b447 100644
--- a/firmware/target/arm/imx31/gigabeat-s/ata-imx31.c
+++ b/firmware/target/arm/imx31/gigabeat-s/ata-imx31.c
@@ -24,6 +24,7 @@
#include "power.h"
#include "panic.h"
#include "ata.h"
+#include "ata-target.h"
#include "clkctl-imx31.h"
static const struct ata_pio_timings
@@ -78,6 +79,8 @@ static const struct ata_pio_timings
},
};
+static bool initialized = false;
+
/* Setup the timing for PIO mode */
static void ata_set_pio_mode(int mode)
{
@@ -125,8 +128,19 @@ void ata_device_init(void)
{
ATA_INTF_CONTROL |= ATA_ATA_RST; /* Make sure we're not in reset mode */
- /* Setup mode 0 by default */
- ata_set_pio_mode(0);
+ if (!initialized)
+ {
+ initialized = true;
+ /* Setup mode 0 by default */
+ ata_set_pio_mode(0);
+ /* mode may be switched later once identify info is ready in which
+ * case the main driver calls back */
+ }
+ else
+ {
+ /* identify info will be ready */
+ ata_identify_ready();
+ }
}
void ata_identify_ready(void)