summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Sevakis <jethead71@rockbox.org>2008-12-24 19:36:37 +0000
committerMichael Sevakis <jethead71@rockbox.org>2008-12-24 19:36:37 +0000
commit377b42b63bf49e72f49969ad96eeeef8cc3c4ce2 (patch)
tree3167e772e655c71c4dc58a2ceaa8a190d65ff287
parent9b8f56f35cfd67a1438ef7a6676319405b226d5d (diff)
downloadrockbox-377b42b63bf49e72f49969ad96eeeef8cc3c4ce2.tar.gz
rockbox-377b42b63bf49e72f49969ad96eeeef8cc3c4ce2.zip
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.h3
-rw-r--r--firmware/export/config-h120.h2
-rw-r--r--firmware/export/config.h14
-rw-r--r--firmware/target/arm/iriver/h10/power-h10.c12
-rw-r--r--firmware/target/coldfire/iriver/h100/power-h100.c6
5 files changed, 21 insertions, 16 deletions
diff --git a/firmware/export/config-h100.h b/firmware/export/config-h100.h
index 7f91e35fbf..be718259f8 100644
--- a/firmware/export/config-h100.h
+++ b/firmware/export/config-h100.h
@@ -110,8 +110,7 @@
110#define BATTERY_TYPES_COUNT 1 /* only one type */ 110#define BATTERY_TYPES_COUNT 1 /* only one type */
111 111
112/* Hardware controlled charging */ 112/* Hardware controlled charging */
113 113#define CONFIG_CHARGING CHARGING_SIMPLE
114#define CONFIG_CHARGING CHARGING_MONITOR /* FIXME: remove that once monitoring is fixed properly */
115 114
116/* define current usage levels */ 115/* define current usage levels */
117#define CURRENT_NORMAL 80 /* 16h playback on 1300mAh battery */ 116#define CURRENT_NORMAL 80 /* 16h playback on 1300mAh battery */
diff --git a/firmware/export/config-h120.h b/firmware/export/config-h120.h
index b4a687b6d7..4757d7708c 100644
--- a/firmware/export/config-h120.h
+++ b/firmware/export/config-h120.h
@@ -110,7 +110,7 @@
110#define BATTERY_TYPES_COUNT 1 /* only one type */ 110#define BATTERY_TYPES_COUNT 1 /* only one type */
111 111
112/* Hardware controlled charging */ 112/* Hardware controlled charging */
113#define CONFIG_CHARGING CHARGING_MONITOR /* FIXME: remove that once monitoring is fixed properly */ 113#define CONFIG_CHARGING CHARGING_SIMPLE
114 114
115/* define current usage levels */ 115/* define current usage levels */
116#define CURRENT_NORMAL 80 /* 16h playback on 1300mAh battery */ 116#define CURRENT_NORMAL 80 /* 16h playback on 1300mAh battery */
diff --git a/firmware/export/config.h b/firmware/export/config.h
index 1854f59d13..9bc6c7c775 100644
--- a/firmware/export/config.h
+++ b/firmware/export/config.h
@@ -116,12 +116,18 @@
116/* CONFIG_CHARGING */ 116/* CONFIG_CHARGING */
117 117
118/* Generic types */ 118/* Generic types */
119#define CHARGING_SIMPLE 1 /* Simple, hardware controlled charging */ 119#define CHARGING_SIMPLE 1 /* Simple, hardware controlled charging
120#define CHARGING_MONITOR 2 /* Hardware controlled charging with monitoring */ 120 * (CPU cannot read charger state but may read
121 * when power is plugged-in). */
122#define CHARGING_MONITOR 2 /* Hardware controlled charging with monitoring
123 * (CPU is able to read HW charging state and
124 * when power is plugged-in). */
121 125
122/* Mostly target-specific code in the /target tree */ 126/* Mostly target-specific code in the /target tree */
123#define CHARGING_TARGET 3 127#define CHARGING_TARGET 3 /* Any algorithm - usually software controlled
124 128 * charging or specific programming is required to
129 * use the charging hardware. */
130
125/* CONFIG_LCD */ 131/* CONFIG_LCD */
126#define LCD_SSD1815 1 /* as used by Archos Recorders and Ondios */ 132#define LCD_SSD1815 1 /* as used by Archos Recorders and Ondios */
127#define LCD_SSD1801 2 /* as used by Archos Player/Studio */ 133#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 1a1f6afbfb..2535c5839f 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)
50 50
51unsigned int power_input_status(void) 51unsigned int power_input_status(void)
52{ 52{
53 /* No separate source for USB and charges from USB on its own */ 53 unsigned int status = POWER_INPUT_NONE;
54 return (GPIOF_INPUT_VAL & 0x08) ? 54
55 POWER_INPUT_MAIN_CHARGER : POWER_INPUT_NONE; 55 if (GPIOF_INPUT_VAL & 0x08)
56 status = POWER_INPUT_MAIN_CHARGER;
57
58 if (GPIOL_INPUT_VAL & 0x04)
59 status |= POWER_INPUT_USB_CHARGER;
60
61 return status;
56} 62}
57 63
58void ide_power_enable(bool on) 64void 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 2717e42f4a..1dcea9ce0e 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)
57 POWER_INPUT_MAIN_CHARGER : POWER_INPUT_NONE; 57 POWER_INPUT_MAIN_CHARGER : POWER_INPUT_NONE;
58} 58}
59 59
60/* Returns true if the unit is charging the batteries. */
61bool charging_state(void)
62{
63 return (power_input_status() & POWER_INPUT_CHARGER) != 0;
64}
65
66#ifdef HAVE_SPDIF_POWER 60#ifdef HAVE_SPDIF_POWER
67void spdif_power_enable(bool on) 61void spdif_power_enable(bool on)
68{ 62{