From e243db65b41c967ae8e7ef4cd946a2cdf7c6a19e Mon Sep 17 00:00:00 2001 From: Michael Giacomelli Date: Sat, 3 May 2008 21:15:13 +0000 Subject: Commit FS#8920, fixed headphone detection for the Ipod 2G by Mark Fawcus. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17336 a1c6a512-1295-4272-9138-f99709370657 --- firmware/target/arm/ipod/button-1g-3g.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'firmware/target/arm/ipod/button-1g-3g.c') diff --git a/firmware/target/arm/ipod/button-1g-3g.c b/firmware/target/arm/ipod/button-1g-3g.c index be02f873bb..2aa65bb2c0 100644 --- a/firmware/target/arm/ipod/button-1g-3g.c +++ b/firmware/target/arm/ipod/button-1g-3g.c @@ -250,5 +250,21 @@ bool button_hold(void) bool headphones_inserted(void) { +#ifdef IPOD_1G2G + if ((IPOD_HW_REVISION >> 16) == 2) + { + /* 2G uses GPIO B bit 0 */ + return (GPIOB_INPUT_VAL & 0x1)?true:false; + } + else + { + /* 1G has no headphone detection, so fake insertion */ + return (true); + } +#else + /* 3G uses GPIO C bit 0 */ return (GPIOC_INPUT_VAL & 0x1)?true:false; +#endif } + + -- cgit v1.2.3