Module Name: src Committed By: uwe Date: Tue Jun 19 22:53:17 UTC 2018
Modified Files: src/sys/dev/pckbport: alps.c Log Message: If the first byte of E7 signature is not 0x73, it's not an ALPS device, so don't complain we failed to initialize it. Still need a reset, b/c the E7 check will be interpreted as normal commands by a normal device. To generate a diff of this commit: cvs rdiff -u -r1.7 -r1.8 src/sys/dev/pckbport/alps.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/pckbport/alps.c diff -u src/sys/dev/pckbport/alps.c:1.7 src/sys/dev/pckbport/alps.c:1.8 --- src/sys/dev/pckbport/alps.c:1.7 Tue Jun 19 21:47:28 2018 +++ src/sys/dev/pckbport/alps.c Tue Jun 19 22:53:17 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: alps.c,v 1.7 2018/06/19 21:47:28 uwe Exp $ */ +/* $NetBSD: alps.c,v 1.8 2018/06/19 22:53:17 uwe Exp $ */ /*- * Copyright (c) 2017 Ryo ONODERA <r...@tetera.org> @@ -30,7 +30,7 @@ #include "opt_pms.h" #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: alps.c,v 1.7 2018/06/19 21:47:28 uwe Exp $"); +__KERNEL_RCSID(0, "$NetBSD: alps.c,v 1.8 2018/06/19 22:53:17 uwe Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -169,7 +169,7 @@ pms_alps_e6sig(struct pms_softc *psc, ui e6sig[1] != 0x00 || e6sig[2] != 0x64) { - return EINVAL; + return ENODEV; } aprint_debug_dev(psc->sc_dev, @@ -218,6 +218,9 @@ pms_alps_e7sig(struct pms_softc *psc, ui "ALPS PS/2 E7 signature: 0x%X 0x%X 0x%X\n", e7sig[0], e7sig[1], e7sig[2]); + if (e7sig[0] != 0x73) + return ENODEV; + return 0; err: aprint_error_dev(psc->sc_dev, "Failed to get E7 signature.\n"); @@ -754,7 +757,8 @@ err: cmd[0] = PMS_RESET; (void)pckbport_poll_cmd(psc->sc_kbctag, psc->sc_kbcslot, cmd, 1, 2, resp, 1); - aprint_verbose_dev(psc->sc_dev, "Failed to initialize an ALPS device.\n"); + if (res != ENODEV) + aprint_verbose_dev(psc->sc_dev, "Failed to initialize an ALPS device.\n"); return res; }