From nobody Thu Nov 02 06:21:53 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4SLYgP35wjz5045P; Thu, 2 Nov 2023 06:21:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SLYgP20mVz4Bb8; Thu, 2 Nov 2023 06:21:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1698906113; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dfiqTGFSj9cgBSvL9Kt17KvAw+nFnfPzQsFQ061tMwE=; b=VljAXk4qLJfdIRI/G2k+xkdUhezyiOv0OaS46WB+ApggHd3/sYAapeQx2Vk1gj0YFbh04G TREtgkEvt1yaSokQpQjDDC1eKoQdK0uh+jK0R5nei4lXDHCEo5M0D9Wq+OG+6WMIu9ptR+ l/dHWkVVSHKGC2uVlTUAg2KZYcXaQNpgsYcZRTY7koY+eGLHNWrcekbGAb8OOGHUWJIOGK PMPoVCXD8ExSmw4SwXz3Lj9NF88haF5Ohbg+yhdUmpyx95bmo0x7AWwmLrrK5GHdJqFLl5 KSvanptbWmnXI/0g2WOfFPSunCVb2OING/1+hXNhLFrBLMIivUfD1q1Tyb9M0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1698906113; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dfiqTGFSj9cgBSvL9Kt17KvAw+nFnfPzQsFQ061tMwE=; b=R73Ax7nc9pVedyibQ1LvLPto1M2Aa3wON3rys3GDqno/qESGWL33ddHQgnjBajxOCY9N/Y Ic5LNjZHqMGTd3L+aOLF2IdjWW6u5VEFBH8WfH3+5uJ0vMeQrPqlj0Z8d6/E5p2UlktIVe n5v+P1Y+/qgaFu7W6DUOLaol5AvEOAbreM9xhjuYYq4LHub1Ylyn3gMFvUDxSPrR61OSi+ 6y3P6rj+oSP0kd8AwL9BtAk+dHoLQqwzRCMbd3c0d2ST59xdQgH8VWVhg/h87csFBZm70F sqS8WBqUK8QDOzu0wKHBF8WuJhcTW94U40nJLa9JJRuvUnXMYeSBe58FP9pE7g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1698906113; a=rsa-sha256; cv=none; b=jm0j/ZBL2JssD2r9g7BqL1i5iWaFHigy8LClZ/4Dv4NMPNtLQq/twC4W3LAm9GQ2u9eoXO PX1teu2JW8TGgYMbgFKpIwZ+F+4yAmDmBMEBLbJZ3hI+WBNkW/hRnn5c7T7tA6SLYDboPc /ll8cMG8Y1dV3HXlAWFL5IGgVbzcXm5bf+/r4z0u9bZYkmOmsoSQMfkeCZfQAE/pd25iMT 8FYZe0BrtzFtuCrw0fs44mdNgm4qjvaGfaU5Zl0Q4lRVG+QS/+D/6OGN5SArxV48SVOXz7 +4Oa4wUtkxh6waFtjMiRkJ0itlEJ1xbKh7ShkjzKhLrNPKYJ2aM5jLIRcmoF8g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4SLYgP0nvlz3bg; Thu, 2 Nov 2023 06:21:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3A26LrKk001338; Thu, 2 Nov 2023 06:21:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3A26LrRm001335; Thu, 2 Nov 2023 06:21:53 GMT (envelope-from git) Date: Thu, 2 Nov 2023 06:21:53 GMT Message-Id: <202311020621.3A26LrRm001335@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Vladimir Kondratyev Subject: git: 1d46c8e5c270 - main - hmt(4): Do not require input report HID usages to be a member of TLC List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wulf X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1d46c8e5c2702c141c6be982b3ca44e74d1cb8f1 Auto-Submitted: auto-generated The branch main has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=1d46c8e5c2702c141c6be982b3ca44e74d1cb8f1 commit 1d46c8e5c2702c141c6be982b3ca44e74d1cb8f1 Author: Vladimir Kondratyev AuthorDate: 2023-11-02 06:20:20 +0000 Commit: Vladimir Kondratyev CommitDate: 2023-11-02 06:20:20 +0000 hmt(4): Do not require input report HID usages to be a member of TLC Some touchpads places button usages (in HID report descriptor) in to the 2-nd level collection rather than in to the top level one. That confuses current code. Remove collection level check in HID report descriptor parser to fix device detection. Reported by: Peter Much PR: 267094 MFC after: 1 week --- sys/dev/hid/hmt.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/sys/dev/hid/hmt.c b/sys/dev/hid/hmt.c index 199a6a2ff045..f6b593222317 100644 --- a/sys/dev/hid/hmt.c +++ b/sys/dev/hid/hmt.c @@ -744,14 +744,13 @@ hmt_hid_parse(struct hmt_softc *sc, const void *d_ptr, hid_size_t d_len, else break; - if (hi.collevel == 1 && left_btn == 2 && + if (left_btn == 2 && hi.usage == HID_USAGE2(HUP_BUTTON, 1)) { has_int_button = true; sc->int_btn_loc = hi.loc; break; } - if (hi.collevel == 1 && - hi.usage >= HID_USAGE2(HUP_BUTTON, left_btn) && + if (hi.usage >= HID_USAGE2(HUP_BUTTON, left_btn) && hi.usage <= HID_USAGE2(HUP_BUTTON, HMT_BTN_MAX)) { btn = (hi.usage & 0xFFFF) - left_btn; setbit(sc->buttons, btn); @@ -760,13 +759,13 @@ hmt_hid_parse(struct hmt_softc *sc, const void *d_ptr, hid_size_t d_len, sc->max_button = btn + 1; break; } - if (hi.collevel == 1 && hi.usage == + if (hi.usage == HID_USAGE2(HUP_DIGITIZERS, HUD_CONTACTCOUNT)) { cont_count_found = true; sc->cont_count_loc = hi.loc; break; } - if (hi.collevel == 1 && hi.usage == + if (hi.usage == HID_USAGE2(HUP_DIGITIZERS, HUD_SCAN_TIME)) { scan_time_found = true; sc->scan_time_loc = hi.loc;