Add a quirk for mice with reversed Z-axis.

This commit is contained in:
augustss 1999-06-26 00:09:15 +00:00
parent 55fbc23acc
commit 7ef0c8eef3
3 changed files with 11 additions and 4 deletions

View File

@ -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 @@ struct ums_softc {
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(ums)
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 @@ ums_intr(reqh, addr, status)
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));

View File

@ -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 @@ struct usbd_quirk_entry {
{ 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 } }
};

View File

@ -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 @@ struct usbd_quirks {
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. */
};