summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlf Brosziewski <bru@cvs.openbsd.org>2016-05-22 22:06:12 +0000
committerUlf Brosziewski <bru@cvs.openbsd.org>2016-05-22 22:06:12 +0000
commit52ac92ef70983c433ebbe83ea322313c1be53ec0 (patch)
tree28002b626f1453f677e6925007678329a0537286
parentd1e38bbbabbac77088f68016026dbda443fbdb18 (diff)
Use the new input functions of wsmouse in mouse and touchscreen drivers.
ok kettenis@
-rw-r--r--sys/dev/hid/hidms.c23
-rw-r--r--sys/dev/pckbc/pms.c5
2 files changed, 15 insertions, 13 deletions
diff --git a/sys/dev/hid/hidms.c b/sys/dev/hid/hidms.c
index bc9b39d4fc8..d5009ef9a88 100644
--- a/sys/dev/hid/hidms.c
+++ b/sys/dev/hid/hidms.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: hidms.c,v 1.2 2016/02/10 05:49:50 guenther Exp $ */
+/* $OpenBSD: hidms.c,v 1.3 2016/05/22 22:06:11 bru Exp $ */
/* $NetBSD: ums.c,v 1.60 2003/03/11 16:44:00 augustss Exp $ */
/*
@@ -331,7 +331,6 @@ hidms_input(struct hidms *ms, uint8_t *data, u_int len)
{
int dx, dy, dz, dw;
u_int32_t buttons = 0;
- int flags;
int i, s;
DPRINTFN(5,("hidms_input: len=%d\n", len));
@@ -358,12 +357,6 @@ hidms_input(struct hidms *ms, uint8_t *data, u_int len)
return;
}
- flags = WSMOUSE_INPUT_DELTA;
- if (ms->sc_flags & HIDMS_ABSX)
- flags |= WSMOUSE_INPUT_ABSOLUTE_X;
- if (ms->sc_flags & HIDMS_ABSY)
- flags |= WSMOUSE_INPUT_ABSOLUTE_Y;
-
dx = hid_get_data(data, len, &ms->sc_loc_x);
dy = -hid_get_data(data, len, &ms->sc_loc_y);
dz = hid_get_data(data, len, &ms->sc_loc_z);
@@ -403,8 +396,18 @@ hidms_input(struct hidms *ms, uint8_t *data, u_int len)
ms->sc_buttons = buttons;
if (ms->sc_wsmousedev != NULL) {
s = spltty();
- wsmouse_input(ms->sc_wsmousedev, buttons,
- dx, dy, dz, dw, flags);
+ if (ms->sc_flags & HIDMS_ABSX) {
+ wsmouse_set(ms->sc_wsmousedev,
+ WSMOUSE_ABS_X, dx, 0);
+ dx = 0;
+ }
+ if (ms->sc_flags & HIDMS_ABSY) {
+ wsmouse_set(ms->sc_wsmousedev,
+ WSMOUSE_ABS_Y, dy, 0);
+ dy = 0;
+ }
+ WSMOUSE_INPUT(ms->sc_wsmousedev,
+ buttons, dx, dy, dz, dw);
splx(s);
}
}
diff --git a/sys/dev/pckbc/pms.c b/sys/dev/pckbc/pms.c
index 2bf2806dda8..796c3d77ce1 100644
--- a/sys/dev/pckbc/pms.c
+++ b/sys/dev/pckbc/pms.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pms.c,v 1.69 2016/03/30 23:34:12 bru Exp $ */
+/* $OpenBSD: pms.c,v 1.70 2016/05/22 22:06:11 bru Exp $ */
/* $NetBSD: psm.c,v 1.11 2000/06/05 22:20:57 sommerfeld Exp $ */
/*-
@@ -632,8 +632,7 @@ pms_proc_mouse(struct pms_softc *sc)
else
dz = 0;
- wsmouse_input(sc->sc_wsmousedev,
- buttons, dx, dy, dz, 0, WSMOUSE_INPUT_DELTA);
+ WSMOUSE_INPUT(sc->sc_wsmousedev, buttons, dx, dy, dz, 0);
}
int