From 7707483a07a5a07dbc6b911719683ec6f9992885 Mon Sep 17 00:00:00 2001 From: Vladimir Kondratyev Date: Thu, 19 Oct 2017 20:54:55 +0000 Subject: [PATCH] ums(4): Unreverse evdev Tilt-axis reporting to match Linux. sysmouse tilt to button mapping remained unchanged. Reviewed by: hselasky Approved by: gonzo (mentor) MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D12671 --- sys/dev/usb/input/ums.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/dev/usb/input/ums.c b/sys/dev/usb/input/ums.c index f9571f2108fe..c393f31a94e7 100644 --- a/sys/dev/usb/input/ums.c +++ b/sys/dev/usb/input/ums.c @@ -296,7 +296,7 @@ ums_intr_callback(struct usb_xfer *xfer, usb_error_t error) if ((info->sc_flags & UMS_FLAG_T_AXIS) && (id == info->sc_iid_t)) { - dt -= hid_get_data(buf, len, &info->sc_loc_t); + dt += hid_get_data(buf, len, &info->sc_loc_t); /* T-axis is translated into button presses */ buttons_found |= (1UL << 5) | (1UL << 6); } @@ -332,10 +332,10 @@ ums_intr_callback(struct usb_xfer *xfer, usb_error_t error) /* translate T-axis into button presses until further */ if (dt > 0) { ums_put_queue(sc, 0, 0, 0, 0, buttons); - buttons |= 1UL << 5; + buttons |= 1UL << 6; } else if (dt < 0) { ums_put_queue(sc, 0, 0, 0, 0, buttons); - buttons |= 1UL << 6; + buttons |= 1UL << 5; } sc->sc_status.button = buttons;