NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

kern/52489: (patch) touchpad doesn't work after ALPS commit



>Number:         52489
>Category:       kern
>Synopsis:       (patch) touchpad doesn't work after ALPS commit
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Aug 16 20:55:00 +0000 2017
>Originator:     coypu
>Release:        NetBSD 8.99.1
>Organization:
>Environment:
NetBSD localhost 8.99.1 NetBSD 8.99.1 (LOCKDEBUG) #4: Wed Aug 16 19:57:25 UTC 2017  fly@:/home/fly/obj/sys/arch/i386/compile/LOCKDEBUG i386

>Description:
I have an ALPS touchpad, but not one of the versions supported. ALPS signature mismatch.
After ALPS probe, probably it gets into the 'wrong mode' and then attempting to use it as a PS/2 mouse fails (no response at all, no changes from trying though).

Sending as PR because I can't commit for the next few days and other people may experience the same issue, and unnecessarily spend time investigating it too.
>How-To-Repeat:

>Fix:
If ALPS probe fails, send a PMS_RESET.
Restores functionality on a wrong version ALPS touchpad

diff --git a/sys/dev/pckbport/alps.c b/sys/dev/pckbport/alps.c
index ffeb7d96e..fa409ca87 100644
--- a/sys/dev/pckbport/alps.c
+++ b/sys/dev/pckbport/alps.c
@@ -685,6 +685,8 @@ pms_alps_probe_init(void *opaque)
 	uint8_t e7sig[3];
 	uint8_t ecsig[3];
 	int res;
+	u_char cmd[1], resp[3];
+
 
 	sc->last_x1 = 0;
 	sc->last_y1 = 0;
@@ -726,8 +728,8 @@ pms_alps_probe_init(void *opaque)
 		aprint_normal_dev(psc->sc_dev,
 			"ALPS PS/2 V2 pointing device\n");
 	} else {
-		aprint_error_dev(psc->sc_dev, "No supported device found.\n");
-		return EINVAL;
+		res = EINVAL;
+		goto err;
 	}
 
 	/* From sysctl */
@@ -740,14 +742,17 @@ pms_alps_probe_init(void *opaque)
 		pckbport_set_inputhandler(psc->sc_kbctag, psc->sc_kbcslot,
 			pms_alps_input_v2, psc, device_xname(psc->sc_dev));
 	} else {
-		aprint_error_dev(psc->sc_dev, "No supported device found.\n");
-		return EINVAL;
+		res = EINVAL;
+		goto err;
 	}
 	/* Palm detection is enabled. */
 
 	return 0;
 
 err:
+	cmd[0] = PMS_RESET;
+	(void)pckbport_poll_cmd(psc->sc_kbctag, psc->sc_kbcslot, cmd,
+	    1, 2, resp, 1);
 	aprint_error_dev(psc->sc_dev, "Failed to initialize an ALPS device.\n");
 	return res;
 }



Home | Main Index | Thread Index | Old Index