summaryrefslogtreecommitdiff
path: root/firmware/drivers
diff options
context:
space:
mode:
authorBjörn Stenberg <bjorn@haxx.se>2002-12-04 14:58:48 +0000
committerBjörn Stenberg <bjorn@haxx.se>2002-12-04 14:58:48 +0000
commitb070dd55be61b19a0cf88cd8d8a5b80387c50f31 (patch)
treebda0516c85e38bfc687fdc74ba97eea016e46b58 /firmware/drivers
parentd41942e12f6a63b1067e9d3b91e55a02ad78b2b6 (diff)
downloadrockbox-b070dd55be61b19a0cf88cd8d8a5b80387c50f31.tar.gz
rockbox-b070dd55be61b19a0cf88cd8d8a5b80387c50f31.zip
Added disk spinup clocking
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@2927 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/drivers')
-rw-r--r--firmware/drivers/ata.c3
-rw-r--r--firmware/drivers/ata.h1
2 files changed, 4 insertions, 0 deletions
diff --git a/firmware/drivers/ata.c b/firmware/drivers/ata.c
index 0b7a37e5ec..8f70714e4c 100644
--- a/firmware/drivers/ata.c
+++ b/firmware/drivers/ata.c
@@ -80,6 +80,7 @@ int ata_io_address; /* 0x300 or 0x200, only valid on recorder */
80static volatile unsigned char* ata_control; 80static volatile unsigned char* ata_control;
81 81
82bool old_recorder = false; 82bool old_recorder = false;
83int ata_spinup_time = 0;
83static bool sleeping = false; 84static bool sleeping = false;
84static int sleep_timeout = 5*HZ; 85static int sleep_timeout = 5*HZ;
85static bool poweroff = false; 86static bool poweroff = false;
@@ -186,6 +187,7 @@ int ata_read_sectors(unsigned long start,
186 } 187 }
187 sleeping = false; 188 sleeping = false;
188 poweroff = false; 189 poweroff = false;
190 ata_spinup_time = current_tick - last_disk_activity;
189 } 191 }
190 192
191 ATA_SELECT = ata_device; 193 ATA_SELECT = ata_device;
@@ -307,6 +309,7 @@ int ata_write_sectors(unsigned long start,
307 } 309 }
308 sleeping = false; 310 sleeping = false;
309 poweroff = false; 311 poweroff = false;
312 ata_spinup_time = current_tick - last_disk_activity;
310 } 313 }
311 314
312 ATA_SELECT = ata_device; 315 ATA_SELECT = ata_device;
diff --git a/firmware/drivers/ata.h b/firmware/drivers/ata.h
index a9a79870c4..7a1fb4a952 100644
--- a/firmware/drivers/ata.h
+++ b/firmware/drivers/ata.h
@@ -48,5 +48,6 @@ extern void ata_spin(void);
48extern unsigned short* ata_get_identify(void); 48extern unsigned short* ata_get_identify(void);
49 49
50extern long last_disk_activity; 50extern long last_disk_activity;
51extern int ata_spinup_time; /* ticks */
51 52
52#endif 53#endif