summaryrefslogtreecommitdiffstats
path: root/firmware/target/arm/imx233/touchscreen-imx233.c
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/target/arm/imx233/touchscreen-imx233.c')
-rw-r--r--firmware/target/arm/imx233/touchscreen-imx233.c27
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;