diff options
| author | Michael Sevakis <jethead71@rockbox.org> | 2008-12-24 19:36:37 +0000 |
|---|---|---|
| committer | Michael Sevakis <jethead71@rockbox.org> | 2008-12-24 19:36:37 +0000 |
| commit | 377b42b63bf49e72f49969ad96eeeef8cc3c4ce2 (patch) | |
| tree | 3167e772e655c71c4dc58a2ceaa8a190d65ff287 | |
| parent | 9b8f56f35cfd67a1438ef7a6676319405b226d5d (diff) | |
| download | rockbox-377b42b63bf49e72f49969ad96eeeef8cc3c4ce2.zip rockbox-377b42b63bf49e72f49969ad96eeeef8cc3c4ce2.tar.gz rockbox-377b42b63bf49e72f49969ad96eeeef8cc3c4ce2.tar.bz2 rockbox-377b42b63bf49e72f49969ad96eeeef8cc3c4ce2.tar.xz | |
H10 can distinguish USB and MAIN charger input so return proper flags. H100s were misconfigured and should use CHARGING_SIMPLE. Comment more on what charging types mean in config.h.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19582 a1c6a512-1295-4272-9138-f99709370657
| -rw-r--r-- | firmware/export/config-h100.h | 3 | ||||
| -rw-r--r-- | firmware/export/config-h120.h | 2 | ||||
| -rw-r--r-- | firmware/export/config.h | 14 | ||||
| -rw-r--r-- | firmware/target/arm/iriver/h10/power-h10.c | 12 | ||||
| -rw-r--r-- | firmware/target/coldfire/iriver/h100/power-h100.c | 6 |
5 files changed, 21 insertions, 16 deletions
diff --git a/firmware/export/config-h100.h b/firmware/export/config-h100.h index 7f91e35..be71825 100644 --- a/firmware/export/config-h100.h +++ b/firmware/export/config-h100.h @@ -110,8 +110,7 @@ #define BATTERY_TYPES_COUNT 1 /* only one type */ /* Hardware controlled charging */ - -#define CONFIG_CHARGING CHARGING_MONITOR /* FIXME: remove that once monitoring is fixed properly */ +#define CONFIG_CHARGING CHARGING_SIMPLE /* define current usage levels */ #define CURRENT_NORMAL 80 /* 16h playback on 1300mAh battery */ diff --git a/firmware/export/config-h120.h b/firmware/export/config-h120.h index b4a687b..4757d77 100644 --- a/firmware/export/config-h120.h +++ b/firmware/export/config-h120.h @@ -110,7 +110,7 @@ #define BATTERY_TYPES_COUNT 1 /* only one type */ /* Hardware controlled charging */ -#define CONFIG_CHARGING CHARGING_MONITOR /* FIXME: remove that once monitoring is fixed properly */ +#define CONFIG_CHARGING CHARGING_SIMPLE /* define current usage levels */ #define CURRENT_NORMAL 80 /* 16h playback on 1300mAh battery */ diff --git a/firmware/export/config.h b/firmware/export/config.h index 1854f59..9bc6c7c 100644 --- a/firmware/export/config.h +++ b/firmware/export/config.h @@ -116,12 +116,18 @@ /* CONFIG_CHARGING */ /* Generic types */ -#define CHARGING_SIMPLE 1 /* Simple, hardware controlled charging */ -#define CHARGING_MONITOR 2 /* Hardware controlled charging with monitoring */ +#define CHARGING_SIMPLE 1 /* Simple, hardware controlled charging + * (CPU cannot read charger state but may read + * when power is plugged-in). */ +#define CHARGING_MONITOR 2 /* Hardware controlled charging with monitoring + * (CPU is able to read HW charging state and + * when power is plugged-in). */ /* Mostly target-specific code in the /target tree */ -#define CHARGING_TARGET 3 - +#define CHARGING_TARGET 3 /* Any algorithm - usually software controlled + * charging or specific programming is required to + * use the charging hardware. */ + /* CONFIG_LCD */ #define LCD_SSD1815 1 /* as used by Archos Recorders and Ondios */ #define LCD_SSD1801 2 /* as used by Archos Player/Studio */ diff --git a/firmware/target/arm/iriver/h10/power-h10.c b/firmware/target/arm/iriver/h10/power-h10.c index 1a1f6af..2535c58 100644 --- a/firmware/target/arm/iriver/h10/power-h10.c +++ b/firmware/target/arm/iriver/h10/power-h10.c @@ -50,9 +50,15 @@ void power_init(void) unsigned int power_input_status(void) { - /* No separate source for USB and charges from USB on its own */ - return (GPIOF_INPUT_VAL & 0x08) ? - POWER_INPUT_MAIN_CHARGER : POWER_INPUT_NONE; + unsigned int status = POWER_INPUT_NONE; + + if (GPIOF_INPUT_VAL & 0x08) + status = POWER_INPUT_MAIN_CHARGER; + + if (GPIOL_INPUT_VAL & 0x04) + status |= POWER_INPUT_USB_CHARGER; + + return status; } void ide_power_enable(bool on) diff --git a/firmware/target/coldfire/iriver/h100/power-h100.c b/firmware/target/coldfire/iriver/h100/power-h100.c index 2717e42..1dcea9c 100644 --- a/firmware/target/coldfire/iriver/h100/power-h100.c +++ b/firmware/target/coldfire/iriver/h100/power-h100.c @@ -57,12 +57,6 @@ unsigned int power_input_status(void) POWER_INPUT_MAIN_CHARGER : POWER_INPUT_NONE; } -/* Returns true if the unit is charging the batteries. */ -bool charging_state(void) -{ - return (power_input_status() & POWER_INPUT_CHARGER) != 0; -} - #ifdef HAVE_SPDIF_POWER void spdif_power_enable(bool on) { |