xref: /freebsd/share/man/man4/hidquirk.4 (revision 924226fba12cc9a228c73b956e1b7fa24c60b055)
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_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