xref: /freebsd/share/man/man4/hidquirk.4 (revision 5ca8e32633c4ffbbcd6762e5888b6a4ba0708c6c)
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.Dd September 16, 2020
18.Dt HIDQUIRK 4
19.Os
20.Sh NAME
21.Nm hidquirk
22.Nd HID quirks module
23.Sh SYNOPSIS
24To compile this module into the kernel,
25place the following line in your
26kernel configuration file:
27.Bd -ragged -offset indent
28.Cd "device hid"
29.Ed
30.Pp
31Alternatively, to load the module at boot
32time, place the following line in
33.Xr loader.conf 5 :
34.Bd -literal -offset indent
35hidquirk_load="YES"
36.Ed
37.Sh DESCRIPTION
38The
39.Nm
40module provides support for adding quirks for HID devices
41.Bl -tag -width Ds
42.It HQ_HID_IGNORE
43device should be ignored by hid class
44.It HQ_KBD_BOOTPROTO
45device should set the boot protocol
46.It HQ_MS_BOOTPROTO
47device should set the boot protocol
48.It HQ_MS_BAD_CLASS
49doesn't identify properly
50.It HQ_MS_LEADING_BYTE
51mouse sends an unknown leading byte
52.It HQ_MS_REVZ
53mouse has Z-axis reversed
54.It HQ_MS_VENDOR_BTN
55mouse has buttons in vendor usage page
56.It HQ_SPUR_BUT_UP
57spurious mouse button up events
58.It HQ_MT_TIMESTAMP
59Multitouch device exports HW timestamps
60.Dv 0x1b5a01
61.El
62.Pp
63See
64.Pa /sys/dev/hid/hidquirk.h
65for the complete list of supported quirks.
66.Sh LOADER TUNABLE
67The following tunable can be set at the
68.Xr loader 8
69prompt before booting the kernel, or stored in
70.Xr loader.conf 5 .
71.Bl -tag -width indent
72.It Va hw.hid.quirk.%d
73The value is a string whose format is:
74.Bd -literal -offset indent
75.Qo BusId VendorId ProductId LowRevision HighRevision HQ_QUIRK,... Qc
76.Ed
77.Pp
78Installs the quirks
79.Ic HQ_QUIRK,...
80for all HID devices matching
81.Ic BusId
82and
83.Ic VendorId
84and
85.Ic ProductId
86which have a hardware revision between and including
87.Ic LowRevision
88and
89.Ic HighRevision .
90.Pp
91.Ic BusId ,
92.Ic VendorId ,
93.Ic ProductId ,
94.Ic LowRevision
95and
96.Ic HighRevision
97are all 16 bits numbers which can be decimal or hexadecimal based.
98.Pp
99A maximum of 100 variables
100.Ic hw.hid.quirk.0, .1, ..., .99
101can be defined.
102.Pp
103If a matching entry is found in the kernel's internal quirks table, it
104is replaced by the new definition.
105.Pp
106Else a new entry is created given that the quirk table is not full.
107.Pp
108The kernel iterates over the
109.Ic hw.hid.quirk.N
110variables starting at
111.Ic N = 0
112and stops at
113.Ic N = 99
114or the first non-existing one.
115.El
116.Sh EXAMPLES
117To install a quirk at boot time, place one or several lines like the
118following in
119.Xr loader.conf 5 :
120.Bd -literal -offset indent
121hw.hid.quirk.0="0x18 0x6cb 0x1941 0 0xffff HQ_MT_TIMESTAMP"
122.Ed
123.Sh HISTORY
124The
125.Nm
126module appeared in
127.Fx 13.0 .
128.Sh AUTHORS
129.An -nosplit
130The
131.Nm
132driver was written by
133.An Hans Petter Selasky Aq Mt hselasky@FreeBSD.org
134for
135.Xr usb 4
136subsystem and adopted to
137.Xr hid 4
138by
139.An Vladimir Kondratyev Aq Mt wulf@FreeBSD.org .
140This manual page is based on
141.Xr usb_quirk 4
142manual page written by
143.An Nick Hibma Aq Mt n_hibma@FreeBSD.org .
144