From 1deab739803ee768e393bba41446450a792b6410 Mon Sep 17 00:00:00 2001 From: Lorenzo Miori Date: Fri, 15 Nov 2013 22:05:40 +0100 Subject: Initial commit for the YP-Z5 port The port uses the imx233 soc, it's a STMP3650 based Samsung player Change-Id: I50b6d7e77fd292fab5ed26de87853cd5aaf9eaa4 Reviewed-on: http://gerrit.rockbox.org/490 Reviewed-by: Amaury Pouly --- firmware/target/arm/imx233/touchscreen-imx233.c | 27 +++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'firmware/target/arm/imx233/touchscreen-imx233.c') diff --git a/firmware/target/arm/imx233/touchscreen-imx233.c b/firmware/target/arm/imx233/touchscreen-imx233.c index c4d2f4d726..53d9d0e320 100644 --- a/firmware/target/arm/imx233/touchscreen-imx233.c +++ b/firmware/target/arm/imx233/touchscreen-imx233.c @@ -20,6 +20,9 @@ ****************************************************************************/ #include "touchscreen-imx233.h" #include "stdlib.h" +#ifdef SAMSUNG_YPZ5 +#include "pinctrl-imx233.h" +#endif /* Description: * the driver basically has 2 modes: @@ -72,6 +75,24 @@ static void touch_channel_irq(int chan) process(); } +#ifdef SAMSUNG_YPZ5 +/* On this target we need to manually setup pulldown pins, + * using specific GPIO lines + */ +static void pulldown_setup(bool xminus_enable, bool yminus_enable, + bool xplus_enable, bool yplus_enable) +{ + /* TX+ */ + imx233_pinctrl_set_gpio(0, 25, xplus_enable); + /* TX- */ + imx233_pinctrl_set_gpio(3, 15, xminus_enable); + /* TY+ */ + imx233_pinctrl_set_gpio(0, 26, yplus_enable); + /* TY- */ + imx233_pinctrl_set_gpio(1, 21, yminus_enable); +} +#endif + static void kick_measure(bool pull_x, bool pull_y, bool detect, int src) { if(touch_chan >= 0) @@ -84,6 +105,9 @@ static void kick_measure(bool pull_x, bool pull_y, bool detect, int src) imx233_icoll_enable_interrupt(INT_SRC_LRADC_CHx(touch_chan), true); imx233_lradc_enable_channel_irq(touch_chan, true); /* setup measurement: x- pull down and x+ pull up */ +#ifdef SAMSUNG_YPZ5 + pulldown_setup(pull_x, pull_y, pull_x, pull_y); +#endif imx233_lradc_setup_touch(pull_x, pull_y, pull_x, pull_y, detect); imx233_lradc_enable_touch_detect_irq(false); imx233_lradc_enable_channel_irq(touch_chan, true); @@ -102,6 +126,9 @@ static void enter_state(enum touch_state_t state) switch(state) { case TOUCH_STATE_WAIT: +#ifdef SAMSUNG_YPZ5 + pulldown_setup(false, false, false, false); +#endif imx233_lradc_setup_touch(false, false, false, false, true); imx233_lradc_enable_touch_detect_irq(true); break; -- cgit v1.2.3