Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Ferruh Yigit and committed by
Dmitry Torokhov
fbd5e77e d2983cdb

+20 -6
+20 -6
drivers/input/touchscreen/cyttsp_core.c
··· 116 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 128 static int cyttsp_load_bl_regs(struct cyttsp *ts) 120 129 { 121 130 memset(&ts->bl_data, 0, sizeof(ts->bl_data)); ··· 176 167 if (error) 177 168 return error; 178 169 170 + error = cyttsp_handshake(ts); 171 + if (error) 172 + return error; 173 + 179 174 return ts->xy_data.act_dist == CY_ACT_DIST_DFLT ? -EIO : 0; 180 175 } 181 176 ··· 198 185 msleep(CY_DELAY_DFLT); 199 186 error = ttsp_read_block_data(ts, CY_REG_BASE, sizeof(ts->sysinfo_data), 200 187 &ts->sysinfo_data); 188 + if (error) 189 + return error; 190 + 191 + error = cyttsp_handshake(ts); 201 192 if (error) 202 193 return error; 203 194 ··· 361 344 goto out; 362 345 363 346 /* provide flow control handshake */ 364 - if (ts->pdata->use_hndshk) { 365 - error = ttsp_send_command(ts, 366 - ts->xy_data.hst_mode ^ CY_HNDSHK_BIT); 367 - if (error) 368 - goto out; 369 - } 347 + error = cyttsp_handshake(ts); 348 + if (error) 349 + goto out; 370 350 371 351 if (unlikely(ts->state == CY_IDLE_STATE)) 372 352 goto out;