summaryrefslogtreecommitdiffstats
path: root/firmware/target/arm/imx233/creative-zen
diff options
context:
space:
mode:
authorAmaury Pouly <amaury.pouly@gmail.com>2014-02-04 00:25:24 +0100
committerAmaury Pouly <amaury.pouly@gmail.com>2014-02-10 23:14:25 +0100
commit965c268e5f486ea9fc564c31bcdb2391ed2fb2b6 (patch)
treee684f8b80d490b3d272f01d011f46142f9d79f8b /firmware/target/arm/imx233/creative-zen
parent0324bf59a8810cadf35d67f71f5ee409834ec4ee (diff)
downloadrockbox-965c268e5f486ea9fc564c31bcdb2391ed2fb2b6.tar.gz
rockbox-965c268e5f486ea9fc564c31bcdb2391ed2fb2b6.zip
imx233: handle jack detect inversion on some devices
Change-Id: I6e8644d8dc410f275c7c7580fa9bcbd2fa26a041
Diffstat (limited to 'firmware/target/arm/imx233/creative-zen')
-rw-r--r--firmware/target/arm/imx233/creative-zen/button-zen.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/firmware/target/arm/imx233/creative-zen/button-zen.c b/firmware/target/arm/imx233/creative-zen/button-zen.c
index c0e7205675..fa01e9370e 100644
--- a/firmware/target/arm/imx233/creative-zen/button-zen.c
+++ b/firmware/target/arm/imx233/creative-zen/button-zen.c
@@ -28,6 +28,7 @@
#if defined(CREATIVE_ZENXFI) || defined(CREATIVE_ZENMOZAIC)
#define JACK_DET_BANK 2
#define JACK_DET_PIN 8
+#define JACK_DET_INVERTED
#elif defined(CREATIVE_ZENXFISTYLE)
#define JACK_DET_BANK 2
#define JACK_DET_PIN 7
@@ -134,7 +135,11 @@ bool button_hold(void)
#ifdef HAVE_HEADPHONE_DETECTION
bool headphones_inserted(void)
{
- return !imx233_pinctrl_get_gpio(JACK_DET_BANK, JACK_DET_PIN);
+ bool det = imx233_pinctrl_get_gpio(JACK_DET_BANK, JACK_DET_PIN);
+#ifdef JACK_DET_INVERTED
+ det = !det;
+#endif
+ return det;
}
#endif