Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 17 May 2010 23:46:08 +0000 (UTC)
From:      Andrew Thompson <thompsa@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
Subject:   svn commit: r208222 - in stable/8/sys/dev/usb: . input
Message-ID:  <201005172346.o4HNk8FC074707@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: thompsa
Date: Mon May 17 23:46:08 2010
New Revision: 208222
URL: http://svn.freebsd.org/changeset/base/208222

Log:
  MFC r208009
  
   Enable support for mouse panning wheels.

Modified:
  stable/8/sys/dev/usb/input/ums.c
  stable/8/sys/dev/usb/usbhid.h
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)
  stable/8/sys/geom/sched/   (props changed)

Modified: stable/8/sys/dev/usb/input/ums.c
==============================================================================
--- stable/8/sys/dev/usb/input/ums.c	Mon May 17 23:45:31 2010	(r208221)
+++ stable/8/sys/dev/usb/input/ums.c	Mon May 17 23:46:08 2010	(r208222)
@@ -293,6 +293,12 @@ ums_intr_callback(struct usb_xfer *xfer,
 			DPRINTFN(6, "x:%d y:%d z:%d t:%d w:%d buttons:0x%08x\n",
 			    dx, dy, dz, dt, dw, buttons);
 
+			/* translate T-axis into button presses until further */
+			if (dt > 0)
+				buttons |= 1UL << 3;
+			else if (dt < 0)
+				buttons |= 1UL << 4;
+
 			sc->sc_status.button = buttons;
 			sc->sc_status.dx += dx;
 			sc->sc_status.dy += dy;
@@ -461,6 +467,12 @@ ums_hid_parse(struct ums_softc *sc, devi
 		if ((flags & MOUSE_FLAGS_MASK) == MOUSE_FLAGS) {
 			info->sc_flags |= UMS_FLAG_T_AXIS;
 		}
+	} else if (hid_locate(buf, len, HID_USAGE2(HUP_CONSUMER,
+		HUC_AC_PAN), hid_input, index, &info->sc_loc_t,
+		&flags, &info->sc_iid_t)) {
+
+		if ((flags & MOUSE_FLAGS_MASK) == MOUSE_FLAGS)
+			info->sc_flags |= UMS_FLAG_T_AXIS;
 	}
 	/* figure out the number of buttons */
 

Modified: stable/8/sys/dev/usb/usbhid.h
==============================================================================
--- stable/8/sys/dev/usb/usbhid.h	Mon May 17 23:45:31 2010	(r208221)
+++ stable/8/sys/dev/usb/usbhid.h	Mon May 17 23:46:08 2010	(r208222)
@@ -156,6 +156,9 @@ struct usb_hid_descriptor {
 #define	HUD_ERASER		0x0045
 #define	HUD_TABLET_PICK		0x0046
 
+/* Usages, Consumer */
+#define	HUC_AC_PAN		0x0238
+
 #define	HID_USAGE2(p,u) (((p) << 16) | (u))
 
 #define	UHID_INPUT_REPORT 0x01



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201005172346.o4HNk8FC074707>