Lines Matching +full:multi +full:- +full:touch
1 // SPDX-License-Identifier: GPL-2.0-only
6 * Copyright (c) 2011 John Sung <penmount.touch@gmail.com>
24 MODULE_AUTHOR("John Sung <penmount.touch@gmail.com>");
38 * Multi-touch slot
43 bool active; /* is the touch valid? */
47 * Per-touchscreen data.
70 for (i = 0; i < pm->maxcontacts; ++i) { in pm_mtevent()
73 pm->slots[i].active); in pm_mtevent()
74 if (pm->slots[i].active) { in pm_mtevent()
75 input_event(input, EV_ABS, ABS_MT_POSITION_X, pm->slots[i].x); in pm_mtevent()
76 input_event(input, EV_ABS, ABS_MT_POSITION_Y, pm->slots[i].y); in pm_mtevent()
101 struct input_dev *dev = pm->dev; in pm_parse_9000()
103 if ((pm->data[0] & 0x80) && pm->packetsize == ++pm->idx) { in pm_parse_9000()
104 input_report_abs(dev, ABS_X, pm->data[1] * 128 + pm->data[2]); in pm_parse_9000()
105 input_report_abs(dev, ABS_Y, pm->data[3] * 128 + pm->data[4]); in pm_parse_9000()
106 input_report_key(dev, BTN_TOUCH, !!(pm->data[0] & 0x40)); in pm_parse_9000()
108 pm->idx = 0; in pm_parse_9000()
114 struct input_dev *dev = pm->dev; in pm_parse_6000()
116 if ((pm->data[0] & 0xbf) == 0x30 && pm->packetsize == ++pm->idx) { in pm_parse_6000()
117 if (pm_checkpacket(pm->data)) { in pm_parse_6000()
119 pm->data[2] * 256 + pm->data[1]); in pm_parse_6000()
121 pm->data[4] * 256 + pm->data[3]); in pm_parse_6000()
122 input_report_key(dev, BTN_TOUCH, pm->data[0] & 0x40); in pm_parse_6000()
125 pm->idx = 0; in pm_parse_6000()
131 struct input_dev *dev = pm->dev; in pm_parse_3000()
133 if ((pm->data[0] & 0xce) == 0x40 && pm->packetsize == ++pm->idx) { in pm_parse_3000()
134 if (pm_checkpacket(pm->data)) { in pm_parse_3000()
135 int slotnum = pm->data[0] & 0x0f; in pm_parse_3000()
136 pm->slots[slotnum].active = pm->data[0] & 0x30; in pm_parse_3000()
137 pm->slots[slotnum].x = pm->data[2] * 256 + pm->data[1]; in pm_parse_3000()
138 pm->slots[slotnum].y = pm->data[4] * 256 + pm->data[3]; in pm_parse_3000()
141 pm->idx = 0; in pm_parse_3000()
147 struct input_dev *dev = pm->dev; in pm_parse_6250()
149 if ((pm->data[0] & 0xb0) == 0x30 && pm->packetsize == ++pm->idx) { in pm_parse_6250()
150 if (pm_checkpacket(pm->data)) { in pm_parse_6250()
151 int slotnum = pm->data[0] & 0x0f; in pm_parse_6250()
152 pm->slots[slotnum].active = pm->data[0] & 0x40; in pm_parse_6250()
153 pm->slots[slotnum].x = pm->data[2] * 256 + pm->data[1]; in pm_parse_6250()
154 pm->slots[slotnum].y = pm->data[4] * 256 + pm->data[3]; in pm_parse_6250()
157 pm->idx = 0; in pm_parse_6250()
166 pm->data[pm->idx] = data; in pm_interrupt()
168 pm->parse_packet(pm); in pm_interrupt()
183 input_unregister_device(pm->dev); in pm_disconnect()
205 err = -ENOMEM; in pm_connect()
209 pm->serio = serio; in pm_connect()
210 pm->dev = input_dev; in pm_connect()
211 snprintf(pm->phys, sizeof(pm->phys), "%s/input0", serio->phys); in pm_connect()
212 pm->maxcontacts = 1; in pm_connect()
214 input_dev->name = "PenMount Serial TouchScreen"; in pm_connect()
215 input_dev->phys = pm->phys; in pm_connect()
216 input_dev->id.bustype = BUS_RS232; in pm_connect()
217 input_dev->id.vendor = SERIO_PENMOUNT; in pm_connect()
218 input_dev->id.product = 0; in pm_connect()
219 input_dev->id.version = 0x0100; in pm_connect()
220 input_dev->dev.parent = &serio->dev; in pm_connect()
222 input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS); in pm_connect()
223 input_dev->keybit[BIT_WORD(BTN_TOUCH)] = BIT_MASK(BTN_TOUCH); in pm_connect()
225 switch (serio->id.id) { in pm_connect()
228 pm->packetsize = 5; in pm_connect()
229 pm->parse_packet = pm_parse_9000; in pm_connect()
230 input_dev->id.product = 0x9000; in pm_connect()
235 pm->packetsize = 6; in pm_connect()
236 pm->parse_packet = pm_parse_6000; in pm_connect()
237 input_dev->id.product = 0x6000; in pm_connect()
242 pm->packetsize = 6; in pm_connect()
243 pm->parse_packet = pm_parse_3000; in pm_connect()
244 input_dev->id.product = 0x3000; in pm_connect()
246 pm->maxcontacts = PM_3000_MTSLOT; in pm_connect()
250 pm->packetsize = 6; in pm_connect()
251 pm->parse_packet = pm_parse_6250; in pm_connect()
252 input_dev->id.product = 0x6250; in pm_connect()
254 pm->maxcontacts = PM_6250_MTSLOT; in pm_connect()
258 input_set_abs_params(pm->dev, ABS_X, 0, max_x, 0, 0); in pm_connect()
259 input_set_abs_params(pm->dev, ABS_Y, 0, max_y, 0, 0); in pm_connect()
261 if (pm->maxcontacts > 1) { in pm_connect()
262 input_mt_init_slots(pm->dev, pm->maxcontacts, 0); in pm_connect()
263 input_set_abs_params(pm->dev, in pm_connect()
265 input_set_abs_params(pm->dev, in pm_connect()
275 err = input_register_device(pm->dev); in pm_connect()
306 .name = "serio-penmount",