zts, hilms, and uts are the drivers that still use wsmouse_input
with absolute coordinates (or with both types of coordinates).
The new, "flag-less" interface of wsmouse requires calls of
wsmouse_position, and, possibly, of wsmouse_touch in this case.

Questions, tests and OKs would be welcome.


Index: arch/zaurus/dev/zts.c
===================================================================
RCS file: /cvs/src/sys/arch/zaurus/dev/zts.c,v
retrieving revision 1.16
diff -u -p -r1.16 zts.c
--- arch/zaurus/dev/zts.c       29 Mar 2014 18:09:30 -0000      1.16
+++ arch/zaurus/dev/zts.c       31 May 2016 19:23:10 -0000
@@ -544,10 +544,9 @@ zts_irq(void *v)
                DPRINTF(("%s: tp.z = %d, tp.x = %d, tp.y = %d\n",
                    sc->sc_dev.dv_xname, tp.z, tp.x, tp.y));
 
-               wsmouse_input(sc->sc_wsmousedev, down, tp.x, tp.y,
-                   0 /* z */, 0 /* w */,
-                   WSMOUSE_INPUT_ABSOLUTE_X | WSMOUSE_INPUT_ABSOLUTE_Y |
-                   WSMOUSE_INPUT_ABSOLUTE_Z);
+               wsmouse_buttons(sc->sc_wsmousedev, down);
+               wsmouse_position(sc->sc_wsmousedev, tp.x, tp.y);
+               wsmouse_input_sync(sc->sc_wsmousedev);
                sc->sc_buttons = down;
                sc->sc_oldx = tp.x;
                sc->sc_oldy = tp.y;
Index: dev/hil/hilms.c
===================================================================
RCS file: /cvs/src/sys/dev/hil/hilms.c,v
retrieving revision 1.5
diff -u -p -r1.5 hilms.c
--- dev/hil/hilms.c     10 Apr 2007 22:37:17 -0000      1.5
+++ dev/hil/hilms.c     31 May 2016 19:23:10 -0000
@@ -219,7 +219,7 @@ void
 hilms_callback(struct hildev_softc *dev, u_int buflen, u_int8_t *buf)
 {
        struct hilms_softc *sc = (struct hilms_softc *)dev;
-       int type, flags;
+       int type;
        int dx, dy, dz, button;
 #ifdef DIAGNOSTIC
        int minlen;
@@ -256,9 +256,6 @@ hilms_callback(struct hildev_softc *dev,
         */
 
        if (type & HIL_MOUSEMOTION) {
-               flags = sc->sc_features & HIL_ABSOLUTE ?
-                   WSMOUSE_INPUT_ABSOLUTE_X | WSMOUSE_INPUT_ABSOLUTE_Y |
-                   WSMOUSE_INPUT_ABSOLUTE_Z : WSMOUSE_INPUT_DELTA;
                if (sc->sc_features & HIL_16_BITS) {
                        dx = *buf++;
                        dx |= (*buf++) << 8;
@@ -302,8 +299,7 @@ hilms_callback(struct hildev_softc *dev,
                if ((sc->sc_features & HIL_ABSOLUTE) == 0 &&
                    sc->sc_buttons == 0)
                        dy = -dy;
-       } else
-               dx = dy = dz = flags = 0;
+       }
 
        if (type & HIL_MOUSEBUTTON) {
                button = *buf;
@@ -332,7 +328,18 @@ hilms_callback(struct hildev_softc *dev,
                /* buf++; */
        }
        
-       if (sc->sc_wsmousedev != NULL)
-               wsmouse_input(sc->sc_wsmousedev,
-                   sc->sc_buttonstate, dx, dy, dz, 0, flags);
+       if (sc->sc_wsmousedev == NULL)
+               return;
+
+       wsmouse_buttons(sc->sc_wsmousedev, sc->sc_buttonstate);
+       if (type & HIL_MOUSEMOTION) {
+               if ((sc->sc_features & HIL_ABSOLUTE) == 0) {
+                       wsmouse_motion(sc->sc_wsmousedev, dx, dy, dz, 0);
+               } else {
+                       wsmouse_position(sc->sc_wsmousedev, dx, dy);
+                       if (sc->sc_axes > 2)
+                               wsmouse_touch(sc->sc_wsmousedev, dz, 0);
+               }
+       }
+       wsmouse_input_sync(sc->sc_wsmousedev);
 }
Index: dev/usb/uts.c
===================================================================
RCS file: /cvs/src/sys/dev/usb/uts.c,v
retrieving revision 1.37
diff -u -p -r1.37 uts.c
--- dev/usb/uts.c       10 Feb 2016 05:49:50 -0000      1.37
+++ dev/usb/uts.c       31 May 2016 19:23:12 -0000
@@ -476,9 +476,7 @@ uts_intr(struct usbd_xfer *xfer, void *a
        DPRINTF(("%s: tp.down = %d, tp.z = %d, tp.x = %d, tp.y = %d\n",
            sc->sc_dev.dv_xname, tp.down, tp.z, tp.x, tp.y));
 
-       wsmouse_input(sc->sc_wsmousedev, tp.down, tp.x, tp.y, tp.z, 0,
-           WSMOUSE_INPUT_ABSOLUTE_X | WSMOUSE_INPUT_ABSOLUTE_Y |
-           WSMOUSE_INPUT_ABSOLUTE_Z);
+       WSMOUSE_TOUCH(sc->sc_wsmousedev, tp.down, tp.x, tp.y, tp.z, 0);
        sc->sc_oldy = tp.y;
        sc->sc_oldx = tp.x;
 

Reply via email to