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