xref: /freebsd/share/man/man4/hidquirk.4 (revision 9768746b)
1.\"
2.\" Copyright (c) 2010 AnyWi Technologies
3.\" All rights reserved.
4.\"
5.\" Permission to use, copy, modify, and distribute this software for any
6.\" purpose with or without fee is hereby granted, provided that the above
7.\" copyright notice and this permission notice appear in all copies.
8.\"
9.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16.\"
17.\" $FreeBSD$
18.\"
19.Dd September 16, 2020
20.Dt HIDQUIRK 4
21.Os
22.Sh NAME
23.Nm hidquirk
24.Nd HID quirks module
25.Sh SYNOPSIS
26To compile this module into the kernel,
27place the following line in your
28kernel configuration file:
29.Bd -ragged -offset indent
30.Cd "device hid"
31.Ed
32.Pp
33Alternatively, to load the module at boot
34time, place the following line in
35.Xr loader.conf 5 :
36.Bd -literal -offset indent
37hidquirk_load="YES"
38.Ed
39.Sh DESCRIPTION
40The
41.Nm
42module provides support for adding quirks for HID devices
43.Bl -tag -width Ds
44.It HQ_HID_IGNORE
45device should be ignored by hid class
46.It HQ_KBD_BOOTPROTO
47device should set the boot protocol
48.It HQ_MS_BOOTPROTO
49device should set the boot protocol
50.It HQ_MS_BAD_CLASS
51doesn't identify properly
52.It HQ_MS_LEADING_BYTE
53mouse sends an unknown leading byte
54.It HQ_MS_REVZ
55mouse has Z-axis reversed
56.It HQ_MS_VENDOR_BTN
57mouse has buttons in vendor usage page
58.It HQ_SPUR_BUT_UP
59spurious mouse button up events
60.It HQ_MT_TIMESTAMP
61Multitouch device exports HW timestamps
62.Dv 0x1b5a01
63.El
64.Pp
65See
66.Pa /sys/dev/hid/hidquirk.h
67for the complete list of supported quirks.
68.Sh LOADER TUNABLE
69The following tunable can be set at the
70.Xr loader 8
71prompt before booting the kernel, or stored in
72.Xr loader.conf 5 .
73.Bl -tag -width indent
74.It Va hw.hid.quirk.%d
75The value is a string whose format is:
76.Bd -literal -offset indent
77.Qo BusId VendorId ProductId LowRevision HighRevision HQ_QUIRK,... Qc
78.Ed
79.Pp
80Installs the quirks
81.Ic HQ_QUIRK,...
82for all HID devices matching
83.Ic BusId
84and
85.Ic VendorId
86and
87.Ic ProductId
88which have a hardware revision between and including
89.Ic LowRevision
90and
91.Ic HighRevision .
92.Pp
93.Ic BusId ,
94.Ic VendorId ,
95.Ic ProductId ,
96.Ic LowRevision
97and
98.Ic HighRevision
99are all 16 bits numbers which can be decimal or hexadecimal based.
100.Pp
101A maximum of 100 variables
102.Ic hw.hid.quirk.0, .1, ..., .99
103can be defined.
104.Pp
105If a matching entry is found in the kernel's internal quirks table, it
106is replaced by the new definition.
107.Pp
108Else a new entry is created given that the quirk table is not full.
109.Pp
110The kernel iterates over the
111.Ic hw.hid.quirk.N
112variables starting at
113.Ic N = 0
114and stops at
115.Ic N = 99
116or the first non-existing one.
117.El
118.Sh EXAMPLES
119To install a quirk at boot time, place one or several lines like the
120following in
121.Xr loader.conf 5 :
122.Bd -literal -offset indent
123hw.hid.quirk.0="0x18 0x6cb 0x1941 0 0xffff HQ_MT_TIMESTAMP"
124.Ed
125.Sh HISTORY
126The
127.Nm
128module appeared in
129.Fx 13.0 .
130.Sh AUTHORS
131.An -nosplit
132The
133.Nm
134driver was written by
135.An Hans Petter Selasky Aq Mt hselasky@FreeBSD.org
136for
137.Xr usb 4
138subsystem and adopted to
139.Xr hid 4
140by
141.An Vladimir Kondratyev Aq Mt wulf@FreeBSD.org .
142This manual page is based on
143.Xr usb_quirk 4
144manual page written by
145.An Nick Hibma Aq Mt n_hibma@FreeBSD.org .
146