Module Name:    src
Committed By:   thorpej
Date:           Wed Feb  3 23:26:08 UTC 2021

Modified Files:
        src/sys/dev/usb: ums.c

Log Message:
I have a cheap USB optical mouse (CHICONY product 0x0939, also known
as "PixArt USB Optical Mouse") that likes to disconnect after 60 seconds
and then reattach 2 seconds later (ad nauseum) unless it's kept open,
so use the "always open" quirk on that device as well.


To generate a diff of this commit:
cvs rdiff -u -r1.99 -r1.100 src/sys/dev/usb/ums.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/usb/ums.c
diff -u src/sys/dev/usb/ums.c:1.99 src/sys/dev/usb/ums.c:1.100
--- src/sys/dev/usb/ums.c:1.99	Sat Oct 10 21:47:42 2020
+++ src/sys/dev/usb/ums.c	Wed Feb  3 23:26:08 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: ums.c,v 1.99 2020/10/10 21:47:42 jmcneill Exp $	*/
+/*	$NetBSD: ums.c,v 1.100 2021/02/03 23:26:08 thorpej Exp $	*/
 
 /*
  * Copyright (c) 1998, 2017 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ums.c,v 1.99 2020/10/10 21:47:42 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ums.c,v 1.100 2021/02/03 23:26:08 thorpej Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -210,6 +210,16 @@ ums_attach(device_t parent, device_t sel
 		sc->sc_alwayson = true;
 	}
 
+	if (uha->uiaa->uiaa_vendor == USB_VENDOR_CHICONY &&
+	    uha->uiaa->uiaa_product == USB_PRODUCT_CHICONY_OPTMOUSE0939) {
+		/*
+		 * This cheap mouse will disconnect after 60 seconds,
+		 * reconnect, and then disconnect again (ad nauseum)
+		 * unless it's kept open.
+		 */
+		sc->sc_alwayson = true;
+	}
+
 	tpcalib_init(&sc->sc_ms.sc_tpcalib);
 
 	/* calibrate the pointer if it reports absolute events */

Reply via email to