From c6ebfcce2cd6fbf4fe5faf9b120b0bdd567ecafe Mon Sep 17 00:00:00 2001 From: Barry Wardell Date: Mon, 2 Oct 2006 16:19:36 +0000 Subject: Enable ATA poweroff option on H10 for a nice increase in battery life. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11107 a1c6a512-1295-4272-9138-f99709370657 --- firmware/export/config-h10.h | 3 +++ firmware/export/config-h10_5gb.h | 3 +++ firmware/target/arm/iriver/h10/power-h10.c | 10 ++++++---- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/firmware/export/config-h10.h b/firmware/export/config-h10.h index 86d7cddca1..d29bd6c22d 100644 --- a/firmware/export/config-h10.h +++ b/firmware/export/config-h10.h @@ -116,6 +116,9 @@ * We can currently put the lcd to sleep but it won't wake up properly */ #define HAVE_LCD_SLEEP +/* We're able to shut off power to the HDD */ +#define HAVE_ATA_POWER_OFF + /* Offset ( in the firmware file's header ) to the file length */ #define FIRMWARE_OFFSET_FILE_LENGTH 0 diff --git a/firmware/export/config-h10_5gb.h b/firmware/export/config-h10_5gb.h index aefc21cef3..e40fdeab86 100644 --- a/firmware/export/config-h10_5gb.h +++ b/firmware/export/config-h10_5gb.h @@ -97,6 +97,9 @@ /* Type of LCD */ #define CONFIG_LCD LCD_H10_5GB +/* We're able to shut off power to the HDD */ +#define HAVE_ATA_POWER_OFF + /* Offset ( in the firmware file's header ) to the file length */ #define FIRMWARE_OFFSET_FILE_LENGTH 0 diff --git a/firmware/target/arm/iriver/h10/power-h10.c b/firmware/target/arm/iriver/h10/power-h10.c index 143248efcd..9470c0a67d 100644 --- a/firmware/target/arm/iriver/h10/power-h10.c +++ b/firmware/target/arm/iriver/h10/power-h10.c @@ -76,15 +76,17 @@ bool charger_inserted(void) void ide_power_enable(bool on) { - (void)on; - /* We do nothing on the iPod */ + if(on){ + GPIOF_OUTPUT_VAL &=~ 0x1; + } else { + GPIOF_OUTPUT_VAL |= 0x1; + } } bool ide_powered(void) { - /* pretend we are always powered - we don't turn it off on the ipod */ - return true; + return ((GPIOF_INPUT_VAL & 0x1) == 0); } void power_off(void) -- cgit v1.2.3