commit de9973b24d10f0cb0b184a691393c6947e16523f Author: Vladimir Kondratyev Date: Tue Aug 24 18:28:02 2021 +0300 hmt(4): Add support for touchpads with no "button type" usage Assume touchpad to be a clickpad if it has only internal button. Fixes Dell Precision 7550 laptop. PR: 257992 diff --git a/sys/dev/hid/hmt.c b/sys/dev/hid/hmt.c index cb7afe7290d..6e63f13b4ae 100644 --- a/sys/dev/hid/hmt.c +++ b/sys/dev/hid/hmt.c @@ -343,14 +343,14 @@ hmt_attach(device_t dev) bzero(fbuf, fsize); err = hid_get_report(dev, fbuf, sc->btn_type_rlen, NULL, HID_FEATURE_REPORT, sc->btn_type_rid); - } - if (sc->btn_type_rlen > 1) { - if (err == 0) - sc->is_clickpad = hid_get_udata(fbuf + 1, - sc->btn_type_rlen - 1, &sc->btn_type_loc) == 0; - else + if (err != 0) DPRINTF("hid_get_report error=%d\n", err); } + if (sc->btn_type_rlen > 1 && err == 0) + sc->is_clickpad = hid_get_udata(fbuf + 1, sc->btn_type_rlen - 1, + &sc->btn_type_loc) == 0; + else + sc->is_clickpad = sc->max_button == 0 && sc->has_int_button; /* Fetch THQA certificate to enable some devices like WaveShare */ if (sc->thqa_cert_rlen > 1 && sc->thqa_cert_rid != sc->cont_max_rid)