diff options
author | Ferruh Yigit <fery@cypress.com> | 2013-05-23 13:04:36 -0400 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2013-06-06 01:46:34 -0400 |
commit | fbd5e77e65c36d84dbcd71a19c4d1526f4604bdb (patch) | |
tree | d81947e53269c552a4d2f1891be16f4c8585b4f7 | |
parent | d2983cdb480157f637df07723f28aaa657b1080d (diff) |
Input: cyttsp - add missing handshake
For the devices that has blocking with timeout communication, these
extra handshakes will prevent one timeout delay in startup sequence
Tested-by: Ferruh Yigit <fery@cypress.com> on TMA300-DVK
Signed-off-by: Ferruh Yigit <fery@cypress.com>
Acked-by: Javier Martinez Canillas <javier@dowhile0.org>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
-rw-r--r-- | drivers/input/touchscreen/cyttsp_core.c | 26 |
1 files changed, 20 insertions, 6 deletions
diff --git a/drivers/input/touchscreen/cyttsp_core.c b/drivers/input/touchscreen/cyttsp_core.c index 97ba89128312..ae89d2609ab0 100644 --- a/drivers/input/touchscreen/cyttsp_core.c +++ b/drivers/input/touchscreen/cyttsp_core.c | |||
@@ -116,6 +116,15 @@ static int ttsp_send_command(struct cyttsp *ts, u8 cmd) | |||
116 | return ttsp_write_block_data(ts, CY_REG_BASE, sizeof(cmd), &cmd); | 116 | return ttsp_write_block_data(ts, CY_REG_BASE, sizeof(cmd), &cmd); |
117 | } | 117 | } |
118 | 118 | ||
119 | static int cyttsp_handshake(struct cyttsp *ts) | ||
120 | { | ||
121 | if (ts->pdata->use_hndshk) | ||
122 | return ttsp_send_command(ts, | ||
123 | ts->xy_data.hst_mode ^ CY_HNDSHK_BIT); | ||
124 | |||
125 | return 0; | ||
126 | } | ||
127 | |||
119 | static int cyttsp_load_bl_regs(struct cyttsp *ts) | 128 | static int cyttsp_load_bl_regs(struct cyttsp *ts) |
120 | { | 129 | { |
121 | memset(&ts->bl_data, 0, sizeof(ts->bl_data)); | 130 | memset(&ts->bl_data, 0, sizeof(ts->bl_data)); |
@@ -167,6 +176,10 @@ static int cyttsp_set_operational_mode(struct cyttsp *ts) | |||
167 | if (error) | 176 | if (error) |
168 | return error; | 177 | return error; |
169 | 178 | ||
179 | error = cyttsp_handshake(ts); | ||
180 | if (error) | ||
181 | return error; | ||
182 | |||
170 | return ts->xy_data.act_dist == CY_ACT_DIST_DFLT ? -EIO : 0; | 183 | return ts->xy_data.act_dist == CY_ACT_DIST_DFLT ? -EIO : 0; |
171 | } | 184 | } |
172 | 185 | ||
@@ -188,6 +201,10 @@ static int cyttsp_set_sysinfo_mode(struct cyttsp *ts) | |||
188 | if (error) | 201 | if (error) |
189 | return error; | 202 | return error; |
190 | 203 | ||
204 | error = cyttsp_handshake(ts); | ||
205 | if (error) | ||
206 | return error; | ||
207 | |||
191 | if (!ts->sysinfo_data.tts_verh && !ts->sysinfo_data.tts_verl) | 208 | if (!ts->sysinfo_data.tts_verh && !ts->sysinfo_data.tts_verl) |
192 | return -EIO; | 209 | return -EIO; |
193 | 210 | ||
@@ -344,12 +361,9 @@ static irqreturn_t cyttsp_irq(int irq, void *handle) | |||
344 | goto out; | 361 | goto out; |
345 | 362 | ||
346 | /* provide flow control handshake */ | 363 | /* provide flow control handshake */ |
347 | if (ts->pdata->use_hndshk) { | 364 | error = cyttsp_handshake(ts); |
348 | error = ttsp_send_command(ts, | 365 | if (error) |
349 | ts->xy_data.hst_mode ^ CY_HNDSHK_BIT); | 366 | goto out; |
350 | if (error) | ||
351 | goto out; | ||
352 | } | ||
353 | 367 | ||
354 | if (unlikely(ts->state == CY_IDLE_STATE)) | 368 | if (unlikely(ts->state == CY_IDLE_STATE)) |
355 | goto out; | 369 | goto out; |