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 @@ | |||
20 | ****************************************************************************/ | 20 | ****************************************************************************/ |
21 | #include "touchscreen-imx233.h" | 21 | #include "touchscreen-imx233.h" |
22 | #include "stdlib.h" | 22 | #include "stdlib.h" |
23 | #ifdef SAMSUNG_YPZ5 | ||
24 | #include "pinctrl-imx233.h" | ||
25 | #endif | ||
23 | 26 | ||
24 | /* Description: | 27 | /* Description: |
25 | * the driver basically has 2 modes: | 28 | * the driver basically has 2 modes: |
@@ -72,6 +75,24 @@ static void touch_channel_irq(int chan) | |||
72 | process(); | 75 | process(); |
73 | } | 76 | } |
74 | 77 | ||
78 | #ifdef SAMSUNG_YPZ5 | ||
79 | /* On this target we need to manually setup pulldown pins, | ||
80 | * using specific GPIO lines | ||
81 | */ | ||
82 | static void pulldown_setup(bool xminus_enable, bool yminus_enable, | ||
83 | bool xplus_enable, bool yplus_enable) | ||
84 | { | ||
85 | /* TX+ */ | ||
86 | imx233_pinctrl_set_gpio(0, 25, xplus_enable); | ||
87 | /* TX- */ | ||
88 | imx233_pinctrl_set_gpio(3, 15, xminus_enable); | ||
89 | /* TY+ */ | ||
90 | imx233_pinctrl_set_gpio(0, 26, yplus_enable); | ||
91 | /* TY- */ | ||
92 | imx233_pinctrl_set_gpio(1, 21, yminus_enable); | ||
93 | } | ||
94 | #endif | ||
95 | |||
75 | static void kick_measure(bool pull_x, bool pull_y, bool detect, int src) | 96 | static void kick_measure(bool pull_x, bool pull_y, bool detect, int src) |
76 | { | 97 | { |
77 | if(touch_chan >= 0) | 98 | if(touch_chan >= 0) |
@@ -84,6 +105,9 @@ static void kick_measure(bool pull_x, bool pull_y, bool detect, int src) | |||
84 | imx233_icoll_enable_interrupt(INT_SRC_LRADC_CHx(touch_chan), true); | 105 | imx233_icoll_enable_interrupt(INT_SRC_LRADC_CHx(touch_chan), true); |
85 | imx233_lradc_enable_channel_irq(touch_chan, true); | 106 | imx233_lradc_enable_channel_irq(touch_chan, true); |
86 | /* setup measurement: x- pull down and x+ pull up */ | 107 | /* setup measurement: x- pull down and x+ pull up */ |
108 | #ifdef SAMSUNG_YPZ5 | ||
109 | pulldown_setup(pull_x, pull_y, pull_x, pull_y); | ||
110 | #endif | ||
87 | imx233_lradc_setup_touch(pull_x, pull_y, pull_x, pull_y, detect); | 111 | imx233_lradc_setup_touch(pull_x, pull_y, pull_x, pull_y, detect); |
88 | imx233_lradc_enable_touch_detect_irq(false); | 112 | imx233_lradc_enable_touch_detect_irq(false); |
89 | imx233_lradc_enable_channel_irq(touch_chan, true); | 113 | imx233_lradc_enable_channel_irq(touch_chan, true); |
@@ -102,6 +126,9 @@ static void enter_state(enum touch_state_t state) | |||
102 | switch(state) | 126 | switch(state) |
103 | { | 127 | { |
104 | case TOUCH_STATE_WAIT: | 128 | case TOUCH_STATE_WAIT: |
129 | #ifdef SAMSUNG_YPZ5 | ||
130 | pulldown_setup(false, false, false, false); | ||
131 | #endif | ||
105 | imx233_lradc_setup_touch(false, false, false, false, true); | 132 | imx233_lradc_setup_touch(false, false, false, false, true); |
106 | imx233_lradc_enable_touch_detect_irq(true); | 133 | imx233_lradc_enable_touch_detect_irq(true); |
107 | break; | 134 | break; |