From 46e1231a446b6adb002808ee83ace9c9be95d5e2 Mon Sep 17 00:00:00 2001 From: Rafaël Carré Date: Wed, 16 Jun 2010 06:08:04 +0000 Subject: FS#11402 by me : sd_enable for Sansa AMSv2 Gets a bit more battery life Adjust current usage, it was a bit too low for Clipv2/Clip+ git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26866 a1c6a512-1295-4272-9138-f99709370657 --- firmware/export/config/sansaclipplus.h | 2 +- firmware/export/config/sansaclipv2.h | 2 +- firmware/export/config/sansafuzev2.h | 2 +- firmware/target/arm/as3525/sd-as3525v2.c | 16 ++++++++++++++-- 4 files changed, 17 insertions(+), 5 deletions(-) diff --git a/firmware/export/config/sansaclipplus.h b/firmware/export/config/sansaclipplus.h index 883a71ea21..90636b152d 100644 --- a/firmware/export/config/sansaclipplus.h +++ b/firmware/export/config/sansaclipplus.h @@ -161,7 +161,7 @@ /* #define HAVE_POWEROFF_WHILE_CHARGING */ /* define current usage levels (based on battery bench) */ -#define CURRENT_NORMAL 15 +#define CURRENT_NORMAL 19 #define CURRENT_BACKLIGHT 15 #define CURRENT_RECORD CURRENT_NORMAL /* TODO */ diff --git a/firmware/export/config/sansaclipv2.h b/firmware/export/config/sansaclipv2.h index 3ae09b7003..85c1276367 100644 --- a/firmware/export/config/sansaclipv2.h +++ b/firmware/export/config/sansaclipv2.h @@ -157,7 +157,7 @@ /* #define HAVE_POWEROFF_WHILE_CHARGING */ /* define current usage levels (based on battery bench) */ -#define CURRENT_NORMAL 23 +#define CURRENT_NORMAL 24 #define CURRENT_BACKLIGHT 15 #define CURRENT_RECORD 11 diff --git a/firmware/export/config/sansafuzev2.h b/firmware/export/config/sansafuzev2.h index f3d8e0860e..de980c6ab3 100644 --- a/firmware/export/config/sansafuzev2.h +++ b/firmware/export/config/sansafuzev2.h @@ -164,7 +164,7 @@ #define CONFIG_I2C I2C_AS3525 /* define current usage levels (based on battery bench) */ -#define CURRENT_NORMAL 30 +#define CURRENT_NORMAL 26 #define CURRENT_BACKLIGHT 30 #define CURRENT_RECORD CURRENT_NORMAL diff --git a/firmware/target/arm/as3525/sd-as3525v2.c b/firmware/target/arm/as3525/sd-as3525v2.c index a668f65e0c..386b76e758 100644 --- a/firmware/target/arm/as3525/sd-as3525v2.c +++ b/firmware/target/arm/as3525/sd-as3525v2.c @@ -953,8 +953,20 @@ long sd_last_disk_activity(void) void sd_enable(bool on) { - /* TODO */ - (void) on; + if (on) + { + CGU_PERI |= CGU_MCI_CLOCK_ENABLE; + CGU_IDE |= (1<<7); /* AHB interface enable */ + CGU_MEMSTICK |= (1<<7); /* interface enable */ + CGU_SDSLOT |= (1<<7); /* interface enable */ + } + else + { + CGU_SDSLOT &= ~(1<<7); /* interface enable */ + CGU_MEMSTICK &= ~(1<<7); /* interface enable */ + CGU_IDE &= ~(1<<7); /* AHB interface enable */ + CGU_PERI &= ~CGU_MCI_CLOCK_ENABLE; + } } tCardInfo *card_get_info_target(int card_no) -- cgit v1.2.3