diff options
author | Vladimir Kondratyev <wulf@FreeBSD.org> | 2021-01-20 20:10:07 +0000 |
---|---|---|
committer | Vladimir Kondratyev <wulf@FreeBSD.org> | 2021-01-20 20:10:07 +0000 |
commit | 5cc21ab9949a189c809285823dbb6eadde6c6864 (patch) | |
tree | 6c26e867193085a19fae5214ece6199f2643bf3c /sys/dev | |
parent | 3e954a8bc64ebc21893eedba0f2f1159c242c9b6 (diff) | |
download | src-5cc21ab9949a189c809285823dbb6eadde6c6864.tar.gz src-5cc21ab9949a189c809285823dbb6eadde6c6864.zip |
hmt: Allow I2C sampling mode support to be compiled out.
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/hid/hmt.c | 10 |
1 files changed, 10 insertions, 0 deletions
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 <sys/param.h> #include <sys/bus.h> #include <sys/kernel.h> @@ -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; |