summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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 @@
#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 b4a687b6d7..4757d7708c 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 1854f59d13..9bc6c7c775 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 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)
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 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)
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)
{