Tue Apr 28 19:22:58 2020 UTC ()
pms_synaptics_enable: no need to send PMS_DEV_ENABLE here because
pms_enable does this for us. Seems to resolve issues with my trackpoint
not working immediately after starting X on ThinkPad X260.


(jmcneill)
diff -r1.65 -r1.66 src/sys/dev/pckbport/synaptics.c

cvs diff -r1.65 -r1.66 src/sys/dev/pckbport/synaptics.c (expand / switch to unified diff)

--- src/sys/dev/pckbport/synaptics.c 2020/04/27 22:31:47 1.65
+++ src/sys/dev/pckbport/synaptics.c 2020/04/28 19:22:58 1.66
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: synaptics.c,v 1.65 2020/04/27 22:31:47 jmcneill Exp $ */ 1/* $NetBSD: synaptics.c,v 1.66 2020/04/28 19:22:58 jmcneill Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 2005, Steve C. Woodford 4 * Copyright (c) 2005, Steve C. Woodford
5 * Copyright (c) 2004, Ales Krenek 5 * Copyright (c) 2004, Ales Krenek
6 * Copyright (c) 2004, Kentaro A. Kurahone 6 * Copyright (c) 2004, Kentaro A. Kurahone
7 * All rights reserved. 7 * All rights reserved.
8 * 8 *
9 * Redistribution and use in source and binary forms, with or without 9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions 10 * modification, are permitted provided that the following conditions
11 * are met: 11 * are met:
12 * 12 *
13 * * Redistributions of source code must retain the above copyright 13 * * Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer. 14 * notice, this list of conditions and the following disclaimer.
@@ -38,27 +38,27 @@ @@ -38,27 +38,27 @@
38/* 38/*
39 * TODO: 39 * TODO:
40 * - Make the sysctl values per-instance instead of global. 40 * - Make the sysctl values per-instance instead of global.
41 * - Consider setting initial scaling factors at runtime according 41 * - Consider setting initial scaling factors at runtime according
42 * to the values returned by the 'Read Resolutions' command. 42 * to the values returned by the 'Read Resolutions' command.
43 * - Support the serial protocol (we only support PS/2 for now) 43 * - Support the serial protocol (we only support PS/2 for now)
44 * - Support auto-repeat for up/down button Z-axis emulation. 44 * - Support auto-repeat for up/down button Z-axis emulation.
45 * - Maybe add some more gestures (can we use Palm support somehow?) 45 * - Maybe add some more gestures (can we use Palm support somehow?)
46 */ 46 */
47 47
48#include "opt_pms.h" 48#include "opt_pms.h"
49 49
50#include <sys/cdefs.h> 50#include <sys/cdefs.h>
51__KERNEL_RCSID(0, "$NetBSD: synaptics.c,v 1.65 2020/04/27 22:31:47 jmcneill Exp $"); 51__KERNEL_RCSID(0, "$NetBSD: synaptics.c,v 1.66 2020/04/28 19:22:58 jmcneill Exp $");
52 52
53#include <sys/param.h> 53#include <sys/param.h>
54#include <sys/systm.h> 54#include <sys/systm.h>
55#include <sys/device.h> 55#include <sys/device.h>
56#include <sys/ioctl.h> 56#include <sys/ioctl.h>
57#include <sys/sysctl.h> 57#include <sys/sysctl.h>
58#include <sys/kernel.h> 58#include <sys/kernel.h>
59#include <sys/proc.h> 59#include <sys/proc.h>
60 60
61#include <sys/bus.h> 61#include <sys/bus.h>
62 62
63#include <dev/pckbport/pckbportvar.h> 63#include <dev/pckbport/pckbportvar.h>
64 64
@@ -474,28 +474,26 @@ pms_synaptics_enable(void *vsc) @@ -474,28 +474,26 @@ pms_synaptics_enable(void *vsc)
474 res = synaptics_special_write(psc, SYNAPTICS_CMD_SET_MODE2, enable_modes); 474 res = synaptics_special_write(psc, SYNAPTICS_CMD_SET_MODE2, enable_modes);
475 if (res) 475 if (res)
476 aprint_error("synaptics: set mode error\n"); 476 aprint_error("synaptics: set mode error\n");
477 477
478 /* a couple of set scales to clear out pending commands */ 478 /* a couple of set scales to clear out pending commands */
479 for (i = 0; i < 2; i++) 479 for (i = 0; i < 2; i++)
480 synaptics_poll_cmd(psc, PMS_SET_SCALE11, 0); 480 synaptics_poll_cmd(psc, PMS_SET_SCALE11, 0);
481 481
482 /* Set advanced gesture mode */ 482 /* Set advanced gesture mode */
483 if ((sc->flags & SYN_FLAG_HAS_EXTENDED_WMODE) || 483 if ((sc->flags & SYN_FLAG_HAS_EXTENDED_WMODE) ||
484 (sc->flags & SYN_FLAG_HAS_ADV_GESTURE_MODE)) 484 (sc->flags & SYN_FLAG_HAS_ADV_GESTURE_MODE))
485 synaptics_special_write(psc, SYNAPTICS_WRITE_DELUXE_3, 0x3);  485 synaptics_special_write(psc, SYNAPTICS_WRITE_DELUXE_3, 0x3);
486 486
487 synaptics_poll_cmd(psc, PMS_DEV_ENABLE, 0); 
488 
489 sc->up_down = 0; 487 sc->up_down = 0;
490 sc->prev_fingers = 0; 488 sc->prev_fingers = 0;
491 sc->gesture_start_x = sc->gesture_start_y = 0; 489 sc->gesture_start_x = sc->gesture_start_y = 0;
492 sc->gesture_start_packet = 0; 490 sc->gesture_start_packet = 0;
493 sc->gesture_tap_packet = 0; 491 sc->gesture_tap_packet = 0;
494 sc->gesture_type = 0; 492 sc->gesture_type = 0;
495 sc->gesture_buttons = 0; 493 sc->gesture_buttons = 0;
496 sc->dz_hold = 0; 494 sc->dz_hold = 0;
497 for (i = 0; i < SYN_MAX_FINGERS; i++) { 495 for (i = 0; i < SYN_MAX_FINGERS; i++) {
498 sc->rem_x[i] = sc->rem_y[i] = sc->rem_z[i] = 0; 496 sc->rem_x[i] = sc->rem_y[i] = sc->rem_z[i] = 0;
499 sc->movement_history[i] = 0; 497 sc->movement_history[i] = 0;
500 } 498 }
501 sc->button_history = 0; 499 sc->button_history = 0;