summaryrefslogtreecommitdiffstats
path: root/firmware
diff options
context:
space:
mode:
authorBertrik Sikken <bertrik@sikken.nl>2009-08-01 17:13:47 +0000
committerBertrik Sikken <bertrik@sikken.nl>2009-08-01 17:13:47 +0000
commit0f0bf7b25836fb78f5d4dc7c7085fb9f0e949d02 (patch)
tree061195b431c48003b3866c6da1c57c03b56022af /firmware
parent64b227e3baf413ba3464e133cd5f173b96132957 (diff)
downloadrockbox-0f0bf7b25836fb78f5d4dc7c7085fb9f0e949d02.tar.gz
rockbox-0f0bf7b25836fb78f5d4dc7c7085fb9f0e949d02.tar.bz2
rockbox-0f0bf7b25836fb78f5d4dc7c7085fb9f0e949d02.zip
Samsung YP-S3: implement headphones detection
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22099 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware')
-rw-r--r--firmware/target/arm/s5l8700/yps3/button-yps3.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/firmware/target/arm/s5l8700/yps3/button-yps3.c b/firmware/target/arm/s5l8700/yps3/button-yps3.c
index 74b5e130c3..afcf89666b 100644
--- a/firmware/target/arm/s5l8700/yps3/button-yps3.c
+++ b/firmware/target/arm/s5l8700/yps3/button-yps3.c
@@ -48,6 +48,9 @@ void button_init_device(void)
/* P0.5/P1.0 power switch input */
PCON0 &= ~(3 << 10);
PCON1 &= ~0x0000000F;
+
+ /* P1.3 headphones detect input */
+ PCON1 &= ~0x0000F000;
/* P1.5 DATA, P1.6 DRDY inputs (touch key controller) */
PCON1 &= ~0x0FF00000;
@@ -144,3 +147,8 @@ bool button_hold(void)
return (PDAT4 & (1 << 3));
}
+bool headphones_inserted(void)
+{
+ return ((PDAT1 & (1 << 3)) == 0);
+}
+