From owner-dev-commits-src-branches@freebsd.org Mon Aug 23 22:26:12 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E9963672DAD; Mon, 23 Aug 2021 22:26:12 +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 4Gtmzm5y7Rz3NC2; Mon, 23 Aug 2021 22:26:12 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 A62C81C7A3; Mon, 23 Aug 2021 22:26:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17NMQCuv014678; Mon, 23 Aug 2021 22:26:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17NMQCbB014677; Mon, 23 Aug 2021 22:26:12 GMT (envelope-from git) Date: Mon, 23 Aug 2021 22:26:12 GMT Message-Id: <202108232226.17NMQCbB014677@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Vladimir Kondratyev Subject: git: 5517f7f9e70d - stable/13 - hmt(4): Store Contact Count in separate variable. 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 5517f7f9e70dcfdb824ce414e4a0f5a24f58fefe Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Aug 2021 22:26:13 -0000 The branch stable/13 has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=5517f7f9e70dcfdb824ce414e4a0f5a24f58fefe commit 5517f7f9e70dcfdb824ce414e4a0f5a24f58fefe Author: Vladimir Kondratyev AuthorDate: 2021-08-16 20:11:36 +0000 Commit: Vladimir Kondratyev CommitDate: 2021-08-23 22:19:43 +0000 hmt(4): Store Contact Count in separate variable. No functional changes. (cherry picked from commit 95add157e341f2c1ce47eaa19b3c5771705ea20d) --- sys/dev/hid/hmt.c | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/sys/dev/hid/hmt.c b/sys/dev/hid/hmt.c index fd50ea4de829..2eb02811a5a4 100644 --- a/sys/dev/hid/hmt.c +++ b/sys/dev/hid/hmt.c @@ -185,6 +185,7 @@ struct hmt_softc { device_t dev; enum hmt_type type; + int32_t cont_count_max; struct hid_absinfo ai[HMT_N_USAGES]; struct hid_location locs[MAX_MT_SLOTS][HMT_N_USAGES]; struct hid_location cont_count_loc; @@ -332,7 +333,7 @@ hmt_attach(device_t dev) * 'Contact Count Maximum' */ if (cont_count_max > 0) - sc->ai[HMT_SLOT].max = cont_count_max - 1; + sc->cont_count_max = cont_count_max; } else DPRINTF("hid_get_report error=%d\n", err); } else @@ -368,12 +369,19 @@ hmt_attach(device_t dev) } /* Cap contact count maximum to MAX_MT_SLOTS */ - if (sc->ai[HMT_SLOT].max >= MAX_MT_SLOTS) { + if (sc->cont_count_max > MAX_MT_SLOTS) { DPRINTF("Hardware reported %d contacts while only %d is " - "supported\n", (int)sc->ai[HMT_SLOT].max+1, MAX_MT_SLOTS); - sc->ai[HMT_SLOT].max = MAX_MT_SLOTS - 1; + "supported\n", sc->cont_count_max, MAX_MT_SLOTS); + sc->cont_count_max = MAX_MT_SLOTS; } + /* Set number of MT protocol type B slots */ + sc->ai[HMT_SLOT] = (struct hid_absinfo) { + .min = 0, + .max = sc->cont_count_max - 1, + .res = 0, + }; + if (hid_test_quirk(hw, HQ_MT_TIMESTAMP) || hmt_timestamps) sc->do_timestamps = true; #ifdef IICHID_SAMPLING @@ -445,7 +453,7 @@ hmt_attach(device_t dev) sc->is_clickpad ? ", click-pad" : ""); device_printf(sc->dev, "%d contacts with [%s%s%s%s%s] properties. Report range [%d:%d] - [%d:%d]\n", - (int)sc->ai[HMT_SLOT].max + 1, + (int)sc->cont_count_max, isset(sc->caps, HMT_IN_RANGE) ? "R" : "", isset(sc->caps, HMT_CONFIDENCE) ? "C" : "", isset(sc->caps, HMT_WIDTH) ? "W" : "", @@ -834,13 +842,6 @@ hmt_hid_parse(struct hmt_softc *sc, const void *d_ptr, hid_size_t d_len, if (cont_count_max < 1) cont_count_max = cont; - /* Set number of MT protocol type B slots */ - sc->ai[HMT_SLOT] = (struct hid_absinfo) { - .min = 0, - .max = cont_count_max - 1, - .res = 0, - }; - /* Report touch orientation if both width and height are supported */ if (isset(sc->caps, HMT_WIDTH) && isset(sc->caps, HMT_HEIGHT)) { setbit(sc->caps, HMT_ORIENTATION); @@ -857,6 +858,7 @@ hmt_hid_parse(struct hmt_softc *sc, const void *d_ptr, hid_size_t d_len, hid_feature, sc->thqa_cert_rid); sc->report_id = report_id; + sc->cont_count_max = cont_count_max; sc->nconts_per_report = cont; sc->has_int_button = has_int_button;