summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sys/dev/acpi/acpi.c4
-rw-r--r--sys/dev/pckbc/pms.c38
-rw-r--r--sys/dev/pckbc/pmsreg.h9
3 files changed, 44 insertions, 7 deletions
diff --git a/sys/dev/acpi/acpi.c b/sys/dev/acpi/acpi.c
index bb429a085ed..c55c6f6413c 100644
--- a/sys/dev/acpi/acpi.c
+++ b/sys/dev/acpi/acpi.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: acpi.c,v 1.286 2015/03/20 20:25:10 kettenis Exp $ */
+/* $OpenBSD: acpi.c,v 1.287 2015/03/26 01:30:22 jsg Exp $ */
/*
* Copyright (c) 2005 Thorsten Lockert <tholo@sigmasoft.com>
* Copyright (c) 2005 Jordan Hargrave <jordan@openbsd.org>
@@ -183,9 +183,7 @@ static const char *sbtn_pnp[] = {
"LEN0041",
"LEN0042",
"LEN0045",
- "LEN0046",
"LEN0047",
- "LEN0048",
"LEN0049",
"LEN2000",
"LEN2001",
diff --git a/sys/dev/pckbc/pms.c b/sys/dev/pckbc/pms.c
index fdffa119241..60da6e43e66 100644
--- a/sys/dev/pckbc/pms.c
+++ b/sys/dev/pckbc/pms.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pms.c,v 1.57 2015/02/09 04:05:25 mpi Exp $ */
+/* $OpenBSD: pms.c,v 1.58 2015/03/26 01:30:22 jsg Exp $ */
/* $NetBSD: psm.c,v 1.11 2000/06/05 22:20:57 sommerfeld Exp $ */
/*-
@@ -82,9 +82,10 @@ struct pms_protocol {
struct synaptics_softc {
int identify;
- int capabilities, ext_capabilities;
+ int capabilities, ext_capabilities, ext2_capabilities;
int model, ext_model;
int resolution, dimension;
+ int modes;
int mode;
@@ -102,6 +103,7 @@ struct synaptics_softc {
int wsmode;
int old_x, old_y;
u_int old_buttons;
+ u_int sec_buttons;
#define SYNAPTICS_SCALE 4
#define SYNAPTICS_PRESSURE 30
};
@@ -937,6 +939,14 @@ synaptics_get_hwinfo(struct pms_softc *sc)
(syn->ext_capabilities & SYNAPTICS_EXT_CAP_MAX_DIMENSIONS) &&
synaptics_query(sc, SYNAPTICS_QUE_EXT_DIMENSIONS, &syn->dimension))
return (-1);
+ if (SYNAPTICS_ID_FULL(syn->identify) >= 0x705) {
+ if (synaptics_query(sc, SYNAPTICS_QUE_MODES, &syn->modes))
+ return (-1);
+ if ((syn->modes & SYNAPTICS_EXT2_CAP) &&
+ synaptics_query(sc, SYNAPTICS_QUE_EXT2_CAPABILITIES,
+ &syn->ext2_capabilities))
+ return (-1);
+ }
syn->res_x = SYNAPTICS_RESOLUTION_X(syn->resolution);
syn->res_y = SYNAPTICS_RESOLUTION_Y(syn->resolution);
@@ -947,6 +957,8 @@ synaptics_get_hwinfo(struct pms_softc *sc)
syn->max_y = (syn->dimension) ?
SYNAPTICS_DIM_Y(syn->dimension) : SYNAPTICS_YMAX_BEZEL;
+ syn->sec_buttons = 0;
+
if (SYNAPTICS_EXT_MODEL_BUTTONS(syn->ext_model) > 8)
syn->ext_model &= ~0xf000;
@@ -967,6 +979,7 @@ synaptics_get_hwinfo(struct pms_softc *sc)
void
synaptics_sec_proc(struct pms_softc *sc)
{
+ struct synaptics_softc *syn = sc->synaptics;
u_int buttons;
int dx, dy;
@@ -974,6 +987,7 @@ synaptics_sec_proc(struct pms_softc *sc)
return;
buttons = butmap[sc->packet[1] & PMS_PS2_BUTTONSMASK];
+ buttons |= syn->sec_buttons;
dx = (sc->packet[1] & PMS_PS2_XNEG) ?
(int)sc->packet[4] - 256 : sc->packet[4];
dy = (sc->packet[1] & PMS_PS2_YNEG) ?
@@ -1092,7 +1106,8 @@ pms_ioctl_synaptics(struct pms_softc *sc, u_long cmd, caddr_t data, int flag,
switch (cmd) {
case WSMOUSEIO_GTYPE:
if ((syn->ext_capabilities & SYNAPTICS_EXT_CAP_CLICKPAD) &&
- mouse_has_softbtn)
+ !(syn->ext2_capabilities & SYNAPTICS_EXT2_CAP_BUTTONS_STICK)
+ && mouse_has_softbtn)
*(u_int *)data = WSMOUSE_TYPE_SYNAP_SBTN;
else
*(u_int *)data = WSMOUSE_TYPE_SYNAPTICS;
@@ -1185,6 +1200,23 @@ pms_proc_synaptics(struct pms_softc *sc)
WSMOUSE_BUTTON(5) : 0;
} else if (SYNAPTICS_EXT_MODEL_BUTTONS(syn->ext_model) &&
((sc->packet[0] ^ sc->packet[3]) & 0x02)) {
+ if (syn->ext2_capabilities & SYNAPTICS_EXT2_CAP_BUTTONS_STICK) {
+ /*
+ * Trackstick buttons on this machine are wired to the
+ * trackpad as extra buttons, so route the event
+ * through the trackstick interface as normal buttons
+ */
+ syn->sec_buttons =
+ (sc->packet[4] & 0x01) ? WSMOUSE_BUTTON(1) : 0;
+ syn->sec_buttons |=
+ (sc->packet[5] & 0x01) ? WSMOUSE_BUTTON(3) : 0;
+ syn->sec_buttons |=
+ (sc->packet[4] & 0x02) ? WSMOUSE_BUTTON(2) : 0;
+ wsmouse_input(sc->sc_sec_wsmousedev,
+ syn->sec_buttons, 0, 0, 0, 0, WSMOUSE_INPUT_DELTA);
+ return;
+ }
+
buttons |= (sc->packet[4] & 0x01) ? WSMOUSE_BUTTON(6) : 0;
buttons |= (sc->packet[5] & 0x01) ? WSMOUSE_BUTTON(7) : 0;
buttons |= (sc->packet[4] & 0x02) ? WSMOUSE_BUTTON(8) : 0;
diff --git a/sys/dev/pckbc/pmsreg.h b/sys/dev/pckbc/pmsreg.h
index 55d8b59604d..cf81d355671 100644
--- a/sys/dev/pckbc/pmsreg.h
+++ b/sys/dev/pckbc/pmsreg.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: pmsreg.h,v 1.10 2013/05/31 19:21:09 jcs Exp $ */
+/* $OpenBSD: pmsreg.h,v 1.11 2015/03/26 01:30:22 jsg Exp $ */
/* $NetBSD: psmreg.h,v 1.1 1998/03/22 15:41:28 drochner Exp $ */
#ifndef SYS_DEV_PCKBC_PMSREG_H
@@ -74,6 +74,7 @@
#define SYNAPTICS_QUE_EXT_MODEL 0x09
#define SYNAPTICS_QUE_EXT_CAPABILITIES 0x0c
#define SYNAPTICS_QUE_EXT_DIMENSIONS 0x0d
+#define SYNAPTICS_QUE_EXT2_CAPABILITIES 0x10
#define SYNAPTICS_CMD_SET_MODE 0x14
#define SYNAPTICS_CMD_SEND_CLIENT 0x28
@@ -83,9 +84,12 @@
#define SYNAPTICS_ID_MODEL(id) (((id) >> 4) & 0x0f)
#define SYNAPTICS_ID_MINOR(id) (((id) >> 16) & 0xff)
#define SYNAPTICS_ID_MAJOR(id) ((id) & 0x0f)
+#define SYNAPTICS_ID_FULL(id) \
+ (SYNAPTICS_ID_MAJOR(id) << 8 | SYNAPTICS_ID_MINOR(id))
#define SYNAPTICS_ID_MAGIC 0x47
/* Modes bits */
+#define SYNAPTICS_EXT2_CAP (1 << 17)
#define SYNAPTICS_ABSOLUTE_MODE (1 << 7)
#define SYNAPTICS_HIGH_RATE (1 << 6)
#define SYNAPTICS_SLEEP_MODE (1 << 3)
@@ -141,6 +145,9 @@
#define SYNAPTICS_DIM_Y(d) ((((d) & 0xff) << 5) | \
(((d) & 0xf000) >> 11))
+/* Extended Capability 2 */
+#define SYNAPTICS_EXT2_CAP_BUTTONS_STICK (1 << 16)
+
/* Typical bezel limit */
#define SYNAPTICS_XMIN_BEZEL 1472
#define SYNAPTICS_XMAX_BEZEL 5472