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

Configure Feed

Select the types of activity you want to include in your feed.

Input: ilitek_ts_i2c - avoid wrong input subsystem sync

For different reasons i2c transaction may fail or report id in the
message may be wrong. Avoid closing the frame in this case as it will
result in all contacts being dropped, indicating that nothing is
touching the screen anymore, while usually it is not the case.

Fixes: 42370681bd46 ("Input: Add support for ILITEK Lego Series")
Signed-off-by: Emanuele Ghidoli <emanuele.ghidoli@toradex.com>
Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com>
Link: https://lore.kernel.org/r/20240805085511.43955-2-francesco@dolcini.it
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>

authored by

Emanuele Ghidoli and committed by
Dmitry Torokhov
7d0b18cd 14d650fc

+5 -6
+5 -6
drivers/input/touchscreen/ilitek_ts_i2c.c
··· 160 160 error = ilitek_i2c_write_and_read(ts, NULL, 0, 0, buf, 64); 161 161 if (error) { 162 162 dev_err(dev, "get touch info failed, err:%d\n", error); 163 - goto err_sync_frame; 163 + return error; 164 164 } 165 165 166 166 report_max_point = buf[REPORT_COUNT_ADDRESS]; 167 167 if (report_max_point > ts->max_tp) { 168 168 dev_err(dev, "FW report max point:%d > panel info. max:%d\n", 169 169 report_max_point, ts->max_tp); 170 - error = -EINVAL; 171 - goto err_sync_frame; 170 + return -EINVAL; 172 171 } 173 172 174 173 count = DIV_ROUND_UP(report_max_point, packet_max_point); ··· 177 178 if (error) { 178 179 dev_err(dev, "get touch info. failed, cnt:%d, err:%d\n", 179 180 count, error); 180 - goto err_sync_frame; 181 + return error; 181 182 } 182 183 } 183 184 ··· 202 203 ilitek_touch_down(ts, id, x, y); 203 204 } 204 205 205 - err_sync_frame: 206 206 input_mt_sync_frame(input); 207 207 input_sync(input); 208 - return error; 208 + 209 + return 0; 209 210 } 210 211 211 212 /* APIs of cmds for ILITEK Touch IC */