summaryrefslogtreecommitdiffstats
path: root/firmware/target/arm
diff options
context:
space:
mode:
authorRob Purchase <shotofadds@rockbox.org>2009-07-10 16:55:18 +0000
committerRob Purchase <shotofadds@rockbox.org>2009-07-10 16:55:18 +0000
commit9cb62038e3cbb5d8c92d5898b84f61ad8a5a9acf (patch)
tree76705658359c5d9f23bd003a5261d07e7bc5c34a /firmware/target/arm
parent99edc7b075983c0d1ba5d078a00cc34983122231 (diff)
downloadrockbox-9cb62038e3cbb5d8c92d5898b84f61ad8a5a9acf.tar.gz
rockbox-9cb62038e3cbb5d8c92d5898b84f61ad8a5a9acf.tar.bz2
rockbox-9cb62038e3cbb5d8c92d5898b84f61ad8a5a9acf.zip
Make the TCC NAND driver use the (virtual) disk activity LED.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21748 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/target/arm')
-rw-r--r--firmware/target/arm/ata-nand-telechips.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/firmware/target/arm/ata-nand-telechips.c b/firmware/target/arm/ata-nand-telechips.c
index 30ca302ce9..8bef57ee21 100644
--- a/firmware/target/arm/ata-nand-telechips.c
+++ b/firmware/target/arm/ata-nand-telechips.c
@@ -27,6 +27,7 @@
#include "nand_id.h"
#include "storage.h"
#include "buffer.h"
+#include "led.h"
#define SECTOR_SIZE 512
@@ -701,7 +702,12 @@ int nand_read_sectors(IF_MV2(int drive,) unsigned long start, int incount,
#ifdef HAVE_MULTIVOLUME
(void)drive; /* unused for now */
#endif
+
+ int ret = 0;
+
mutex_lock(&ata_mtx);
+
+ led(true);
while (incount > 0)
{
@@ -713,8 +719,8 @@ int nand_read_sectors(IF_MV2(int drive,) unsigned long start, int incount,
{
if (!nand_read_sector_of_logical_segment(segment, secmod, inbuf))
{
- mutex_unlock(&ata_mtx);
- return -1;
+ ret = -1;
+ goto nand_read_error;
}
#ifdef CPU_TCC780X /* 77x doesn't have USEC_TIMER yet */
@@ -733,14 +739,18 @@ int nand_read_sectors(IF_MV2(int drive,) unsigned long start, int incount,
if (done < 0)
{
- mutex_unlock(&ata_mtx);
- return -1;
+ ret = -1;
+ goto nand_read_error;
}
start += done;
}
+nand_read_error:
+
mutex_unlock(&ata_mtx);
- return 0;
+ led(false);
+
+ return ret;
}