From owner-svn-src-head@freebsd.org Thu Oct 6 01:01:01 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 66C33AF60D0; Thu, 6 Oct 2016 01:01:01 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 40F4512A; Thu, 6 Oct 2016 01:01:01 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u96110IU004300; Thu, 6 Oct 2016 01:01:00 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u96110AJ004299; Thu, 6 Oct 2016 01:01:00 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201610060101.u96110AJ004299@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Thu, 6 Oct 2016 01:01:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r306746 - head/sys/dev/atkbdc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Oct 2016 01:01:01 -0000 Author: gonzo Date: Thu Oct 6 01:01:00 2016 New Revision: 306746 URL: https://svnweb.freebsd.org/changeset/base/306746 Log: Fix extended buttons support on synaptic clickpad Fix regression introduced by r306355 on synaptic clickpads with extended buttons (buttons stopped working) PR: 205690 Submitted by: Vladimir Kondratyev Modified: head/sys/dev/atkbdc/psm.c Modified: head/sys/dev/atkbdc/psm.c ============================================================================== --- head/sys/dev/atkbdc/psm.c Thu Oct 6 00:51:27 2016 (r306745) +++ head/sys/dev/atkbdc/psm.c Thu Oct 6 01:01:00 2016 (r306746) @@ -2750,7 +2750,9 @@ proc_synaptics(struct psm_softc *sc, pac static int touchpad_buttons; static int guest_buttons; static finger_t f[PSM_FINGERS]; - int w, id, nfingers, ewcode; + int w, id, nfingers, ewcode, extended_buttons; + + extended_buttons = 0; /* TouchPad PS/2 absolute mode message format with capFourButtons: * @@ -2863,7 +2865,8 @@ proc_synaptics(struct psm_softc *sc, pac if (pb->ipacket[1] & 0x02) guest_buttons |= MOUSE_BUTTON3DOWN; - ms->button = touchpad_buttons | guest_buttons; + ms->button = touchpad_buttons | guest_buttons | + sc->extended_buttons; } goto SYNAPTICS_END; @@ -2933,30 +2936,26 @@ proc_synaptics(struct psm_softc *sc, pac /* Middle Button */ if ((pb->ipacket[0] ^ pb->ipacket[3]) & 0x01) touchpad_buttons |= MOUSE_BUTTON2DOWN; - } else if (sc->synhw.capExtended && sc->synhw.capClickPad) { - /* ClickPad Button */ - if ((pb->ipacket[0] ^ pb->ipacket[3]) & 0x01) - touchpad_buttons = MOUSE_BUTTON1DOWN; } else if (sc->synhw.capExtended && (sc->synhw.nExtendedButtons > 0)) { /* Extended Buttons */ if ((pb->ipacket[0] ^ pb->ipacket[3]) & 0x02) { if (sc->syninfo.directional_scrolls) { if (pb->ipacket[4] & 0x01) - touchpad_buttons |= MOUSE_BUTTON4DOWN; + extended_buttons |= MOUSE_BUTTON4DOWN; if (pb->ipacket[5] & 0x01) - touchpad_buttons |= MOUSE_BUTTON5DOWN; + extended_buttons |= MOUSE_BUTTON5DOWN; if (pb->ipacket[4] & 0x02) - touchpad_buttons |= MOUSE_BUTTON6DOWN; + extended_buttons |= MOUSE_BUTTON6DOWN; if (pb->ipacket[5] & 0x02) - touchpad_buttons |= MOUSE_BUTTON7DOWN; + extended_buttons |= MOUSE_BUTTON7DOWN; } else { if (pb->ipacket[4] & 0x01) - touchpad_buttons |= MOUSE_BUTTON1DOWN; + extended_buttons |= MOUSE_BUTTON1DOWN; if (pb->ipacket[5] & 0x01) - touchpad_buttons |= MOUSE_BUTTON3DOWN; + extended_buttons |= MOUSE_BUTTON3DOWN; if (pb->ipacket[4] & 0x02) - touchpad_buttons |= MOUSE_BUTTON2DOWN; - sc->extended_buttons = touchpad_buttons; + extended_buttons |= MOUSE_BUTTON2DOWN; + sc->extended_buttons = extended_buttons; } /* @@ -2984,9 +2983,13 @@ proc_synaptics(struct psm_softc *sc, pac * Keep reporting MOUSE DOWN until we get a new packet * indicating otherwise. */ - touchpad_buttons |= sc->extended_buttons; + extended_buttons |= sc->extended_buttons; } } + /* Handle ClickPad */ + if (sc->synhw.capClickPad && + ((pb->ipacket[0] ^ pb->ipacket[3]) & 0x01)) + touchpad_buttons |= MOUSE_BUTTON1DOWN; if (sc->synhw.capReportsV && nfingers > 1) f[0] = (finger_t) { @@ -3023,7 +3026,7 @@ proc_synaptics(struct psm_softc *sc, pac if (id >= nfingers) PSM_FINGER_RESET(f[id]); - ms->button = touchpad_buttons | guest_buttons; + ms->button = touchpad_buttons; /* Palm detection doesn't terminate the current action. */ if (!psmpalmdetect(sc, &f[0], nfingers)) { @@ -3034,6 +3037,8 @@ proc_synaptics(struct psm_softc *sc, pac VLOG(2, (LOG_DEBUG, "synaptics: palm detected! (%d)\n", f[0].w)); } + ms->button |= extended_buttons | guest_buttons; + SYNAPTICS_END: /* * Use the extra buttons as a scrollwheel