From owner-svn-src-head@FreeBSD.ORG  Thu Sep  2 03:44:56 2010
Return-Path: <owner-svn-src-head@FreeBSD.ORG>
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id D2CCE10656BC;
	Thu,  2 Sep 2010 03:44:56 +0000 (UTC)
	(envelope-from thompsa@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id C2CA08FC15;
	Thu,  2 Sep 2010 03:44:56 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o823iuEj090659;
	Thu, 2 Sep 2010 03:44:56 GMT (envelope-from thompsa@svn.freebsd.org)
Received: (from thompsa@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o823iuhk090657;
	Thu, 2 Sep 2010 03:44:56 GMT (envelope-from thompsa@svn.freebsd.org)
Message-Id: <201009020344.o823iuhk090657@svn.freebsd.org>
From: Andrew Thompson <thompsa@FreeBSD.org>
Date: Thu, 2 Sep 2010 03:44:56 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r212129 - head/sys/dev/usb/input
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	<svn-src-head.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-head>,
	<mailto:svn-src-head-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-head>
List-Post: <mailto:svn-src-head@freebsd.org>
List-Help: <mailto:svn-src-head-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-head>,
	<mailto:svn-src-head-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Thu, 02 Sep 2010 03:44:56 -0000

Author: thompsa
Date: Thu Sep  2 03:44:56 2010
New Revision: 212129
URL: http://svn.freebsd.org/changeset/base/212129

Log:
  Add support for extra buttons on the Kensington Slimblade Trackball.
  
  Submitted by:	Lee, Chung-Yeol

Modified:
  head/sys/dev/usb/input/ums.c

Modified: head/sys/dev/usb/input/ums.c
==============================================================================
--- head/sys/dev/usb/input/ums.c	Thu Sep  2 03:42:26 2010	(r212128)
+++ head/sys/dev/usb/input/ums.c	Thu Sep  2 03:44:56 2010	(r212129)
@@ -399,6 +399,7 @@ ums_hid_parse(struct ums_softc *sc, devi
 	struct ums_info *info = &sc->sc_info[index];
 	uint32_t flags;
 	uint8_t i;
+	uint8_t j;
 
 	if (hid_locate(buf, len, HID_USAGE2(HUP_GENERIC_DESKTOP, HUG_X),
 	    hid_input, index, &info->sc_loc_x, &flags, &info->sc_iid_x)) {
@@ -476,6 +477,17 @@ ums_hid_parse(struct ums_softc *sc, devi
 			break;
 		}
 	}
+
+	/* detect other buttons */
+
+	for (j = 0; (i < UMS_BUTTONS_MAX) && (j < 2); i++, j++) {
+		if (!hid_locate(buf, len, HID_USAGE2(HUP_MICROSOFT, (j + 1)),
+		    hid_input, index, &info->sc_loc_btn[i], NULL, 
+		    &info->sc_iid_btn[i])) {
+			break;
+		}
+	}
+
 	info->sc_buttons = i;
 
 	if (i > sc->sc_buttons)