From owner-dev-commits-src-all@freebsd.org Wed Jan 20 20:10:45 2021 Return-Path: Delivered-To: dev-commits-src-all@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 C7B6A4D88DC; Wed, 20 Jan 2021 20:10:45 +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 4DLc8j4c71z3mHF; Wed, 20 Jan 2021 20:10:45 +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 849381F511; Wed, 20 Jan 2021 20:10:45 +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 10KKAjIF045086; Wed, 20 Jan 2021 20:10:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10KKAjVN045085; Wed, 20 Jan 2021 20:10:45 GMT (envelope-from git) Date: Wed, 20 Jan 2021 20:10:45 GMT Message-Id: <202101202010.10KKAjVN045085@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: 5cc21ab9949a - main - hmt: Allow I2C sampling mode support to be compiled out. 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: 5cc21ab9949a189c809285823dbb6eadde6c6864 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Jan 2021 20:10:46 -0000 The branch main has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=5cc21ab9949a189c809285823dbb6eadde6c6864 commit 5cc21ab9949a189c809285823dbb6eadde6c6864 Author: Vladimir Kondratyev AuthorDate: 2021-01-20 20:10:07 +0000 Commit: Vladimir Kondratyev CommitDate: 2021-01-20 20:10:07 +0000 hmt: Allow I2C sampling mode support to be compiled out. --- sys/dev/hid/hmt.c | 10 ++++++++++ sys/modules/hid/hmt/Makefile | 1 + 2 files changed, 11 insertions(+) diff --git a/sys/dev/hid/hmt.c b/sys/dev/hid/hmt.c index 6cfe43157e64..fd50ea4de829 100644 --- a/sys/dev/hid/hmt.c +++ b/sys/dev/hid/hmt.c @@ -35,6 +35,8 @@ __FBSDID("$FreeBSD$"); * https://www.kernel.org/doc/Documentation/input/multi-touch-protocol.txt */ +#include "opt_hid.h" + #include #include #include @@ -207,7 +209,9 @@ struct hmt_softc { bool has_int_button; bool is_clickpad; bool do_timestamps; +#ifdef IICHID_SAMPLING bool iichid_sampling; +#endif struct hid_location cont_max_loc; uint32_t cont_max_rlen; @@ -372,8 +376,10 @@ hmt_attach(device_t dev) if (hid_test_quirk(hw, HQ_MT_TIMESTAMP) || hmt_timestamps) sc->do_timestamps = true; +#ifdef IICHID_SAMPLING if (hid_test_quirk(hw, HQ_IICHID_SAMPLING)) sc->iichid_sampling = true; +#endif hidbus_set_intr(dev, hmt_intr, sc); @@ -404,8 +410,10 @@ hmt_attach(device_t dev) evdev_support_event(sc->evdev, EV_MSC); evdev_support_msc(sc->evdev, MSC_TIMESTAMP); } +#ifdef IICHID_SAMPLING if (sc->iichid_sampling) evdev_set_flag(sc->evdev, EVDEV_FLAG_MT_AUTOREL); +#endif nbuttons = 0; if (sc->max_button != 0 || sc->has_int_button) { evdev_support_event(sc->evdev, EV_KEY); @@ -476,6 +484,7 @@ hmt_intr(void *context, void *buf, hid_size_t len) int32_t delta; uint8_t id; +#ifdef IICHID_SAMPLING /* * Special packet of zero length is generated by iichid driver running * in polling mode at the start of inactivity period to workaround @@ -492,6 +501,7 @@ hmt_intr(void *context, void *buf, hid_size_t len) evdev_sync(sc->evdev); return; } +#endif /* Ignore irrelevant reports */ id = sc->report_id != 0 ? *(uint8_t *)buf : 0; diff --git a/sys/modules/hid/hmt/Makefile b/sys/modules/hid/hmt/Makefile index f6bed08d439d..975c94fa0b88 100644 --- a/sys/modules/hid/hmt/Makefile +++ b/sys/modules/hid/hmt/Makefile @@ -4,6 +4,7 @@ KMOD= hmt SRCS= hmt.c +SRCS+= opt_hid.h SRCS+= bus_if.h device_if.h .include