summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Giacomelli <giac2000@hotmail.com>2008-01-20 23:03:23 +0000
committerMichael Giacomelli <giac2000@hotmail.com>2008-01-20 23:03:23 +0000
commit31b6eb57b01b4e46120ea311d8d32bcebb15ecb1 (patch)
treeb2b8cbb880ca039af3dce2ce042ba932d9fd12ca
parentc1791a540ec3599de0f3e03cc24c669970d1fa51 (diff)
downloadrockbox-31b6eb57b01b4e46120ea311d8d32bcebb15ecb1.tar.gz
rockbox-31b6eb57b01b4e46120ea311d8d32bcebb15ecb1.tar.bz2
rockbox-31b6eb57b01b4e46120ea311d8d32bcebb15ecb1.zip
Commit FS#8387 by Adam Gashlin. Enables detection of firewire devices for charging on various Ipods. Note that charging itself is not yet implemented on these devices.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16124 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--firmware/export/config-ipod4g.h4
-rw-r--r--firmware/export/config-ipodcolor.h4
-rw-r--r--firmware/export/config-ipodmini.h4
-rw-r--r--firmware/export/config-ipodmini2g.h4
-rw-r--r--firmware/target/arm/ipod/power-ipod.c6
5 files changed, 13 insertions, 9 deletions
diff --git a/firmware/export/config-ipod4g.h b/firmware/export/config-ipod4g.h
index ff15d20c20..ce2831f848 100644
--- a/firmware/export/config-ipod4g.h
+++ b/firmware/export/config-ipod4g.h
@@ -102,8 +102,8 @@
#define BATTERY_CAPACITY_INC 10 /* capacity increment */
#define BATTERY_TYPES_COUNT 1 /* only one type */
-/* Hardware controlled charging? FIXME */
-//#define CONFIG_CHARGING CHARGING_SIMPLE
+/* Hardware controlled charging? */
+#define CONFIG_CHARGING CHARGING_MONITOR
/* define this if the unit can be powered or charged via USB */
#define HAVE_USB_POWER
diff --git a/firmware/export/config-ipodcolor.h b/firmware/export/config-ipodcolor.h
index 3cd6d76685..3a9303a3be 100644
--- a/firmware/export/config-ipodcolor.h
+++ b/firmware/export/config-ipodcolor.h
@@ -89,8 +89,8 @@
#define BATTERY_CAPACITY_INC 10 /* capacity increment */
#define BATTERY_TYPES_COUNT 1 /* only one type */
-/* Hardware controlled charging? FIXME */
-//#define CONFIG_CHARGING CHARGING_SIMPLE
+/* Hardware controlled charging? */
+#define CONFIG_CHARGING CHARGING_MONITOR
/* define this if the unit can be powered or charged via USB */
#define HAVE_USB_POWER
diff --git a/firmware/export/config-ipodmini.h b/firmware/export/config-ipodmini.h
index 061b15a404..f38de3e352 100644
--- a/firmware/export/config-ipodmini.h
+++ b/firmware/export/config-ipodmini.h
@@ -92,8 +92,8 @@
#define BATTERY_CAPACITY_INC 10 /* capacity increment */
#define BATTERY_TYPES_COUNT 1 /* only one type */
-/* Hardware controlled charging? FIXME */
-//#define CONFIG_CHARGING CHARGING_SIMPLE
+/* Hardware controlled charging? */
+#define CONFIG_CHARGING CHARGING_MONITOR
/* define this if the unit can be powered or charged via USB */
#define HAVE_USB_POWER
diff --git a/firmware/export/config-ipodmini2g.h b/firmware/export/config-ipodmini2g.h
index c3f4e97e7b..567ee0b361 100644
--- a/firmware/export/config-ipodmini2g.h
+++ b/firmware/export/config-ipodmini2g.h
@@ -99,8 +99,8 @@
#define BATTERY_CAPACITY_INC 50 /* capacity increment */
#define BATTERY_TYPES_COUNT 1 /* only one type */
-/* Hardware controlled charging? FIXME */
-//#define CONFIG_CHARGING CHARGING_SIMPLE
+/* Hardware controlled charging? */
+#define CONFIG_CHARGING CHARGING_MONITOR
/* define this if the unit can be powered or charged via USB */
#define HAVE_USB_POWER
diff --git a/firmware/target/arm/ipod/power-ipod.c b/firmware/target/arm/ipod/power-ipod.c
index ae663d16e5..4c6f6a8db5 100644
--- a/firmware/target/arm/ipod/power-ipod.c
+++ b/firmware/target/arm/ipod/power-ipod.c
@@ -42,8 +42,12 @@ void power_init(void)
bool charger_inserted(void)
{
-#ifdef IPOD_VIDEO
+#if defined(IPOD_VIDEO)
return (GPIOL_INPUT_VAL & 0x08)?false:true;
+#elif defined(IPOD_4G) || defined(IPOD_COLOR) \
+ || defined(IPOD_MINI) || defined(IPOD_MINI2G)
+ /* C2 is firewire power */
+ return (GPIOC_INPUT_VAL & 0x04)?false:true;
#else
/* This needs filling in for other ipods. */
return false;