Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/usb Add a quirk for mice with reversed Z-axis.
details: https://anonhg.NetBSD.org/src/rev/ed91186f2a0f
branches: trunk
changeset: 474013:ed91186f2a0f
user: augustss <augustss%NetBSD.org@localhost>
date: Sat Jun 26 00:09:15 1999 +0000
description:
Add a quirk for mice with reversed Z-axis.
diffstat:
sys/dev/usb/ums.c | 8 +++++++-
sys/dev/usb/usb_quirks.c | 3 ++-
sys/dev/usb/usb_quirks.h | 4 ++--
3 files changed, 11 insertions(+), 4 deletions(-)
diffs (71 lines):
diff -r fc36ce4fb306 -r ed91186f2a0f sys/dev/usb/ums.c
--- a/sys/dev/usb/ums.c Sat Jun 26 00:08:15 1999 +0000
+++ b/sys/dev/usb/ums.c Sat Jun 26 00:09:15 1999 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ums.c,v 1.23 1999/05/09 15:10:31 augustss Exp $ */
+/* $NetBSD: ums.c,v 1.24 1999/06/26 00:09:15 augustss Exp $ */
/*
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -115,6 +115,8 @@
int nbuttons;
#define MAX_BUTTONS 7 /* chosen because sc_buttons is u_char */
+ char revz; /* Z-axis is reversed */
+
#if defined(__NetBSD__)
u_char sc_buttons; /* mouse button status */
struct device *sc_wsmousedev;
@@ -245,6 +247,8 @@
USB_ATTACH_ERROR_RETURN;
}
+ sc->revz = (usbd_get_quirks(uaa->device)->uq_flags & UQ_MS_REVZ) != 0;
+
r = usbd_alloc_report_desc(uaa->iface, &desc, &size, M_TEMP);
if (r != USBD_NORMAL_COMPLETION)
USB_ATTACH_ERROR_RETURN;
@@ -440,6 +444,8 @@
dx = hid_get_data(ibuf, &sc->sc_loc_x);
dy = -hid_get_data(ibuf, &sc->sc_loc_y);
dz = hid_get_data(ibuf, &sc->sc_loc_z);
+ if (sc->revz)
+ dz = -dz;
for (i = 0; i < sc->nbuttons; i++)
if (hid_get_data(ibuf, &sc->sc_loc_btn[i]))
buttons |= (1 << UMS_BUT(i));
diff -r fc36ce4fb306 -r ed91186f2a0f sys/dev/usb/usb_quirks.c
--- a/sys/dev/usb/usb_quirks.c Sat Jun 26 00:08:15 1999 +0000
+++ b/sys/dev/usb/usb_quirks.c Sat Jun 26 00:09:15 1999 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: usb_quirks.c,v 1.10 1999/06/14 17:09:57 augustss Exp $ */
+/* $NetBSD: usb_quirks.c,v 1.11 1999/06/26 00:09:15 augustss Exp $ */
/*
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -65,6 +65,7 @@
{ USB_VENDOR_ADS, USB_PRODUCT_ADS_ENET, 0x002, { UQ_NO_STRINGS }},
{ USB_VENDOR_PERACOM, USB_PRODUCT_PERACOM_SERIAL1, 0x101, { UQ_NO_STRINGS }},
{ USB_VENDOR_JAZZ, USB_PRODUCT_JAZZ_J6502, 0x0a2, { UQ_BAD_ADC }},
+ { USB_VENDOR_LOGITECH, USB_PRODUCT_LOGITECH_USBPS2,0x110, { UQ_MS_REVZ }},
{ 0, 0, 0, { 0 } }
};
diff -r fc36ce4fb306 -r ed91186f2a0f sys/dev/usb/usb_quirks.h
--- a/sys/dev/usb/usb_quirks.h Sat Jun 26 00:08:15 1999 +0000
+++ b/sys/dev/usb/usb_quirks.h Sat Jun 26 00:09:15 1999 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: usb_quirks.h,v 1.6 1999/06/14 17:09:57 augustss Exp $ */
+/* $NetBSD: usb_quirks.h,v 1.7 1999/06/26 00:09:15 augustss Exp $ */
/*
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -41,7 +41,7 @@
u_int32_t uq_flags; /* Device problems: */
#define UQ_NO_SET_PROTO 0x01 /* cannot handle SET PROTOCOL. */
#define UQ_SWAP_UNICODE 0x02 /* has some Unicode strings swapped. */
-/*#define UQ_ 0x04 */
+#define UQ_MS_REVZ 0x04 /* mouse has Z-axis reversed */
#define UQ_NO_STRINGS 0x08 /* string descriptors are broken. */
#define UQ_BAD_ADC 0x10 /* bad audio spec version number. */
};
Home |
Main Index |
Thread Index |
Old Index