diff options
author | Lorenzo Miori <memorys60@gmail.com> | 2013-11-15 22:05:40 +0100 |
---|---|---|
committer | Amaury Pouly <amaury.pouly@gmail.com> | 2013-12-02 20:48:21 +0100 |
commit | 1deab739803ee768e393bba41446450a792b6410 (patch) | |
tree | 26b5a121d6a03d2f394aa285ab017b1f317caf37 /firmware/target/arm/imx233/touchscreen-imx233.c | |
parent | 15155ed10006f84c42bc435e354a16b3f391d55e (diff) | |
download | rockbox-1deab739803ee768e393bba41446450a792b6410.tar.gz rockbox-1deab739803ee768e393bba41446450a792b6410.zip |
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 <amaury.pouly@gmail.com>
Diffstat (limited to 'firmware/target/arm/imx233/touchscreen-imx233.c')
-rw-r--r-- | firmware/target/arm/imx233/touchscreen-imx233.c | 27 |
1 files changed, 27 insertions, 0 deletions
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; |