summaryrefslogtreecommitdiffstats
path: root/firmware/target/arm/imx233/creative-zenxfi2
diff options
context:
space:
mode:
authorAmaury Pouly <amaury.pouly@gmail.com>2014-02-16 20:47:09 +0100
committerAmaury Pouly <amaury.pouly@gmail.com>2014-02-16 20:53:08 +0100
commitf0f1758067b7afb9d8b56d12f1672861269fd7da (patch)
tree75413c27a3d4e6d8c51ddabe33c6fcb8c8e3a61b /firmware/target/arm/imx233/creative-zenxfi2
parent6b3c29da6979aeb31e9e0eccaed9a3cfd4b9ad3c (diff)
downloadrockbox-f0f1758067b7afb9d8b56d12f1672861269fd7da.tar.gz
rockbox-f0f1758067b7afb9d8b56d12f1672861269fd7da.tar.bz2
rockbox-f0f1758067b7afb9d8b56d12f1672861269fd7da.zip
zenxfi2: implement headphones detection
Change-Id: Ifbc8b10cebb3b7b126f1d6a212f6731f91e234e4
Diffstat (limited to 'firmware/target/arm/imx233/creative-zenxfi2')
-rw-r--r--firmware/target/arm/imx233/creative-zenxfi2/button-zenxfi2.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/firmware/target/arm/imx233/creative-zenxfi2/button-zenxfi2.c b/firmware/target/arm/imx233/creative-zenxfi2/button-zenxfi2.c
index 4f2a2775bf..2e72eabdb4 100644
--- a/firmware/target/arm/imx233/creative-zenxfi2/button-zenxfi2.c
+++ b/firmware/target/arm/imx233/creative-zenxfi2/button-zenxfi2.c
@@ -78,6 +78,10 @@ void button_init_device(void)
imx233_pinctrl_acquire(0, 14, "select");
imx233_pinctrl_set_function(0, 14, PINCTRL_FUNCTION_GPIO);
imx233_pinctrl_enable_gpio(0, 14, false);
+ /* jack detect */
+ imx233_pinctrl_acquire(2, 7, "jack_detect");
+ imx233_pinctrl_set_function(2, 7, PINCTRL_FUNCTION_GPIO);
+ imx233_pinctrl_enable_gpio(2, 7, false);
}
static int touch_to_pixels(int *val_x, int *val_y)
@@ -119,6 +123,11 @@ static int touchscreen_read_device(int *data)
return touchscreen_to_pixels(x, y, data);
}
+bool headphones_inserted(void)
+{
+ return imx233_pinctrl_get_gpio(2, 7);
+}
+
int button_read_device(int *data)
{
int res = 0;