CVS commit: src/sys/dev/pckbport
Module Name:src Committed By: blymn Date: Wed Jun 30 22:13:27 UTC 2021 Modified Files: src/sys/dev/pckbport: synapticsvar.h Log Message: Fix hardcoded size for total_patckets array in synaptics_softc, it needs to be SYN_MAX_FINGERS because the driver expects it to be. To generate a diff of this commit: cvs rdiff -u -r1.10 -r1.11 src/sys/dev/pckbport/synapticsvar.h 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/synapticsvar.h diff -u src/sys/dev/pckbport/synapticsvar.h:1.10 src/sys/dev/pckbport/synapticsvar.h:1.11 --- src/sys/dev/pckbport/synapticsvar.h:1.10 Mon Apr 27 22:31:47 2020 +++ src/sys/dev/pckbport/synapticsvar.h Wed Jun 30 22:13:27 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: synapticsvar.h,v 1.10 2020/04/27 22:31:47 jmcneill Exp $ */ +/* $NetBSD: synapticsvar.h,v 1.11 2021/06/30 22:13:27 blymn Exp $ */ /* * Copyright (c) 2005, Steve C. Woodford @@ -38,6 +38,8 @@ #ifndef _DEV_PCKBCPORT_SYNAPTICSVAR_H_ #define _DEV_PCKBCPORT_SYNAPTICSVAR_H_ +#define SYN_MAX_FINGERS 2 + struct synaptics_softc { int caps; @@ -56,7 +58,9 @@ struct synaptics_softc { #define SYN_FLAG_HAS_EXTENDED_WMODE (1 << 11) #define SYN_FLAG_HAS_ADV_GESTURE_MODE (1 << 12) - u_int total_packets[2]; /* Total number of packets received */ + /* Total number of packets received */ + u_int total_packets[SYN_MAX_FINGERS]; + #define SYN_TIME(sc,c,n) (((sc)->total_packets[(n)] >= (c)) ? \ ((sc)->total_packets[(n)] - (c)) : \ ((c) - (sc)->total_packets[(n)])) @@ -79,7 +83,6 @@ struct synaptics_softc { #define SYN_IS_DRAG(t) ((t) & SYN_GESTURE_DRAG) #define SYN_HIST_SIZE 4 -#define SYN_MAX_FINGERS 2 char button_history; int dz_hold; int rem_x[SYN_MAX_FINGERS];
CVS commit: src/sys/dev/pckbport
Module Name:src Committed By: riastradh Date: Sun May 30 13:20:01 UTC 2021 Modified Files: src/sys/dev/pckbport: synaptics.c Log Message: synaptics(4): New sysctl knob for debug output. Set hw.synaptics.debug=1 to re-enable it; the compile-time DIAGNOSTIC option was inappropriate for this. To generate a diff of this commit: cvs rdiff -u -r1.70 -r1.71 src/sys/dev/pckbport/synaptics.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/synaptics.c diff -u src/sys/dev/pckbport/synaptics.c:1.70 src/sys/dev/pckbport/synaptics.c:1.71 --- src/sys/dev/pckbport/synaptics.c:1.70 Thu Oct 1 17:13:19 2020 +++ src/sys/dev/pckbport/synaptics.c Sun May 30 13:20:01 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: synaptics.c,v 1.70 2020/10/01 17:13:19 nia Exp $ */ +/* $NetBSD: synaptics.c,v 1.71 2021/05/30 13:20:01 riastradh Exp $ */ /* * Copyright (c) 2005, Steve C. Woodford @@ -48,7 +48,7 @@ #include "opt_pms.h" #include -__KERNEL_RCSID(0, "$NetBSD: synaptics.c,v 1.70 2020/10/01 17:13:19 nia Exp $"); +__KERNEL_RCSID(0, "$NetBSD: synaptics.c,v 1.71 2021/05/30 13:20:01 riastradh Exp $"); #include #include @@ -125,6 +125,16 @@ static int synaptics_fscroll_max = 14; static int synaptics_dz_hold = 30; static int synaptics_movement_enable = 1; static bool synaptics_aux_mid_button_scroll = TRUE; +static int synaptics_debug = 0; + +#define DPRINTF(SC, FMT, ARGS...) do \ +{ \ + if (synaptics_debug) { \ + struct pms_softc *_dprintf_psc = \ + container_of((SC), struct pms_softc, u.synaptics); \ + device_printf(_dprintf_psc->sc_dev, FMT, ##ARGS); \ + } \ +} while (0) /* Sysctl nodes. */ static int synaptics_button_boundary_nodenum; @@ -844,6 +854,17 @@ pms_sysctl_synaptics(struct sysctllog ** goto err; synaptics_aux_mid_button_scroll_nodenum = node->sysctl_num; + + if ((rc = sysctl_createv(clog, 0, NULL, , + CTLFLAG_PERMANENT | CTLFLAG_READWRITE, + CTLTYPE_INT, "debug", + SYSCTL_DESCR("Enable debug output"), + NULL, 0, + _debug, + 0, CTL_HW, root_num, CTL_CREATE, + CTL_EOL)) != 0) + goto err; + return; err: @@ -1394,10 +1415,10 @@ synaptics_gesture_detect(struct synaptic sc->gesture_move_y = 0; sc->gesture_start_packet = sc->total_packets[0]; -#ifdef DIAGNOSTIC - aprint_debug("Finger applied: gesture_start_x: %d gesture_start_y: %d\n", - sc->gesture_start_x, sc->gesture_start_y); -#endif + DPRINTF(sc, "Finger applied:" + " gesture_start_x: %d" + " gesture_start_y: %d\n", + sc->gesture_start_x, sc->gesture_start_y); } else if (fingers == 0 && sc->prev_fingers != 0) { /* @@ -1409,14 +1430,12 @@ synaptics_gesture_detect(struct synaptic * of the fingers). */ -#ifdef DIAGNOSTIC - aprint_debug("Finger removed: gesture_len: %d (%d)\n", - gesture_len, synaptics_gesture_length); - aprint_debug("gesture_move_x: %d (%d) sp_x: %d\n", - sc->gesture_move_x, synaptics_gesture_move, abs(sp->sp_x)); - aprint_debug("gesture_move_y: %d (%d) sp_y: %d\n", - sc->gesture_move_y, synaptics_gesture_move, abs(sp->sp_y)); -#endif + DPRINTF(sc, "Finger removed: gesture_len: %d (%d)\n", + gesture_len, synaptics_gesture_length); + DPRINTF(sc, "gesture_move_x: %d (%d) sp_x: %d\n", + sc->gesture_move_x, synaptics_gesture_move, abs(sp->sp_x)); + DPRINTF(sc, "gesture_move_y: %d (%d) sp_y: %d\n", + sc->gesture_move_y, synaptics_gesture_move, abs(sp->sp_y)); if (gesture_len < synaptics_gesture_length && ((sc->gesture_move_x < synaptics_gesture_move &&
CVS commit: src/sys/dev/pckbport
Module Name:src Committed By: nia Date: Thu Oct 1 15:08:11 UTC 2020 Modified Files: src/sys/dev/pckbport: synaptics.c Log Message: erect a signpost for weary travellers To generate a diff of this commit: cvs rdiff -u -r1.68 -r1.69 src/sys/dev/pckbport/synaptics.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/synaptics.c diff -u src/sys/dev/pckbport/synaptics.c:1.68 src/sys/dev/pckbport/synaptics.c:1.69 --- src/sys/dev/pckbport/synaptics.c:1.68 Thu Oct 1 14:33:26 2020 +++ src/sys/dev/pckbport/synaptics.c Thu Oct 1 15:08:11 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: synaptics.c,v 1.68 2020/10/01 14:33:26 nia Exp $ */ +/* $NetBSD: synaptics.c,v 1.69 2020/10/01 15:08:11 nia Exp $ */ /* * Copyright (c) 2005, Steve C. Woodford @@ -48,7 +48,7 @@ #include "opt_pms.h" #include -__KERNEL_RCSID(0, "$NetBSD: synaptics.c,v 1.68 2020/10/01 14:33:26 nia Exp $"); +__KERNEL_RCSID(0, "$NetBSD: synaptics.c,v 1.69 2020/10/01 15:08:11 nia Exp $"); #include #include @@ -1141,6 +1141,10 @@ pms_synaptics_parse(struct pms_softc *ps pms_synaptics_process_packet(psc, ); } +/* + * Passthrough is used for e.g. TrackPoints and additional pointing + * devices connected to a Synaptics touchpad. + */ static void pms_synaptics_passthrough(struct pms_softc *psc) {
CVS commit: src/sys/dev/pckbport
Module Name:src Committed By: nia Date: Thu Oct 1 14:33:26 UTC 2020 Modified Files: src/sys/dev/pckbport: synaptics.c Log Message: comment was likely true in 2007 but no longer reflects the reality of hw To generate a diff of this commit: cvs rdiff -u -r1.67 -r1.68 src/sys/dev/pckbport/synaptics.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/synaptics.c diff -u src/sys/dev/pckbport/synaptics.c:1.67 src/sys/dev/pckbport/synaptics.c:1.68 --- src/sys/dev/pckbport/synaptics.c:1.67 Thu May 14 18:06:58 2020 +++ src/sys/dev/pckbport/synaptics.c Thu Oct 1 14:33:26 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: synaptics.c,v 1.67 2020/05/14 18:06:58 nia Exp $ */ +/* $NetBSD: synaptics.c,v 1.68 2020/10/01 14:33:26 nia Exp $ */ /* * Copyright (c) 2005, Steve C. Woodford @@ -48,7 +48,7 @@ #include "opt_pms.h" #include -__KERNEL_RCSID(0, "$NetBSD: synaptics.c,v 1.67 2020/05/14 18:06:58 nia Exp $"); +__KERNEL_RCSID(0, "$NetBSD: synaptics.c,v 1.68 2020/10/01 14:33:26 nia Exp $"); #include #include @@ -1683,20 +1683,12 @@ pms_synaptics_process_packet(struct pms_ if (synaptics_up_down_emul == 2) { if (sc->up_down == 0) { if (sp->sp_up && sp->sp_down) { -/* - * Most up/down buttons will be actuated using - * a rocker switch, so we should never see - * them both simultaneously. But just in case, - * treat this situation as a middle button - * event. - */ sp->sp_middle = 1; - } else - if (sp->sp_up) + } else if (sp->sp_up) { dz = -synaptics_up_down_motion_delta; - else - if (sp->sp_down) + } else if (sp->sp_down) { dz = synaptics_up_down_motion_delta; + } } sc->up_down = sp->sp_up | sp->sp_down;
CVS commit: src/sys/dev/pckbport
Module Name:src Committed By: nia Date: Thu May 14 18:06:58 UTC 2020 Modified Files: src/sys/dev/pckbport: synaptics.c Log Message: synaptics: Don't reset the device multiple times in succession Cherrypicked from a patch from an anonymous contributor. To generate a diff of this commit: cvs rdiff -u -r1.66 -r1.67 src/sys/dev/pckbport/synaptics.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/synaptics.c diff -u src/sys/dev/pckbport/synaptics.c:1.66 src/sys/dev/pckbport/synaptics.c:1.67 --- src/sys/dev/pckbport/synaptics.c:1.66 Tue Apr 28 19:22:58 2020 +++ src/sys/dev/pckbport/synaptics.c Thu May 14 18:06:58 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: synaptics.c,v 1.66 2020/04/28 19:22:58 jmcneill Exp $ */ +/* $NetBSD: synaptics.c,v 1.67 2020/05/14 18:06:58 nia Exp $ */ /* * Copyright (c) 2005, Steve C. Woodford @@ -48,7 +48,7 @@ #include "opt_pms.h" #include -__KERNEL_RCSID(0, "$NetBSD: synaptics.c,v 1.66 2020/04/28 19:22:58 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: synaptics.c,v 1.67 2020/05/14 18:06:58 nia Exp $"); #include #include @@ -1192,7 +1192,7 @@ pms_synaptics_input(void *vsc, int data) getmicrouptime(>current); - if (psc->inputstate != 0) { + if (psc->inputstate > 0) { timersub(>current, >last, ); if (diff.tv_sec > 0 || diff.tv_usec >= 4) { aprint_debug_dev(psc->sc_dev,
CVS commit: src/sys/dev/pckbport
Module Name:src Committed By: jmcneill Date: Tue Apr 28 19:22:58 UTC 2020 Modified Files: src/sys/dev/pckbport: synaptics.c Log Message: pms_synaptics_enable: no need to send PMS_DEV_ENABLE here because pms_enable does this for us. Seems to resolve issues with my trackpoint not working immediately after starting X on ThinkPad X260. To generate a diff of this commit: cvs rdiff -u -r1.65 -r1.66 src/sys/dev/pckbport/synaptics.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/synaptics.c diff -u src/sys/dev/pckbport/synaptics.c:1.65 src/sys/dev/pckbport/synaptics.c:1.66 --- src/sys/dev/pckbport/synaptics.c:1.65 Mon Apr 27 22:31:47 2020 +++ src/sys/dev/pckbport/synaptics.c Tue Apr 28 19:22:58 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: synaptics.c,v 1.65 2020/04/27 22:31:47 jmcneill Exp $ */ +/* $NetBSD: synaptics.c,v 1.66 2020/04/28 19:22:58 jmcneill Exp $ */ /* * Copyright (c) 2005, Steve C. Woodford @@ -48,7 +48,7 @@ #include "opt_pms.h" #include -__KERNEL_RCSID(0, "$NetBSD: synaptics.c,v 1.65 2020/04/27 22:31:47 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: synaptics.c,v 1.66 2020/04/28 19:22:58 jmcneill Exp $"); #include #include @@ -484,8 +484,6 @@ pms_synaptics_enable(void *vsc) (sc->flags & SYN_FLAG_HAS_ADV_GESTURE_MODE)) synaptics_special_write(psc, SYNAPTICS_WRITE_DELUXE_3, 0x3); - synaptics_poll_cmd(psc, PMS_DEV_ENABLE, 0); - sc->up_down = 0; sc->prev_fingers = 0; sc->gesture_start_x = sc->gesture_start_y = 0;
CVS commit: src/sys/dev/pckbport
Module Name:src Committed By: jmcneill Date: Mon Apr 27 22:31:47 UTC 2020 Modified Files: src/sys/dev/pckbport: synaptics.c synapticsvar.h Log Message: Extended buttons are reported separate from touchpad buttons, so track button press / release state separate from touch events. To generate a diff of this commit: cvs rdiff -u -r1.64 -r1.65 src/sys/dev/pckbport/synaptics.c cvs rdiff -u -r1.9 -r1.10 src/sys/dev/pckbport/synapticsvar.h 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/synaptics.c diff -u src/sys/dev/pckbport/synaptics.c:1.64 src/sys/dev/pckbport/synaptics.c:1.65 --- src/sys/dev/pckbport/synaptics.c:1.64 Tue Mar 31 19:08:19 2020 +++ src/sys/dev/pckbport/synaptics.c Mon Apr 27 22:31:47 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: synaptics.c,v 1.64 2020/03/31 19:08:19 nia Exp $ */ +/* $NetBSD: synaptics.c,v 1.65 2020/04/27 22:31:47 jmcneill Exp $ */ /* * Copyright (c) 2005, Steve C. Woodford @@ -48,7 +48,7 @@ #include "opt_pms.h" #include -__KERNEL_RCSID(0, "$NetBSD: synaptics.c,v 1.64 2020/03/31 19:08:19 nia Exp $"); +__KERNEL_RCSID(0, "$NetBSD: synaptics.c,v 1.65 2020/04/27 22:31:47 jmcneill Exp $"); #include #include @@ -1010,19 +1010,29 @@ pms_synaptics_parse(struct pms_softc *ps psc->packet[3], psc->packet[4], psc->packet[5]); if ((psc->packet[4] & SYN_1BUTMASK) != 0) -sp.sp_left = PMS_LBUTMASK; +sc->ext_left = PMS_LBUTMASK; + else +sc->ext_left = 0; if ((psc->packet[4] & SYN_3BUTMASK) != 0) -sp.sp_middle = PMS_MBUTMASK; +sc->ext_middle = PMS_MBUTMASK; + else +sc->ext_middle = 0; if ((psc->packet[5] & SYN_2BUTMASK) != 0) -sp.sp_right = PMS_RBUTMASK; +sc->ext_right = PMS_RBUTMASK; + else +sc->ext_right = 0; if ((psc->packet[5] & SYN_4BUTMASK) != 0) -sp.sp_up = 1; +sc->ext_up = 1; + else +sc->ext_up = 0; if ((psc->packet[4] & SYN_5BUTMASK) != 0) -sp.sp_down = 1; +sc->ext_down = 1; + else +sc->ext_down = 0; } else { /* Left/Right button handling. */ sp.sp_left = psc->packet[0] & PMS_LBUTMASK; @@ -1102,6 +1112,13 @@ pms_synaptics_parse(struct pms_softc *ps sp.sp_middle = 0; } + /* Overlay extended button state */ + sp.sp_left |= sc->ext_left; + sp.sp_right |= sc->ext_right; + sp.sp_middle |= sc->ext_middle; + sp.sp_up |= sc->ext_up; + sp.sp_down |= sc->ext_down; + switch (synaptics_up_down_emul) { case 1: /* Do middle button emulation using up/down buttons */ Index: src/sys/dev/pckbport/synapticsvar.h diff -u src/sys/dev/pckbport/synapticsvar.h:1.9 src/sys/dev/pckbport/synapticsvar.h:1.10 --- src/sys/dev/pckbport/synapticsvar.h:1.9 Sun Jun 2 08:55:00 2019 +++ src/sys/dev/pckbport/synapticsvar.h Mon Apr 27 22:31:47 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: synapticsvar.h,v 1.9 2019/06/02 08:55:00 blymn Exp $ */ +/* $NetBSD: synapticsvar.h,v 1.10 2020/04/27 22:31:47 jmcneill Exp $ */ /* * Copyright (c) 2005, Steve C. Woodford @@ -89,6 +89,12 @@ struct synaptics_softc { int history_x[SYN_MAX_FINGERS][SYN_HIST_SIZE]; int history_y[SYN_MAX_FINGERS][SYN_HIST_SIZE]; int history_z[SYN_MAX_FINGERS][SYN_HIST_SIZE]; + + char ext_left; + char ext_right; + char ext_middle; + char ext_up; + char ext_down; }; int pms_synaptics_probe_init(void *vsc);
CVS commit: src/sys/dev/pckbport
Module Name:src Committed By: nia Date: Tue Mar 31 19:08:19 UTC 2020 Modified Files: src/sys/dev/pckbport: synaptics.c Log Message: synaptics: Maintain the left/right buttons when up/down are remapped Reported on current-users by MandacarĂº Cascavel To generate a diff of this commit: cvs rdiff -u -r1.63 -r1.64 src/sys/dev/pckbport/synaptics.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/synaptics.c diff -u src/sys/dev/pckbport/synaptics.c:1.63 src/sys/dev/pckbport/synaptics.c:1.64 --- src/sys/dev/pckbport/synaptics.c:1.63 Fri Mar 27 11:10:07 2020 +++ src/sys/dev/pckbport/synaptics.c Tue Mar 31 19:08:19 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: synaptics.c,v 1.63 2020/03/27 11:10:07 nia Exp $ */ +/* $NetBSD: synaptics.c,v 1.64 2020/03/31 19:08:19 nia Exp $ */ /* * Copyright (c) 2005, Steve C. Woodford @@ -48,7 +48,7 @@ #include "opt_pms.h" #include -__KERNEL_RCSID(0, "$NetBSD: synaptics.c,v 1.63 2020/03/27 11:10:07 nia Exp $"); +__KERNEL_RCSID(0, "$NetBSD: synaptics.c,v 1.64 2020/03/31 19:08:19 nia Exp $"); #include #include @@ -1110,8 +1110,8 @@ pms_synaptics_parse(struct pms_softc *ps break; case 3: /* Do left/right button emulation using up/down buttons */ - sp.sp_left = sp.sp_up; - sp.sp_right = sp.sp_down; + sp.sp_left = sp.sp_left | sp.sp_up; + sp.sp_right = sp.sp_right | sp.sp_down; sp.sp_up = sp.sp_down = 0; break; default:
CVS commit: src/sys/dev/pckbport
Module Name:src Committed By: nia Date: Fri Mar 27 11:10:07 UTC 2020 Modified Files: src/sys/dev/pckbport: synaptics.c Log Message: synaptics: Revert changes that broke gestures in cases where they worked. It seems I have to figure out another way to make scrolling work for me. To generate a diff of this commit: cvs rdiff -u -r1.62 -r1.63 src/sys/dev/pckbport/synaptics.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/synaptics.c diff -u src/sys/dev/pckbport/synaptics.c:1.62 src/sys/dev/pckbport/synaptics.c:1.63 --- src/sys/dev/pckbport/synaptics.c:1.62 Mon Mar 16 11:13:19 2020 +++ src/sys/dev/pckbport/synaptics.c Fri Mar 27 11:10:07 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: synaptics.c,v 1.62 2020/03/16 11:13:19 nia Exp $ */ +/* $NetBSD: synaptics.c,v 1.63 2020/03/27 11:10:07 nia Exp $ */ /* * Copyright (c) 2005, Steve C. Woodford @@ -48,7 +48,7 @@ #include "opt_pms.h" #include -__KERNEL_RCSID(0, "$NetBSD: synaptics.c,v 1.62 2020/03/16 11:13:19 nia Exp $"); +__KERNEL_RCSID(0, "$NetBSD: synaptics.c,v 1.63 2020/03/27 11:10:07 nia Exp $"); #include #include @@ -115,10 +115,10 @@ static int synaptics_button3 = SYNAPTICS static int synaptics_two_fingers_emul = 0; static int synaptics_scale_x = 16; static int synaptics_scale_y = 16; -static int synaptics_scale_z = 64; +static int synaptics_scale_z = 32; static int synaptics_max_speed_x = 32; static int synaptics_max_speed_y = 32; -static int synaptics_max_speed_z = 1; +static int synaptics_max_speed_z = 2; static int synaptics_movement_threshold = 4; static int synaptics_fscroll_min = 13; static int synaptics_fscroll_max = 14; @@ -1285,7 +1285,13 @@ synaptics_finger_detect(struct synaptics return (0); } - if (sc->flags & SYN_FLAG_HAS_MULTI_FINGER) { + /* + * Detect 2 and 3 fingers if supported, but only if multiple + * fingers appear within the tap gesture time period. + */ + if (sc->flags & SYN_FLAG_HAS_MULTI_FINGER && + SYN_TIME(sc, sc->gesture_start_packet, + sp->sp_finger) < synaptics_gesture_length) { switch (sp->sp_w) { case SYNAPTICS_WIDTH_TWO_FINGERS: fingers = 2; @@ -1732,14 +1738,6 @@ pms_synaptics_process_packet(struct pms_ synaptics_movement(sc, sp, sp->sp_finger, z_emul, , , ); - } else if (fingers > 1) { - /* - * Multiple finger movement. Interpret it as scrolling. - */ - synaptics_movement(sc, sp, sp->sp_finger, 1, -, , ); - sc->rem_x[0] = sc->rem_y[0] = 0; - dx = dy = 0; } else { /* * No valid finger. Therefore no movement.
CVS commit: src/sys/dev/pckbport
Module Name:src Committed By: nia Date: Mon Mar 16 11:13:19 UTC 2020 Modified Files: src/sys/dev/pckbport: synaptics.c Log Message: synaptics: Increase default scale_z for more precise scrolling To generate a diff of this commit: cvs rdiff -u -r1.61 -r1.62 src/sys/dev/pckbport/synaptics.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/synaptics.c diff -u src/sys/dev/pckbport/synaptics.c:1.61 src/sys/dev/pckbport/synaptics.c:1.62 --- src/sys/dev/pckbport/synaptics.c:1.61 Sun Mar 15 22:44:32 2020 +++ src/sys/dev/pckbport/synaptics.c Mon Mar 16 11:13:19 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: synaptics.c,v 1.61 2020/03/15 22:44:32 nia Exp $ */ +/* $NetBSD: synaptics.c,v 1.62 2020/03/16 11:13:19 nia Exp $ */ /* * Copyright (c) 2005, Steve C. Woodford @@ -48,7 +48,7 @@ #include "opt_pms.h" #include -__KERNEL_RCSID(0, "$NetBSD: synaptics.c,v 1.61 2020/03/15 22:44:32 nia Exp $"); +__KERNEL_RCSID(0, "$NetBSD: synaptics.c,v 1.62 2020/03/16 11:13:19 nia Exp $"); #include #include @@ -115,7 +115,7 @@ static int synaptics_button3 = SYNAPTICS static int synaptics_two_fingers_emul = 0; static int synaptics_scale_x = 16; static int synaptics_scale_y = 16; -static int synaptics_scale_z = 32; +static int synaptics_scale_z = 64; static int synaptics_max_speed_x = 32; static int synaptics_max_speed_y = 32; static int synaptics_max_speed_z = 1;
CVS commit: src/sys/dev/pckbport
Module Name:src Committed By: nia Date: Sun Mar 15 22:44:32 UTC 2020 Modified Files: src/sys/dev/pckbport: synaptics.c Log Message: synaptics: Check for single-finger event jitter in all cases. I now have smooth two-finger scrolling. To generate a diff of this commit: cvs rdiff -u -r1.60 -r1.61 src/sys/dev/pckbport/synaptics.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/synaptics.c diff -u src/sys/dev/pckbport/synaptics.c:1.60 src/sys/dev/pckbport/synaptics.c:1.61 --- src/sys/dev/pckbport/synaptics.c:1.60 Sat Mar 14 22:23:17 2020 +++ src/sys/dev/pckbport/synaptics.c Sun Mar 15 22:44:32 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: synaptics.c,v 1.60 2020/03/14 22:23:17 nia Exp $ */ +/* $NetBSD: synaptics.c,v 1.61 2020/03/15 22:44:32 nia Exp $ */ /* * Copyright (c) 2005, Steve C. Woodford @@ -48,7 +48,7 @@ #include "opt_pms.h" #include -__KERNEL_RCSID(0, "$NetBSD: synaptics.c,v 1.60 2020/03/14 22:23:17 nia Exp $"); +__KERNEL_RCSID(0, "$NetBSD: synaptics.c,v 1.61 2020/03/15 22:44:32 nia Exp $"); #include #include @@ -1295,19 +1295,12 @@ synaptics_finger_detect(struct synaptics fingers = 3; break; - case SYNAPTICS_WIDTH_PEN: - fingers = 1; - break; - default: /* * The width value can report spurious single-finger * events after a multi-finger event. */ - if (sc->prev_fingers > 1) -fingers = sc->prev_fingers; - else -fingers = 1; + fingers = sc->prev_fingers <= 1 ? 1 : sc->prev_fingers; break; } }
CVS commit: src/sys/dev/pckbport
Module Name:src Committed By: nia Date: Sat Mar 14 22:23:17 UTC 2020 Modified Files: src/sys/dev/pckbport: synaptics.c Log Message: synaptics: Detect multiple fingers outside the gesture period I suspect this code doesn't make any sense if we want two-finger scrolling To generate a diff of this commit: cvs rdiff -u -r1.59 -r1.60 src/sys/dev/pckbport/synaptics.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/synaptics.c diff -u src/sys/dev/pckbport/synaptics.c:1.59 src/sys/dev/pckbport/synaptics.c:1.60 --- src/sys/dev/pckbport/synaptics.c:1.59 Sat Mar 14 21:56:08 2020 +++ src/sys/dev/pckbport/synaptics.c Sat Mar 14 22:23:17 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: synaptics.c,v 1.59 2020/03/14 21:56:08 nia Exp $ */ +/* $NetBSD: synaptics.c,v 1.60 2020/03/14 22:23:17 nia Exp $ */ /* * Copyright (c) 2005, Steve C. Woodford @@ -48,7 +48,7 @@ #include "opt_pms.h" #include -__KERNEL_RCSID(0, "$NetBSD: synaptics.c,v 1.59 2020/03/14 21:56:08 nia Exp $"); +__KERNEL_RCSID(0, "$NetBSD: synaptics.c,v 1.60 2020/03/14 22:23:17 nia Exp $"); #include #include @@ -1285,13 +1285,7 @@ synaptics_finger_detect(struct synaptics return (0); } - /* - * Detect 2 and 3 fingers if supported, but only if multiple - * fingers appear within the tap gesture time period. - */ - if (sc->flags & SYN_FLAG_HAS_MULTI_FINGER && - SYN_TIME(sc, sc->gesture_start_packet, - sp->sp_finger) < synaptics_gesture_length) { + if (sc->flags & SYN_FLAG_HAS_MULTI_FINGER) { switch (sp->sp_w) { case SYNAPTICS_WIDTH_TWO_FINGERS: fingers = 2;
CVS commit: src/sys/dev/pckbport
Module Name:src Committed By: nia Date: Sat Mar 14 21:56:08 UTC 2020 Modified Files: src/sys/dev/pckbport: synaptics.c Log Message: synaptics: Automatically scroll when multiple fingers are detected This will mean we automatically get two-finger scrolling on multitouch pads. This works, but the scrolling is janky. Why does it eventually move the mouse cursor (only one finger detected, but two are still there), and why does it jump up slightly? To generate a diff of this commit: cvs rdiff -u -r1.58 -r1.59 src/sys/dev/pckbport/synaptics.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/synaptics.c diff -u src/sys/dev/pckbport/synaptics.c:1.58 src/sys/dev/pckbport/synaptics.c:1.59 --- src/sys/dev/pckbport/synaptics.c:1.58 Sat Mar 14 21:23:32 2020 +++ src/sys/dev/pckbport/synaptics.c Sat Mar 14 21:56:08 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: synaptics.c,v 1.58 2020/03/14 21:23:32 nia Exp $ */ +/* $NetBSD: synaptics.c,v 1.59 2020/03/14 21:56:08 nia Exp $ */ /* * Copyright (c) 2005, Steve C. Woodford @@ -48,7 +48,7 @@ #include "opt_pms.h" #include -__KERNEL_RCSID(0, "$NetBSD: synaptics.c,v 1.58 2020/03/14 21:23:32 nia Exp $"); +__KERNEL_RCSID(0, "$NetBSD: synaptics.c,v 1.59 2020/03/14 21:56:08 nia Exp $"); #include #include @@ -118,7 +118,7 @@ static int synaptics_scale_y = 16; static int synaptics_scale_z = 32; static int synaptics_max_speed_x = 32; static int synaptics_max_speed_y = 32; -static int synaptics_max_speed_z = 2; +static int synaptics_max_speed_z = 1; static int synaptics_movement_threshold = 4; static int synaptics_fscroll_min = 13; static int synaptics_fscroll_max = 14; @@ -1745,6 +1745,14 @@ pms_synaptics_process_packet(struct pms_ synaptics_movement(sc, sp, sp->sp_finger, z_emul, , , ); + } else if (fingers > 1) { + /* + * Multiple finger movement. Interpret it as scrolling. + */ + synaptics_movement(sc, sp, sp->sp_finger, 1, +, , ); + sc->rem_x[0] = sc->rem_y[0] = 0; + dx = dy = 0; } else { /* * No valid finger. Therefore no movement.
CVS commit: src/sys/dev/pckbport
Module Name:src Committed By: nia Date: Sat Mar 14 21:23:32 UTC 2020 Modified Files: src/sys/dev/pckbport: synaptics.c Log Message: synaptics: fix syntax To generate a diff of this commit: cvs rdiff -u -r1.57 -r1.58 src/sys/dev/pckbport/synaptics.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/synaptics.c diff -u src/sys/dev/pckbport/synaptics.c:1.57 src/sys/dev/pckbport/synaptics.c:1.58 --- src/sys/dev/pckbport/synaptics.c:1.57 Sat Mar 14 21:18:50 2020 +++ src/sys/dev/pckbport/synaptics.c Sat Mar 14 21:23:32 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: synaptics.c,v 1.57 2020/03/14 21:18:50 nia Exp $ */ +/* $NetBSD: synaptics.c,v 1.58 2020/03/14 21:23:32 nia Exp $ */ /* * Copyright (c) 2005, Steve C. Woodford @@ -48,7 +48,7 @@ #include "opt_pms.h" #include -__KERNEL_RCSID(0, "$NetBSD: synaptics.c,v 1.57 2020/03/14 21:18:50 nia Exp $"); +__KERNEL_RCSID(0, "$NetBSD: synaptics.c,v 1.58 2020/03/14 21:23:32 nia Exp $"); #include #include @@ -862,7 +862,7 @@ pms_sysctl_synaptics_verify(SYSCTLFN_ARG } else if (node.sysctl_num == synaptics_gesture_length_nodenum || node.sysctl_num == synaptics_edge_motion_delta_nodenum || - node.sysctl_num == synaptics_up_down_motion_delta_nodenum) { + node.sysctl_num == synaptics_up_down_motion_delta_nodenum || node.sysctl_num == synaptics_max_speed_x_nodenum || node.sysctl_num == synaptics_max_speed_y_nodenum || node.sysctl_num == synaptics_max_speed_z_nodenum) {
CVS commit: src/sys/dev/pckbport
Module Name:src Committed By: nia Date: Sat Mar 14 21:18:50 UTC 2020 Modified Files: src/sys/dev/pckbport: synaptics.c Log Message: synaptics: Allow the max_speed sysctls to be set To generate a diff of this commit: cvs rdiff -u -r1.56 -r1.57 src/sys/dev/pckbport/synaptics.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/synaptics.c diff -u src/sys/dev/pckbport/synaptics.c:1.56 src/sys/dev/pckbport/synaptics.c:1.57 --- src/sys/dev/pckbport/synaptics.c:1.56 Sat Mar 14 19:29:39 2020 +++ src/sys/dev/pckbport/synaptics.c Sat Mar 14 21:18:50 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: synaptics.c,v 1.56 2020/03/14 19:29:39 nia Exp $ */ +/* $NetBSD: synaptics.c,v 1.57 2020/03/14 21:18:50 nia Exp $ */ /* * Copyright (c) 2005, Steve C. Woodford @@ -48,7 +48,7 @@ #include "opt_pms.h" #include -__KERNEL_RCSID(0, "$NetBSD: synaptics.c,v 1.56 2020/03/14 19:29:39 nia Exp $"); +__KERNEL_RCSID(0, "$NetBSD: synaptics.c,v 1.57 2020/03/14 21:18:50 nia Exp $"); #include #include @@ -863,6 +863,9 @@ pms_sysctl_synaptics_verify(SYSCTLFN_ARG if (node.sysctl_num == synaptics_gesture_length_nodenum || node.sysctl_num == synaptics_edge_motion_delta_nodenum || node.sysctl_num == synaptics_up_down_motion_delta_nodenum) { + node.sysctl_num == synaptics_max_speed_x_nodenum || + node.sysctl_num == synaptics_max_speed_y_nodenum || + node.sysctl_num == synaptics_max_speed_z_nodenum) { if (t < 0) return (EINVAL); } else
CVS commit: src/sys/dev/pckbport
Module Name:src Committed By: ryoon Date: Tue Feb 25 21:41:38 UTC 2020 Modified Files: src/sys/dev/pckbport: synaptics.c Log Message: Messages in pms_synaptics_input() should not start with "pms_input" Use "pms_synaptics_input" instead for another 2 messages. To generate a diff of this commit: cvs rdiff -u -r1.53 -r1.54 src/sys/dev/pckbport/synaptics.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/synaptics.c diff -u src/sys/dev/pckbport/synaptics.c:1.53 src/sys/dev/pckbport/synaptics.c:1.54 --- src/sys/dev/pckbport/synaptics.c:1.53 Tue Feb 25 21:38:42 2020 +++ src/sys/dev/pckbport/synaptics.c Tue Feb 25 21:41:38 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: synaptics.c,v 1.53 2020/02/25 21:38:42 ryoon Exp $ */ +/* $NetBSD: synaptics.c,v 1.54 2020/02/25 21:41:38 ryoon Exp $ */ /* * Copyright (c) 2005, Steve C. Woodford @@ -48,7 +48,7 @@ #include "opt_pms.h" #include -__KERNEL_RCSID(0, "$NetBSD: synaptics.c,v 1.53 2020/02/25 21:38:42 ryoon Exp $"); +__KERNEL_RCSID(0, "$NetBSD: synaptics.c,v 1.54 2020/02/25 21:41:38 ryoon Exp $"); #include #include @@ -1182,7 +1182,7 @@ pms_synaptics_input(void *vsc, int data) case 0: if ((data & 0xc8) != 0x80) { aprint_debug_dev(psc->sc_dev, - "pms_input: 0x%02x out of sync\n", data); + "pms_synaptics_input: 0x%02x out of sync\n", data); /* use negative counts to limit resync phase */ psc->inputstate--; return; /* not in sync yet, discard input */ @@ -1194,7 +1194,7 @@ pms_synaptics_input(void *vsc, int data) case 3: if ((data & 8) == 8) { aprint_debug_dev(psc->sc_dev, - "pms_input: dropped in relative mode, reset\n"); + "pms_synaptics_input: dropped in relative mode, reset\n"); psc->inputstate = 0; psc->sc_enabled = 0; wakeup(>sc_enabled);
CVS commit: src/sys/dev/pckbport
Module Name:src Committed By: ryoon Date: Tue Feb 25 21:38:42 UTC 2020 Modified Files: src/sys/dev/pckbport: synaptics.c Log Message: Messages in pms_synaptics_input() should not start with "pms_input" Use "pms_synaptics_input" instead. To generate a diff of this commit: cvs rdiff -u -r1.52 -r1.53 src/sys/dev/pckbport/synaptics.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/synaptics.c diff -u src/sys/dev/pckbport/synaptics.c:1.52 src/sys/dev/pckbport/synaptics.c:1.53 --- src/sys/dev/pckbport/synaptics.c:1.52 Tue Feb 25 21:36:13 2020 +++ src/sys/dev/pckbport/synaptics.c Tue Feb 25 21:38:42 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: synaptics.c,v 1.52 2020/02/25 21:36:13 ryoon Exp $ */ +/* $NetBSD: synaptics.c,v 1.53 2020/02/25 21:38:42 ryoon Exp $ */ /* * Copyright (c) 2005, Steve C. Woodford @@ -48,7 +48,7 @@ #include "opt_pms.h" #include -__KERNEL_RCSID(0, "$NetBSD: synaptics.c,v 1.52 2020/02/25 21:36:13 ryoon Exp $"); +__KERNEL_RCSID(0, "$NetBSD: synaptics.c,v 1.53 2020/02/25 21:38:42 ryoon Exp $"); #include #include @@ -1159,10 +1159,10 @@ pms_synaptics_input(void *vsc, int data) timersub(>current, >last, ); if (diff.tv_sec > 0 || diff.tv_usec >= 4) { aprint_debug_dev(psc->sc_dev, - "pms_input: unusual delay (%ld.%06ld s), " + "pms_synaptics_input: unusual delay (%ld.%06ld s), " "scheduling reset\n", (long)diff.tv_sec, (long)diff.tv_usec); - printf("pms_input: unusual delay (%ld.%06ld s), " + printf("pms_synaptics_input: unusual delay (%ld.%06ld s), " "scheduling reset\n", (long)diff.tv_sec, (long)diff.tv_usec); psc->inputstate = 0;
CVS commit: src/sys/dev/pckbport
Module Name:src Committed By: ryoon Date: Tue Feb 25 21:36:13 UTC 2020 Modified Files: src/sys/dev/pckbport: synaptics.c Log Message: Do not enter extended W mode conditional for non extended W mode device Even without extended W mode, sp_w can be 2. This causes "invalid extended w mode N" warning messages. Restrict extended W mode conditional for hardwares with extended W support. Tested with Synaptics 6.2 device on Panasonic CF-Y8, however it does not work with X. To generate a diff of this commit: cvs rdiff -u -r1.51 -r1.52 src/sys/dev/pckbport/synaptics.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/synaptics.c diff -u src/sys/dev/pckbport/synaptics.c:1.51 src/sys/dev/pckbport/synaptics.c:1.52 --- src/sys/dev/pckbport/synaptics.c:1.51 Tue Feb 25 16:24:47 2020 +++ src/sys/dev/pckbport/synaptics.c Tue Feb 25 21:36:13 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: synaptics.c,v 1.51 2020/02/25 16:24:47 ryoon Exp $ */ +/* $NetBSD: synaptics.c,v 1.52 2020/02/25 21:36:13 ryoon Exp $ */ /* * Copyright (c) 2005, Steve C. Woodford @@ -48,7 +48,7 @@ #include "opt_pms.h" #include -__KERNEL_RCSID(0, "$NetBSD: synaptics.c,v 1.51 2020/02/25 16:24:47 ryoon Exp $"); +__KERNEL_RCSID(0, "$NetBSD: synaptics.c,v 1.52 2020/02/25 21:36:13 ryoon Exp $"); #include #include @@ -945,7 +945,8 @@ pms_synaptics_parse(struct pms_softc *ps ((psc->packet[0] & 0x04) >> 1) + ((psc->packet[3] & 0x04) >> 2); sp.sp_finger = 0; - if (sp.sp_w == SYNAPTICS_WIDTH_EXTENDED_W) { + if ((sc->flags & SYN_FLAG_HAS_EXTENDED_WMODE) && + (sp.sp_w == SYNAPTICS_WIDTH_EXTENDED_W)) { ew_mode = psc->packet[5] >> 4; switch (ew_mode) {
CVS commit: src/sys/dev/pckbport
Module Name:src Committed By: ryoon Date: Tue Feb 25 16:24:47 UTC 2020 Modified Files: src/sys/dev/pckbport: synaptics.c Log Message: Remove a trailing tab. To generate a diff of this commit: cvs rdiff -u -r1.50 -r1.51 src/sys/dev/pckbport/synaptics.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/synaptics.c diff -u src/sys/dev/pckbport/synaptics.c:1.50 src/sys/dev/pckbport/synaptics.c:1.51 --- src/sys/dev/pckbport/synaptics.c:1.50 Fri Jul 5 05:09:24 2019 +++ src/sys/dev/pckbport/synaptics.c Tue Feb 25 16:24:47 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: synaptics.c,v 1.50 2019/07/05 05:09:24 mlelstv Exp $ */ +/* $NetBSD: synaptics.c,v 1.51 2020/02/25 16:24:47 ryoon Exp $ */ /* * Copyright (c) 2005, Steve C. Woodford @@ -48,7 +48,7 @@ #include "opt_pms.h" #include -__KERNEL_RCSID(0, "$NetBSD: synaptics.c,v 1.50 2019/07/05 05:09:24 mlelstv Exp $"); +__KERNEL_RCSID(0, "$NetBSD: synaptics.c,v 1.51 2020/02/25 16:24:47 ryoon Exp $"); #include #include @@ -956,7 +956,7 @@ pms_synaptics_parse(struct pms_softc *ps case SYNAPTICS_EW_SECONDARY_FINGER: /* parse the second finger report */ - + sp.sp_finger = 1; /* just one other finger for now */ sp.sp_x = psc->packet[1] + ((psc->packet[4] & 0x0f) << 8);
CVS commit: src/sys/dev/pckbport
Module Name:src Committed By: ryoon Date: Mon Feb 10 16:12:59 UTC 2020 Modified Files: src/sys/dev/pckbport: alps.c Log Message: Introduce hw.alps.touchpad_movement_threshold to better button area clicks To generate a diff of this commit: cvs rdiff -u -r1.13 -r1.14 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.13 src/sys/dev/pckbport/alps.c:1.14 --- src/sys/dev/pckbport/alps.c:1.13 Mon Feb 10 15:29:05 2020 +++ src/sys/dev/pckbport/alps.c Mon Feb 10 16:12:58 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: alps.c,v 1.13 2020/02/10 15:29:05 ryoon Exp $ */ +/* $NetBSD: alps.c,v 1.14 2020/02/10 16:12:58 ryoon Exp $ */ /*- * Copyright (c) 2017 Ryo ONODERA @@ -30,7 +30,7 @@ #include "opt_pms.h" #include -__KERNEL_RCSID(0, "$NetBSD: alps.c,v 1.13 2020/02/10 15:29:05 ryoon Exp $"); +__KERNEL_RCSID(0, "$NetBSD: alps.c,v 1.14 2020/02/10 16:12:58 ryoon Exp $"); #include #include @@ -51,9 +51,11 @@ __KERNEL_RCSID(0, "$NetBSD: alps.c,v 1.1 /* #define ALPS_DEBUG */ +static int alps_touchpad_movement_threshold_nodenum; static int alps_touchpad_xy_unprecision_nodenum; static int alps_trackstick_xy_precision_nodenum; +static int alps_touchpad_movement_threshold = 4; static int alps_touchpad_xy_unprecision = 2; static int alps_trackstick_xy_precision = 1; @@ -77,6 +79,9 @@ pms_sysctl_alps_verify(SYSCTLFN_ARGS) node.sysctl_num == alps_trackstick_xy_precision_nodenum) { if (t < 0 || t > 7) return EINVAL; + } else if (node.sysctl_num == alps_touchpad_movement_threshold_nodenum) { + if (t < 0) + return EINVAL; } else return EINVAL; @@ -122,6 +127,17 @@ pms_sysctl_alps(struct sysctllog **clog) goto err; alps_trackstick_xy_precision_nodenum = node->sysctl_num; + if ((rc = sysctl_createv(clog, 0, NULL, , + CTLFLAG_PERMANENT | CTLFLAG_READWRITE, + CTLTYPE_INT, "touchpad_movement_threshold", + SYSCTL_DESCR("Minimum reported movement threshold"), + pms_sysctl_alps_verify, 0, + _touchpad_movement_threshold, + 0, CTL_HW, root_num, CTL_CREATE, + CTL_EOL)) != 0) + goto err; + alps_touchpad_movement_threshold_nodenum = node->sysctl_num; + return; err: @@ -967,6 +983,13 @@ pms_alps_decode_touchpad_packet_v7(struc dy1 = dy1 >> alps_touchpad_xy_unprecision; } + if (abs(dx1) < alps_touchpad_movement_threshold) { + dx1 = 0; + } + if (abs(dy1) < alps_touchpad_movement_threshold) { + dy1 = 0; + } + /* Allow finger detouch during drag and drop */ if ((sc->nfingers < sc->last_nfingers) && (cur_x2 == sc->last_x1) && (cur_y2 == sc->last_y1)) {
CVS commit: src/sys/dev/pckbport
Module Name:src Committed By: ryoon Date: Mon Feb 10 15:29:05 UTC 2020 Modified Files: src/sys/dev/pckbport: alps.c Log Message: Fix typo in sysctl node name To generate a diff of this commit: cvs rdiff -u -r1.12 -r1.13 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.12 src/sys/dev/pckbport/alps.c:1.13 --- src/sys/dev/pckbport/alps.c:1.12 Tue May 28 08:59:35 2019 +++ src/sys/dev/pckbport/alps.c Mon Feb 10 15:29:05 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: alps.c,v 1.12 2019/05/28 08:59:35 msaitoh Exp $ */ +/* $NetBSD: alps.c,v 1.13 2020/02/10 15:29:05 ryoon Exp $ */ /*- * Copyright (c) 2017 Ryo ONODERA @@ -30,7 +30,7 @@ #include "opt_pms.h" #include -__KERNEL_RCSID(0, "$NetBSD: alps.c,v 1.12 2019/05/28 08:59:35 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: alps.c,v 1.13 2020/02/10 15:29:05 ryoon Exp $"); #include #include @@ -113,7 +113,7 @@ pms_sysctl_alps(struct sysctllog **clog) if ((rc = sysctl_createv(clog, 0, NULL, , CTLFLAG_PERMANENT | CTLFLAG_READWRITE, - CTLTYPE_INT, "tackstick_xy_precision_shift", + CTLTYPE_INT, "trackstick_xy_precision_shift", SYSCTL_DESCR("Trackstick X/Y-axis precision value"), pms_sysctl_alps_verify, 0, _trackstick_xy_precision,
CVS commit: src/sys/dev/pckbport
Module Name:src Committed By: blymn Date: Mon Apr 22 00:53:59 UTC 2019 Modified Files: src/sys/dev/pckbport: synaptics.c synapticsreg.h Log Message: Modify driver to use bits(3) to extract capabilities. Thanks to Anon Ymous for the fix. To generate a diff of this commit: cvs rdiff -u -r1.47 -r1.48 src/sys/dev/pckbport/synaptics.c cvs rdiff -u -r1.10 -r1.11 src/sys/dev/pckbport/synapticsreg.h 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/synaptics.c diff -u src/sys/dev/pckbport/synaptics.c:1.47 src/sys/dev/pckbport/synaptics.c:1.48 --- src/sys/dev/pckbport/synaptics.c:1.47 Sun Apr 21 02:40:35 2019 +++ src/sys/dev/pckbport/synaptics.c Mon Apr 22 00:53:59 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: synaptics.c,v 1.47 2019/04/21 02:40:35 blymn Exp $ */ +/* $NetBSD: synaptics.c,v 1.48 2019/04/22 00:53:59 blymn Exp $ */ /* * Copyright (c) 2005, Steve C. Woodford @@ -48,7 +48,7 @@ #include "opt_pms.h" #include -__KERNEL_RCSID(0, "$NetBSD: synaptics.c,v 1.47 2019/04/21 02:40:35 blymn Exp $"); +__KERNEL_RCSID(0, "$NetBSD: synaptics.c,v 1.48 2019/04/22 00:53:59 blymn Exp $"); #include #include @@ -302,20 +302,23 @@ pms_synaptics_probe_extended(struct pms_ * 1 0x20 report min query 0x0f gives min coord reported */ if (res == 0) { - u_char clickpad_type = (resp[0] & 0x10); - clickpad_type |= (resp[1] & 0x01); + uint val = SYN_CCAP_VALUE(resp); aprint_debug_dev(psc->sc_dev, "%s: Continued " "Capabilities 0x%02x 0x%02x 0x%02x.\n", __func__, resp[0], resp[1], resp[2]); - switch (clickpad_type) { - case 0x10: + switch (SYN_CCAP_CLICKPAD_TYPE(val)) { + case 0: /* not a clickpad */ +break; + case 1: sc->flags |= SYN_FLAG_HAS_ONE_BUTTON_CLICKPAD; break; - case 0x01: + case 2: sc->flags |= SYN_FLAG_HAS_TWO_BUTTON_CLICKPAD; break; + case 3: /* reserved */ default: +/* unreached */ break; } } @@ -395,7 +398,7 @@ pms_synaptics_probe_init(void *vsc) goto doreset; } - sc->caps = (resp[0] << 8) | resp[2]; + sc->caps = SYNAPTICS_CAP_VALUE(resp); if (sc->caps & SYNAPTICS_CAP_MBUTTON) sc->flags |= SYN_FLAG_HAS_MIDDLE_BUTTON; Index: src/sys/dev/pckbport/synapticsreg.h diff -u src/sys/dev/pckbport/synapticsreg.h:1.10 src/sys/dev/pckbport/synapticsreg.h:1.11 --- src/sys/dev/pckbport/synapticsreg.h:1.10 Sat Jul 14 00:47:33 2018 +++ src/sys/dev/pckbport/synapticsreg.h Mon Apr 22 00:53:59 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: synapticsreg.h,v 1.10 2018/07/14 00:47:33 maya Exp $ */ +/* $NetBSD: synapticsreg.h,v 1.11 2019/04/22 00:53:59 blymn Exp $ */ /* * Copyright (c) 2005, Steve C. Woodford @@ -56,16 +56,39 @@ #define SYNAPTICS_MAGIC_BYTE 0x47 /* Capability bits. */ +/* (byte[0] << 8) | byte[2] */ +#define SYNAPTICS_CAP_VALUE(b) (((b)[0] << 8) | (b)[2]) #define SYNAPTICS_CAP_EXTENDED (1 << 15) #define SYNAPTICS_CAP_EXTNUM (1 << 14 | 1 << 13 | 1 << 12) #define SYNAPTICS_CAP_MBUTTON (1 << 10) #define SYNAPTICS_CAP_PASSTHROUGH (1 << 7) +#define SYNAPTICS_CAP_LOWPOWER (1 << 6) #define SYNAPTICS_CAP_MULTIFINGERREPORT (1 << 5) #define SYNAPTICS_CAP_SLEEP (1 << 4) #define SYNAPTICS_CAP_4BUTTON (1 << 3) #define SYNAPTICS_CAP_MULTIDETECT (1 << 1) #define SYNAPTICS_CAP_PALMDETECT (1 << 0) +/* Continued Capability bits */ +/* (byte[0] << 8) | byte[1] */ +#define SYN_CCAP_VALUE(b) (((b)[0] << 8) | (b)[1]) +#define SYN_CCAP_COVERED_PAD __BIT(15) +#define SYN_CCAP_MULTIFINGER_MODE __BITS(13,14) +#define SYN_CCAP_CLICKPAD_BIT_0 __BIT(12) /* one-button clickpad */ +#define SYN_CCAP_HAS_ADV_GESTURE_MODE __BIT(11) +#define SYN_CCAP_CLEARPAD __BIT(10) +#define SYN_CCAP_REPORT_MAX __BIT(9) +#define SYN_CCAP_ADJ_THRESHOLD __BIT(8) +#define SYN_CCAP_REPORT_MIN __BIT(5) +#define SYN_CCAP_UNIFORM_CLICKPAD __BIT(4) +#define SYN_CCAP_IMAGE_SENSOR __BIT(3) /* reports V */ +#define SYN_CCAP_REDUCED_FILTERING __BIT(2) +#define SYN_CCAP_DELUX_LED_CONTROLS __BIT(1) +#define SYN_CCAP_CLICKPAD_BIT_1 __BIT(0) /* two-button clickpad */ +#define SYN_CCAP_CLICKPAD_TYPE(v) \ + ((__SHIFTOUT((v), SYN_CCAP_CLICKPAD_BIT_1) << 1) | \ + __SHIFTOUT((v), SYN_CCAP_CLICKPAD_BIT_0)) + /* Mode bits. */ #define SYNAPTICS_MODE_ABSOLUTE (1 << 7) #define SYNAPTICS_MODE_RATE (1 << 6) @@ -73,7 +96,7 @@ #define SYNAPTICS_MODE_EXTENDED_W (1 << 2) /* double meaning */ #define SYNAPTICS_MODE_GEST (1 << 2) #define SYNAPTICS_MODE_4BYTE_CLIENT (1 << 1) -#define SYNAPTICS_MODE_W (1) +#define SYNAPTICS_MODE_W (1 << 0) /* Extended mode button masks. */ #define SYN_1BUTMASK 0x1
CVS commit: src/sys/dev/pckbport
Module Name:src Committed By: blymn Date: Sun Apr 21 02:40:35 UTC 2019 Modified Files: src/sys/dev/pckbport: synaptics.c Log Message: Fix minor comment nit. To generate a diff of this commit: cvs rdiff -u -r1.46 -r1.47 src/sys/dev/pckbport/synaptics.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/synaptics.c diff -u src/sys/dev/pckbport/synaptics.c:1.46 src/sys/dev/pckbport/synaptics.c:1.47 --- src/sys/dev/pckbport/synaptics.c:1.46 Tue Dec 4 10:10:15 2018 +++ src/sys/dev/pckbport/synaptics.c Sun Apr 21 02:40:35 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: synaptics.c,v 1.46 2018/12/04 10:10:15 blymn Exp $ */ +/* $NetBSD: synaptics.c,v 1.47 2019/04/21 02:40:35 blymn Exp $ */ /* * Copyright (c) 2005, Steve C. Woodford @@ -48,7 +48,7 @@ #include "opt_pms.h" #include -__KERNEL_RCSID(0, "$NetBSD: synaptics.c,v 1.46 2018/12/04 10:10:15 blymn Exp $"); +__KERNEL_RCSID(0, "$NetBSD: synaptics.c,v 1.47 2019/04/21 02:40:35 blymn Exp $"); #include #include @@ -297,7 +297,7 @@ pms_synaptics_probe_extended(struct pms_ * for noise. * 1 0x08 image sensor image sensor tracks 5 fingers, but only * reports 2. - * 1 0x01 uniform clickpad whole clickpad moves instead of being + * 1 0x10 uniform clickpad whole clickpad moves instead of being * hinged at the top. * 1 0x20 report min query 0x0f gives min coord reported */
CVS commit: src/sys/dev/pckbport
Module Name:src Committed By: ryoon Date: Sat Mar 16 03:27:15 UTC 2019 Modified Files: src/sys/dev/pckbport: alps.c Log Message: Support more ALPS V2 devices * The V2 devices found in Toshiba dynabook satellite B551/D and dynabook SS RX1/T8E. To generate a diff of this commit: cvs rdiff -u -r1.10 -r1.11 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.10 src/sys/dev/pckbport/alps.c:1.11 --- src/sys/dev/pckbport/alps.c:1.10 Tue Jun 19 23:25:59 2018 +++ src/sys/dev/pckbport/alps.c Sat Mar 16 03:27:15 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: alps.c,v 1.10 2018/06/19 23:25:59 uwe Exp $ */ +/* $NetBSD: alps.c,v 1.11 2019/03/16 03:27:15 ryoon Exp $ */ /*- * Copyright (c) 2017 Ryo ONODERA @@ -30,7 +30,7 @@ #include "opt_pms.h" #include -__KERNEL_RCSID(0, "$NetBSD: alps.c,v 1.10 2018/06/19 23:25:59 uwe Exp $"); +__KERNEL_RCSID(0, "$NetBSD: alps.c,v 1.11 2019/03/16 03:27:15 ryoon Exp $"); #include #include @@ -714,8 +714,10 @@ pms_alps_probe_init(void *opaque) /* V7 device in Toshiba dynabook R63/PS */ sc->version = ALPS_PROTO_V7; } else if ((e7sig[0] == 0x73) && (e7sig[1] == 0x02) && - (e7sig[2] == 0x14)) { - /* V2 device in NEC VJ22MF-7 (VersaPro JVF-7) */ + ((e7sig[2] == 0x14) || (e7sig[2] == 0x0a))) { + /* 0x14: V2 device in NEC VJ22MF-7 (VersaPro JVF-7) */ + /* 0x0a: V2 devices in Toshiba dynabook satellite B551/D + and dynabook SS RX1 */ sc->version = ALPS_PROTO_V2; }
CVS commit: src/sys/dev/pckbport
Module Name:src Committed By: blymn Date: Tue Dec 4 10:10:15 UTC 2018 Modified Files: src/sys/dev/pckbport: synaptics.c Log Message: * Increase the default scaling of the two finger scroll to make it less sensitive * Fix range check for hw.synaptics.scale_z so it can be set with sysctl To generate a diff of this commit: cvs rdiff -u -r1.45 -r1.46 src/sys/dev/pckbport/synaptics.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/synaptics.c diff -u src/sys/dev/pckbport/synaptics.c:1.45 src/sys/dev/pckbport/synaptics.c:1.46 --- src/sys/dev/pckbport/synaptics.c:1.45 Wed Nov 28 09:14:03 2018 +++ src/sys/dev/pckbport/synaptics.c Tue Dec 4 10:10:15 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: synaptics.c,v 1.45 2018/11/28 09:14:03 blymn Exp $ */ +/* $NetBSD: synaptics.c,v 1.46 2018/12/04 10:10:15 blymn Exp $ */ /* * Copyright (c) 2005, Steve C. Woodford @@ -48,7 +48,7 @@ #include "opt_pms.h" #include -__KERNEL_RCSID(0, "$NetBSD: synaptics.c,v 1.45 2018/11/28 09:14:03 blymn Exp $"); +__KERNEL_RCSID(0, "$NetBSD: synaptics.c,v 1.46 2018/12/04 10:10:15 blymn Exp $"); #include #include @@ -115,7 +115,7 @@ static int synaptics_button3 = SYNAPTICS static int synaptics_two_fingers_emul = 0; static int synaptics_scale_x = 16; static int synaptics_scale_y = 16; -static int synaptics_scale_z = 1; +static int synaptics_scale_z = 32; static int synaptics_max_speed_x = 32; static int synaptics_max_speed_y = 32; static int synaptics_max_speed_z = 2; @@ -867,7 +867,8 @@ pms_sysctl_synaptics_verify(SYSCTLFN_ARG return (EINVAL); } else if (node.sysctl_num == synaptics_scale_x_nodenum || - node.sysctl_num == synaptics_scale_y_nodenum) { + node.sysctl_num == synaptics_scale_y_nodenum || + node.sysctl_num == synaptics_scale_z_nodenum) { if (t < 1 || t > (SYNAPTICS_EDGE_MAX / 4)) return (EINVAL); } else
CVS commit: src/sys/dev/pckbport
Module Name:src Committed By: blymn Date: Wed Nov 28 09:14:03 UTC 2018 Modified Files: src/sys/dev/pckbport: synaptics.c Log Message: * Increase minimum finger width to prevent entering scroll mode erroneously * Attempt to clarify what the sysctl variables for finger scroll do * Add hysteresis to validity check so changing it does not get rejected Thanks to Martin Husemann and Michael van Elst for reporting the issues. To generate a diff of this commit: cvs rdiff -u -r1.44 -r1.45 src/sys/dev/pckbport/synaptics.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/synaptics.c diff -u src/sys/dev/pckbport/synaptics.c:1.44 src/sys/dev/pckbport/synaptics.c:1.45 --- src/sys/dev/pckbport/synaptics.c:1.44 Tue Nov 6 09:13:17 2018 +++ src/sys/dev/pckbport/synaptics.c Wed Nov 28 09:14:03 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: synaptics.c,v 1.44 2018/11/06 09:13:17 blymn Exp $ */ +/* $NetBSD: synaptics.c,v 1.45 2018/11/28 09:14:03 blymn Exp $ */ /* * Copyright (c) 2005, Steve C. Woodford @@ -48,7 +48,7 @@ #include "opt_pms.h" #include -__KERNEL_RCSID(0, "$NetBSD: synaptics.c,v 1.44 2018/11/06 09:13:17 blymn Exp $"); +__KERNEL_RCSID(0, "$NetBSD: synaptics.c,v 1.45 2018/11/28 09:14:03 blymn Exp $"); #include #include @@ -120,8 +120,8 @@ static int synaptics_max_speed_x = 32; static int synaptics_max_speed_y = 32; static int synaptics_max_speed_z = 2; static int synaptics_movement_threshold = 4; -static int synaptics_fscroll_min = 5; -static int synaptics_fscroll_max = 12; +static int synaptics_fscroll_min = 13; +static int synaptics_fscroll_max = 14; static int synaptics_dz_hold = 30; static int synaptics_movement_enable = 1; @@ -793,7 +793,7 @@ pms_sysctl_synaptics(struct sysctllog ** if ((rc = sysctl_createv(clog, 0, NULL, , CTLFLAG_PERMANENT | CTLFLAG_READWRITE, CTLTYPE_INT, "finger_scroll-min", - SYSCTL_DESCR("Minimum width for finger scrolling detection"), + SYSCTL_DESCR("Minimum width at which y cursor movements will be converted to scroll wheel events"), pms_sysctl_synaptics_verify, 0, _fscroll_min, 0, CTL_HW, root_num, CTL_CREATE, @@ -805,7 +805,7 @@ pms_sysctl_synaptics(struct sysctllog ** if ((rc = sysctl_createv(clog, 0, NULL, , CTLFLAG_PERMANENT | CTLFLAG_READWRITE, CTLTYPE_INT, "finger_scroll-max", - SYSCTL_DESCR("Maximum width for finger scrolling detection"), + SYSCTL_DESCR("Maximum width at which y cursor movements will be converted to scroll wheel events"), pms_sysctl_synaptics_verify, 0, _fscroll_max, 0, CTL_HW, root_num, CTL_CREATE, @@ -817,7 +817,7 @@ pms_sysctl_synaptics(struct sysctllog ** if ((rc = sysctl_createv(clog, 0, NULL, , CTLFLAG_PERMANENT | CTLFLAG_READWRITE, CTLTYPE_INT, "finger_scroll-hysteresis", - SYSCTL_DESCR("Number of packets to stay in finger scroll mode"), + SYSCTL_DESCR("Number of packets to keep reporting y cursor movements as scroll wheel events"), pms_sysctl_synaptics_verify, 0, _dz_hold, 0, CTL_HW, root_num, CTL_CREATE, @@ -903,6 +903,10 @@ pms_sysctl_synaptics_verify(SYSCTLFN_ARG if ((t < 5) || (t > 14)) return (EINVAL); } else + if (node.sysctl_num == synaptics_dz_hold_nodenum) { + if (t < 0) + return (EINVAL); + } else if (node.sysctl_num == synaptics_movement_enable_nodenum) { if (t < 0 || t > 1) return (EINVAL);
CVS commit: src/sys/dev/pckbport
Module Name:src Committed By: blymn Date: Tue Nov 6 09:13:17 UTC 2018 Modified Files: src/sys/dev/pckbport: synaptics.c synapticsvar.h Log Message: Add double finger scroll feature. If the detected width is between a defined range then report y movement as z-axis. Effectively emulating a mouse scroll wheel. To generate a diff of this commit: cvs rdiff -u -r1.43 -r1.44 src/sys/dev/pckbport/synaptics.c cvs rdiff -u -r1.7 -r1.8 src/sys/dev/pckbport/synapticsvar.h 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/synaptics.c diff -u src/sys/dev/pckbport/synaptics.c:1.43 src/sys/dev/pckbport/synaptics.c:1.44 --- src/sys/dev/pckbport/synaptics.c:1.43 Tue Nov 6 08:55:02 2018 +++ src/sys/dev/pckbport/synaptics.c Tue Nov 6 09:13:17 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: synaptics.c,v 1.43 2018/11/06 08:55:02 blymn Exp $ */ +/* $NetBSD: synaptics.c,v 1.44 2018/11/06 09:13:17 blymn Exp $ */ /* * Copyright (c) 2005, Steve C. Woodford @@ -48,7 +48,7 @@ #include "opt_pms.h" #include -__KERNEL_RCSID(0, "$NetBSD: synaptics.c,v 1.43 2018/11/06 08:55:02 blymn Exp $"); +__KERNEL_RCSID(0, "$NetBSD: synaptics.c,v 1.44 2018/11/06 09:13:17 blymn Exp $"); #include #include @@ -115,9 +115,14 @@ static int synaptics_button3 = SYNAPTICS static int synaptics_two_fingers_emul = 0; static int synaptics_scale_x = 16; static int synaptics_scale_y = 16; +static int synaptics_scale_z = 1; static int synaptics_max_speed_x = 32; static int synaptics_max_speed_y = 32; +static int synaptics_max_speed_z = 2; static int synaptics_movement_threshold = 4; +static int synaptics_fscroll_min = 5; +static int synaptics_fscroll_max = 12; +static int synaptics_dz_hold = 30; static int synaptics_movement_enable = 1; /* Sysctl nodes. */ @@ -138,9 +143,14 @@ static int synaptics_finger_low_nodenum; static int synaptics_two_fingers_emul_nodenum; static int synaptics_scale_x_nodenum; static int synaptics_scale_y_nodenum; +static int synaptics_scale_z_nodenum; static int synaptics_max_speed_x_nodenum; static int synaptics_max_speed_y_nodenum; +static int synaptics_max_speed_z_nodenum; static int synaptics_movement_threshold_nodenum; +static int synaptics_finger_scroll_min_nodenum; +static int synaptics_finger_scroll_max_nodenum; +static int synaptics_dz_hold_nodenum; static int synaptics_movement_enable_nodenum; static int @@ -424,7 +434,7 @@ pms_synaptics_enable(void *vsc) struct pms_softc *psc = vsc; struct synaptics_softc *sc = >u.synaptics; u_char enable_modes; - int res; + int res, i; if (sc->flags & SYN_FLAG_HAS_PASSTHROUGH) { /* @@ -452,7 +462,7 @@ pms_synaptics_enable(void *vsc) */ synaptics_poll_cmd(psc, PMS_DEV_DISABLE, 0); /* a couple of set scales to clear out pending commands */ - for (int i = 0; i < 2; i++) + for (i = 0; i < 2; i++) synaptics_poll_cmd(psc, PMS_SET_SCALE11, 0); res = synaptics_special_write(psc, SYNAPTICS_CMD_SET_MODE2, enable_modes); @@ -460,7 +470,7 @@ pms_synaptics_enable(void *vsc) aprint_error("synaptics: set mode error\n"); /* a couple of set scales to clear out pending commands */ - for (int i = 0; i < 2; i++) + for (i = 0; i < 2; i++) synaptics_poll_cmd(psc, PMS_SET_SCALE11, 0); /* Set advanced gesture mode */ @@ -476,10 +486,11 @@ pms_synaptics_enable(void *vsc) sc->gesture_tap_packet = 0; sc->gesture_type = 0; sc->gesture_buttons = 0; - sc->rem_x[0] = sc->rem_y[0] = 0; - sc->rem_x[1] = sc->rem_y[1] = 0; - sc->movement_history[0] = 0; - sc->movement_history[1] = 0; + sc->dz_hold = 0; + for (i = 0; i < SYN_MAX_FINGERS; i++) { + sc->rem_x[i] = sc->rem_y[i] = sc->rem_z[i] = 0; + sc->movement_history[i] = 0; + } sc->button_history = 0; } @@ -673,6 +684,18 @@ pms_sysctl_synaptics(struct sysctllog ** if ((rc = sysctl_createv(clog, 0, NULL, , CTLFLAG_PERMANENT | CTLFLAG_READWRITE, + CTLTYPE_INT, "scale_z", + SYSCTL_DESCR("Sroll wheel emulation scale factor"), + pms_sysctl_synaptics_verify, 0, + _scale_z, + 0, CTL_HW, root_num, CTL_CREATE, + CTL_EOL)) != 0) + goto err; + + synaptics_scale_z_nodenum = node->sysctl_num; + + if ((rc = sysctl_createv(clog, 0, NULL, , + CTLFLAG_PERMANENT | CTLFLAG_READWRITE, CTLTYPE_INT, "max_speed_x", SYSCTL_DESCR("Horizontal movement maximum speed"), pms_sysctl_synaptics_verify, 0, @@ -697,6 +720,18 @@ pms_sysctl_synaptics(struct sysctllog ** if ((rc = sysctl_createv(clog, 0, NULL, , CTLFLAG_PERMANENT | CTLFLAG_READWRITE, + CTLTYPE_INT, "max_speed_z", + SYSCTL_DESCR("Scroll wheel emulation maximum speed"), + pms_sysctl_synaptics_verify, 0, + _max_speed_z, + 0, CTL_HW, root_num, CTL_CREATE, + CTL_EOL)) != 0) + goto err; + + synaptics_max_speed_z_nodenum = node->sysctl_num; + + if ((rc = sysctl_createv(clog, 0, NULL, , + CTLFLAG_PERMANENT | CTLFLAG_READWRITE, CTLTYPE_INT,
CVS commit: src/sys/dev/pckbport
Module Name:src Committed By: blymn Date: Tue Nov 6 08:55:02 UTC 2018 Modified Files: src/sys/dev/pckbport: synaptics.c Log Message: Fix clamping of deltas so it works for both positive and negative deltas. To generate a diff of this commit: cvs rdiff -u -r1.42 -r1.43 src/sys/dev/pckbport/synaptics.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/synaptics.c diff -u src/sys/dev/pckbport/synaptics.c:1.42 src/sys/dev/pckbport/synaptics.c:1.43 --- src/sys/dev/pckbport/synaptics.c:1.42 Sat Jul 14 00:47:33 2018 +++ src/sys/dev/pckbport/synaptics.c Tue Nov 6 08:55:02 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: synaptics.c,v 1.42 2018/07/14 00:47:33 maya Exp $ */ +/* $NetBSD: synaptics.c,v 1.43 2018/11/06 08:55:02 blymn Exp $ */ /* * Copyright (c) 2005, Steve C. Woodford @@ -48,7 +48,7 @@ #include "opt_pms.h" #include -__KERNEL_RCSID(0, "$NetBSD: synaptics.c,v 1.42 2018/07/14 00:47:33 maya Exp $"); +__KERNEL_RCSID(0, "$NetBSD: synaptics.c,v 1.43 2018/11/06 08:55:02 blymn Exp $"); #include #include @@ -1485,10 +1485,10 @@ synaptics_movement(struct synaptics_soft /* * Clamp deltas to specified maximums. */ - if (dx > synaptics_max_speed_x) - dx = synaptics_max_speed_x; - if (dy > synaptics_max_speed_y) - dy = synaptics_max_speed_y; + if (abs(dx) > synaptics_max_speed_x) + dx = ((dx >= 0)? 1 : -1) * synaptics_max_speed_x; + if (abs(dy) > synaptics_max_speed_y) + dy = ((dy >= 0)? 1 : -1) * synaptics_max_speed_y; *dxp = dx; *dyp = dy;
CVS commit: src/sys/dev/pckbport
Module Name:src Committed By: maya Date: Sat Jul 14 00:47:33 UTC 2018 Modified Files: src/sys/dev/pckbport: synaptics.c synapticsreg.h Log Message: Send the 'magic reverse engineered sequence' with a single sliced command, don't wait for individual ACKs. Fixes kern/53444. While here: - use better descriptive names for functions - use a function for the extended write command - add macro for number from the old synaptics documentation - don't get the resp from the command sequence if we're going to ignore it anyway most from uwe. To generate a diff of this commit: cvs rdiff -u -r1.41 -r1.42 src/sys/dev/pckbport/synaptics.c cvs rdiff -u -r1.9 -r1.10 src/sys/dev/pckbport/synapticsreg.h 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/synaptics.c diff -u src/sys/dev/pckbport/synaptics.c:1.41 src/sys/dev/pckbport/synaptics.c:1.42 --- src/sys/dev/pckbport/synaptics.c:1.41 Sun Jun 3 15:10:12 2018 +++ src/sys/dev/pckbport/synaptics.c Sat Jul 14 00:47:33 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: synaptics.c,v 1.41 2018/06/03 15:10:12 christos Exp $ */ +/* $NetBSD: synaptics.c,v 1.42 2018/07/14 00:47:33 maya Exp $ */ /* * Copyright (c) 2005, Steve C. Woodford @@ -48,7 +48,7 @@ #include "opt_pms.h" #include -__KERNEL_RCSID(0, "$NetBSD: synaptics.c,v 1.41 2018/06/03 15:10:12 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: synaptics.c,v 1.42 2018/07/14 00:47:33 maya Exp $"); #include #include @@ -179,7 +179,7 @@ synaptics_poll_reset(struct pms_softc *p } static int -synaptics_poll_status(struct pms_softc *psc, u_char slice, u_char resp[3]) +synaptics_special_read(struct pms_softc *psc, u_char slice, u_char resp[3]) { u_char cmd[1] = { PMS_SEND_DEV_STATUS }; int res = pms_sliced_command(psc->sc_kbctag, psc->sc_kbcslot, slice); @@ -188,6 +188,21 @@ synaptics_poll_status(struct pms_softc * cmd, 1, 3, resp, 0); } +static int +synaptics_special_write(struct pms_softc *psc, u_char command, u_char arg) +{ + int res = pms_sliced_command(psc->sc_kbctag, psc->sc_kbcslot, arg); + if (res) + return res; + + u_char cmd[2]; + cmd[0] = PMS_SET_SAMPLE; + cmd[1] = command; + res = pckbport_poll_cmd(psc->sc_kbctag, psc->sc_kbcslot, + cmd, 2, 0, NULL, 0); + return res; +} + static void pms_synaptics_probe_extended(struct pms_softc *psc) { @@ -213,7 +228,7 @@ pms_synaptics_probe_extended(struct pms_ if (((sc->caps & SYNAPTICS_CAP_EXTNUM) + 0x08) >= SYNAPTICS_EXTENDED_QUERY) { - res = synaptics_poll_status(psc, SYNAPTICS_EXTENDED_QUERY, resp); + res = synaptics_special_read(psc, SYNAPTICS_EXTENDED_QUERY, resp); if (res == 0) { int buttons = (resp[1] >> 4); aprint_debug_dev(psc->sc_dev, @@ -245,7 +260,7 @@ pms_synaptics_probe_extended(struct pms_ if (((sc->caps & SYNAPTICS_CAP_EXTNUM) + 0x08) >= SYNAPTICS_CONTINUED_CAPABILITIES) { - res = synaptics_poll_status(psc, + res = synaptics_special_read(psc, SYNAPTICS_CONTINUED_CAPABILITIES, resp); /* @@ -362,7 +377,7 @@ pms_synaptics_probe_init(void *vsc) /* Query the hardware capabilities. */ - res = synaptics_poll_status(psc, SYNAPTICS_READ_CAPABILITIES, resp); + res = synaptics_special_read(psc, SYNAPTICS_READ_CAPABILITIES, resp); if (res) { /* Hmm, failed to get capabilites. */ aprint_error_dev(psc->sc_dev, @@ -410,7 +425,6 @@ pms_synaptics_enable(void *vsc) struct synaptics_softc *sc = >u.synaptics; u_char enable_modes; int res; - u_char cmd[1], resp[3]; if (sc->flags & SYN_FLAG_HAS_PASSTHROUGH) { /* @@ -441,37 +455,17 @@ pms_synaptics_enable(void *vsc) for (int i = 0; i < 2; i++) synaptics_poll_cmd(psc, PMS_SET_SCALE11, 0); - res = pms_sliced_command(psc->sc_kbctag, psc->sc_kbcslot, - enable_modes); + res = synaptics_special_write(psc, SYNAPTICS_CMD_SET_MODE2, enable_modes); if (res) aprint_error("synaptics: set mode error\n"); - synaptics_poll_cmd(psc, PMS_SET_SAMPLE, SYNAPTICS_CMD_SET_MODE2, 0); - /* a couple of set scales to clear out pending commands */ for (int i = 0; i < 2; i++) synaptics_poll_cmd(psc, PMS_SET_SCALE11, 0); - /* - * Enable multi-finger capability in cold boot case with - * undocumented sequence. - * Parameters from - * https://github.com/RehabMan/OS-X-Voodoo-PS2-Controller/ - * VoodooPS2Trackpad/VoodooPS2SynapticsTouchPad.cpp - * setTouchPadModeByte function. - */ - if (sc->flags & SYN_FLAG_HAS_EXTENDED_WMODE) { - static const uint8_t seq[] = { - 0xe6, 0xe8, 0x00, 0xe8, 0x00, - 0xe8, 0x00, 0xe8, 0x03, 0xf3, - 0xc8, - }; - for (size_t s = 0; s < __arraycount(seq); s++) { - cmd[0] = seq[s]; - (void)pckbport_poll_cmd(psc->sc_kbctag, psc->sc_kbcslot, -cmd, 1, 3, resp, 0); - } - } + /* Set advanced gesture mode */ + if (sc->flags & SYN_FLAG_HAS_EXTENDED_WMODE) + synaptics_special_write(psc, SYNAPTICS_WRITE_DELUXE_3, 0x3); synaptics_poll_cmd(psc, PMS_DEV_ENABLE, 0);
CVS commit: src/sys/dev/pckbport
Module Name:src Committed By: maya Date: Fri Jul 13 19:44:08 UTC 2018 Modified Files: src/sys/dev/pckbport: pms.c Log Message: Add comment elaborating what a sliced command is. To generate a diff of this commit: cvs rdiff -u -r1.36 -r1.37 src/sys/dev/pckbport/pms.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/pms.c diff -u src/sys/dev/pckbport/pms.c:1.36 src/sys/dev/pckbport/pms.c:1.37 --- src/sys/dev/pckbport/pms.c:1.36 Sun Aug 13 08:49:27 2017 +++ src/sys/dev/pckbport/pms.c Fri Jul 13 19:44:08 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: pms.c,v 1.36 2017/08/13 08:49:27 christos Exp $ */ +/* $NetBSD: pms.c,v 1.37 2018/07/13 19:44:08 maya Exp $ */ /*- * Copyright (c) 2004 Kentaro Kurahone. @@ -26,7 +26,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: pms.c,v 1.36 2017/08/13 08:49:27 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pms.c,v 1.37 2018/07/13 19:44:08 maya Exp $"); #include "opt_pms.h" @@ -675,6 +675,10 @@ pmsinput(void *vsc, int data) } } +/* + * Touchpad special command sequence used by Synaptics and others. + * Sends 0xE6 0xE8 rr 0xE8 ss 0xE8 tt 0xE8 uu where (rr*64)+(ss*16)+(tt*4)+uu + */ int pms_sliced_command(pckbport_tag_t tag, pckbport_slot_t slot, u_char scmd) {
CVS commit: src/sys/dev/pckbport
Module Name:src Committed By: uwe Date: Tue Jun 19 23:25:59 UTC 2018 Modified Files: src/sys/dev/pckbport: alps.c Log Message: Make the error message from pms_alps_probe_init() an error again now that we don't misidentify almost anything as an ALPS device. Reset if E6 check failed as well. To generate a diff of this commit: cvs rdiff -u -r1.9 -r1.10 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.9 src/sys/dev/pckbport/alps.c:1.10 --- src/sys/dev/pckbport/alps.c:1.9 Tue Jun 19 23:03:28 2018 +++ src/sys/dev/pckbport/alps.c Tue Jun 19 23:25:59 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: alps.c,v 1.9 2018/06/19 23:03:28 uwe Exp $ */ +/* $NetBSD: alps.c,v 1.10 2018/06/19 23:25:59 uwe Exp $ */ /*- * Copyright (c) 2017 Ryo ONODERA @@ -30,7 +30,7 @@ #include "opt_pms.h" #include -__KERNEL_RCSID(0, "$NetBSD: alps.c,v 1.9 2018/06/19 23:03:28 uwe Exp $"); +__KERNEL_RCSID(0, "$NetBSD: alps.c,v 1.10 2018/06/19 23:25:59 uwe Exp $"); #include #include @@ -169,7 +169,7 @@ pms_alps_e6sig(struct pms_softc *psc, ui e6sig[1] != 0x00 || e6sig[2] != 0x64) { - return ENODEV; + return ENODEV; /* This is not an ALPS device */ } aprint_debug_dev(psc->sc_dev, @@ -219,7 +219,7 @@ pms_alps_e7sig(struct pms_softc *psc, ui e7sig[0], e7sig[1], e7sig[2]); if (e7sig[0] != 0x73) - return ENODEV; + return ENODEV; /* This is not an ALPS device */ return 0; err: @@ -701,7 +701,7 @@ pms_alps_probe_init(void *opaque) pckbport_flush(psc->sc_kbctag, psc->sc_kbcslot); if ((res = pms_alps_e6sig(psc, e6sig)) != 0) - return res; /* This is not ALPS device */ + goto err; if ((res = pms_alps_e7sig(psc, e7sig)) != 0) goto err; @@ -758,7 +758,7 @@ err: (void)pckbport_poll_cmd(psc->sc_kbctag, psc->sc_kbcslot, cmd, 1, 2, NULL, 1); if (res != ENODEV) - aprint_verbose_dev(psc->sc_dev, "Failed to initialize an ALPS device.\n"); + aprint_error_dev(psc->sc_dev, "Failed to initialize an ALPS device.\n"); return res; }
CVS commit: src/sys/dev/pckbport
Module Name:src Committed By: uwe Date: Tue Jun 19 23:03:28 UTC 2018 Modified Files: src/sys/dev/pckbport: alps.c Log Message: Don't pass response buffer to the reset command since we are not interested in it (pckbport_poll_cmd() is smart enough). To generate a diff of this commit: cvs rdiff -u -r1.8 -r1.9 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.8 src/sys/dev/pckbport/alps.c:1.9 --- src/sys/dev/pckbport/alps.c:1.8 Tue Jun 19 22:53:17 2018 +++ src/sys/dev/pckbport/alps.c Tue Jun 19 23:03:28 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: alps.c,v 1.8 2018/06/19 22:53:17 uwe Exp $ */ +/* $NetBSD: alps.c,v 1.9 2018/06/19 23:03:28 uwe Exp $ */ /*- * Copyright (c) 2017 Ryo ONODERA @@ -30,7 +30,7 @@ #include "opt_pms.h" #include -__KERNEL_RCSID(0, "$NetBSD: alps.c,v 1.8 2018/06/19 22:53:17 uwe Exp $"); +__KERNEL_RCSID(0, "$NetBSD: alps.c,v 1.9 2018/06/19 23:03:28 uwe Exp $"); #include #include @@ -690,7 +690,7 @@ pms_alps_probe_init(void *opaque) uint8_t e7sig[3]; uint8_t ecsig[3]; int res; - u_char cmd[1], resp[3]; + u_char cmd[1]; sc->last_x1 = 0; sc->last_y1 = 0; @@ -755,8 +755,8 @@ pms_alps_probe_init(void *opaque) err: cmd[0] = PMS_RESET; - (void)pckbport_poll_cmd(psc->sc_kbctag, psc->sc_kbcslot, cmd, - 1, 2, resp, 1); + (void)pckbport_poll_cmd(psc->sc_kbctag, psc->sc_kbcslot, + cmd, 1, 2, NULL, 1); if (res != ENODEV) aprint_verbose_dev(psc->sc_dev, "Failed to initialize an ALPS device.\n"); return res;
CVS commit: src/sys/dev/pckbport
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 @@ -30,7 +30,7 @@ #include "opt_pms.h" #include -__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 #include @@ -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; }
CVS commit: src/sys/dev/pckbport
Module Name:src Committed By: uwe Date: Tue Jun 19 21:47:28 UTC 2018 Modified Files: src/sys/dev/pckbport: alps.c Log Message: When E6 signature is checked, ignore pressed buttons. To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 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.6 src/sys/dev/pckbport/alps.c:1.7 --- src/sys/dev/pckbport/alps.c:1.6 Tue Jun 19 21:21:04 2018 +++ src/sys/dev/pckbport/alps.c Tue Jun 19 21:47:28 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: alps.c,v 1.6 2018/06/19 21:21:04 uwe Exp $ */ +/* $NetBSD: alps.c,v 1.7 2018/06/19 21:47:28 uwe Exp $ */ /*- * Copyright (c) 2017 Ryo ONODERA @@ -30,7 +30,7 @@ #include "opt_pms.h" #include -__KERNEL_RCSID(0, "$NetBSD: alps.c,v 1.6 2018/06/19 21:21:04 uwe Exp $"); +__KERNEL_RCSID(0, "$NetBSD: alps.c,v 1.7 2018/06/19 21:47:28 uwe Exp $"); #include #include @@ -165,8 +165,10 @@ pms_alps_e6sig(struct pms_softc *psc, ui goto err; /* ALPS input device returns 00-00-64 as E6 signature */ - if (e6sig[0] != 0x00 || e6sig[1] != 0x00 || - e6sig[2] != 0x64) { + if ((e6sig[0] & ~0x07u) != 0x00 || /* ignore buttons */ + e6sig[1] != 0x00 || + e6sig[2] != 0x64) + { return EINVAL; }
CVS commit: src/sys/dev/pckbport
Module Name:src Committed By: uwe Date: Tue Jun 19 21:21:04 UTC 2018 Modified Files: src/sys/dev/pckbport: alps.c Log Message: Use PMS_SEND_DEV_STATUS for E9 instead of PMS_GET_SCALE (also defined as E9). This is more readable and is congruent with other drivers. Same object code is generated. To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 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.5 src/sys/dev/pckbport/alps.c:1.6 --- src/sys/dev/pckbport/alps.c:1.5 Sun Jun 3 15:02:56 2018 +++ src/sys/dev/pckbport/alps.c Tue Jun 19 21:21:04 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: alps.c,v 1.5 2018/06/03 15:02:56 jakllsch Exp $ */ +/* $NetBSD: alps.c,v 1.6 2018/06/19 21:21:04 uwe Exp $ */ /*- * Copyright (c) 2017 Ryo ONODERA @@ -30,7 +30,7 @@ #include "opt_pms.h" #include -__KERNEL_RCSID(0, "$NetBSD: alps.c,v 1.5 2018/06/03 15:02:56 jakllsch Exp $"); +__KERNEL_RCSID(0, "$NetBSD: alps.c,v 1.6 2018/06/19 21:21:04 uwe Exp $"); #include #include @@ -159,7 +159,7 @@ pms_alps_e6sig(struct pms_softc *psc, ui goto err; e6sig[0] = e6sig[1] = e6sig[2] = 0; /* Get E6 signature */ - cmd[0] = PMS_GET_SCALE; /* E9 */ + cmd[0] = PMS_SEND_DEV_STATUS; /* E9 */ if ((res = pckbport_poll_cmd(psc->sc_kbctag, psc->sc_kbcslot, cmd, 1, 3, e6sig, 0)) != 0) goto err; @@ -207,7 +207,7 @@ pms_alps_e7sig(struct pms_softc *psc, ui cmd, 1, 0, NULL, 0)) != 0) goto err; e7sig[0] = e7sig[1] = e7sig[2] = 0; - cmd[0] = PMS_GET_SCALE; /* E9 */ + cmd[0] = PMS_SEND_DEV_STATUS; /* E9 */ if ((res = pckbport_poll_cmd(psc->sc_kbctag, psc->sc_kbcslot, cmd, 1, 3, e7sig, 0)) != 0) goto err; @@ -249,7 +249,7 @@ pms_alps_ecsig(struct pms_softc *psc, ui cmd, 1, 0, NULL, 0)) != 0) goto err; ecsig[0] = ecsig[1] = ecsig[2] = 0; - cmd[0] = PMS_GET_SCALE; /* E9 */ + cmd[0] = PMS_SEND_DEV_STATUS; /* E9 */ if ((res = pckbport_poll_cmd(psc->sc_kbctag, psc->sc_kbcslot, cmd, 1, 3, ecsig, 0)) != 0) goto err; @@ -288,7 +288,7 @@ pms_alps_start_command_mode(struct pms_s cmd, 1, 0, NULL, 0)) != 0) goto err; resp[0] = resp[1] = resp[2] = 0; - cmd[0] = PMS_GET_SCALE; /* E9 */ + cmd[0] = PMS_SEND_DEV_STATUS; /* E9 */ if ((res = pckbport_poll_cmd(psc->sc_kbctag, psc->sc_kbcslot, cmd, 1, 3, resp, 0)) != 0) goto err;
CVS commit: src/sys/dev/pckbport
Module Name:src Committed By: christos Date: Sun Jun 3 15:10:12 UTC 2018 Modified Files: src/sys/dev/pckbport: synaptics.c Log Message: restore \n printing. To generate a diff of this commit: cvs rdiff -u -r1.40 -r1.41 src/sys/dev/pckbport/synaptics.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/synaptics.c diff -u src/sys/dev/pckbport/synaptics.c:1.40 src/sys/dev/pckbport/synaptics.c:1.41 --- src/sys/dev/pckbport/synaptics.c:1.40 Sun Jun 3 10:41:05 2018 +++ src/sys/dev/pckbport/synaptics.c Sun Jun 3 11:10:12 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: synaptics.c,v 1.40 2018/06/03 14:41:05 christos Exp $ */ +/* $NetBSD: synaptics.c,v 1.41 2018/06/03 15:10:12 christos Exp $ */ /* * Copyright (c) 2005, Steve C. Woodford @@ -48,7 +48,7 @@ #include "opt_pms.h" #include -__KERNEL_RCSID(0, "$NetBSD: synaptics.c,v 1.40 2018/06/03 14:41:05 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: synaptics.c,v 1.41 2018/06/03 15:10:12 christos Exp $"); #include #include @@ -392,6 +392,7 @@ pms_synaptics_probe_init(void *vsc) sep = comma; } } + aprint_normal("\n"); } done:
CVS commit: src/sys/dev/pckbport
Module Name:src Committed By: jakllsch Date: Sun Jun 3 15:02:56 UTC 2018 Modified Files: src/sys/dev/pckbport: alps.c Log Message: Move two probe-time aprint_errors to debug and verbose level instead. These two are regularly happening within qemu, and would muddle up the aprint error counter otherwise. To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 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.4 src/sys/dev/pckbport/alps.c:1.5 --- src/sys/dev/pckbport/alps.c:1.4 Wed Aug 16 21:18:58 2017 +++ src/sys/dev/pckbport/alps.c Sun Jun 3 15:02:56 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: alps.c,v 1.4 2017/08/16 21:18:58 nat Exp $ */ +/* $NetBSD: alps.c,v 1.5 2018/06/03 15:02:56 jakllsch Exp $ */ /*- * Copyright (c) 2017 Ryo ONODERA @@ -30,7 +30,7 @@ #include "opt_pms.h" #include -__KERNEL_RCSID(0, "$NetBSD: alps.c,v 1.4 2017/08/16 21:18:58 nat Exp $"); +__KERNEL_RCSID(0, "$NetBSD: alps.c,v 1.5 2018/06/03 15:02:56 jakllsch Exp $"); #include #include @@ -261,7 +261,7 @@ pms_alps_ecsig(struct pms_softc *psc, ui return 0; err: - aprint_error_dev(psc->sc_dev, "Failed to get EC signature.\n"); + aprint_debug_dev(psc->sc_dev, "Failed to get EC signature.\n"); return res; } @@ -752,7 +752,7 @@ 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"); + aprint_verbose_dev(psc->sc_dev, "Failed to initialize an ALPS device.\n"); return res; }
CVS commit: src/sys/dev/pckbport
Module Name:src Committed By: christos Date: Sun Jun 3 14:41:05 UTC 2018 Modified Files: src/sys/dev/pckbport: synaptics.c Log Message: use a more data-driven :-) approach to avoid cut-n-pasted code. To generate a diff of this commit: cvs rdiff -u -r1.39 -r1.40 src/sys/dev/pckbport/synaptics.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/synaptics.c diff -u src/sys/dev/pckbport/synaptics.c:1.39 src/sys/dev/pckbport/synaptics.c:1.40 --- src/sys/dev/pckbport/synaptics.c:1.39 Sun Jun 3 03:24:18 2018 +++ src/sys/dev/pckbport/synaptics.c Sun Jun 3 10:41:05 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: synaptics.c,v 1.39 2018/06/03 07:24:18 ryoon Exp $ */ +/* $NetBSD: synaptics.c,v 1.40 2018/06/03 14:41:05 christos Exp $ */ /* * Copyright (c) 2005, Steve C. Woodford @@ -48,7 +48,7 @@ #include "opt_pms.h" #include -__KERNEL_RCSID(0, "$NetBSD: synaptics.c,v 1.39 2018/06/03 07:24:18 ryoon Exp $"); +__KERNEL_RCSID(0, "$NetBSD: synaptics.c,v 1.40 2018/06/03 14:41:05 christos Exp $"); #include #include @@ -297,6 +297,24 @@ pms_synaptics_probe_extended(struct pms_ } } +static const struct { + int bit; + const char *desc; +} syn_flags[] = { + { SYN_FLAG_HAS_EXTENDED_WMODE, "Extended W mode", }, + { SYN_FLAG_HAS_PASSTHROUGH, "Passthrough", }, + { SYN_FLAG_HAS_MIDDLE_BUTTON, "Middle button", }, + { SYN_FLAG_HAS_BUTTONS_4_5, "Buttons 4/5", }, + { SYN_FLAG_HAS_UP_DOWN_BUTTONS, "Up/down buttons", }, + { SYN_FLAG_HAS_PALM_DETECT, "Palm detect", }, + { SYN_FLAG_HAS_ONE_BUTTON_CLICKPAD, "One button click pad", }, + { SYN_FLAG_HAS_TWO_BUTTON_CLICKPAD, "Two button click pad", }, + { SYN_FLAG_HAS_VERTICAL_SCROLL, "Vertical scroll", }, + { SYN_FLAG_HAS_HORIZONTAL_SCROLL, "Horizontal scroll", }, + { SYN_FLAG_HAS_MULTI_FINGER_REPORT, "Multi-finger Report", }, + { SYN_FLAG_HAS_MULTI_FINGER, "Multi-finger", }, +}; + int pms_synaptics_probe_init(void *vsc) { @@ -368,54 +386,12 @@ pms_synaptics_probe_init(void *vsc) const char comma[] = ", "; const char *sep = ""; aprint_normal_dev(psc->sc_dev, ""); - if (sc->flags & SYN_FLAG_HAS_EXTENDED_WMODE) { - aprint_normal("%sExtended W mode", sep); - sep = comma; - } - if (sc->flags & SYN_FLAG_HAS_PASSTHROUGH) { - aprint_normal("%sPassthrough", sep); - sep = comma; - } - if (sc->flags & SYN_FLAG_HAS_MIDDLE_BUTTON) { - aprint_normal("%sMiddle button", sep); - sep = comma; - } - if (sc->flags & SYN_FLAG_HAS_BUTTONS_4_5) { - aprint_normal("%sButtons 4/5", sep); - sep = comma; - } - if (sc->flags & SYN_FLAG_HAS_UP_DOWN_BUTTONS) { - aprint_normal("%sUp/down buttons", sep); - sep = comma; - } - if (sc->flags & SYN_FLAG_HAS_PALM_DETECT) { - aprint_normal("%sPalm detect", sep); - sep = comma; - } - if (sc->flags & SYN_FLAG_HAS_ONE_BUTTON_CLICKPAD) { - aprint_normal("%sOne button click pad", sep); - sep = comma; - } - if (sc->flags & SYN_FLAG_HAS_TWO_BUTTON_CLICKPAD) { - aprint_normal("%sTwo button click pad", sep); - sep = comma; - } - if (sc->flags & SYN_FLAG_HAS_VERTICAL_SCROLL) { - aprint_normal("%sVertical scroll", sep); - sep = comma; - } - if (sc->flags & SYN_FLAG_HAS_HORIZONTAL_SCROLL) { - aprint_normal("%sHorizontal scroll", sep); - sep = comma; - } - if (sc->flags & SYN_FLAG_HAS_MULTI_FINGER_REPORT) { - aprint_normal("%sMulti-finger Report", sep); - sep = comma; + for (size_t f = 0; f < __arraycount(syn_flags); f++) { + if (sc->flags & syn_flags[f].bit) { +aprint_normal("%s%s", sep, syn_flags[f].desc); +sep = comma; + } } - if (sc->flags & SYN_FLAG_HAS_MULTI_FINGER) - aprint_normal("%sMulti-finger", sep); - - aprint_normal("\n"); } done: @@ -437,8 +413,8 @@ pms_synaptics_enable(void *vsc) if (sc->flags & SYN_FLAG_HAS_PASSTHROUGH) { /* - * Extended capability probes can confuse the passthrough device; - * reset the touchpad now to cure that. + * Extended capability probes can confuse the passthrough + * device; reset the touchpad now to cure that. */ res = synaptics_poll_reset(psc); } @@ -477,46 +453,23 @@ pms_synaptics_enable(void *vsc) /* * Enable multi-finger capability in cold boot case with - * undocumented dequence. + * undocumented sequence. * Parameters from * https://github.com/RehabMan/OS-X-Voodoo-PS2-Controller/ * VoodooPS2Trackpad/VoodooPS2SynapticsTouchPad.cpp * setTouchPadModeByte function. */ if (sc->flags & SYN_FLAG_HAS_EXTENDED_WMODE) { - cmd[0] = 0xe6; - (void)pckbport_poll_cmd(psc->sc_kbctag, psc->sc_kbcslot, - cmd, 1, 3, resp, 0); - cmd[0] = 0xe8; - (void)pckbport_poll_cmd(psc->sc_kbctag, psc->sc_kbcslot, - cmd, 1, 3, resp, 0); - cmd[0] = 0x00; - (void)pckbport_poll_cmd(psc->sc_kbctag, psc->sc_kbcslot, - cmd, 1, 3, resp, 0); - cmd[0] = 0xe8; - (void)pckbport_poll_cmd(psc->sc_kbctag, psc->sc_kbcslot, - cmd, 1, 3, resp, 0); - cmd[0] = 0x00; -
CVS commit: src/sys/dev/pckbport
Module Name:src Committed By: ryoon Date: Sun Jun 3 07:24:18 UTC 2018 Modified Files: src/sys/dev/pckbport: synaptics.c Log Message: Enable Synaptics multifinger capability (Extended W mode) Magic parameters are taken from https://github.com/RehabMan/OS-X-Voodoo-PS2-Controller/. Tested on HP ProBook 4630s, Lenovo E530, VAIO Pro 11 and HP Spectre x360 ae. To generate a diff of this commit: cvs rdiff -u -r1.38 -r1.39 src/sys/dev/pckbport/synaptics.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/synaptics.c diff -u src/sys/dev/pckbport/synaptics.c:1.38 src/sys/dev/pckbport/synaptics.c:1.39 --- src/sys/dev/pckbport/synaptics.c:1.38 Wed May 30 13:20:39 2018 +++ src/sys/dev/pckbport/synaptics.c Sun Jun 3 07:24:18 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: synaptics.c,v 1.38 2018/05/30 13:20:39 ryoon Exp $ */ +/* $NetBSD: synaptics.c,v 1.39 2018/06/03 07:24:18 ryoon Exp $ */ /* * Copyright (c) 2005, Steve C. Woodford @@ -48,7 +48,7 @@ #include "opt_pms.h" #include -__KERNEL_RCSID(0, "$NetBSD: synaptics.c,v 1.38 2018/05/30 13:20:39 ryoon Exp $"); +__KERNEL_RCSID(0, "$NetBSD: synaptics.c,v 1.39 2018/06/03 07:24:18 ryoon Exp $"); #include #include @@ -433,6 +433,7 @@ pms_synaptics_enable(void *vsc) struct synaptics_softc *sc = >u.synaptics; u_char enable_modes; int res; + u_char cmd[1], resp[3]; if (sc->flags & SYN_FLAG_HAS_PASSTHROUGH) { /* @@ -474,6 +475,50 @@ pms_synaptics_enable(void *vsc) for (int i = 0; i < 2; i++) synaptics_poll_cmd(psc, PMS_SET_SCALE11, 0); + /* + * Enable multi-finger capability in cold boot case with + * undocumented dequence. + * Parameters from + * https://github.com/RehabMan/OS-X-Voodoo-PS2-Controller/ + * VoodooPS2Trackpad/VoodooPS2SynapticsTouchPad.cpp + * setTouchPadModeByte function. + */ + if (sc->flags & SYN_FLAG_HAS_EXTENDED_WMODE) { + cmd[0] = 0xe6; + (void)pckbport_poll_cmd(psc->sc_kbctag, psc->sc_kbcslot, + cmd, 1, 3, resp, 0); + cmd[0] = 0xe8; + (void)pckbport_poll_cmd(psc->sc_kbctag, psc->sc_kbcslot, + cmd, 1, 3, resp, 0); + cmd[0] = 0x00; + (void)pckbport_poll_cmd(psc->sc_kbctag, psc->sc_kbcslot, + cmd, 1, 3, resp, 0); + cmd[0] = 0xe8; + (void)pckbport_poll_cmd(psc->sc_kbctag, psc->sc_kbcslot, + cmd, 1, 3, resp, 0); + cmd[0] = 0x00; + (void)pckbport_poll_cmd(psc->sc_kbctag, psc->sc_kbcslot, + cmd, 1, 3, resp, 0); + cmd[0] = 0xe8; + (void)pckbport_poll_cmd(psc->sc_kbctag, psc->sc_kbcslot, + cmd, 1, 3, resp, 0); + cmd[0] = 0x00; + (void)pckbport_poll_cmd(psc->sc_kbctag, psc->sc_kbcslot, + cmd, 1, 3, resp, 0); + cmd[0] = 0xe8; + (void)pckbport_poll_cmd(psc->sc_kbctag, psc->sc_kbcslot, + cmd, 1, 3, resp, 0); + cmd[0] = 0x03; + (void)pckbport_poll_cmd(psc->sc_kbctag, psc->sc_kbcslot, + cmd, 1, 3, resp, 0); + cmd[0] = 0xf3; + (void)pckbport_poll_cmd(psc->sc_kbctag, psc->sc_kbcslot, + cmd, 1, 3, resp, 0); + cmd[0] = 0xc8; + (void)pckbport_poll_cmd(psc->sc_kbctag, psc->sc_kbcslot, + cmd, 1, 3, resp, 0); + } + synaptics_poll_cmd(psc, PMS_DEV_ENABLE, 0); sc->up_down = 0;
CVS commit: src/sys/dev/pckbport
Module Name:src Committed By: ryoon Date: Wed May 30 13:20:39 UTC 2018 Modified Files: src/sys/dev/pckbport: synaptics.c Log Message: Remove double and trailing whitespaces To generate a diff of this commit: cvs rdiff -u -r1.37 -r1.38 src/sys/dev/pckbport/synaptics.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/synaptics.c diff -u src/sys/dev/pckbport/synaptics.c:1.37 src/sys/dev/pckbport/synaptics.c:1.38 --- src/sys/dev/pckbport/synaptics.c:1.37 Tue May 29 11:38:24 2018 +++ src/sys/dev/pckbport/synaptics.c Wed May 30 13:20:39 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: synaptics.c,v 1.37 2018/05/29 11:38:24 ryoon Exp $ */ +/* $NetBSD: synaptics.c,v 1.38 2018/05/30 13:20:39 ryoon Exp $ */ /* * Copyright (c) 2005, Steve C. Woodford @@ -48,7 +48,7 @@ #include "opt_pms.h" #include -__KERNEL_RCSID(0, "$NetBSD: synaptics.c,v 1.37 2018/05/29 11:38:24 ryoon Exp $"); +__KERNEL_RCSID(0, "$NetBSD: synaptics.c,v 1.38 2018/05/30 13:20:39 ryoon Exp $"); #include #include @@ -451,7 +451,7 @@ pms_synaptics_enable(void *vsc) enable_modes = SYNAPTICS_MODE_ABSOLUTE | SYNAPTICS_MODE_W | SYNAPTICS_MODE_RATE; - if (sc->flags & SYN_FLAG_HAS_EXTENDED_WMODE) + if (sc->flags & SYN_FLAG_HAS_EXTENDED_WMODE) enable_modes |= SYNAPTICS_MODE_EXTENDED_W; /* @@ -823,7 +823,7 @@ pms_sysctl_synaptics_verify(SYSCTLFN_ARG return (EINVAL); } else if (node.sysctl_num == synaptics_button_boundary_nodenum) { - if (t < 0 || t < SYNAPTICS_EDGE_BOTTOM || + if (t < 0 || t < SYNAPTICS_EDGE_BOTTOM || t > SYNAPTICS_EDGE_TOP) return (EINVAL); } else @@ -862,7 +862,7 @@ pms_synaptics_parse(struct pms_softc *ps ((psc->packet[0] & 0x04) >> 1) + ((psc->packet[3] & 0x04) >> 2); sp.sp_finger = 0; - if (sp.sp_w == SYNAPTICS_WIDTH_EXTENDED_W) { + if (sp.sp_w == SYNAPTICS_WIDTH_EXTENDED_W) { ew_mode = psc->packet[5] >> 4; switch (ew_mode) { @@ -936,7 +936,7 @@ pms_synaptics_parse(struct pms_softc *ps new_buttons = 0; if(sc->flags & SYN_FLAG_HAS_ONE_BUTTON_CLICKPAD) { /* This is not correctly specified. Read this button press - * from L/U bit. Emulate 3 buttons by checking the + * from L/U bit. Emulate 3 buttons by checking the * coordinates of the click and returning the appropriate * button code. Outside the button region default to a * left click.
CVS commit: src/sys/dev/pckbport
Module Name:src Committed By: ryoon Date: Tue May 29 11:38:24 UTC 2018 Modified Files: src/sys/dev/pckbport: synaptics.c Log Message: Remove trailing tab To generate a diff of this commit: cvs rdiff -u -r1.36 -r1.37 src/sys/dev/pckbport/synaptics.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/synaptics.c diff -u src/sys/dev/pckbport/synaptics.c:1.36 src/sys/dev/pckbport/synaptics.c:1.37 --- src/sys/dev/pckbport/synaptics.c:1.36 Tue Dec 5 18:04:21 2017 +++ src/sys/dev/pckbport/synaptics.c Tue May 29 11:38:24 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: synaptics.c,v 1.36 2017/12/05 18:04:21 jmcneill Exp $ */ +/* $NetBSD: synaptics.c,v 1.37 2018/05/29 11:38:24 ryoon Exp $ */ /* * Copyright (c) 2005, Steve C. Woodford @@ -48,7 +48,7 @@ #include "opt_pms.h" #include -__KERNEL_RCSID(0, "$NetBSD: synaptics.c,v 1.36 2017/12/05 18:04:21 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: synaptics.c,v 1.37 2018/05/29 11:38:24 ryoon Exp $"); #include #include @@ -469,7 +469,7 @@ pms_synaptics_enable(void *vsc) aprint_error("synaptics: set mode error\n"); synaptics_poll_cmd(psc, PMS_SET_SAMPLE, SYNAPTICS_CMD_SET_MODE2, 0); - + /* a couple of set scales to clear out pending commands */ for (int i = 0; i < 2; i++) synaptics_poll_cmd(psc, PMS_SET_SCALE11, 0);
CVS commit: src/sys/dev/pckbport
Module Name:src Committed By: jmcneill Date: Tue Dec 5 18:04:21 UTC 2017 Modified Files: src/sys/dev/pckbport: synaptics.c Log Message: Add hw.synaptics.movement_enable sysctl. Default value is 1, but if set to 0 disables movement events from the touchpad. While here, fixup a few sysctl nodenum comparisons in pms_sysctl_synaptics_verify to compare against node numbers instead of values. To generate a diff of this commit: cvs rdiff -u -r1.35 -r1.36 src/sys/dev/pckbport/synaptics.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/synaptics.c diff -u src/sys/dev/pckbport/synaptics.c:1.35 src/sys/dev/pckbport/synaptics.c:1.36 --- src/sys/dev/pckbport/synaptics.c:1.35 Tue Nov 7 12:39:07 2017 +++ src/sys/dev/pckbport/synaptics.c Tue Dec 5 18:04:21 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: synaptics.c,v 1.35 2017/11/07 12:39:07 ryoon Exp $ */ +/* $NetBSD: synaptics.c,v 1.36 2017/12/05 18:04:21 jmcneill Exp $ */ /* * Copyright (c) 2005, Steve C. Woodford @@ -48,7 +48,7 @@ #include "opt_pms.h" #include -__KERNEL_RCSID(0, "$NetBSD: synaptics.c,v 1.35 2017/11/07 12:39:07 ryoon Exp $"); +__KERNEL_RCSID(0, "$NetBSD: synaptics.c,v 1.36 2017/12/05 18:04:21 jmcneill Exp $"); #include #include @@ -118,6 +118,7 @@ static int synaptics_scale_y = 16; static int synaptics_max_speed_x = 32; static int synaptics_max_speed_y = 32; static int synaptics_movement_threshold = 4; +static int synaptics_movement_enable = 1; /* Sysctl nodes. */ static int synaptics_button_boundary_nodenum; @@ -140,6 +141,7 @@ static int synaptics_scale_y_nodenum; static int synaptics_max_speed_x_nodenum; static int synaptics_max_speed_y_nodenum; static int synaptics_movement_threshold_nodenum; +static int synaptics_movement_enable_nodenum; static int synaptics_poll_cmd(struct pms_softc *psc, ...) @@ -714,6 +716,18 @@ pms_sysctl_synaptics(struct sysctllog ** if ((rc = sysctl_createv(clog, 0, NULL, , CTLFLAG_PERMANENT | CTLFLAG_READWRITE, + CTLTYPE_INT, "movement_enable", + SYSCTL_DESCR("Enable movement reporting"), + pms_sysctl_synaptics_verify, 0, + _movement_enable, + 0, CTL_HW, root_num, CTL_CREATE, + CTL_EOL)) != 0) + goto err; + + synaptics_movement_enable_nodenum = node->sysctl_num; + + if ((rc = sysctl_createv(clog, 0, NULL, , + CTLFLAG_PERMANENT | CTLFLAG_READWRITE, CTLTYPE_INT, "button_boundary", SYSCTL_DESCR("Top edge of button area"), pms_sysctl_synaptics_verify, 0, @@ -808,16 +822,20 @@ pms_sysctl_synaptics_verify(SYSCTLFN_ARG if (t < 0 || t > (SYNAPTICS_EDGE_MAX / 4)) return (EINVAL); } else - if (node.sysctl_num == synaptics_button_boundary) { + if (node.sysctl_num == synaptics_button_boundary_nodenum) { if (t < 0 || t < SYNAPTICS_EDGE_BOTTOM || t > SYNAPTICS_EDGE_TOP) return (EINVAL); } else - if (node.sysctl_num == synaptics_button2 || - node.sysctl_num == synaptics_button3) { + if (node.sysctl_num == synaptics_button2_nodenum || + node.sysctl_num == synaptics_button3_nodenum) { if (t < SYNAPTICS_EDGE_LEFT || t > SYNAPTICS_EDGE_RIGHT) return (EINVAL); } else + if (node.sysctl_num == synaptics_movement_enable_nodenum) { + if (t < 0 || t > 1) + return (EINVAL); + } else return (EINVAL); *(int *)rnode->sysctl_data = t; @@ -1558,7 +1576,7 @@ pms_synaptics_process_packet(struct pms_ * Do movement processing IFF we have a single finger and no palm or * a secondary finger and no palm. */ - if (palm == 0) { + if (palm == 0 && synaptics_movement_enable) { if (fingers == 1) { synaptics_movement(sc, sp, sp->sp_finger, , ); } else {
CVS commit: src/sys/dev/pckbport
Module Name:src Committed By: ryoon Date: Tue Nov 7 12:39:07 UTC 2017 Modified Files: src/sys/dev/pckbport: synaptics.c Log Message: Return res in non-synaptics case like before. Fix ALPS case To generate a diff of this commit: cvs rdiff -u -r1.34 -r1.35 src/sys/dev/pckbport/synaptics.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/synaptics.c diff -u src/sys/dev/pckbport/synaptics.c:1.34 src/sys/dev/pckbport/synaptics.c:1.35 --- src/sys/dev/pckbport/synaptics.c:1.34 Mon Nov 6 21:07:17 2017 +++ src/sys/dev/pckbport/synaptics.c Tue Nov 7 12:39:07 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: synaptics.c,v 1.34 2017/11/06 21:07:17 blymn Exp $ */ +/* $NetBSD: synaptics.c,v 1.35 2017/11/07 12:39:07 ryoon Exp $ */ /* * Copyright (c) 2005, Steve C. Woodford @@ -48,7 +48,7 @@ #include "opt_pms.h" #include -__KERNEL_RCSID(0, "$NetBSD: synaptics.c,v 1.34 2017/11/06 21:07:17 blymn Exp $"); +__KERNEL_RCSID(0, "$NetBSD: synaptics.c,v 1.35 2017/11/07 12:39:07 ryoon Exp $"); #include #include @@ -316,7 +316,8 @@ pms_synaptics_probe_init(void *vsc) * Reset device in case the probe confused it. */ doreset: - return synaptics_poll_reset(psc); + (void)synaptics_poll_reset(psc); + return res; } if (resp[1] != SYNAPTICS_MAGIC_BYTE) {
CVS commit: src/sys/dev/pckbport
Module Name:src Committed By: blymn Date: Mon Nov 6 21:07:17 UTC 2017 Modified Files: src/sys/dev/pckbport: synaptics.c synapticsreg.h synapticsvar.h Log Message: Add two finger support and middle/right button emulation. To generate a diff of this commit: cvs rdiff -u -r1.33 -r1.34 src/sys/dev/pckbport/synaptics.c cvs rdiff -u -r1.8 -r1.9 src/sys/dev/pckbport/synapticsreg.h cvs rdiff -u -r1.6 -r1.7 src/sys/dev/pckbport/synapticsvar.h 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/synaptics.c diff -u src/sys/dev/pckbport/synaptics.c:1.33 src/sys/dev/pckbport/synaptics.c:1.34 --- src/sys/dev/pckbport/synaptics.c:1.33 Wed Mar 4 22:58:35 2015 +++ src/sys/dev/pckbport/synaptics.c Mon Nov 6 21:07:17 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: synaptics.c,v 1.33 2015/03/04 22:58:35 christos Exp $ */ +/* $NetBSD: synaptics.c,v 1.34 2017/11/06 21:07:17 blymn Exp $ */ /* * Copyright (c) 2005, Steve C. Woodford @@ -48,7 +48,7 @@ #include "opt_pms.h" #include -__KERNEL_RCSID(0, "$NetBSD: synaptics.c,v 1.33 2015/03/04 22:58:35 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: synaptics.c,v 1.34 2017/11/06 21:07:17 blymn Exp $"); #include #include @@ -80,6 +80,10 @@ struct synaptics_packet { signed short sp_y; u_char sp_z; /* Z (pressure) */ u_char sp_w; /* W (contact patch width) */ + signed short sp_sx; /* Secondary finger unscaled absolute */ +/* X/Y coordinates */ + signed short sp_xy; + u_char sp_finger; /* 0 for primary, 1 for secondary */ char sp_left; /* Left mouse button status */ char sp_right; /* Right mouse button status */ char sp_middle; /* Middle button status (possibly emulated) */ @@ -105,6 +109,9 @@ static int synaptics_edge_bottom = SYNAP static int synaptics_edge_motion_delta = 32; static u_int synaptics_finger_high = SYNAPTICS_FINGER_LIGHT + 5; static u_int synaptics_finger_low = SYNAPTICS_FINGER_LIGHT - 10; +static int synaptics_button_boundary = SYNAPTICS_EDGE_BOTTOM + 720; +static int synaptics_button2 = SYNAPTICS_EDGE_LEFT + (SYNAPTICS_EDGE_RIGHT - SYNAPTICS_EDGE_LEFT) / 3; +static int synaptics_button3 = SYNAPTICS_EDGE_LEFT + 2 * (SYNAPTICS_EDGE_RIGHT - SYNAPTICS_EDGE_LEFT) / 3; static int synaptics_two_fingers_emul = 0; static int synaptics_scale_x = 16; static int synaptics_scale_y = 16; @@ -113,6 +120,9 @@ static int synaptics_max_speed_y = 32; static int synaptics_movement_threshold = 4; /* Sysctl nodes. */ +static int synaptics_button_boundary_nodenum; +static int synaptics_button2_nodenum; +static int synaptics_button3_nodenum; static int synaptics_up_down_emul_nodenum; static int synaptics_up_down_motion_delta_nodenum; static int synaptics_gesture_move_nodenum; @@ -131,11 +141,56 @@ static int synaptics_max_speed_x_nodenum static int synaptics_max_speed_y_nodenum; static int synaptics_movement_threshold_nodenum; +static int +synaptics_poll_cmd(struct pms_softc *psc, ...) +{ + u_char cmd[4]; + size_t i; + va_list ap; + + va_start(ap, psc); + + for (i = 0; i < __arraycount(cmd); i++) + if ((cmd[i] = (u_char)va_arg(ap, int)) == 0) + break; + va_end(ap); + + int res = pckbport_poll_cmd(psc->sc_kbctag, psc->sc_kbcslot, cmd, i, 0, + NULL, 0); + if (res) + aprint_error_dev(psc->sc_dev, "command error %#x\n", cmd[0]); + return res; +} + +static int +synaptics_poll_reset(struct pms_softc *psc) +{ + u_char resp[2]; + int res; + + u_char cmd[1] = { PMS_RESET }; + res = pckbport_poll_cmd(psc->sc_kbctag, psc->sc_kbcslot, cmd, 1, 2, + resp, 1); + aprint_debug_dev(psc->sc_dev, "reset %d 0x%02x 0x%02x\n", + res, resp[0], resp[1]); + return res; +} + +static int +synaptics_poll_status(struct pms_softc *psc, u_char slice, u_char resp[3]) +{ + u_char cmd[1] = { PMS_SEND_DEV_STATUS }; + int res = pms_sliced_command(psc->sc_kbctag, psc->sc_kbcslot, slice); + + return res | pckbport_poll_cmd(psc->sc_kbctag, psc->sc_kbcslot, + cmd, 1, 3, resp, 0); +} + static void pms_synaptics_probe_extended(struct pms_softc *psc) { struct synaptics_softc *sc = >u.synaptics; - u_char cmd[1], resp[3]; + u_char resp[3]; int res; aprint_debug_dev(psc->sc_dev, @@ -156,11 +211,7 @@ pms_synaptics_probe_extended(struct pms_ if (((sc->caps & SYNAPTICS_CAP_EXTNUM) + 0x08) >= SYNAPTICS_EXTENDED_QUERY) { - res = pms_sliced_command(psc->sc_kbctag, - psc->sc_kbcslot, SYNAPTICS_EXTENDED_QUERY); - cmd[0] = PMS_SEND_DEV_STATUS; - res |= pckbport_poll_cmd(psc->sc_kbctag, - psc->sc_kbcslot, cmd, 1, 3, resp, 0); + res = synaptics_poll_status(psc, SYNAPTICS_EXTENDED_QUERY, resp); if (res == 0) { int buttons = (resp[1] >> 4); aprint_debug_dev(psc->sc_dev, @@ -192,11 +243,9 @@ pms_synaptics_probe_extended(struct pms_ if (((sc->caps & SYNAPTICS_CAP_EXTNUM) + 0x08) >= SYNAPTICS_CONTINUED_CAPABILITIES) { - res = pms_sliced_command(psc->sc_kbctag, - psc->sc_kbcslot,
CVS commit: src/sys/dev/pckbport
Module Name:src Committed By: nat Date: Wed Aug 16 21:18:58 UTC 2017 Modified Files: src/sys/dev/pckbport: alps.c Log Message: Remove extra newline. To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 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.3 src/sys/dev/pckbport/alps.c:1.4 --- src/sys/dev/pckbport/alps.c:1.3 Wed Aug 16 21:09:48 2017 +++ src/sys/dev/pckbport/alps.c Wed Aug 16 21:18:58 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: alps.c,v 1.3 2017/08/16 21:09:48 nat Exp $ */ +/* $NetBSD: alps.c,v 1.4 2017/08/16 21:18:58 nat Exp $ */ /*- * Copyright (c) 2017 Ryo ONODERA@@ -30,7 +30,7 @@ #include "opt_pms.h" #include -__KERNEL_RCSID(0, "$NetBSD: alps.c,v 1.3 2017/08/16 21:09:48 nat Exp $"); +__KERNEL_RCSID(0, "$NetBSD: alps.c,v 1.4 2017/08/16 21:18:58 nat Exp $"); #include #include @@ -687,7 +687,6 @@ pms_alps_probe_init(void *opaque) int res; u_char cmd[1], resp[3]; - sc->last_x1 = 0; sc->last_y1 = 0; sc->last_x2 = 0;
CVS commit: src/sys/dev/pckbport
Module Name:src Committed By: nat Date: Wed Aug 16 21:09:48 UTC 2017 Modified Files: src/sys/dev/pckbport: alps.c Log Message: If ALPS probe fails, send a PMS_RESET. Restores functionality on a wrong version ALPS touchpad. Addresses PR kern/52489. This patch was prepared by/committed on behalf of maya@. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 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.2 src/sys/dev/pckbport/alps.c:1.3 --- src/sys/dev/pckbport/alps.c:1.2 Tue Aug 15 22:23:09 2017 +++ src/sys/dev/pckbport/alps.c Wed Aug 16 21:09:48 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: alps.c,v 1.2 2017/08/15 22:23:09 ryoon Exp $ */ +/* $NetBSD: alps.c,v 1.3 2017/08/16 21:09:48 nat Exp $ */ /*- * Copyright (c) 2017 Ryo ONODERA@@ -30,7 +30,7 @@ #include "opt_pms.h" #include -__KERNEL_RCSID(0, "$NetBSD: alps.c,v 1.2 2017/08/15 22:23:09 ryoon Exp $"); +__KERNEL_RCSID(0, "$NetBSD: alps.c,v 1.3 2017/08/16 21:09:48 nat Exp $"); #include #include @@ -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; }
CVS commit: src/sys/dev/pckbport
Module Name:src Committed By: ryoon Date: Tue Aug 15 22:23:09 UTC 2017 Modified Files: src/sys/dev/pckbport: alps.c Log Message: Do not print ALPS related message when generic PS/2 case To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 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.1 src/sys/dev/pckbport/alps.c:1.2 --- src/sys/dev/pckbport/alps.c:1.1 Sun Aug 13 08:49:27 2017 +++ src/sys/dev/pckbport/alps.c Tue Aug 15 22:23:09 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: alps.c,v 1.1 2017/08/13 08:49:27 christos Exp $ */ +/* $NetBSD: alps.c,v 1.2 2017/08/15 22:23:09 ryoon Exp $ */ /*- * Copyright (c) 2017 Ryo ONODERA@@ -30,7 +30,7 @@ #include "opt_pms.h" #include -__KERNEL_RCSID(0, "$NetBSD: alps.c,v 1.1 2017/08/13 08:49:27 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: alps.c,v 1.2 2017/08/15 22:23:09 ryoon Exp $"); #include #include @@ -695,7 +695,7 @@ pms_alps_probe_init(void *opaque) pckbport_flush(psc->sc_kbctag, psc->sc_kbcslot); if ((res = pms_alps_e6sig(psc, e6sig)) != 0) - goto err; + return res; /* This is not ALPS device */ if ((res = pms_alps_e7sig(psc, e7sig)) != 0) goto err;
CVS commit: src/sys/dev/pckbport
Module Name:src Committed By: christos Date: Sun Aug 13 08:49:27 UTC 2017 Modified Files: src/sys/dev/pckbport: files.pckbport pms.c pmsvar.h Added Files: src/sys/dev/pckbport: alps.c alpsreg.h alpsvar.h Log Message: PR/52483: Ryo ONODERA: Add support for ALPS PS/2 pointing devices To generate a diff of this commit: cvs rdiff -u -r0 -r1.1 src/sys/dev/pckbport/alps.c \ src/sys/dev/pckbport/alpsreg.h src/sys/dev/pckbport/alpsvar.h cvs rdiff -u -r1.8 -r1.9 src/sys/dev/pckbport/files.pckbport cvs rdiff -u -r1.35 -r1.36 src/sys/dev/pckbport/pms.c cvs rdiff -u -r1.11 -r1.12 src/sys/dev/pckbport/pmsvar.h 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/files.pckbport diff -u src/sys/dev/pckbport/files.pckbport:1.8 src/sys/dev/pckbport/files.pckbport:1.9 --- src/sys/dev/pckbport/files.pckbport:1.8 Wed Sep 7 15:05:13 2011 +++ src/sys/dev/pckbport/files.pckbport Sun Aug 13 04:49:27 2017 @@ -1,4 +1,4 @@ -# $NetBSD: files.pckbport,v 1.8 2011/09/07 19:05:13 jakllsch Exp $ +# $NetBSD: files.pckbport,v 1.9 2017/08/13 08:49:27 christos Exp $ # devices attached at pckbport, for use with wscons defflag opt_wskbdmap.h WSKBD_USONLY @@ -16,8 +16,10 @@ defflag PCKBD_CNATTACH_MAY_FAIL obsolete defflag opt_pms.h PMS_DISABLE_POWERHOOK defflag opt_pms.h PMS_SYNAPTICS_TOUCHPAD defflag opt_pms.h PMS_ELANTECH_TOUCHPAD +defflag opt_pms.h PMS_ALPS_TOUCHPAD device pms: wsmousedev attach pms at pckbport file dev/pckbport/pms.c pms file dev/pckbport/synaptics.c pms & pms_synaptics_touchpad file dev/pckbport/elantech.c pms & pms_elantech_touchpad +file dev/pckbport/alps.c pms & pms_alps_touchpad Index: src/sys/dev/pckbport/pms.c diff -u src/sys/dev/pckbport/pms.c:1.35 src/sys/dev/pckbport/pms.c:1.36 --- src/sys/dev/pckbport/pms.c:1.35 Fri Sep 9 10:29:47 2011 +++ src/sys/dev/pckbport/pms.c Sun Aug 13 04:49:27 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: pms.c,v 1.35 2011/09/09 14:29:47 jakllsch Exp $ */ +/* $NetBSD: pms.c,v 1.36 2017/08/13 08:49:27 christos Exp $ */ /*- * Copyright (c) 2004 Kentaro Kurahone. @@ -26,7 +26,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: pms.c,v 1.35 2011/09/09 14:29:47 jakllsch Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pms.c,v 1.36 2017/08/13 08:49:27 christos Exp $"); #include "opt_pms.h" @@ -46,6 +46,9 @@ __KERNEL_RCSID(0, "$NetBSD: pms.c,v 1.35 #ifdef PMS_ELANTECH_TOUCHPAD #include #endif +#ifdef PMS_ALPS_TOUCHPAD +#include +#endif #include #include @@ -207,6 +210,11 @@ pmsattach(device_t parent, device_t self sc->protocol = PMS_ELANTECH; } else #endif +#ifdef PMS_ALPS_TOUCHPAD + if (pms_alps_probe_init(sc) == 0) { + sc->protocol = PMS_ALPS; + } else +#endif /* Install generic handler. */ pckbport_set_inputhandler(sc->sc_kbctag, sc->sc_kbcslot, pmsinput, sc, device_xname(sc->sc_dev)); @@ -255,6 +263,10 @@ do_enable(struct pms_softc *sc) if (sc->protocol == PMS_ELANTECH) pms_elantech_enable(sc); #endif +#ifdef PMS_ALPS_TOUCHPAD + if (sc->protocol == PMS_ALPS) + pms_alps_enable(sc); +#endif cmd[0] = PMS_DEV_ENABLE; res = pckbport_enqueue_cmd(sc->sc_kbctag, sc->sc_kbcslot, cmd, @@ -371,6 +383,14 @@ pms_resume(device_t dv, const pmf_qual_t } } else #endif +#ifdef PMS_ALPS_TOUCHPAD + if (sc->protocol == PMS_ALPS) { + pms_alps_resume(sc); + if (sc->sc_enabled) { + do_enable(sc); + } + } else +#endif if (sc->sc_enabled) { /* recheck protocol & init mouse */ sc->protocol = PMS_UNKNOWN; @@ -445,7 +465,8 @@ pms_reset_thread(void *arg) } /* For the synaptics and elantech case, leave the protocol alone. */ - if (sc->protocol != PMS_SYNAPTICS && sc->protocol != PMS_ELANTECH) + if (sc->protocol != PMS_SYNAPTICS && sc->protocol != PMS_ELANTECH + && sc->protocol != PMS_ALPS) sc->protocol = PMS_UNKNOWN; pms_enable(sc); Index: src/sys/dev/pckbport/pmsvar.h diff -u src/sys/dev/pckbport/pmsvar.h:1.11 src/sys/dev/pckbport/pmsvar.h:1.12 --- src/sys/dev/pckbport/pmsvar.h:1.11 Fri Sep 9 10:29:47 2011 +++ src/sys/dev/pckbport/pmsvar.h Sun Aug 13 04:49:27 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: pmsvar.h,v 1.11 2011/09/09 14:29:47 jakllsch Exp $ */ +/* $NetBSD: pmsvar.h,v 1.12 2017/08/13 08:49:27 christos Exp $ */ /*- * Copyright (c) 2004 Kentaro Kurahone. @@ -30,6 +30,7 @@ #include #include +#include enum pms_type { PMS_UNKNOWN, @@ -37,7 +38,8 @@ enum pms_type { PMS_SCROLL3, PMS_SCROLL5, PMS_SYNAPTICS, - PMS_ELANTECH + PMS_ELANTECH, + PMS_ALPS }; struct pms_protocol { @@ -62,7 +64,8 @@ struct pms_softc { /* driver status inf device_t sc_wsmousedev; struct lwp *sc_event_thread; -#if defined(PMS_SYNAPTICS_TOUCHPAD) || defined(PMS_ELANTECH_TOUCHPAD) +#if defined(PMS_SYNAPTICS_TOUCHPAD) || defined(PMS_ELANTECH_TOUCHPAD) \ + || defined(PMS_ALPS_TOUCHPAD) union { #ifdef PMS_SYNAPTICS_TOUCHPAD struct synaptics_softc synaptics; @@ -70,6 +73,9 @@
CVS commit: src/sys/dev/pckbport
Module Name:src Committed By: prlw1 Date: Thu Jul 16 15:01:04 UTC 2015 Modified Files: src/sys/dev/pckbport: pckbd.c Log Message: Disambiguate debug message. To generate a diff of this commit: cvs rdiff -u -r1.31 -r1.32 src/sys/dev/pckbport/pckbd.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/pckbd.c diff -u src/sys/dev/pckbport/pckbd.c:1.31 src/sys/dev/pckbport/pckbd.c:1.32 --- src/sys/dev/pckbport/pckbd.c:1.31 Sun Sep 15 09:24:05 2013 +++ src/sys/dev/pckbport/pckbd.c Thu Jul 16 15:01:04 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: pckbd.c,v 1.31 2013/09/15 09:24:05 martin Exp $ */ +/* $NetBSD: pckbd.c,v 1.32 2015/07/16 15:01:04 prlw1 Exp $ */ /*- * Copyright (c) 1998, 2009 The NetBSD Foundation, Inc. @@ -68,7 +68,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: pckbd.c,v 1.31 2013/09/15 09:24:05 martin Exp $); +__KERNEL_RCSID(0, $NetBSD: pckbd.c,v 1.32 2015/07/16 15:01:04 prlw1 Exp $); #include sys/param.h #include sys/systm.h @@ -288,10 +288,9 @@ pckbd_resume(device_t dv, const pmf_qual res = pckbport_poll_cmd(sc-id-t_kbctag, sc-id-t_kbcslot, cmd, 1, 1, resp, 1); if (res) - aprint_debug(pckbdprobe: reset error %d\n, res); + aprint_debug(%s: reset error %d\n, __func__, res); if (resp[0] != KBR_RSTDONE) - printf(pckbdprobe: reset response 0x%x\n, - resp[0]); + printf(%s: reset response 0x%x\n, __func__, resp[0]); pckbport_flush(sc-id-t_kbctag, sc-id-t_kbcslot);
CVS commit: src/sys/dev/pckbport
Module Name:src Committed By: christos Date: Wed Mar 4 22:58:36 UTC 2015 Modified Files: src/sys/dev/pckbport: synaptics.c Log Message: Fix clickpad button detection (From Rhialto) To generate a diff of this commit: cvs rdiff -u -r1.32 -r1.33 src/sys/dev/pckbport/synaptics.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/synaptics.c diff -u src/sys/dev/pckbport/synaptics.c:1.32 src/sys/dev/pckbport/synaptics.c:1.33 --- src/sys/dev/pckbport/synaptics.c:1.32 Thu May 22 21:11:29 2014 +++ src/sys/dev/pckbport/synaptics.c Wed Mar 4 17:58:35 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: synaptics.c,v 1.32 2014/05/23 01:11:29 christos Exp $ */ +/* $NetBSD: synaptics.c,v 1.33 2015/03/04 22:58:35 christos Exp $ */ /* * Copyright (c) 2005, Steve C. Woodford @@ -48,7 +48,7 @@ #include opt_pms.h #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: synaptics.c,v 1.32 2014/05/23 01:11:29 christos Exp $); +__KERNEL_RCSID(0, $NetBSD: synaptics.c,v 1.33 2015/03/04 22:58:35 christos Exp $); #include sys/param.h #include sys/systm.h @@ -197,18 +197,46 @@ pms_synaptics_probe_extended(struct pms_ cmd[0] = PMS_SEND_DEV_STATUS; res |= pckbport_poll_cmd(psc-sc_kbctag, psc-sc_kbcslot, cmd, 1, 3, resp, 0); +/* + * The following describes response for the + * SYNAPTICS_CONTINUED_CAPABILITIES query. + * + * byte mask name meaning + * --- + * 0 0x01 adjustable threshold capacitive button sensitivity + * can be adjusted + * 0 0x02 report max query 0x0d gives max coord reported + * 0 0x04 clearpad sensor is ClearPad product + * 0 0x08 advanced gesture not particularly meaningful + * 0 0x10 clickpad bit 0 1-button ClickPad + * 0 0x60 multifinger mode identifies firmware finger counting + * (not reporting!) algorithm. + * Not particularly meaningful + * 0 0x80 covered pad W clipped to 14, 15 == pad mostly covered + * 1 0x01 clickpad bit 1 2-button ClickPad + * 1 0x02 deluxe LED controls touchpad support LED commands + * ala multimedia control bar + * 1 0x04 reduced filtering firmware does less filtering on + * position data, driver should watch + * for noise. + * 1 0x08 image sensor image sensor tracks 5 fingers, but only + * reports 2. + * 1 0x01 uniform clickpad whole clickpad moves instead of being + * hinged at the top. + * 1 0x20 report min query 0x0f gives min coord reported + */ if (res == 0) { - u_char clickpad_type = (resp[1] 0x1); - clickpad_type |= ((resp[0] 4) 0x1); + u_char clickpad_type = (resp[0] 0x10); + clickpad_type |= (resp[1] 0x01); aprint_debug_dev(psc-sc_dev, %s: Continued Capabilities 0x%02x 0x%02x 0x%02x.\n, __func__, resp[0], resp[1], resp[2]); switch (clickpad_type) { - case 1: + case 0x10: sc-flags |= SYN_FLAG_HAS_ONE_BUTTON_CLICKPAD; break; - case 2: + case 0x01: sc-flags |= SYN_FLAG_HAS_TWO_BUTTON_CLICKPAD; break; default:
CVS commit: src/sys/dev/pckbport
Module Name:src Committed By: riastradh Date: Wed Jun 11 20:09:17 UTC 2014 Modified Files: src/sys/dev/pckbport: wskbdmap_mfii.c Log Message: Nuke trailing whitespace. To generate a diff of this commit: cvs rdiff -u -r1.23 -r1.24 src/sys/dev/pckbport/wskbdmap_mfii.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/wskbdmap_mfii.c diff -u src/sys/dev/pckbport/wskbdmap_mfii.c:1.23 src/sys/dev/pckbport/wskbdmap_mfii.c:1.24 --- src/sys/dev/pckbport/wskbdmap_mfii.c:1.23 Sat Oct 13 17:51:51 2012 +++ src/sys/dev/pckbport/wskbdmap_mfii.c Wed Jun 11 20:09:17 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: wskbdmap_mfii.c,v 1.23 2012/10/13 17:51:51 jdc Exp $ */ +/* $NetBSD: wskbdmap_mfii.c,v 1.24 2014/06/11 20:09:17 riastradh Exp $ */ /*- * Copyright (c) 1997 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: wskbdmap_mfii.c,v 1.23 2012/10/13 17:51:51 jdc Exp $); +__KERNEL_RCSID(0, $NetBSD: wskbdmap_mfii.c,v 1.24 2014/06/11 20:09:17 riastradh Exp $); #include opt_wskbdmap.h #include sys/types.h @@ -307,7 +307,7 @@ static const keysym_t pckbd_keydesc_sg[] KC(53), KS_minus, KS_underscore, KC(86), KS_less, KS_greater, KS_backslash, KC(184), KS_Mode_switch,KS_Multi_key, -}; +}; static const keysym_t pckbd_keydesc_sg_nodead[] = { /* pos normal shifted altgr shift-altgr */ @@ -516,21 +516,21 @@ static const keysym_t pckbd_keydesc_es[] KC(184), KS_Mode_switch, KS_Multi_key, }; -static const keysym_t pckbd_keydesc_cz[] = { -/* pos normal shifted altgr shift-altgr */ -KC(2), KS_plus, KS_1, KS_asciitilde, -KC(3), KS_ecaron, KS_2, KS_dead_caron, -KC(4), KS_scaron, KS_3, KS_dead_circumflex, -KC(5), KS_ccaron, KS_4, KS_dead_breve, -KC(6), KS_rcaron, KS_5, KS_dead_abovering, -KC(7), KS_zcaron, KS_6, KS_dead_ogonek, -KC(8), KS_yacute, KS_7, KS_dead_grave, -KC(9), KS_aacute, KS_8, KS_dead_dotaccent, -KC(10), KS_iacute, KS_9, KS_dead_acute, -KC(11), KS_eacute, KS_0, KS_dead_hungarumlaut, +static const keysym_t pckbd_keydesc_cz[] = { +/* pos normal shifted altgr shift-altgr */ +KC(2), KS_plus, KS_1, KS_asciitilde, +KC(3), KS_ecaron, KS_2, KS_dead_caron, +KC(4), KS_scaron, KS_3, KS_dead_circumflex, +KC(5), KS_ccaron, KS_4, KS_dead_breve, +KC(6), KS_rcaron, KS_5, KS_dead_abovering, +KC(7), KS_zcaron, KS_6, KS_dead_ogonek, +KC(8), KS_yacute, KS_7, KS_dead_grave, +KC(9), KS_aacute, KS_8, KS_dead_dotaccent, +KC(10), KS_iacute, KS_9, KS_dead_acute, +KC(11), KS_eacute, KS_0, KS_dead_hungarumlaut, KC(12), KS_equal, KS_percent, KS_dead_diaeresis, KC(13), KS_dead_acute, KS_dead_caron, KS_dead_cedilla, -KC(26), KS_uacute, KS_slash, +KC(26), KS_uacute, KS_slash, KC(27), KS_adiaeresis, KS_parenleft, KS_multiply, KC(39), KS_uabovering, KS_quotedbl, KS_dollar, KC(40), KS_section, KS_exclam, KS_ssharp, @@ -552,8 +552,8 @@ static const keysym_t pckbd_keydesc_cz[] KC(47), KS_v, KS_V, KS_at, KC(48), KS_b, KS_B, KS_braceleft, KC(49), KS_n, KS_N, KS_braceright, -KC(184), KS_Mode_switch,KS_Multi_key, -}; +KC(184), KS_Mode_switch,KS_Multi_key, +}; static const keysym_t pckbd_keydesc_pt[] = { /* pos normal shifted altgr shift-altgr */
CVS commit: src/sys/dev/pckbport
Module Name:src Committed By: christos Date: Fri May 23 01:11:29 UTC 2014 Modified Files: src/sys/dev/pckbport: synaptics.c synapticsreg.h synapticsvar.h Log Message: PR/48831: J�rg Grundmann: Synaptics Touch pad (ClickPad) and Klick-by-tap-gestures do not work To generate a diff of this commit: cvs rdiff -u -r1.31 -r1.32 src/sys/dev/pckbport/synaptics.c cvs rdiff -u -r1.7 -r1.8 src/sys/dev/pckbport/synapticsreg.h cvs rdiff -u -r1.5 -r1.6 src/sys/dev/pckbport/synapticsvar.h 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/synaptics.c diff -u src/sys/dev/pckbport/synaptics.c:1.31 src/sys/dev/pckbport/synaptics.c:1.32 --- src/sys/dev/pckbport/synaptics.c:1.31 Tue Feb 25 13:30:10 2014 +++ src/sys/dev/pckbport/synaptics.c Thu May 22 21:11:29 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: synaptics.c,v 1.31 2014/02/25 18:30:10 pooka Exp $ */ +/* $NetBSD: synaptics.c,v 1.32 2014/05/23 01:11:29 christos Exp $ */ /* * Copyright (c) 2005, Steve C. Woodford @@ -48,7 +48,7 @@ #include opt_pms.h #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: synaptics.c,v 1.31 2014/02/25 18:30:10 pooka Exp $); +__KERNEL_RCSID(0, $NetBSD: synaptics.c,v 1.32 2014/05/23 01:11:29 christos Exp $); #include sys/param.h #include sys/systm.h @@ -131,6 +131,93 @@ static int synaptics_max_speed_x_nodenum static int synaptics_max_speed_y_nodenum; static int synaptics_movement_threshold_nodenum; +static void +pms_synaptics_probe_extended(struct pms_softc *psc) +{ + struct synaptics_softc *sc = psc-u.synaptics; + u_char cmd[1], resp[3]; + int res; + + aprint_debug_dev(psc-sc_dev, + synaptics_probe: Capabilities 0x%04x.\n, sc-caps); + if (sc-caps SYNAPTICS_CAP_PASSTHROUGH) + sc-flags |= SYN_FLAG_HAS_PASSTHROUGH; + + if (sc-caps SYNAPTICS_CAP_PALMDETECT) + sc-flags |= SYN_FLAG_HAS_PALM_DETECT; + + if (sc-caps SYNAPTICS_CAP_MULTIDETECT) + sc-flags |= SYN_FLAG_HAS_MULTI_FINGER; + + if (sc-caps SYNAPTICS_CAP_MULTIFINGERREPORT) + sc-flags |= SYN_FLAG_HAS_MULTI_FINGER_REPORT; + + /* Ask about extra buttons to detect up/down. */ + if (((sc-caps SYNAPTICS_CAP_EXTNUM) + 0x08) + = SYNAPTICS_EXTENDED_QUERY) + { + res = pms_sliced_command(psc-sc_kbctag, + psc-sc_kbcslot, SYNAPTICS_EXTENDED_QUERY); + cmd[0] = PMS_SEND_DEV_STATUS; + res |= pckbport_poll_cmd(psc-sc_kbctag, + psc-sc_kbcslot, cmd, 1, 3, resp, 0); + if (res == 0) { + int buttons = (resp[1] 4); + aprint_debug_dev(psc-sc_dev, + %s: Extended Buttons: %d.\n, __func__, buttons); + + aprint_debug_dev(psc-sc_dev, %s: Extended + Capabilities: 0x%02x 0x%02x 0x%02x.\n, __func__, + resp[0], resp[1], resp[2]); + if (buttons = 2) { +/* Yes. */ +sc-flags |= SYN_FLAG_HAS_UP_DOWN_BUTTONS; + } + if (resp[0] 0x1) { +/* Vertical scroll area */ +sc-flags |= SYN_FLAG_HAS_VERTICAL_SCROLL; + } + if (resp[0] 0x2) { +/* Horizontal scroll area */ +sc-flags |= SYN_FLAG_HAS_HORIZONTAL_SCROLL; + } + if (resp[0] 0x4) { +/* Extended W-Mode */ +sc-flags |= SYN_FLAG_HAS_EXTENDED_WMODE; + } + } + } + + /* Ask about click pad */ + if (((sc-caps SYNAPTICS_CAP_EXTNUM) + 0x08) = + SYNAPTICS_CONTINUED_CAPABILITIES) + { + res = pms_sliced_command(psc-sc_kbctag, + psc-sc_kbcslot, SYNAPTICS_CONTINUED_CAPABILITIES); + cmd[0] = PMS_SEND_DEV_STATUS; + res |= pckbport_poll_cmd(psc-sc_kbctag, + psc-sc_kbcslot, cmd, 1, 3, resp, 0); + if (res == 0) { + u_char clickpad_type = (resp[1] 0x1); + clickpad_type |= ((resp[0] 4) 0x1); + + aprint_debug_dev(psc-sc_dev, %s: Continued + Capabilities 0x%02x 0x%02x 0x%02x.\n, __func__, + resp[0], resp[1], resp[2]); + switch (clickpad_type) { + case 1: +sc-flags |= SYN_FLAG_HAS_ONE_BUTTON_CLICKPAD; +break; + case 2: +sc-flags |= SYN_FLAG_HAS_TWO_BUTTON_CLICKPAD; +break; + default: +break; + } + } + } +} + int pms_synaptics_probe_init(void *vsc) { @@ -200,39 +287,17 @@ pms_synaptics_probe_init(void *vsc) sc-flags |= SYN_FLAG_HAS_BUTTONS_4_5; if (sc-caps SYNAPTICS_CAP_EXTENDED) { - aprint_debug_dev(psc-sc_dev, - synaptics_probe: Capabilities 0x%04x.\n, sc-caps); - if (sc-caps SYNAPTICS_CAP_PASSTHROUGH) - sc-flags |= SYN_FLAG_HAS_PASSTHROUGH; - - if (sc-caps SYNAPTICS_CAP_PALMDETECT) - sc-flags |= SYN_FLAG_HAS_PALM_DETECT; - - if (sc-caps SYNAPTICS_CAP_MULTIDETECT) - sc-flags |= SYN_FLAG_HAS_MULTI_FINGER; - - /* Ask about extra buttons to detect up/down. */ - if (sc-caps SYNAPTICS_CAP_EXTNUM) { - res = pms_sliced_command(psc-sc_kbctag, - psc-sc_kbcslot, SYNAPTICS_EXTENDED_QUERY); - cmd[0] = PMS_SEND_DEV_STATUS; - res |= pckbport_poll_cmd(psc-sc_kbctag, - psc-sc_kbcslot, cmd, 1, 3, resp, 0); - if (res == 0) -aprint_debug_dev(psc-sc_dev, -synaptics_probe: Extended -Capabilities 0x%02x.\n, resp[1]); - if (!res (resp[1] 4) =
CVS commit: src/sys/dev/pckbport
Module Name:src Committed By: jakllsch Date: Sat Jan 11 20:29:03 UTC 2014 Modified Files: src/sys/dev/pckbport: pckbport.c Log Message: KASSERT that cmd is non-NULL in more places, and in a place that previously did not use KASSERT to do the same thing. To generate a diff of this commit: cvs rdiff -u -r1.16 -r1.17 src/sys/dev/pckbport/pckbport.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/pckbport.c diff -u src/sys/dev/pckbport/pckbport.c:1.16 src/sys/dev/pckbport/pckbport.c:1.17 --- src/sys/dev/pckbport/pckbport.c:1.16 Wed Mar 6 04:22:03 2013 +++ src/sys/dev/pckbport/pckbport.c Sat Jan 11 20:29:03 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: pckbport.c,v 1.16 2013/03/06 04:22:03 christos Exp $ */ +/* $NetBSD: pckbport.c,v 1.17 2014/01/11 20:29:03 jakllsch Exp $ */ /* * Copyright (c) 2004 Ben Harris @@ -27,7 +27,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: pckbport.c,v 1.16 2013/03/06 04:22:03 christos Exp $); +__KERNEL_RCSID(0, $NetBSD: pckbport.c,v 1.17 2014/01/11 20:29:03 jakllsch Exp $); #include sys/param.h #include sys/systm.h @@ -396,6 +396,7 @@ pckbport_start(struct pckbport_tag *t, p struct pckbport_slotdata *q = t-t_slotdata[slot]; struct pckbport_devcmd *cmd = TAILQ_FIRST(q-cmdqueue); + KASSERT(cmd != NULL); if (q-polling) { do { pckbport_poll_cmd1(t, slot, cmd); @@ -432,10 +433,7 @@ pckbport_cmdresponse(struct pckbport_tag struct pckbport_slotdata *q = t-t_slotdata[slot]; struct pckbport_devcmd *cmd = TAILQ_FIRST(q-cmdqueue); -#ifdef DIAGNOSTIC - if (!cmd) - panic(pckbport_cmdresponse: no active command); -#endif + KASSERT(cmd != NULL); if (cmd-cmdidx cmd-cmdlen) { if (data != KBR_ACK data != KBR_RESEND) return 0;
CVS commit: src/sys/dev/pckbport
Module Name:src Committed By: martin Date: Sun Sep 15 09:24:05 UTC 2013 Modified Files: src/sys/dev/pckbport: pckbd.c Log Message: Cosemetically fix the pckbd_attach() return value, so gcc can see the value is used (no functional change) To generate a diff of this commit: cvs rdiff -u -r1.30 -r1.31 src/sys/dev/pckbport/pckbd.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/pckbd.c diff -u src/sys/dev/pckbport/pckbd.c:1.30 src/sys/dev/pckbport/pckbd.c:1.31 --- src/sys/dev/pckbport/pckbd.c:1.30 Sat Oct 13 17:51:28 2012 +++ src/sys/dev/pckbport/pckbd.c Sun Sep 15 09:24:05 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: pckbd.c,v 1.30 2012/10/13 17:51:28 jdc Exp $ */ +/* $NetBSD: pckbd.c,v 1.31 2013/09/15 09:24:05 martin Exp $ */ /*- * Copyright (c) 1998, 2009 The NetBSD Foundation, Inc. @@ -68,7 +68,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: pckbd.c,v 1.30 2012/10/13 17:51:28 jdc Exp $); +__KERNEL_RCSID(0, $NetBSD: pckbd.c,v 1.31 2013/09/15 09:24:05 martin Exp $); #include sys/param.h #include sys/systm.h @@ -1081,7 +1081,7 @@ pckbd_cnattach(pckbport_tag_t kbctag, in wskbd_cnattach(pckbd_consops, pckbd_consdata, pckbd_keymapdata); - return 0; + return res; } /* ARGSUSED */
CVS commit: src/sys/dev/pckbport
Module Name:src Committed By: christos Date: Wed Mar 6 03:26:17 UTC 2013 Modified Files: src/sys/dev/pckbport: pckbdreg.h pckbport.c Log Message: Deal with Foxconn NanoPC nT-i1250 returning BAT_FAIL and don't infinite loop From OpenBSD. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/sys/dev/pckbport/pckbdreg.h cvs rdiff -u -r1.14 -r1.15 src/sys/dev/pckbport/pckbport.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/pckbdreg.h diff -u src/sys/dev/pckbport/pckbdreg.h:1.2 src/sys/dev/pckbport/pckbdreg.h:1.3 --- src/sys/dev/pckbport/pckbdreg.h:1.2 Sun Dec 11 07:23:22 2005 +++ src/sys/dev/pckbport/pckbdreg.h Tue Mar 5 22:26:17 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: pckbdreg.h,v 1.2 2005/12/11 12:23:22 christos Exp $ */ +/* $NetBSD: pckbdreg.h,v 1.3 2013/03/06 03:26:17 christos Exp $ */ /* * Keyboard definitions @@ -19,7 +19,9 @@ #define KBR_EXTENDED0 0xE0 /* extended key sequence */ #define KBR_EXTENDED1 0xE1 /* extended key sequence */ #define KBR_RESEND 0xFE /* needs resend of command */ +#define KBR_BAT_DONE 0xAA #define KBR_ACK 0xFA /* received a valid command */ +#define KBR_BAT_FAIL 0xFC #define KBR_OVERRUN 0x00 /* flooded */ #define KBR_FAILURE 0xFD /* diagnostic failure */ #define KBR_BREAK 0xF0 /* break code prefix - sent on key release */ Index: src/sys/dev/pckbport/pckbport.c diff -u src/sys/dev/pckbport/pckbport.c:1.14 src/sys/dev/pckbport/pckbport.c:1.15 --- src/sys/dev/pckbport/pckbport.c:1.14 Fri Sep 9 10:00:01 2011 +++ src/sys/dev/pckbport/pckbport.c Tue Mar 5 22:26:17 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: pckbport.c,v 1.14 2011/09/09 14:00:01 jakllsch Exp $ */ +/* $NetBSD: pckbport.c,v 1.15 2013/03/06 03:26:17 christos Exp $ */ /* * Copyright (c) 2004 Ben Harris @@ -27,7 +27,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: pckbport.c,v 1.14 2011/09/09 14:00:01 jakllsch Exp $); +__KERNEL_RCSID(0, $NetBSD: pckbport.c,v 1.15 2013/03/06 03:26:17 christos Exp $); #include sys/param.h #include sys/systm.h @@ -93,11 +93,14 @@ static const char * const pckbport_slot_ static struct pckbport_tag pckbport_cntag; -#define KBC_DEVCMD_ACK 0xfa -#define KBC_DEVCMD_RESEND 0xfe - #define KBD_DELAY DELAY(8) +#ifdef PCKBPORTDEBUG +#define DPRINTF(a) printf a +#else +#define DPRINTF(a) +#endif + static int pckbport_poll_data1(pckbport_tag_t t, pckbport_slot_t slot) { @@ -261,35 +264,29 @@ pckbport_poll_cmd1(struct pckbport_tag * if (c != -1) break; } - - if (c == KBC_DEVCMD_ACK) { + switch (c) { + case KBR_ACK: cmd-cmdidx++; continue; - } - if (c == KBC_DEVCMD_RESEND) { -#ifdef PCKBPORTDEBUG - printf(pckbport_cmd: RESEND\n); -#endif + case KBR_BAT_DONE: + case KBR_BAT_FAIL: + case KBR_RESEND: + DPRINTF((%s: %s\n, __func__, c == KBR_RESEND ? + RESEND : (c == KBR_BAT_DONE ? BAT_DONE : + BAT_FAIL))); if (cmd-retries++ 5) continue; else { -#ifdef PCKBPORTDEBUG -printf(pckbport: cmd failed\n); -#endif +DPRINTF((%s: cmd failed\n, __func__)); cmd-status = EIO; return; } - } - if (c == -1) { -#ifdef PCKBPORTDEBUG - printf(pckbport_cmd: timeout\n); -#endif + case -1: + DPRINTF((%s: timeout\n, __func__)); cmd-status = EIO; return; } -#ifdef PCKBPORTDEBUG - printf(pckbport_cmd: lost 0x%x\n, c); -#endif + DPRINTF((%s: lost 0x%x\n, __func__, c)); } while (cmd-responseidx cmd-responselen) { @@ -303,9 +300,7 @@ pckbport_poll_cmd1(struct pckbport_tag * break; } if (c == -1) { -#ifdef PCKBPORTDEBUG - printf(pckbport_cmd: no data\n); -#endif + DPRINTF((%s: no data\n, __func__)); cmd-status = ETIMEDOUT; return; } else @@ -344,15 +339,12 @@ void pckbport_cleanqueue(struct pckbport_slotdata *q) { struct pckbport_devcmd *cmd; -#ifdef PCKBPORTDEBUG - int i; -#endif while ((cmd = TAILQ_FIRST(q-cmdqueue))) { TAILQ_REMOVE(q-cmdqueue, cmd, next); #ifdef PCKBPORTDEBUG - printf(pckbport_cleanqueue: removing); - for (i = 0; i cmd-cmdlen; i++) + printf(%s: removing, __func__); + for (int i = 0; i cmd-cmdlen; i++) printf( %02x, cmd-cmd[i]); printf(\n); #endif @@ -445,17 +437,15 @@ pckbport_cmdresponse(struct pckbport_tag panic(pckbport_cmdresponse: no active command); #endif if (cmd-cmdidx cmd-cmdlen) { - if (data != KBC_DEVCMD_ACK data != KBC_DEVCMD_RESEND) + if (data != KBR_ACK data != KBR_RESEND) return 0; - if (data == KBC_DEVCMD_RESEND) { + if (data == KBR_RESEND) { if (cmd-retries++ 5) /* try again last command */ goto restart; else { -#ifdef PCKBPORTDEBUG -printf(pckbport: cmd failed\n); -#endif +DPRINTF((%s: cmd failed\n, __func__)); cmd-status = EIO; /* dequeue */ } @@ -584,12 +574,11 @@ pckbportintr(pckbport_tag_t t, pckbport_ if (CMD_IN_QUEUE(q) pckbport_cmdresponse(t, slot, data)) return; - if
CVS commit: src/sys/dev/pckbport
Module Name:src Committed By: christos Date: Wed Mar 6 04:22:03 UTC 2013 Modified Files: src/sys/dev/pckbport: pckbport.c Log Message: fix debugging printf To generate a diff of this commit: cvs rdiff -u -r1.15 -r1.16 src/sys/dev/pckbport/pckbport.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/pckbport.c diff -u src/sys/dev/pckbport/pckbport.c:1.15 src/sys/dev/pckbport/pckbport.c:1.16 --- src/sys/dev/pckbport/pckbport.c:1.15 Tue Mar 5 22:26:17 2013 +++ src/sys/dev/pckbport/pckbport.c Tue Mar 5 23:22:03 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: pckbport.c,v 1.15 2013/03/06 03:26:17 christos Exp $ */ +/* $NetBSD: pckbport.c,v 1.16 2013/03/06 04:22:03 christos Exp $ */ /* * Copyright (c) 2004 Ben Harris @@ -27,7 +27,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: pckbport.c,v 1.15 2013/03/06 03:26:17 christos Exp $); +__KERNEL_RCSID(0, $NetBSD: pckbport.c,v 1.16 2013/03/06 04:22:03 christos Exp $); #include sys/param.h #include sys/systm.h @@ -578,7 +578,7 @@ pckbportintr(pckbport_tag_t t, pckbport_ (*t-t_inputhandler[slot])(t-t_inputarg[slot], data); return; } - DPRINTF((%s: slot %d lost %d\n, slot, data, __func__)); + DPRINTF((%s: slot %d lost %d\n, __func__, slot, data)); } int
CVS commit: src/sys/dev/pckbport
Module Name:src Committed By: jdc Date: Sat Oct 13 17:51:51 UTC 2012 Modified Files: src/sys/dev/pckbport: wskbdmap_mfii.c Log Message: Add the extra keys found on the Tadpole SPARCle to the keysym list. To generate a diff of this commit: cvs rdiff -u -r1.22 -r1.23 src/sys/dev/pckbport/wskbdmap_mfii.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/wskbdmap_mfii.c diff -u src/sys/dev/pckbport/wskbdmap_mfii.c:1.22 src/sys/dev/pckbport/wskbdmap_mfii.c:1.23 --- src/sys/dev/pckbport/wskbdmap_mfii.c:1.22 Fri Jul 22 23:22:38 2011 +++ src/sys/dev/pckbport/wskbdmap_mfii.c Sat Oct 13 17:51:51 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: wskbdmap_mfii.c,v 1.22 2011/07/22 23:22:38 christos Exp $ */ +/* $NetBSD: wskbdmap_mfii.c,v 1.23 2012/10/13 17:51:51 jdc Exp $ */ /*- * Copyright (c) 1997 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: wskbdmap_mfii.c,v 1.22 2011/07/22 23:22:38 christos Exp $); +__KERNEL_RCSID(0, $NetBSD: wskbdmap_mfii.c,v 1.23 2012/10/13 17:51:51 jdc Exp $); #include opt_wskbdmap.h #include sys/types.h @@ -128,6 +128,17 @@ static const keysym_t pckbd_keydesc_us[] KC(87), KS_f11, KC(88), KS_f12, KC(127), KS_Pause, /* Break */ +KC(136), KS_Help, +KC(137), KS_Stop, +KC(138), KS_Again, +KC(139), KS_Props, +KC(140), KS_Undo, +KC(141), KS_Front, +KC(142), KS_Copy, +KC(143), KS_Open, +KC(144), KS_Paste, +KC(145), KS_Find, +KC(146), KS_Cut, KC(156), KS_KP_Enter, KC(157), KS_Control_R, KC(160), KS_Cmd_VolumeToggle,
CVS commit: src/sys/dev/pckbport
Module Name:src Committed By: dsl Date: Sun Jun 3 13:52:46 UTC 2012 Modified Files: src/sys/dev/pckbport: synaptics.c Log Message: Remove a couple of (void *) casts added in the previous commin. They aren't needed here (script error). To generate a diff of this commit: cvs rdiff -u -r1.29 -r1.30 src/sys/dev/pckbport/synaptics.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/synaptics.c diff -u src/sys/dev/pckbport/synaptics.c:1.29 src/sys/dev/pckbport/synaptics.c:1.30 --- src/sys/dev/pckbport/synaptics.c:1.29 Sat Jun 2 21:36:45 2012 +++ src/sys/dev/pckbport/synaptics.c Sun Jun 3 13:52:46 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: synaptics.c,v 1.29 2012/06/02 21:36:45 dsl Exp $ */ +/* $NetBSD: synaptics.c,v 1.30 2012/06/03 13:52:46 dsl Exp $ */ /* * Copyright (c) 2005, Steve C. Woodford @@ -48,7 +48,7 @@ #include opt_pms.h #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: synaptics.c,v 1.29 2012/06/02 21:36:45 dsl Exp $); +__KERNEL_RCSID(0, $NetBSD: synaptics.c,v 1.30 2012/06/03 13:52:46 dsl Exp $); #include sys/param.h #include sys/systm.h @@ -493,7 +493,7 @@ pms_sysctl_synaptics(struct sysctllog ** CTLTYPE_INT, scale_x, SYSCTL_DESCR(Horizontal movement scale factor), pms_sysctl_synaptics_verify, 0, - (void *)synaptics_scale_x, + synaptics_scale_x, 0, CTL_HW, root_num, CTL_CREATE, CTL_EOL)) != 0) goto err; @@ -505,7 +505,7 @@ pms_sysctl_synaptics(struct sysctllog ** CTLTYPE_INT, scale_y, SYSCTL_DESCR(Vertical movement scale factor), pms_sysctl_synaptics_verify, 0, - (void *)synaptics_scale_y, + synaptics_scale_y, 0, CTL_HW, root_num, CTL_CREATE, CTL_EOL)) != 0) goto err;
CVS commit: src/sys/dev/pckbport
Module Name:src Committed By: jmcneill Date: Sat Jan 7 10:27:59 UTC 2012 Modified Files: src/sys/dev/pckbport: elantech.c elantechvar.h Log Message: add support for elantech (v2) touchpads that report input pressure To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/sys/dev/pckbport/elantech.c cvs rdiff -u -r1.1 -r1.2 src/sys/dev/pckbport/elantechvar.h 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/elantech.c diff -u src/sys/dev/pckbport/elantech.c:1.4 src/sys/dev/pckbport/elantech.c:1.5 --- src/sys/dev/pckbport/elantech.c:1.4 Fri Sep 9 14:29:47 2011 +++ src/sys/dev/pckbport/elantech.c Sat Jan 7 10:27:58 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: elantech.c,v 1.4 2011/09/09 14:29:47 jakllsch Exp $ */ +/* $NetBSD: elantech.c,v 1.5 2012/01/07 10:27:58 jmcneill Exp $ */ /*- * Copyright (c) 2008 Jared D. McNeill jmcne...@invisible.ca @@ -29,7 +29,7 @@ #include opt_pms.h #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: elantech.c,v 1.4 2011/09/09 14:29:47 jakllsch Exp $); +__KERNEL_RCSID(0, $NetBSD: elantech.c,v 1.5 2012/01/07 10:27:58 jmcneill Exp $); #include sys/param.h #include sys/systm.h @@ -220,11 +220,20 @@ pms_elantech_input(void *opaque, int dat if (!psc-sc_enabled) return; - if ((psc-inputstate == 0 (data 0x0c) != 0x0c) || - (psc-inputstate == 3 (data 0x0f) != 0x08)) { - aprint_debug_dev(psc-sc_dev, waiting for sync..\n); - psc-inputstate = 0; - return; + if (sc-version = 0x020800) { + if ((psc-inputstate == 0 (data 0x0c) != 0x04) || + (psc-inputstate == 3 (data 0x0f) != 0x02)) { + aprint_debug_dev(psc-sc_dev, waiting for sync..\n); + psc-inputstate = 0; + return; + } + } else { + if ((psc-inputstate == 0 (data 0x0c) != 0x0c) || + (psc-inputstate == 3 (data 0x0e) != 0x08)) { + aprint_debug_dev(psc-sc_dev, waiting for sync..\n); + psc-inputstate = 0; + return; + } } psc-packet[psc-inputstate++] = data 0xff; @@ -245,8 +254,8 @@ pms_elantech_input(void *opaque, int dat case 0: /* FALLTHROUGH */ case 1: - ep.ep_x = ((int16_t)psc-packet[1] 8) | psc-packet[2]; - ep.ep_y = ((int16_t)psc-packet[4] 8) | psc-packet[5]; + ep.ep_x = ((int16_t)(psc-packet[1] 0xf) 8) | psc-packet[2]; + ep.ep_y = ((int16_t)(psc-packet[4] 0xf) 8) | psc-packet[5]; aprint_debug_dev(psc-sc_dev, %d finger detected in elantech mode:\n, ep.ep_nfingers); @@ -365,9 +374,9 @@ pms_elantech_probe_init(void *opaque) resp[0], resp[2], resp[0], resp[1], resp[2]); goto doreset; } - sc-version = fwversion; - aprint_normal_dev(psc-sc_dev, Elantech touchpad version %d.%d\n, - resp[0], resp[2]); + sc-version = (resp[0] 16) | (resp[1] 8) | resp[2]; + aprint_normal_dev(psc-sc_dev, Elantech touchpad version %d.%d (%06x)\n, + resp[0], resp[2], sc-version); res = pms_elantech_init(psc); if (res) { Index: src/sys/dev/pckbport/elantechvar.h diff -u src/sys/dev/pckbport/elantechvar.h:1.1 src/sys/dev/pckbport/elantechvar.h:1.2 --- src/sys/dev/pckbport/elantechvar.h:1.1 Sun Dec 14 00:42:33 2008 +++ src/sys/dev/pckbport/elantechvar.h Sat Jan 7 10:27:58 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: elantechvar.h,v 1.1 2008/12/14 00:42:33 jmcneill Exp $ */ +/* $NetBSD: elantechvar.h,v 1.2 2012/01/07 10:27:58 jmcneill Exp $ */ /*- * Copyright (c) 2008 Jared D. McNeill jmcne...@invisible.ca @@ -30,7 +30,7 @@ #define _DEV_PCKBCPORT_ELANTECHVAR_H struct elantech_softc { - uint16_t version; + uint32_t version; bool initializing; int16_t last_x, last_y, last_z;
CVS commit: src/sys/dev/pckbport
Module Name:src Committed By: jakllsch Date: Sat Sep 10 18:38:20 UTC 2011 Modified Files: src/sys/dev/pckbport: synaptics.c synapticsreg.h synapticsvar.h Log Message: Correct and improve some comments. Collect unused variables. Add a define. To generate a diff of this commit: cvs rdiff -u -r1.27 -r1.28 src/sys/dev/pckbport/synaptics.c cvs rdiff -u -r1.6 -r1.7 src/sys/dev/pckbport/synapticsreg.h cvs rdiff -u -r1.4 -r1.5 src/sys/dev/pckbport/synapticsvar.h 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/synaptics.c diff -u src/sys/dev/pckbport/synaptics.c:1.27 src/sys/dev/pckbport/synaptics.c:1.28 --- src/sys/dev/pckbport/synaptics.c:1.27 Fri Sep 9 14:29:47 2011 +++ src/sys/dev/pckbport/synaptics.c Sat Sep 10 18:38:20 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: synaptics.c,v 1.27 2011/09/09 14:29:47 jakllsch Exp $ */ +/* $NetBSD: synaptics.c,v 1.28 2011/09/10 18:38:20 jakllsch Exp $ */ /* * Copyright (c) 2005, Steve C. Woodford @@ -48,7 +48,7 @@ #include opt_pms.h #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: synaptics.c,v 1.27 2011/09/09 14:29:47 jakllsch Exp $); +__KERNEL_RCSID(0, $NetBSD: synaptics.c,v 1.28 2011/09/10 18:38:20 jakllsch Exp $); #include sys/param.h #include sys/systm.h @@ -93,7 +93,7 @@ static void pms_sysctl_synaptics(struct sysctllog **); static int pms_sysctl_synaptics_verify(SYSCTLFN_ARGS); -/* Controled by sysctl. */ +/* Controlled by sysctl. */ static int synaptics_up_down_emul = 2; static int synaptics_up_down_motion_delta = 1; static int synaptics_gesture_move = 200; @@ -136,7 +136,7 @@ { struct pms_softc *psc = vsc; struct synaptics_softc *sc = psc-u.synaptics; - u_char cmd[2], resp[3]; + u_char cmd[1], resp[3]; int res, ver_minor, ver_major; struct sysctllog *clog = NULL; @@ -724,7 +724,7 @@ struct timeval diff; if (!psc-sc_enabled) { - /* Interrupts are not expected. Discard the byte. */ + /* Interrupts are not expected. Discard the byte. */ return; } @@ -775,7 +775,7 @@ if ((psc-packet[0] 0xfc) == 0x84 (psc-packet[3] 0xcc) == 0xc4) { - /* PS/2 passthrough */ + /* W = SYNAPTICS_WIDTH_PASSTHROUGH, PS/2 passthrough */ pms_synaptics_passthrough(psc); } else { pms_synaptics_parse(psc); Index: src/sys/dev/pckbport/synapticsreg.h diff -u src/sys/dev/pckbport/synapticsreg.h:1.6 src/sys/dev/pckbport/synapticsreg.h:1.7 --- src/sys/dev/pckbport/synapticsreg.h:1.6 Sun Mar 21 19:53:52 2010 +++ src/sys/dev/pckbport/synapticsreg.h Sat Sep 10 18:38:20 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: synapticsreg.h,v 1.6 2010/03/21 19:53:52 plunky Exp $ */ +/* $NetBSD: synapticsreg.h,v 1.7 2011/09/10 18:38:20 jakllsch Exp $ */ /* * Copyright (c) 2005, Steve C. Woodford @@ -95,6 +95,8 @@ #define SYNAPTICS_WIDTH_TWO_FINGERS 0 #define SYNAPTICS_WIDTH_THREE_OR_MORE 1 #define SYNAPTICS_WIDTH_PEN 2 +#define SYNAPTICS_WIDTH_ADVANCEDGESTURE 2 +#define SYNAPTICS_WIDTH_PASSTHROUGH 3 #define SYNAPTICS_WIDTH_FINGER_MIN 4 #define SYNAPTICS_WIDTH_FINGER_NORMAL 5 #define SYNAPTICS_WIDTH_FINGER_MAX 7 Index: src/sys/dev/pckbport/synapticsvar.h diff -u src/sys/dev/pckbport/synapticsvar.h:1.4 src/sys/dev/pckbport/synapticsvar.h:1.5 --- src/sys/dev/pckbport/synapticsvar.h:1.4 Sun Dec 11 12:23:22 2005 +++ src/sys/dev/pckbport/synapticsvar.h Sat Sep 10 18:38:20 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: synapticsvar.h,v 1.4 2005/12/11 12:23:22 christos Exp $ */ +/* $NetBSD: synapticsvar.h,v 1.5 2011/09/10 18:38:20 jakllsch Exp $ */ /* * Copyright (c) 2005, Steve C. Woodford @@ -39,14 +39,13 @@ #define _DEV_PCKBCPORT_SYNAPTICSVAR_H_ struct synaptics_softc { - struct proc *syn_thread; int caps; int flags; #define SYN_FLAG_HAS_MIDDLE_BUTTON (1 0) #define SYN_FLAG_HAS_BUTTONS_4_5 (1 1) #define SYN_FLAG_HAS_UP_DOWN_BUTTONS (1 2) -#define SYN_FLAG_HAS_PASSTHROUGH (1 3) /* Not yet supported */ +#define SYN_FLAG_HAS_PASSTHROUGH (1 3) #define SYN_FLAG_HAS_PALM_DETECT (1 4) #define SYN_FLAG_HAS_MULTI_FINGER (1 5)
CVS commit: src/sys/dev/pckbport
Module Name:src Committed By: jakllsch Date: Fri Sep 9 14:00:01 UTC 2011 Modified Files: src/sys/dev/pckbport: pckbport.c pckbportvar.h Log Message: const-ify input command buffer argument to pckbport_poll_cmd and pckbport_enqueue_cmd. To generate a diff of this commit: cvs rdiff -u -r1.13 -r1.14 src/sys/dev/pckbport/pckbport.c cvs rdiff -u -r1.8 -r1.9 src/sys/dev/pckbport/pckbportvar.h 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/pckbport.c diff -u src/sys/dev/pckbport/pckbport.c:1.13 src/sys/dev/pckbport/pckbport.c:1.14 --- src/sys/dev/pckbport/pckbport.c:1.13 Sat Mar 15 18:59:07 2008 +++ src/sys/dev/pckbport/pckbport.c Fri Sep 9 14:00:01 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: pckbport.c,v 1.13 2008/03/15 18:59:07 cube Exp $ */ +/* $NetBSD: pckbport.c,v 1.14 2011/09/09 14:00:01 jakllsch Exp $ */ /* * Copyright (c) 2004 Ben Harris @@ -27,7 +27,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: pckbport.c,v 1.13 2008/03/15 18:59:07 cube Exp $); +__KERNEL_RCSID(0, $NetBSD: pckbport.c,v 1.14 2011/09/09 14:00:01 jakllsch Exp $); #include sys/param.h #include sys/systm.h @@ -315,8 +315,8 @@ /* for use in autoconfiguration */ int -pckbport_poll_cmd(pckbport_tag_t t, pckbport_slot_t slot, u_char *cmd, int len, -int responselen, u_char *respbuf, int slow) +pckbport_poll_cmd(pckbport_tag_t t, pckbport_slot_t slot, const u_char *cmd, +int len, int responselen, u_char *respbuf, int slow) { struct pckbport_devcmd nc; @@ -493,7 +493,7 @@ * Put command into the device's command queue, return zero or errno. */ int -pckbport_enqueue_cmd(pckbport_tag_t t, pckbport_slot_t slot, u_char *cmd, +pckbport_enqueue_cmd(pckbport_tag_t t, pckbport_slot_t slot, const u_char *cmd, int len, int responselen, int sync, u_char *respbuf) { struct pckbport_slotdata *q = t-t_slotdata[slot]; Index: src/sys/dev/pckbport/pckbportvar.h diff -u src/sys/dev/pckbport/pckbportvar.h:1.8 src/sys/dev/pckbport/pckbportvar.h:1.9 --- src/sys/dev/pckbport/pckbportvar.h:1.8 Sat Mar 15 18:59:07 2008 +++ src/sys/dev/pckbport/pckbportvar.h Fri Sep 9 14:00:01 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: pckbportvar.h,v 1.8 2008/03/15 18:59:07 cube Exp $ */ +/* $NetBSD: pckbportvar.h,v 1.9 2011/09/09 14:00:01 jakllsch Exp $ */ /* * Copyright (c) 2004 Ben Harris @@ -82,9 +82,9 @@ pckbport_inputfcn, void *, const char *); void pckbport_flush(pckbport_tag_t, pckbport_slot_t); -int pckbport_poll_cmd(pckbport_tag_t, pckbport_slot_t, u_char *, int, +int pckbport_poll_cmd(pckbport_tag_t, pckbport_slot_t, const u_char *, int, int, u_char *, int); -int pckbport_enqueue_cmd(pckbport_tag_t, pckbport_slot_t, u_char *, int, +int pckbport_enqueue_cmd(pckbport_tag_t, pckbport_slot_t, const u_char *, int, int, int, u_char *); int pckbport_poll_data(pckbport_tag_t, pckbport_slot_t); void pckbport_set_poll(pckbport_tag_t, pckbport_slot_t, int);
CVS commit: src/sys/dev/pckbport
Module Name:src Committed By: jakllsch Date: Fri Sep 9 14:29:47 UTC 2011 Modified Files: src/sys/dev/pckbport: elantech.c pms.c pmsvar.h synaptics.c Log Message: Replace pms_synaptics_send_command() and identical pms_elantech_send_command() with pms_sliced_command(). Linux shows that this sequence can also be used by Logitech PS/2++ protocol as well. To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/sys/dev/pckbport/elantech.c cvs rdiff -u -r1.34 -r1.35 src/sys/dev/pckbport/pms.c cvs rdiff -u -r1.10 -r1.11 src/sys/dev/pckbport/pmsvar.h cvs rdiff -u -r1.26 -r1.27 src/sys/dev/pckbport/synaptics.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/elantech.c diff -u src/sys/dev/pckbport/elantech.c:1.3 src/sys/dev/pckbport/elantech.c:1.4 --- src/sys/dev/pckbport/elantech.c:1.3 Tue Dec 30 10:44:30 2008 +++ src/sys/dev/pckbport/elantech.c Fri Sep 9 14:29:47 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: elantech.c,v 1.3 2008/12/30 10:44:30 jmcneill Exp $ */ +/* $NetBSD: elantech.c,v 1.4 2011/09/09 14:29:47 jakllsch Exp $ */ /*- * Copyright (c) 2008 Jared D. McNeill jmcne...@invisible.ca @@ -29,7 +29,7 @@ #include opt_pms.h #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: elantech.c,v 1.3 2008/12/30 10:44:30 jmcneill Exp $); +__KERNEL_RCSID(0, $NetBSD: elantech.c,v 1.4 2011/09/09 14:29:47 jakllsch Exp $); #include sys/param.h #include sys/systm.h @@ -134,42 +134,6 @@ aprint_error(%s: sysctl_createv failed (rc = %d)\n, __func__, rc); } -/* lifted from synaptics.c */ -static int -pms_elantech_send_command(pckbport_tag_t tag, pckbport_slot_t slot, -uint8_t syn_cmd) -{ - uint8_t cmd[2]; - int res; - - cmd[0] = PMS_SET_SCALE11; - res = pckbport_poll_cmd(tag, slot, cmd, 1, 0, NULL, 0); - if (res) - return res; - - /* - * Need to send 4 Set Resolution commands, with the argument - * encoded in the bottom most 2 bits. - */ - cmd[0] = PMS_SET_RES; - cmd[1] = syn_cmd 6; - res = pckbport_poll_cmd(tag, slot, cmd, 2, 0, NULL, 0); - - cmd[0] = PMS_SET_RES; - cmd[1] = (syn_cmd 0x30) 4; - res |= pckbport_poll_cmd(tag, slot, cmd, 2, 0, NULL, 0); - - cmd[0] = PMS_SET_RES; - cmd[1] = (syn_cmd 0x0c) 2; - res |= pckbport_poll_cmd(tag, slot, cmd, 2, 0, NULL, 0); - - cmd[0] = PMS_SET_RES; - cmd[1] = (syn_cmd 0x03); - res |= pckbport_poll_cmd(tag, slot, cmd, 2, 0, NULL, 0); - - return res; -} - static int pms_elantech_read_1(pckbport_tag_t tag, pckbport_slot_t slot, uint8_t reg, uint8_t *val) @@ -383,7 +347,7 @@ goto doreset; } - res = pms_elantech_send_command(psc-sc_kbctag, psc-sc_kbcslot, + res = pms_sliced_command(psc-sc_kbctag, psc-sc_kbcslot, ELANTECH_FW_VERSION); cmd[0] = PMS_SEND_DEV_STATUS; res |= pckbport_poll_cmd(psc-sc_kbctag, psc-sc_kbcslot, Index: src/sys/dev/pckbport/pms.c diff -u src/sys/dev/pckbport/pms.c:1.34 src/sys/dev/pckbport/pms.c:1.35 --- src/sys/dev/pckbport/pms.c:1.34 Thu Sep 8 16:34:09 2011 +++ src/sys/dev/pckbport/pms.c Fri Sep 9 14:29:47 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: pms.c,v 1.34 2011/09/08 16:34:09 jakllsch Exp $ */ +/* $NetBSD: pms.c,v 1.35 2011/09/09 14:29:47 jakllsch Exp $ */ /*- * Copyright (c) 2004 Kentaro Kurahone. @@ -26,7 +26,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: pms.c,v 1.34 2011/09/08 16:34:09 jakllsch Exp $); +__KERNEL_RCSID(0, $NetBSD: pms.c,v 1.35 2011/09/09 14:29:47 jakllsch Exp $); #include opt_pms.h @@ -224,7 +224,7 @@ /* no interrupts until enabled */ cmd[0] = PMS_DEV_DISABLE; - res = pckbport_poll_cmd(pa-pa_tag, pa-pa_slot, cmd, 1, 0, 0, 0); + res = pckbport_poll_cmd(pa-pa_tag, pa-pa_slot, cmd, 1, 0, NULL, 0); if (res) aprint_error(pmsattach: disable error\n); pckbport_slot_enable(sc-sc_kbctag, sc-sc_kbcslot, 0); @@ -653,3 +653,28 @@ return; } } + +int +pms_sliced_command(pckbport_tag_t tag, pckbport_slot_t slot, u_char scmd) +{ + u_char cmd[2]; + int i, err, ret = 0; + + cmd[0] = PMS_SET_SCALE11; + ret = pckbport_poll_cmd(tag, slot, cmd, 1, 0, NULL, 0); + + /* + * Need to send 4 Set Resolution commands, with the argument + * encoded in the bottom most 2 bits. + */ + for (i = 6; i = 0; i -= 2) { + cmd[0] = PMS_SET_RES; + cmd[1] = (scmd i) 3; + err = pckbport_poll_cmd(tag, slot, cmd, 2, 0, NULL, 0); + if (ret == 0 err != 0) { + ret = err; + } + } + + return ret; +} Index: src/sys/dev/pckbport/pmsvar.h diff -u src/sys/dev/pckbport/pmsvar.h:1.10 src/sys/dev/pckbport/pmsvar.h:1.11 --- src/sys/dev/pckbport/pmsvar.h:1.10 Thu Sep 8 15:27:50 2011 +++ src/sys/dev/pckbport/pmsvar.h Fri Sep 9 14:29:47 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: pmsvar.h,v 1.10 2011/09/08 15:27:50 jakllsch Exp $ */ +/* $NetBSD: pmsvar.h,v 1.11 2011/09/09 14:29:47 jakllsch Exp $ */ /*- * Copyright (c) 2004 Kentaro Kurahone. @@ -74,4 +74,6 @@ #endif }; +int pms_sliced_command(pckbport_tag_t, pckbport_slot_t, u_char); + #endif /* _DEV_PCKBCPORT_PMSVAR_H_
CVS commit: src/sys/dev/pckbport
Module Name:src Committed By: jakllsch Date: Thu Sep 8 15:26:26 UTC 2011 Modified Files: src/sys/dev/pckbport: pms.c Log Message: Make whitespace more consistent. To generate a diff of this commit: cvs rdiff -u -r1.32 -r1.33 src/sys/dev/pckbport/pms.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/pms.c diff -u src/sys/dev/pckbport/pms.c:1.32 src/sys/dev/pckbport/pms.c:1.33 --- src/sys/dev/pckbport/pms.c:1.32 Wed Sep 7 19:05:13 2011 +++ src/sys/dev/pckbport/pms.c Thu Sep 8 15:26:26 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: pms.c,v 1.32 2011/09/07 19:05:13 jakllsch Exp $ */ +/* $NetBSD: pms.c,v 1.33 2011/09/08 15:26:26 jakllsch Exp $ */ /*- * Copyright (c) 2004 Kentaro Kurahone. @@ -26,7 +26,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: pms.c,v 1.32 2011/09/07 19:05:13 jakllsch Exp $); +__KERNEL_RCSID(0, $NetBSD: pms.c,v 1.33 2011/09/08 15:26:26 jakllsch Exp $); #include opt_pms.h @@ -498,7 +498,7 @@ int newbuttons = 0; if (!sc-sc_enabled) { - /* Interrupts are not expected. Discard the byte. */ + /* Interrupts are not expected. Discard the byte. */ return; } @@ -585,9 +585,9 @@ dz = sc-packet[3] 0xf; if (dz = 8) dz -= 16; - if (sc-packet[3] PMS_4BUTMASK) + if (sc-packet[3] PMS_4BUTMASK) newbuttons |= 0x8; - if (sc-packet[3] PMS_5BUTMASK) + if (sc-packet[3] PMS_5BUTMASK) newbuttons |= 0x10; } else { DPRINTF((pmsinput: why am I looking at this byte?\n));
CVS commit: src/sys/dev/pckbport
Module Name:src Committed By: jakllsch Date: Thu Sep 8 15:27:51 UTC 2011 Modified Files: src/sys/dev/pckbport: pmsvar.h Log Message: Cosmetic changes. To generate a diff of this commit: cvs rdiff -u -r1.9 -r1.10 src/sys/dev/pckbport/pmsvar.h 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/pmsvar.h diff -u src/sys/dev/pckbport/pmsvar.h:1.9 src/sys/dev/pckbport/pmsvar.h:1.10 --- src/sys/dev/pckbport/pmsvar.h:1.9 Wed Sep 7 19:05:13 2011 +++ src/sys/dev/pckbport/pmsvar.h Thu Sep 8 15:27:50 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: pmsvar.h,v 1.9 2011/09/07 19:05:13 jakllsch Exp $ */ +/* $NetBSD: pmsvar.h,v 1.10 2011/09/08 15:27:50 jakllsch Exp $ */ /*- * Copyright (c) 2004 Kentaro Kurahone. @@ -50,7 +50,7 @@ device_t sc_dev; pckbport_tag_t sc_kbctag; - int sc_kbcslot; + pckbport_slot_t sc_kbcslot; int sc_enabled; /* input enabled? */ int inputstate; /* number of bytes received for this packet */ @@ -74,4 +74,4 @@ #endif }; -#endif +#endif /* _DEV_PCKBCPORT_PMSVAR_H_ */
CVS commit: src/sys/dev/pckbport
Module Name:src Committed By: jakllsch Date: Thu Sep 8 16:34:09 UTC 2011 Modified Files: src/sys/dev/pckbport: pms.c Log Message: Sprinkle static. To generate a diff of this commit: cvs rdiff -u -r1.33 -r1.34 src/sys/dev/pckbport/pms.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/pms.c diff -u src/sys/dev/pckbport/pms.c:1.33 src/sys/dev/pckbport/pms.c:1.34 --- src/sys/dev/pckbport/pms.c:1.33 Thu Sep 8 15:26:26 2011 +++ src/sys/dev/pckbport/pms.c Thu Sep 8 16:34:09 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: pms.c,v 1.33 2011/09/08 15:26:26 jakllsch Exp $ */ +/* $NetBSD: pms.c,v 1.34 2011/09/08 16:34:09 jakllsch Exp $ */ /*- * Copyright (c) 2004 Kentaro Kurahone. @@ -26,7 +26,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: pms.c,v 1.33 2011/09/08 15:26:26 jakllsch Exp $); +__KERNEL_RCSID(0, $NetBSD: pms.c,v 1.34 2011/09/08 16:34:09 jakllsch Exp $); #include opt_pms.h @@ -61,11 +61,11 @@ #define DPRINTF(x) #endif -const enum pms_type tries[] = { +static const enum pms_type tries[] = { PMS_SCROLL5, PMS_SCROLL3, PMS_STANDARD, PMS_UNKNOWN }; -const struct pms_protocol pms_protocols[] = { +static const struct pms_protocol pms_protocols[] = { { { 0, 0, 0 }, 0, unknown protocol }, { { 0, 0, 0 }, 0, no scroll wheel (3 buttons) }, { { 200, 100, 80 }, 3, scroll wheel (3 buttons) }, @@ -75,9 +75,9 @@ }; -int pmsprobe(device_t, cfdata_t, void *); -void pmsattach(device_t, device_t, void *); -void pmsinput(void *, int); +static int pmsprobe(device_t, cfdata_t, void *); +static void pmsattach(device_t, device_t, void *); +static void pmsinput(void *, int); CFATTACH_DECL_NEW(pms, sizeof(struct pms_softc), pmsprobe, pmsattach, NULL, NULL); @@ -86,14 +86,14 @@ static void do_enable(struct pms_softc *); static void do_disable(struct pms_softc *); static void pms_reset_thread(void*); -int pms_enable(void *); -int pms_ioctl(void *, u_long, void *, int, struct lwp *); -void pms_disable(void *); +static int pms_enable(void *); +static int pms_ioctl(void *, u_long, void *, int, struct lwp *); +static void pms_disable(void *); static bool pms_suspend(device_t, const pmf_qual_t *); static bool pms_resume(device_t, const pmf_qual_t *); -const struct wsmouse_accessops pms_accessops = { +static const struct wsmouse_accessops pms_accessops = { pms_enable, pms_ioctl, pms_disable, @@ -166,7 +166,7 @@ return 10; } -void +static void pmsattach(device_t parent, device_t self, void *aux) { struct pms_softc *sc = device_private(self); @@ -308,7 +308,7 @@ pckbport_slot_enable(sc-sc_kbctag, sc-sc_kbcslot, 0); } -int +static int pms_enable(void *v) { struct pms_softc *sc = v; @@ -326,7 +326,7 @@ return 0; } -void +static void pms_disable(void *v) { struct pms_softc *sc = v; @@ -380,7 +380,7 @@ return true; } -int +static int pms_ioctl(void *v, u_long cmd, void *data, int flag, struct lwp *l) { @@ -489,7 +489,7 @@ #define PMS_4BUTMASK 0x10 #define PMS_5BUTMASK 0x20 -void +static void pmsinput(void *vsc, int data) { struct pms_softc *sc = vsc;
CVS commit: src/sys/dev/pckbport
Module Name:src Committed By: jakllsch Date: Wed Sep 7 19:05:13 UTC 2011 Modified Files: src/sys/dev/pckbport: files.pckbport pms.c pmsvar.h Log Message: options PMS_DISABLE_POWERHOOK has been obsolete for a while now, remove what little still remains of it. To generate a diff of this commit: cvs rdiff -u -r1.7 -r1.8 src/sys/dev/pckbport/files.pckbport cvs rdiff -u -r1.31 -r1.32 src/sys/dev/pckbport/pms.c cvs rdiff -u -r1.8 -r1.9 src/sys/dev/pckbport/pmsvar.h 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/files.pckbport diff -u src/sys/dev/pckbport/files.pckbport:1.7 src/sys/dev/pckbport/files.pckbport:1.8 --- src/sys/dev/pckbport/files.pckbport:1.7 Sun Dec 14 00:42:33 2008 +++ src/sys/dev/pckbport/files.pckbport Wed Sep 7 19:05:13 2011 @@ -1,4 +1,4 @@ -# $NetBSD: files.pckbport,v 1.7 2008/12/14 00:42:33 jmcneill Exp $ +# $NetBSD: files.pckbport,v 1.8 2011/09/07 19:05:13 jakllsch Exp $ # devices attached at pckbport, for use with wscons defflag opt_wskbdmap.h WSKBD_USONLY @@ -13,7 +13,7 @@ defparam PCKBD_LAYOUT defflag PCKBD_CNATTACH_MAY_FAIL -defflag opt_pms.h PMS_DISABLE_POWERHOOK +obsolete defflag opt_pms.h PMS_DISABLE_POWERHOOK defflag opt_pms.h PMS_SYNAPTICS_TOUCHPAD defflag opt_pms.h PMS_ELANTECH_TOUCHPAD device pms: wsmousedev Index: src/sys/dev/pckbport/pms.c diff -u src/sys/dev/pckbport/pms.c:1.31 src/sys/dev/pckbport/pms.c:1.32 --- src/sys/dev/pckbport/pms.c:1.31 Tue May 24 16:42:53 2011 +++ src/sys/dev/pckbport/pms.c Wed Sep 7 19:05:13 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: pms.c,v 1.31 2011/05/24 16:42:53 joerg Exp $ */ +/* $NetBSD: pms.c,v 1.32 2011/09/07 19:05:13 jakllsch Exp $ */ /*- * Copyright (c) 2004 Kentaro Kurahone. @@ -26,7 +26,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: pms.c,v 1.31 2011/05/24 16:42:53 joerg Exp $); +__KERNEL_RCSID(0, $NetBSD: pms.c,v 1.32 2011/09/07 19:05:13 jakllsch Exp $); #include opt_pms.h @@ -232,9 +232,6 @@ kthread_create(PRI_NONE, 0, NULL, pms_reset_thread, sc, sc-sc_event_thread, %s, device_xname(sc-sc_dev)); -#ifndef PMS_DISABLE_POWERHOOK - sc-sc_suspended = 0; -#endif if (!pmf_device_register(self, pms_suspend, pms_resume)) aprint_error_dev(self, couldn't establish power handler\n); } Index: src/sys/dev/pckbport/pmsvar.h diff -u src/sys/dev/pckbport/pmsvar.h:1.8 src/sys/dev/pckbport/pmsvar.h:1.9 --- src/sys/dev/pckbport/pmsvar.h:1.8 Sun Dec 14 00:42:33 2008 +++ src/sys/dev/pckbport/pmsvar.h Wed Sep 7 19:05:13 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: pmsvar.h,v 1.8 2008/12/14 00:42:33 jmcneill Exp $ */ +/* $NetBSD: pmsvar.h,v 1.9 2011/09/07 19:05:13 jakllsch Exp $ */ /*- * Copyright (c) 2004 Kentaro Kurahone. @@ -53,10 +53,6 @@ int sc_kbcslot; int sc_enabled; /* input enabled? */ -#ifndef PMS_DISABLE_POWERHOOK - void *sc_powerhook; /* cookie from power hook */ - int sc_suspended; /* suspended? */ -#endif /* !PMS_DISABLE_POWERHOOK */ int inputstate; /* number of bytes received for this packet */ u_int buttons; /* mouse button status */ enum pms_type protocol;
CVS commit: src/sys/dev/pckbport
Module Name:src Committed By: christos Date: Fri Jul 22 19:20:29 UTC 2011 Modified Files: src/sys/dev/pckbport: wskbdmap_mfii.c Log Message: fixes from OpenBSD To generate a diff of this commit: cvs rdiff -u -r1.20 -r1.21 src/sys/dev/pckbport/wskbdmap_mfii.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/wskbdmap_mfii.c diff -u src/sys/dev/pckbport/wskbdmap_mfii.c:1.20 src/sys/dev/pckbport/wskbdmap_mfii.c:1.21 --- src/sys/dev/pckbport/wskbdmap_mfii.c:1.20 Fri Jul 22 14:17:11 2011 +++ src/sys/dev/pckbport/wskbdmap_mfii.c Fri Jul 22 15:20:28 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: wskbdmap_mfii.c,v 1.20 2011/07/22 18:17:11 christos Exp $ */ +/* $NetBSD: wskbdmap_mfii.c,v 1.21 2011/07/22 19:20:28 christos Exp $ */ /*- * Copyright (c) 1997 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: wskbdmap_mfii.c,v 1.20 2011/07/22 18:17:11 christos Exp $); +__KERNEL_RCSID(0, $NetBSD: wskbdmap_mfii.c,v 1.21 2011/07/22 19:20:28 christos Exp $); #include opt_wskbdmap.h #include sys/types.h @@ -203,57 +203,32 @@ KC(11), KS_0, KS_apostrophe, KC(12), KS_slash, KS_question, KS_backslash, KC(13), KS_degree, KS_dead_tilde, KS_dead_cedilla, -KC(18), KS_e, KS_E, KS_currency, +KC(18), KS_r, KS_R, KS_paragraph, KC(26), KS_dead_diaeresis, KS_dead_circumflex, KC(27), KS_asterisk, KS_bar, KC(30), KS_s, KS_S, KS_ssharp, KC(39), KS_plus, KS_plusminus, KC(40), KS_dead_acute, KS_dead_grave, -KC(41), KS_at, KS_paragraph, KS_notsign, +KC(41), KS_at, KS_section, KS_notsign, KC(43), KS_less, KS_greater, KC(44), KS_z, KS_Z, KS_guillemotleft, KC(45), KS_x, KS_X, KS_guillemotright, KC(46), KS_c, KS_C, KS_cent, KC(50), KS_m, KS_M, KS_mu, KC(51), KS_comma, KS_semicolon, -KC(52), KS_period, KS_colon, +KC(52), KS_period, KS_colon, KS_periodcentered, KC(53), KS_minus, KS_equal, KC(86), KS_braceleft, KS_braceright, KS_brokenbar, KC(184), KS_Mode_switch, KS_Multi_key, }; -static const keysym_t pckbd_keydesc_nl[] = { +static const keysym_t pckbd_keydesc_nl_nodead[] = { /* pos normal shifted altgr shift-altgr */ -KC(2), KS_1, KS_exclam, KS_onesuperior, -KC(3), KS_2, KS_quotedbl, KS_twosuperior, -KC(4), KS_3, KS_numbersign, KS_threesuperior, -KC(5), KS_4, KS_dollar, KS_onequarter, -KC(6), KS_5, KS_percent, KS_onehalf, -KC(7), KS_6, KS_ampersand, KS_threequarters, -KC(8), KS_7, KS_underscore, KS_sterling, -KC(9), KS_8, KS_parenleft, KS_braceleft, -KC(10), KS_9, KS_parenright, KS_braceright, -KC(11), KS_0, KS_apostrophe, -KC(12), KS_slash, KS_question, KS_backslash, -KC(13), KS_degree, KS_dead_tilde, KS_dead_cedilla, -KC(18), KS_e, KS_E, KS_currency, -KC(26), KS_dead_diaeresis, KS_dead_circumflex, +KC(13), KS_degree, KS_asciitilde, KS_cedilla, +KC(26), KS_quotedbl, KS_asciicircum, KC(27), KS_asterisk, KS_bar, -KC(31), KS_s, KS_S, KS_ssharp, -KC(39), KS_plus, KS_plusminus, -KC(40), KS_dead_acute, KS_dead_grave, -KC(41), KS_at, KS_paragraph, KS_notsign, -KC(43), KS_less, KS_greater, -KC(44), KS_z, KS_Z, KS_guillemotleft, -KC(45), KS_x, KS_X, KS_guillemotright, -KC(46), KS_c, KS_C, KS_cent, -KC(50), KS_m, KS_M, KS_mu, -KC(51), KS_comma, KS_semicolon, -KC(52), KS_period, KS_colon, -KC(53), KS_minus, KS_equal, -KC(86), KS_bracketright, KS_bracketleft, KS_brokenbar, -KC(184), KS_Mode_switch, KS_Multi_key, +KC(40), KS_apostrophe, KS_grave, }; @@ -827,6 +802,7 @@ KBD_MAP(KB_CZ, KB_US, pckbd_keydesc_cz), KBD_MAP(KB_HU, KB_US, pckbd_keydesc_hu), KBD_MAP(KB_NL, KB_US, pckbd_keydesc_nl), + KBD_MAP(KB_NL | KB_NODEAD, KB_NL, pckbd_keydesc_nl_nodead), #endif /* WSKBD_USONLY */ /* placeholders */
CVS commit: src/sys/dev/pckbport
Module Name:src Committed By: christos Date: Fri Jul 22 23:22:38 UTC 2011 Modified Files: src/sys/dev/pckbport: wskbdmap_mfii.c Log Message: fixes from gilbert dot fernandes at orange dot fr To generate a diff of this commit: cvs rdiff -u -r1.21 -r1.22 src/sys/dev/pckbport/wskbdmap_mfii.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/wskbdmap_mfii.c diff -u src/sys/dev/pckbport/wskbdmap_mfii.c:1.21 src/sys/dev/pckbport/wskbdmap_mfii.c:1.22 --- src/sys/dev/pckbport/wskbdmap_mfii.c:1.21 Fri Jul 22 15:20:28 2011 +++ src/sys/dev/pckbport/wskbdmap_mfii.c Fri Jul 22 19:22:38 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: wskbdmap_mfii.c,v 1.21 2011/07/22 19:20:28 christos Exp $ */ +/* $NetBSD: wskbdmap_mfii.c,v 1.22 2011/07/22 23:22:38 christos Exp $ */ /*- * Copyright (c) 1997 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: wskbdmap_mfii.c,v 1.21 2011/07/22 19:20:28 christos Exp $); +__KERNEL_RCSID(0, $NetBSD: wskbdmap_mfii.c,v 1.22 2011/07/22 23:22:38 christos Exp $); #include opt_wskbdmap.h #include sys/types.h @@ -198,15 +198,16 @@ KC(6), KS_5, KS_percent, KS_onehalf, KC(7), KS_6, KS_ampersand, KS_threequarters, KC(8), KS_7, KS_underscore, KS_sterling, -KC(9), KS_8, KS_parenleft, KS_bracketleft, -KC(10), KS_9, KS_parenright, KS_bracketright, +KC(9), KS_8, KS_parenleft, KS_braceleft, +KC(10), KS_9, KS_parenright, KS_braceright, KC(11), KS_0, KS_apostrophe, KC(12), KS_slash, KS_question, KS_backslash, KC(13), KS_degree, KS_dead_tilde, KS_dead_cedilla, -KC(18), KS_r, KS_R, KS_paragraph, +KC(18), KS_e, KS_E, KS_currency, +KC(19), KS_r, KS_R, KS_paragraph, KC(26), KS_dead_diaeresis, KS_dead_circumflex, KC(27), KS_asterisk, KS_bar, -KC(30), KS_s, KS_S, KS_ssharp, +KC(31), KS_s, KS_S, KS_ssharp, KC(39), KS_plus, KS_plusminus, KC(40), KS_dead_acute, KS_dead_grave, KC(41), KS_at, KS_section, KS_notsign, @@ -218,7 +219,7 @@ KC(51), KS_comma, KS_semicolon, KC(52), KS_period, KS_colon, KS_periodcentered, KC(53), KS_minus, KS_equal, -KC(86), KS_braceleft, KS_braceright, KS_brokenbar, +KC(86), KS_bracketleft, KS_bracketright,KS_brokenbar, KC(184), KS_Mode_switch, KS_Multi_key, }; @@ -227,7 +228,7 @@ /* pos normal shifted altgr shift-altgr */ KC(13), KS_degree, KS_asciitilde, KS_cedilla, KC(26), KS_quotedbl, KS_asciicircum, -KC(27), KS_asterisk, KS_bar, +/* KC(27), KS_asterisk, KS_bar, */ KC(40), KS_apostrophe, KS_grave, };
CVS commit: src/sys/dev/pckbport
Module Name:src Committed By: joerg Date: Tue May 24 16:42:53 UTC 2011 Modified Files: src/sys/dev/pckbport: pms.c Log Message: Use proper format string To generate a diff of this commit: cvs rdiff -u -r1.30 -r1.31 src/sys/dev/pckbport/pms.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/pms.c diff -u src/sys/dev/pckbport/pms.c:1.30 src/sys/dev/pckbport/pms.c:1.31 --- src/sys/dev/pckbport/pms.c:1.30 Wed Feb 24 22:38:08 2010 +++ src/sys/dev/pckbport/pms.c Tue May 24 16:42:53 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: pms.c,v 1.30 2010/02/24 22:38:08 dyoung Exp $ */ +/* $NetBSD: pms.c,v 1.31 2011/05/24 16:42:53 joerg Exp $ */ /*- * Copyright (c) 2004 Kentaro Kurahone. @@ -26,7 +26,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: pms.c,v 1.30 2010/02/24 22:38:08 dyoung Exp $); +__KERNEL_RCSID(0, $NetBSD: pms.c,v 1.31 2011/05/24 16:42:53 joerg Exp $); #include opt_pms.h @@ -230,7 +230,7 @@ pckbport_slot_enable(sc-sc_kbctag, sc-sc_kbcslot, 0); kthread_create(PRI_NONE, 0, NULL, pms_reset_thread, sc, - sc-sc_event_thread, device_xname(sc-sc_dev)); + sc-sc_event_thread, %s, device_xname(sc-sc_dev)); #ifndef PMS_DISABLE_POWERHOOK sc-sc_suspended = 0;
CVS commit: src/sys/dev/pckbport
Module Name:src Committed By: cegger Date: Tue Feb 8 07:32:47 UTC 2011 Modified Files: src/sys/dev/pckbport: pmsreg.h Log Message: add PS/2 registers from synaptics spec: PMS_RESET_WRAP_MODE, PMS_SET_WRAP_MODE, PMS_ACK, PMS_ERROR and PMS_RESEND while here use #definetab consistently. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/sys/dev/pckbport/pmsreg.h 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/pmsreg.h diff -u src/sys/dev/pckbport/pmsreg.h:1.2 src/sys/dev/pckbport/pmsreg.h:1.3 --- src/sys/dev/pckbport/pmsreg.h:1.2 Sun Dec 11 12:23:22 2005 +++ src/sys/dev/pckbport/pmsreg.h Tue Feb 8 07:32:47 2011 @@ -1,19 +1,24 @@ -/* $NetBSD: pmsreg.h,v 1.2 2005/12/11 12:23:22 christos Exp $ */ +/* $NetBSD: pmsreg.h,v 1.3 2011/02/08 07:32:47 cegger Exp $ */ /* mouse commands */ -#define PMS_SET_SCALE11 0xe6 /* set scaling 1:1 */ -#define PMS_SET_SCALE21 0xe7 /* set scaling 2:1 */ -#define PMS_SET_RES 0xe8 /* set resolution (0..3) */ -#define PMS_GET_SCALE 0xe9 /* get scaling factor */ -#define PMS_SEND_DEV_STATUS 0xe9 -#define PMS_SET_STREAM 0xea /* set streaming mode */ -#define PMS_SEND_DEV_DATA 0xeb -#define PMS_SET_REMOTE_MODE 0xf0 -#define PMS_SEND_DEV_ID 0xf2 -#define PMS_SET_SAMPLE 0xf3 /* set sampling rate */ -#define PMS_DEV_ENABLE 0xf4 /* mouse on */ -#define PMS_DEV_DISABLE 0xf5 /* mouse off */ -#define PMS_SET_DEFAULTS 0xf6 -#define PMS_RESET 0xff /* reset */ +#define PMS_SET_SCALE11 0xe6 /* set scaling 1:1 */ +#define PMS_SET_SCALE21 0xe7 /* set scaling 2:1 */ +#define PMS_SET_RES 0xe8 /* set resolution (0..3) */ +#define PMS_GET_SCALE 0xe9 /* get scaling factor */ +#define PMS_SEND_DEV_STATUS 0xe9 /* status request */ +#define PMS_SET_STREAM 0xea /* set streaming mode */ +#define PMS_SEND_DEV_DATA 0xeb /* read data */ +#define PMS_RESET_WRAP_MODE 0xec +#define PMS_SET_WRAP_MODE 0xed +#define PMS_SET_REMOTE_MODE 0xf0 +#define PMS_SEND_DEV_ID 0xf2 /* read device type */ +#define PMS_SET_SAMPLE 0xf3 /* set sampling rate */ +#define PMS_DEV_ENABLE 0xf4 /* mouse on */ +#define PMS_DEV_DISABLE 0xf5 /* mouse off */ +#define PMS_SET_DEFAULTS 0xf6 +#define PMS_ACK 0xfa +#define PMS_ERROR 0xfc +#define PMS_RESEND 0xfe +#define PMS_RESET 0xff /* reset */ -#define PMS_RSTDONE 0xaa +#define PMS_RSTDONE 0xaa
CVS commit: src/sys/dev/pckbport
Module Name:src Committed By: cegger Date: Sat Jan 29 20:37:25 UTC 2011 Modified Files: src/sys/dev/pckbport: synaptics.c Log Message: use aprint_debug_dev and get rid of SYNAPTICSDEBUG To generate a diff of this commit: cvs rdiff -u -r1.25 -r1.26 src/sys/dev/pckbport/synaptics.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/synaptics.c diff -u src/sys/dev/pckbport/synaptics.c:1.25 src/sys/dev/pckbport/synaptics.c:1.26 --- src/sys/dev/pckbport/synaptics.c:1.25 Mon Nov 15 05:58:18 2010 +++ src/sys/dev/pckbport/synaptics.c Sat Jan 29 20:37:24 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: synaptics.c,v 1.25 2010/11/15 05:58:18 uebayasi Exp $ */ +/* $NetBSD: synaptics.c,v 1.26 2011/01/29 20:37:24 cegger Exp $ */ /* * Copyright (c) 2005, Steve C. Woodford @@ -48,7 +48,7 @@ #include opt_pms.h #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: synaptics.c,v 1.25 2010/11/15 05:58:18 uebayasi Exp $); +__KERNEL_RCSID(0, $NetBSD: synaptics.c,v 1.26 2011/01/29 20:37:24 cegger Exp $); #include sys/param.h #include sys/systm.h @@ -147,10 +147,8 @@ res |= pckbport_poll_cmd(psc-sc_kbctag, psc-sc_kbcslot, cmd, 1, 3, resp, 0); if (res) { -#ifdef SYNAPTICSDEBUG - aprint_normal_dev(psc-sc_dev, + aprint_debug_dev(psc-sc_dev, synaptics_probe: Identify Touchpad error.\n); -#endif /* * Reset device in case the probe confused it. */ @@ -162,10 +160,8 @@ } if (resp[1] != SYNAPTICS_MAGIC_BYTE) { -#ifdef SYNAPTICSDEBUG - aprint_normal_dev(psc-sc_dev, + aprint_debug_dev(psc-sc_dev, synaptics_probe: Not synaptics.\n); -#endif res = 1; goto doreset; } @@ -205,10 +201,8 @@ sc-flags |= SYN_FLAG_HAS_BUTTONS_4_5; if (sc-caps SYNAPTICS_CAP_EXTENDED) { -#ifdef SYNAPTICSDEBUG - aprint_normal_dev(psc-sc_dev, + aprint_debug_dev(psc-sc_dev, synaptics_probe: Capabilities 0x%04x.\n, sc-caps); -#endif if (sc-caps SYNAPTICS_CAP_PASSTHROUGH) sc-flags |= SYN_FLAG_HAS_PASSTHROUGH; @@ -225,12 +219,10 @@ cmd[0] = PMS_SEND_DEV_STATUS; res |= pckbport_poll_cmd(psc-sc_kbctag, psc-sc_kbcslot, cmd, 1, 3, resp, 0); -#ifdef SYNAPTICSDEBUG if (res == 0) -aprint_normal_dev(psc-sc_dev, +aprint_debug_dev(psc-sc_dev, synaptics_probe: Extended Capabilities 0x%02x.\n, resp[1]); -#endif if (!res (resp[1] 4) = 2) { /* Yes. */ sc-flags |= SYN_FLAG_HAS_UP_DOWN_BUTTONS; @@ -790,20 +782,16 @@ switch (psc-inputstate) { case 0: if ((data 0xc8) != 0x80) { -#ifdef SYNAPTICSDEBUG - aprint_normal_dev(psc-sc_dev, + aprint_debug_dev(psc-sc_dev, pms_input: 0x%02x out of sync\n, data); -#endif return; /* not in sync yet, discard input */ } /*FALLTHROUGH*/ case 3: if ((data 8) == 8) { -#ifdef SYNAPTICSDEBUG - aprint_normal_dev(psc-sc_dev, + aprint_debug_dev(psc-sc_dev, pms_input: dropped in relative mode, reset\n); -#endif psc-inputstate = 0; psc-sc_enabled = 0; wakeup(psc-sc_enabled);
CVS commit: src/sys/dev/pckbport
Module Name:src Committed By: uebayasi Date: Mon Nov 15 05:58:18 UTC 2010 Modified Files: src/sys/dev/pckbport: synaptics.c Log Message: wakeup needs sys/proc.h. To generate a diff of this commit: cvs rdiff -u -r1.24 -r1.25 src/sys/dev/pckbport/synaptics.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/synaptics.c diff -u src/sys/dev/pckbport/synaptics.c:1.24 src/sys/dev/pckbport/synaptics.c:1.25 --- src/sys/dev/pckbport/synaptics.c:1.24 Sun Mar 21 20:04:43 2010 +++ src/sys/dev/pckbport/synaptics.c Mon Nov 15 05:58:18 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: synaptics.c,v 1.24 2010/03/21 20:04:43 plunky Exp $ */ +/* $NetBSD: synaptics.c,v 1.25 2010/11/15 05:58:18 uebayasi Exp $ */ /* * Copyright (c) 2005, Steve C. Woodford @@ -48,7 +48,7 @@ #include opt_pms.h #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: synaptics.c,v 1.24 2010/03/21 20:04:43 plunky Exp $); +__KERNEL_RCSID(0, $NetBSD: synaptics.c,v 1.25 2010/11/15 05:58:18 uebayasi Exp $); #include sys/param.h #include sys/systm.h @@ -56,6 +56,7 @@ #include sys/ioctl.h #include sys/sysctl.h #include sys/kernel.h +#include sys/proc.h #include sys/bus.h
CVS commit: src/sys/dev/pckbport
Module Name:src Committed By: plunky Date: Sun Mar 21 19:57:05 UTC 2010 Modified Files: src/sys/dev/pckbport: synaptics.c Log Message: Extended capability probes can confuse the passthrough device, reset the touchpad on enable to cure that. To generate a diff of this commit: cvs rdiff -u -r1.22 -r1.23 src/sys/dev/pckbport/synaptics.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/synaptics.c diff -u src/sys/dev/pckbport/synaptics.c:1.22 src/sys/dev/pckbport/synaptics.c:1.23 --- src/sys/dev/pckbport/synaptics.c:1.22 Sun Mar 21 19:53:52 2010 +++ src/sys/dev/pckbport/synaptics.c Sun Mar 21 19:57:05 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: synaptics.c,v 1.22 2010/03/21 19:53:52 plunky Exp $ */ +/* $NetBSD: synaptics.c,v 1.23 2010/03/21 19:57:05 plunky Exp $ */ /* * Copyright (c) 2005, Steve C. Woodford @@ -48,7 +48,7 @@ #include opt_pms.h #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: synaptics.c,v 1.22 2010/03/21 19:53:52 plunky Exp $); +__KERNEL_RCSID(0, $NetBSD: synaptics.c,v 1.23 2010/03/21 19:57:05 plunky Exp $); #include sys/param.h #include sys/systm.h @@ -241,6 +241,10 @@ const char comma[] = , ; const char *sep = ; aprint_normal_dev(psc-sc_dev, ); + if (sc-flags SYN_FLAG_HAS_PASSTHROUGH) { + aprint_normal(%sPassthrough, sep); + sep = comma; + } if (sc-flags SYN_FLAG_HAS_MIDDLE_BUTTON) { aprint_normal(%sMiddle button, sep); sep = comma; @@ -276,9 +280,19 @@ { struct pms_softc *psc = vsc; struct synaptics_softc *sc = psc-u.synaptics; - u_char cmd[2]; + u_char cmd[2], resp[2]; int res; + if (sc-flags SYN_FLAG_HAS_PASSTHROUGH) { + /* + * Extended capability probes can confuse the passthrough device; + * reset the touchpad now to cure that. + */ + cmd[0] = PMS_RESET; + res = pckbport_poll_cmd(psc-sc_kbctag, psc-sc_kbcslot, cmd, + 1, 2, resp, 1); + } + /* * Enable Absolute mode with W (width) reporting, and set * the packet rate to maximum (80 packets per second).
CVS commit: src/sys/dev/pckbport
Module Name:src Committed By: plunky Date: Sun Mar 21 20:04:43 UTC 2010 Modified Files: src/sys/dev/pckbport: synaptics.c Log Message: send the SET_SCALE11 command before the 'sliced' command as per the Linux driver (and elantech(4)), via PR kern/42853 To generate a diff of this commit: cvs rdiff -u -r1.23 -r1.24 src/sys/dev/pckbport/synaptics.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/synaptics.c diff -u src/sys/dev/pckbport/synaptics.c:1.23 src/sys/dev/pckbport/synaptics.c:1.24 --- src/sys/dev/pckbport/synaptics.c:1.23 Sun Mar 21 19:57:05 2010 +++ src/sys/dev/pckbport/synaptics.c Sun Mar 21 20:04:43 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: synaptics.c,v 1.23 2010/03/21 19:57:05 plunky Exp $ */ +/* $NetBSD: synaptics.c,v 1.24 2010/03/21 20:04:43 plunky Exp $ */ /* * Copyright (c) 2005, Steve C. Woodford @@ -48,7 +48,7 @@ #include opt_pms.h #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: synaptics.c,v 1.23 2010/03/21 19:57:05 plunky Exp $); +__KERNEL_RCSID(0, $NetBSD: synaptics.c,v 1.24 2010/03/21 20:04:43 plunky Exp $); #include sys/param.h #include sys/systm.h @@ -630,13 +630,16 @@ u_char cmd[2]; int res; + cmd[0] = PMS_SET_SCALE11; + res = pckbport_poll_cmd(tag, slot, cmd, 1, 0, NULL, 0); + /* * Need to send 4 Set Resolution commands, with the argument * encoded in the bottom most 2 bits. */ cmd[0] = PMS_SET_RES; cmd[1] = syn_cmd 6; - res = pckbport_poll_cmd(tag, slot, cmd, 2, 0, NULL, 0); + res |= pckbport_poll_cmd(tag, slot, cmd, 2, 0, NULL, 0); cmd[0] = PMS_SET_RES; cmd[1] = (syn_cmd 0x30) 4;
CVS commit: src/sys/dev/pckbport
Module Name:src Committed By: dyoung Date: Fri Jan 8 20:00:33 UTC 2010 Modified Files: src/sys/dev/pckbport: pckbd.c pms.c Log Message: Expand PMF_FN_* macros. To generate a diff of this commit: cvs rdiff -u -r1.27 -r1.28 src/sys/dev/pckbport/pckbd.c cvs rdiff -u -r1.28 -r1.29 src/sys/dev/pckbport/pms.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/pckbd.c diff -u src/sys/dev/pckbport/pckbd.c:1.27 src/sys/dev/pckbport/pckbd.c:1.28 --- src/sys/dev/pckbport/pckbd.c:1.27 Thu Jul 16 20:44:54 2009 +++ src/sys/dev/pckbport/pckbd.c Fri Jan 8 20:00:32 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: pckbd.c,v 1.27 2009/07/16 20:44:54 jakllsch Exp $ */ +/* $NetBSD: pckbd.c,v 1.28 2010/01/08 20:00:32 dyoung Exp $ */ /*- * Copyright (c) 1998, 2009 The NetBSD Foundation, Inc. @@ -68,7 +68,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: pckbd.c,v 1.27 2009/07/16 20:44:54 jakllsch Exp $); +__KERNEL_RCSID(0, $NetBSD: pckbd.c,v 1.28 2010/01/08 20:00:32 dyoung Exp $); #include sys/param.h #include sys/systm.h @@ -236,7 +236,7 @@ } static bool -pckbd_suspend(device_t dv PMF_FN_ARGS) +pckbd_suspend(device_t dv, pmf_qual_t qual) { struct pckbd_softc *sc = device_private(dv); u_char cmd[1]; @@ -259,7 +259,7 @@ } static bool -pckbd_resume(device_t dv PMF_FN_ARGS) +pckbd_resume(device_t dv, pmf_qual_t qual) { struct pckbd_softc *sc = device_private(dv); u_char cmd[1], resp[1]; Index: src/sys/dev/pckbport/pms.c diff -u src/sys/dev/pckbport/pms.c:1.28 src/sys/dev/pckbport/pms.c:1.29 --- src/sys/dev/pckbport/pms.c:1.28 Sun Mar 8 15:06:56 2009 +++ src/sys/dev/pckbport/pms.c Fri Jan 8 20:00:32 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: pms.c,v 1.28 2009/03/08 15:06:56 ad Exp $ */ +/* $NetBSD: pms.c,v 1.29 2010/01/08 20:00:32 dyoung Exp $ */ /*- * Copyright (c) 2004 Kentaro Kurahone. @@ -26,7 +26,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: pms.c,v 1.28 2009/03/08 15:06:56 ad Exp $); +__KERNEL_RCSID(0, $NetBSD: pms.c,v 1.29 2010/01/08 20:00:32 dyoung Exp $); #include opt_pms.h @@ -90,8 +90,8 @@ int pms_ioctl(void *, u_long, void *, int, struct lwp *); void pms_disable(void *); -static bool pms_suspend(device_t PMF_FN_PROTO); -static bool pms_resume(device_t PMF_FN_PROTO); +static bool pms_suspend(device_t, pmf_qual_t); +static bool pms_resume(device_t, pmf_qual_t); const struct wsmouse_accessops pms_accessops = { pms_enable, @@ -343,7 +343,7 @@ } static bool -pms_suspend(device_t dv PMF_FN_ARGS) +pms_suspend(device_t dv, pmf_qual_t qual) { struct pms_softc *sc = device_private(dv); @@ -354,7 +354,7 @@ } static bool -pms_resume(device_t dv PMF_FN_ARGS) +pms_resume(device_t dv, pmf_qual_t qual) { struct pms_softc *sc = device_private(dv);
CVS commit: src/sys/dev/pckbport
Module Name:src Committed By: jakllsch Date: Thu Jul 16 20:44:54 UTC 2009 Modified Files: src/sys/dev/pckbport: pckbd.c Log Message: Ignore scancodes E0 2A, E0 AA, E0 36, E0 B6 when decoding. For the 10 keys on the editing keypad, these prefix/postfix scancodes indicate the state of the Left Shift and Right Shift keys and Num Lock indicator. This change prevents a spurious WSCONS_EVENT_KEY_UP event upon press as well as the corresponding WSCONS_EVENT_KEY_DOWN event upon release. To generate a diff of this commit: cvs rdiff -u -r1.26 -r1.27 src/sys/dev/pckbport/pckbd.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/pckbd.c diff -u src/sys/dev/pckbport/pckbd.c:1.26 src/sys/dev/pckbport/pckbd.c:1.27 --- src/sys/dev/pckbport/pckbd.c:1.26 Sun Mar 8 15:06:56 2009 +++ src/sys/dev/pckbport/pckbd.c Thu Jul 16 20:44:54 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: pckbd.c,v 1.26 2009/03/08 15:06:56 ad Exp $ */ +/* $NetBSD: pckbd.c,v 1.27 2009/07/16 20:44:54 jakllsch Exp $ */ /*- * Copyright (c) 1998, 2009 The NetBSD Foundation, Inc. @@ -68,7 +68,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: pckbd.c,v 1.26 2009/03/08 15:06:56 ad Exp $); +__KERNEL_RCSID(0, $NetBSD: pckbd.c,v 1.27 2009/07/16 20:44:54 jakllsch Exp $); #include sys/param.h #include sys/systm.h @@ -459,6 +459,17 @@ return 0; } + if (id-t_extended0 == 1) { + switch (datain 0x7f) { + case 0x2a: + case 0x36: + id-t_extended0 = 0; + return 0; + default: + break; + } + } + /* map extended keys to (unused) codes 128-254 */ key = (datain 0x7f) | (id-t_extended0 ? 0x80 : 0); id-t_extended0 = 0;
CVS commit: src/sys/dev/pckbport
Module Name:src Committed By: tonnerre Date: Sat Jun 13 20:21:56 UTC 2009 Modified Files: src/sys/dev/pckbport: wskbdmap_mfii.c Log Message: Add support for Swiss german kezboard to wskbd. Contributed by Marc Balmer. To generate a diff of this commit: cvs rdiff -u -r1.17 -r1.18 src/sys/dev/pckbport/wskbdmap_mfii.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/wskbdmap_mfii.c diff -u src/sys/dev/pckbport/wskbdmap_mfii.c:1.17 src/sys/dev/pckbport/wskbdmap_mfii.c:1.18 --- src/sys/dev/pckbport/wskbdmap_mfii.c:1.17 Mon Apr 6 17:32:09 2009 +++ src/sys/dev/pckbport/wskbdmap_mfii.c Sat Jun 13 20:21:56 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: wskbdmap_mfii.c,v 1.17 2009/04/06 17:32:09 mkirby Exp $ */ +/* $NetBSD: wskbdmap_mfii.c,v 1.18 2009/06/13 20:21:56 tonnerre Exp $ */ /*- * Copyright (c) 1997 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: wskbdmap_mfii.c,v 1.17 2009/04/06 17:32:09 mkirby Exp $); +__KERNEL_RCSID(0, $NetBSD: wskbdmap_mfii.c,v 1.18 2009/06/13 20:21:56 tonnerre Exp $); #include opt_wskbdmap.h #include sys/types.h @@ -225,6 +225,49 @@ KC(41), KS_asciicircum, KS_degree, }; +static const keysym_t pckbd_keydesc_sg[] = { +/* pos normal shifted altgr shift-altgr */ +KC(2), KS_1, KS_plus,KS_bar, +KC(3), KS_2, KS_quotedbl,KS_at, +KC(4), KS_3, KS_asterisk,KS_numbersign, +KC(5), KS_4, KS_ccedilla, +KC(7), KS_6, KS_ampersand, KS_notsign, +KC(8), KS_7, KS_slash, KS_brokenbar, +KC(9), KS_8, KS_parenleft, KS_cent, +KC(10), KS_9, KS_parenright, +KC(11), KS_0, KS_equal, +KC(12), KS_apostrophe, KS_question,KS_dead_acute, +KC(13), KS_dead_circumflex,KS_dead_grave, KS_dead_tilde, +KC(18), KS_e, KS_E, KS_currency, +KC(21), KS_z, +KC(26), KS_udiaeresis, KS_egrave, KS_bracketleft, +KC(27), KS_dead_diaeresis, KS_exclam, KS_bracketright, +KC(39), KS_odiaeresis, KS_eacute, +KC(40), KS_adiaeresis, KS_agrave, KS_braceleft, +KC(41), KS_section,KS_degree, KS_dead_abovering, +KC(43), KS_dollar, KS_sterling,KS_braceright, +KC(44), KS_y, +KC(51), KS_comma, KS_semicolon, +KC(52), KS_period, KS_colon, +KC(53), KS_minus, KS_underscore, +KC(86), KS_less, KS_greater, KS_backslash, +KC(184), KS_Mode_switch,KS_Multi_key, +}; + +static const keysym_t pckbd_keydesc_sg_nodead[] = { +/* pos normal shifted altgr shift-altgr */ +KC(12), KS_apostrophe, KS_question,KS_acute, +KC(13), KS_asciicircum,KS_grave, KS_asciitilde, +KC(27), KS_diaeresis, KS_exclam, KS_bracketright +}; + +static const keysym_t pckbd_keydesc_sf[] = { +/* pos normal shifted altgr shift-altgr */ +KC(26), KS_egrave, KS_udiaeresis, KS_bracketleft, +KC(39), KS_eacute, KS_odiaeresis, +KC(40), KS_agrave, KS_adiaeresis, KS_braceleft +}; + static const keysym_t pckbd_keydesc_dk[] = { /* pos normal shifted altgr shift-altgr */ KC(3), KS_2, KS_quotedbl, KS_at, @@ -647,6 +690,10 @@ #ifndef WSKBD_USONLY KBD_MAP(KB_DE, KB_US, pckbd_keydesc_de), KBD_MAP(KB_DE | KB_NODEAD, KB_DE, pckbd_keydesc_de_nodead), + KBD_MAP(KB_SG, KB_US, pckbd_keydesc_sg), + KBD_MAP(KB_SG | KB_NODEAD, KB_SG, pckbd_keydesc_sg_nodead), + KBD_MAP(KB_SF, KB_SG, pckbd_keydesc_sf), + KBD_MAP(KB_SF | KB_NODEAD, KB_SF, pckbd_keydesc_sg_nodead), KBD_MAP(KB_FR, KB_US, pckbd_keydesc_fr), KBD_MAP(KB_DK, KB_US, pckbd_keydesc_dk), KBD_MAP(KB_DK | KB_NODEAD, KB_DK, pckbd_keydesc_dk_nodead), @@ -678,6 +725,7 @@ KBD_NULLMAP(KB_US | KB_MACHDEP, KB_US), #ifndef WSKBD_USONLY KBD_NULLMAP(KB_DE | KB_MACHDEP, KB_DE), + KBD_NULLMAP(KB_SG | KB_MACHDEP, KB_SG), KBD_NULLMAP(KB_ES | KB_MACHDEP, KB_ES), KBD_NULLMAP(KB_FR | KB_MACHDEP, KB_FR), KBD_NULLMAP(KB_JP | KB_MACHDEP, KB_JP),