Lines Matching +full:timeout +full:- +full:swipe +full:- +full:ms

1 // SPDX-License-Identifier: GPL-2.0-only
38 * Absolute coordinate packets are in the range 0-255 for both X and Y
53 /* Time in jiffies used to timeout various touch events (64 ms) */
59 * Swipe gesture from off-pad to on-pad
67 * 1 - 8 : least to most delay
114 * 1 - 7 : least to most sensitive
135 * 1 - 5 : slowest to fastest
147 * 0 - 7 : smallest to largest width
152 * 0 - 9 : smallest to largest height
157 * 1 - 6 : smallest to largest
162 * 0 - 7 : smallest to largest width
167 * 0 - 9 : smallest to largest height
179 * 1 - 9 : slowest to fastest
238 struct byd_data *priv = psmouse->private; in byd_report_input()
239 struct input_dev *dev = psmouse->dev; in byd_report_input()
241 input_report_key(dev, BTN_TOUCH, priv->touch); in byd_report_input()
242 input_report_key(dev, BTN_TOOL_FINGER, priv->touch); in byd_report_input()
244 input_report_abs(dev, ABS_X, priv->abs_x); in byd_report_input()
245 input_report_abs(dev, ABS_Y, priv->abs_y); in byd_report_input()
246 input_report_key(dev, BTN_LEFT, priv->btn_left); in byd_report_input()
247 input_report_key(dev, BTN_RIGHT, priv->btn_right); in byd_report_input()
255 struct psmouse *psmouse = priv->psmouse; in byd_clear_touch()
257 guard(serio_pause_rx)(psmouse->ps2dev.serio); in byd_clear_touch()
259 priv->touch = false; in byd_clear_touch()
264 * Move cursor back to center of pad when we lose touch - this in byd_clear_touch()
268 priv->abs_x = BYD_PAD_WIDTH / 2; in byd_clear_touch()
269 priv->abs_y = BYD_PAD_HEIGHT / 2; in byd_clear_touch()
274 struct byd_data *priv = psmouse->private; in byd_process_byte()
275 u8 *pkt = psmouse->packet; in byd_process_byte()
277 if (psmouse->pktcnt > 0 && !(pkt[0] & PS2_ALWAYS_1)) { in byd_process_byte()
283 if (psmouse->pktcnt < psmouse->pktsize) in byd_process_byte()
290 if (!priv->touch) { in byd_process_byte()
293 priv->last_touch_time + BYD_TOUCH_TIMEOUT; in byd_process_byte()
294 priv->touch = time_after(jiffies, tap_time); in byd_process_byte()
297 priv->abs_x = pkt[1] * (BYD_PAD_WIDTH / 256); in byd_process_byte()
298 priv->abs_y = (255 - pkt[2]) * (BYD_PAD_HEIGHT / 256); in byd_process_byte()
303 /* Sign-extend if a sign bit is set. */ in byd_process_byte()
310 priv->abs_x += dx * BYD_DT; in byd_process_byte()
311 priv->abs_y -= dy * BYD_DT; in byd_process_byte()
313 priv->touch = true; in byd_process_byte()
319 psmouse->packet[0], psmouse->packet[1], in byd_process_byte()
320 psmouse->packet[2], psmouse->packet[3]); in byd_process_byte()
324 priv->btn_left = pkt[0] & PS2_LEFT; in byd_process_byte()
325 priv->btn_right = pkt[0] & PS2_RIGHT; in byd_process_byte()
330 if (priv->touch) { in byd_process_byte()
331 priv->last_touch_time = jiffies; in byd_process_byte()
332 mod_timer(&priv->timer, jiffies + BYD_TOUCH_TIMEOUT); in byd_process_byte()
340 struct ps2dev *ps2dev = &psmouse->ps2dev; in byd_reset_touchpad()
349 * Intellimouse initialization sequence, to get 4-byte instead in byd_reset_touchpad()
350 * of 3-byte packets. in byd_reset_touchpad()
358 * BYD-specific initialization, which enables absolute mode and in byd_reset_touchpad()
359 * (if desired), the touchpad's built-in gesture detection. in byd_reset_touchpad()
363 /* The touchpad should reply with 4 seemingly-random bytes */ in byd_reset_touchpad()
390 return -EIO; in byd_reset_touchpad()
425 struct byd_data *priv = psmouse->private; in byd_disconnect()
428 del_timer(&priv->timer); in byd_disconnect()
429 kfree(psmouse->private); in byd_disconnect()
430 psmouse->private = NULL; in byd_disconnect()
436 struct ps2dev *ps2dev = &psmouse->ps2dev; in byd_detect()
440 return -1; in byd_detect()
442 return -1; in byd_detect()
444 return -1; in byd_detect()
446 return -1; in byd_detect()
448 return -1; in byd_detect()
451 return -ENODEV; in byd_detect()
456 psmouse->vendor = "BYD"; in byd_detect()
457 psmouse->name = "TouchPad"; in byd_detect()
465 struct input_dev *dev = psmouse->dev; in byd_init()
469 return -EIO; in byd_init()
472 return -EIO; in byd_init()
476 return -ENOMEM; in byd_init()
478 priv->psmouse = psmouse; in byd_init()
479 timer_setup(&priv->timer, byd_clear_touch, 0); in byd_init()
481 psmouse->private = priv; in byd_init()
482 psmouse->disconnect = byd_disconnect; in byd_init()
483 psmouse->reconnect = byd_reconnect; in byd_init()
484 psmouse->protocol_handler = byd_process_byte; in byd_init()
485 psmouse->pktsize = 4; in byd_init()
486 psmouse->resync_time = 0; in byd_init()
488 __set_bit(INPUT_PROP_POINTER, dev->propbit); in byd_init()
490 __set_bit(BTN_TOUCH, dev->keybit); in byd_init()
491 __set_bit(BTN_TOOL_FINGER, dev->keybit); in byd_init()
493 __set_bit(BTN_LEFT, dev->keybit); in byd_init()
494 __set_bit(BTN_RIGHT, dev->keybit); in byd_init()
495 __clear_bit(BTN_MIDDLE, dev->keybit); in byd_init()
498 __set_bit(EV_ABS, dev->evbit); in byd_init()
504 __clear_bit(EV_REL, dev->evbit); in byd_init()
505 __clear_bit(REL_X, dev->relbit); in byd_init()
506 __clear_bit(REL_Y, dev->relbit); in byd_init()