Commit Graph

20 Commits

Author SHA1 Message Date
Warner Losh
56cc89585d bcm5874: Add opt_usb.h for module dependency
Sponsored by:		Netflix
2022-04-05 13:52:55 -06:00
Vladimir Kondratyev
d5add41d4d ietp(4): Driver for Elantech I2C touchpad
MFC after:	2 month
Tested by:	Matt Daw <matt.daw_AT_gmail_DOT_com>
2022-03-03 02:35:24 +03:00
Vladimir Kondratyev
5aa839c9e2 bcm5974: wsp(4) driver version with HID attachment.
MFC after:	2 month
Tested by:	Greg V (Type 4 touchpads)
2022-03-03 02:35:23 +03:00
Konstantin Belousov
5bb3134a8c Fix some modules to export more used symbols
and remove non-present symbols that are now reported by kmod_syms.awk.

Reviewed by:	emaste
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D32878
2021-11-18 15:56:23 +02:00
Vladimir Kondratyev
8e84712d01 hidmap: add missing opt_hid.h to module Makefile
Reported by:	pstef
MFC after:	2 weeks
2021-04-14 23:05:59 +03:00
Vladimir Kondratyev
6241b57131 hid: add opt_hid.h to modules that use HID_DEBUG
Submitted by:	Greg V <greg_AT_unrelenting_DOT_technology>
Reviewed by:	imp, wulf
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D28995
2021-03-04 01:43:29 +03:00
Vladimir Kondratyev
5cc21ab994 hmt: Allow I2C sampling mode support to be compiled out. 2021-01-20 23:10:07 +03:00
Vladimir Kondratyev
3e954a8bc6 hms: Workaround idle mouse drift in I2C sampling mode.
Many I2C "compatibility" mouse devices found on touchpads continue to
return last report data in sampling mode after touch has been ended.
That results in cursor drift.  Filter out such a reports with comparing
content of current report with content of previous one.

Reported by:	many
Tested by:	omatsuda, gllb (github.com)
Obtained from:	sysutils/iichid
2021-01-20 23:10:07 +03:00
Vladimir Kondratyev
d97d5c0ce8 hid: Import hidmap-based drivers written by Greg V
This change includes:

hpen    - Generic / MS Windows compatible HID pen tablet driver.
hgame   - Generic game controller and joystick driver.
xb360gp - Xbox360-compatible game controller driver.

Submitted by:	Greg V <greg_unrelenting.technology>
Reviewed by:	hselasky (as part of D27993)
2021-01-08 02:18:44 +03:00
Vladimir Kondratyev
afd590d9e5 hid: Import hidmap and bunch of drivers based on it
hidmap is a kernel module that maps HID input usages to evdev events.

Following dependent drivers is included in the commit:

hms       - HID mouse driver.
hcons     - Consumer page AKA Multimedia keys driver.
hsctrl    - System Controls page (Power/Sleep keys) driver.
ps4dshock - Sony DualShock 4 gamepad driver.

Reviewed by:	hselasky
Differential revision:	https://reviews.freebsd.org/D27993
2021-01-08 02:18:44 +03:00
Vladimir Kondratyev
9be6b22da9 hidraw(4): Add HIDRAW_MAKE_UHID_ALIAS kernel option
which installs /dev/uhid# alias to hidraw character device for
compatibility with some existing uhid(4) users like Firefox.
As side effect it renames traditional uhid(4) driver to hidraw
to make possible using of common unit number allocator.

Requested by:	Greg V <greg_unrelenting.technology>
Reviewed by:	hselasky (as part of D27992)
2021-01-08 02:18:44 +03:00
Vladimir Kondratyev
9477390796 hid: Import hidraw(4) - driver for access to raw HID device data
This driver provides raw access to HID devices through uhid(4)-compatible
interface and is based on pre-8.x uhid(4) code. Unlike uhid(4) it does
not take devices in to monopoly ownership and allows parallel access
from other drivers.

hidraw supports Linux's hidraw-compatible interface as well.

Reviewed by:	hselasky
Differential revision:	https://reviews.freebsd.org/D27992
2021-01-08 02:18:43 +03:00
Vladimir Kondratyev
b93f6bfca3 hid: Port ukbd to HID and attach to build
Reviewed by:	hselasky
Differential revision:  https://reviews.freebsd.org/D27991
2021-01-08 02:18:43 +03:00
Vladimir Kondratyev
cb022db825 hid: Port multitouch hmt(4) driver to hidbus and attach to build
Reviewed by:	hselasky
Differential revision:	https://reviews.freebsd.org/D27990
2021-01-08 02:18:43 +03:00
Vladimir Kondratyev
10fbbdfbbd hid: Import hconf(4) - digitizer configuration top-level collection support.
Reviewed by:	hselasky (as part of D27990)
2021-01-08 02:18:43 +03:00
Vladimir Kondratyev
e49fa9f6f3 hid: Import quirk subsystem.
hidquirk(4) is derived from usb_quirk(4) and inherits all its HID-related
functionality. It does not support ioctl(2) interface yet.

Reviewed by:	hselasky
Differential revision:	https://reviews.freebsd.org/D27890
2021-01-08 02:18:43 +03:00
Vladimir Kondratyev
2b4464b0b1 hid: Import hidbus(4)
This driver provides support for multiple HID driver attachments
to single HID transport backend. This ability existed in Net/OpenBSD
(uhidev and ihidev drivers) but has never been ported to FreeBSD.
Unlike Net/OpenBSD we do not use report number alone to distinct report
source but we follow MS way and use a top level collection (TLC) usage
index that report belongs to as a location key.

The driver performs child device autodiscovery based on HID report
descriptor data, proxying of HID requests from child devices to parent
transport backends and broadcasting of interrupts in backward direction.

Differential revision:	https://reviews.freebsd.org/D27888
2021-01-08 02:18:42 +03:00
Vladimir Kondratyev
961a3535db hid: Import HID transport method definitions and helper functions.
Create an abstract HID interface that provides hardware independent
access to HID capabilities and functions through the device tree.

hid_if.m resembles existing USBHID KPI and consist of next methods:

HID method		USBHID variant
-----------------------------------------------------------------------
hid_intr_setup		usbd_transfer_setup	(INTERRUPT IN xfer)
hid_intr_unsetup	usbd_transfer_unsetup	(INTERRUPT IN xfer)
hid_intr_start		usbd_transfer_start	(INTERRUPT IN xfer)
hid_intr_stop		usbd_transfer_drain	(INTERRUPT IN xfer)
hid_intr_poll		usbd_transfer_poll	(INTERRUPT IN xfer)

hid_get_rdesc		usbd_req_get_report_descriptor
hid_read		No direct analog. Not intended for common use.
hid_write		uhid(4) write()
hid_get_report		usbd_req_get_report
hid_set_report		usbd_req_set_report
hid_set_idle		usbd_req_set_idle
hid_set_protocol	usbd_req_set_protocol

This change is part of D27888
2021-01-08 02:18:42 +03:00
Vladimir Kondratyev
1975878673 hid: Import functions and constants required by new subsystem
This does an import of quirk stubs, debugging macros from USB code and
numerous usage constants used by dependent drivers.

Besides, this change renames some functions to get a better matching
with userland library and NetBSD/OpenBSD HID code. Namely:

- Old hid_report_size() renamed to hid_report_size_max()
- New hid_report_size() calculates size of given report rather than
  maximum size of all reports.
- hid_get_data_unsigned() renamed to hid_get_udata()
- hid_put_data_unsigned() renamed to hid_put_udata()

Compat shim functions are provided in usbhid.h to make possible compile
of legacy code unmodified after this change.

Reviewed by:	manu, hselasky
Differential revision:	https://reviews.freebsd.org/D27887
2021-01-08 02:18:42 +03:00
Vladimir Kondratyev
67de2db262 Factor-out hardware-independent part of USB HID support to new module
It will be used by the upcoming HID-over-i2C implementation.  Should be
no-op, except hid.ko module dependency is to be added to affected drivers.

Reviewed by:	hselasky, manu
Differential revision:	https://reviews.freebsd.org/D27867
2021-01-08 02:18:42 +03:00