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: ektf2127 - add support for eKTF2132 touchscreen

The eKTF2132 is a touchscreen controller found, for example, in the Kobo
Aura ebook reader. It is similar to the ektf2127, but it uses a different
packet type to report touch events.

Signed-off-by: Jonathan Neuschäfer <j.neuschaefer@gmx.net>
Link: https://lore.kernel.org/r/20201106112412.390724-3-j.neuschaefer@gmx.net
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>

authored by

Jonathan Neuschäfer and committed by
Dmitry Torokhov
af5689fb cdab490e

+31 -1
+31 -1
drivers/input/touchscreen/ektf2127.c
··· 28 28 #define EKTF2127_RESPONSE 0x52 29 29 #define EKTF2127_REQUEST 0x53 30 30 #define EKTF2127_HELLO 0x55 31 + #define EKTF2127_REPORT2 0x5a 31 32 #define EKTF2127_REPORT 0x5d 32 33 #define EKTF2127_CALIB_DONE 0x66 33 34 ··· 96 95 input_sync(ts->input); 97 96 } 98 97 98 + static void ektf2127_report2_contact(struct ektf2127_ts *ts, int slot, 99 + const u8 *buf, bool active) 100 + { 101 + input_mt_slot(ts->input, slot); 102 + input_mt_report_slot_state(ts->input, MT_TOOL_FINGER, active); 103 + 104 + if (active) { 105 + int x = (buf[0] & 0xf0) << 4 | buf[1]; 106 + int y = (buf[0] & 0x0f) << 8 | buf[2]; 107 + 108 + touchscreen_report_pos(ts->input, &ts->prop, x, y, true); 109 + } 110 + } 111 + 112 + static void ektf2127_report2_event(struct ektf2127_ts *ts, const u8 *buf) 113 + { 114 + ektf2127_report2_contact(ts, 0, &buf[1], !!(buf[7] & 2)); 115 + ektf2127_report2_contact(ts, 1, &buf[4], !!(buf[7] & 4)); 116 + 117 + input_mt_sync_frame(ts->input); 118 + input_sync(ts->input); 119 + } 120 + 99 121 static irqreturn_t ektf2127_irq(int irq, void *dev_id) 100 122 { 101 123 struct ektf2127_ts *ts = dev_id; ··· 135 111 switch (buf[0]) { 136 112 case EKTF2127_REPORT: 137 113 ektf2127_report_event(ts, buf); 114 + break; 115 + 116 + case EKTF2127_REPORT2: 117 + ektf2127_report2_event(ts, buf); 138 118 break; 139 119 140 120 case EKTF2127_NOISE: ··· 333 305 #ifdef CONFIG_OF 334 306 static const struct of_device_id ektf2127_of_match[] = { 335 307 { .compatible = "elan,ektf2127" }, 308 + { .compatible = "elan,ektf2132" }, 336 309 {} 337 310 }; 338 311 MODULE_DEVICE_TABLE(of, ektf2127_of_match); ··· 341 312 342 313 static const struct i2c_device_id ektf2127_i2c_id[] = { 343 314 { "ektf2127", 0 }, 315 + { "ektf2132", 0 }, 344 316 {} 345 317 }; 346 318 MODULE_DEVICE_TABLE(i2c, ektf2127_i2c_id); ··· 357 327 }; 358 328 module_i2c_driver(ektf2127_driver); 359 329 360 - MODULE_DESCRIPTION("ELAN eKTF2127 I2C Touchscreen Driver"); 330 + MODULE_DESCRIPTION("ELAN eKTF2127/eKTF2132 I2C Touchscreen Driver"); 361 331 MODULE_AUTHOR("Michel Verlaan, Siebren Vroegindeweij"); 362 332 MODULE_LICENSE("GPL");