| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: alps.c,v 1.1 2017/08/13 08:49:27 christos Exp $ */ | | 1 | /* $NetBSD: alps.c,v 1.2 2017/08/15 22:23:09 ryoon Exp $ */ |
2 | | | 2 | |
3 | /*- | | 3 | /*- |
4 | * Copyright (c) 2017 Ryo ONODERA <ryo@tetera.org> | | 4 | * Copyright (c) 2017 Ryo ONODERA <ryo@tetera.org> |
5 | * Copyright (c) 2008 Jared D. McNeill <jmcneill@invisible.ca> | | 5 | * Copyright (c) 2008 Jared D. McNeill <jmcneill@invisible.ca> |
6 | * All rights reserved. | | 6 | * All rights reserved. |
7 | * | | 7 | * |
8 | * Redistribution and use in source and binary forms, with or without | | 8 | * Redistribution and use in source and binary forms, with or without |
9 | * modification, are permitted provided that the following conditions | | 9 | * modification, are permitted provided that the following conditions |
10 | * are met: | | 10 | * are met: |
11 | * 1. Redistributions of source code must retain the above copyright | | 11 | * 1. Redistributions of source code must retain the above copyright |
12 | * notice, this list of conditions and the following disclaimer. | | 12 | * notice, this list of conditions and the following disclaimer. |
13 | * 2. Redistributions in binary form must reproduce the above copyright | | 13 | * 2. Redistributions in binary form must reproduce the above copyright |
14 | * notice, this list of conditions and the following disclaimer in the | | 14 | * notice, this list of conditions and the following disclaimer in the |
| @@ -20,27 +20,27 @@ | | | @@ -20,27 +20,27 @@ |
20 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | | 20 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS |
21 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | | 21 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
22 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | | 22 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
23 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | | 23 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
24 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | | 24 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
25 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | | 25 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
26 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | | 26 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
27 | * POSSIBILITY OF SUCH DAMAGE. | | 27 | * POSSIBILITY OF SUCH DAMAGE. |
28 | */ | | 28 | */ |
29 | | | 29 | |
30 | #include "opt_pms.h" | | 30 | #include "opt_pms.h" |
31 | | | 31 | |
32 | #include <sys/cdefs.h> | | 32 | #include <sys/cdefs.h> |
33 | __KERNEL_RCSID(0, "$NetBSD: alps.c,v 1.1 2017/08/13 08:49:27 christos Exp $"); | | 33 | __KERNEL_RCSID(0, "$NetBSD: alps.c,v 1.2 2017/08/15 22:23:09 ryoon Exp $"); |
34 | | | 34 | |
35 | #include <sys/param.h> | | 35 | #include <sys/param.h> |
36 | #include <sys/systm.h> | | 36 | #include <sys/systm.h> |
37 | #include <sys/device.h> | | 37 | #include <sys/device.h> |
38 | #include <sys/kernel.h> | | 38 | #include <sys/kernel.h> |
39 | #include <sys/sysctl.h> | | 39 | #include <sys/sysctl.h> |
40 | #include <sys/bus.h> | | 40 | #include <sys/bus.h> |
41 | #include <sys/bitops.h> | | 41 | #include <sys/bitops.h> |
42 | | | 42 | |
43 | #include <dev/wscons/wsconsio.h> | | 43 | #include <dev/wscons/wsconsio.h> |
44 | #include <dev/wscons/wsmousevar.h> | | 44 | #include <dev/wscons/wsmousevar.h> |
45 | | | 45 | |
46 | #include <dev/pckbport/pckbportvar.h> | | 46 | #include <dev/pckbport/pckbportvar.h> |
| @@ -685,27 +685,27 @@ pms_alps_probe_init(void *opaque) | | | @@ -685,27 +685,27 @@ pms_alps_probe_init(void *opaque) |
685 | uint8_t e7sig[3]; | | 685 | uint8_t e7sig[3]; |
686 | uint8_t ecsig[3]; | | 686 | uint8_t ecsig[3]; |
687 | int res; | | 687 | int res; |
688 | | | 688 | |
689 | sc->last_x1 = 0; | | 689 | sc->last_x1 = 0; |
690 | sc->last_y1 = 0; | | 690 | sc->last_y1 = 0; |
691 | sc->last_x2 = 0; | | 691 | sc->last_x2 = 0; |
692 | sc->last_y2 = 0; | | 692 | sc->last_y2 = 0; |
693 | sc->last_nfingers = 0; | | 693 | sc->last_nfingers = 0; |
694 | | | 694 | |
695 | pckbport_flush(psc->sc_kbctag, psc->sc_kbcslot); | | 695 | pckbport_flush(psc->sc_kbctag, psc->sc_kbcslot); |
696 | | | 696 | |
697 | if ((res = pms_alps_e6sig(psc, e6sig)) != 0) | | 697 | if ((res = pms_alps_e6sig(psc, e6sig)) != 0) |
698 | goto err; | | 698 | return res; /* This is not ALPS device */ |
699 | | | 699 | |
700 | if ((res = pms_alps_e7sig(psc, e7sig)) != 0) | | 700 | if ((res = pms_alps_e7sig(psc, e7sig)) != 0) |
701 | goto err; | | 701 | goto err; |
702 | | | 702 | |
703 | if ((res = pms_alps_ecsig(psc, ecsig)) != 0) | | 703 | if ((res = pms_alps_ecsig(psc, ecsig)) != 0) |
704 | goto err; | | 704 | goto err; |
705 | | | 705 | |
706 | /* Determine protocol version */ | | 706 | /* Determine protocol version */ |
707 | if ((ecsig[0] == 0x88) && (__SHIFTOUT(ecsig[1], __BITS(7, 4)) == 0x0b)) { | | 707 | if ((ecsig[0] == 0x88) && (__SHIFTOUT(ecsig[1], __BITS(7, 4)) == 0x0b)) { |
708 | /* V7 device in Toshiba dynabook R63/PS */ | | 708 | /* V7 device in Toshiba dynabook R63/PS */ |
709 | sc->version = ALPS_PROTO_V7; | | 709 | sc->version = ALPS_PROTO_V7; |
710 | } else if ((e7sig[0] == 0x73) && (e7sig[1] == 0x02) && | | 710 | } else if ((e7sig[0] == 0x73) && (e7sig[1] == 0x02) && |
711 | (e7sig[2] == 0x14)) { | | 711 | (e7sig[2] == 0x14)) { |