diff options
Diffstat (limited to 'Documentation')
-rw-r--r-- | Documentation/DocBook/device-drivers.tmpl | 12 | ||||
-rw-r--r-- | Documentation/IRQ-domain.txt | 117 | ||||
-rw-r--r-- | Documentation/input/event-codes.txt | 72 | ||||
-rw-r--r-- | Documentation/sysctl/kernel.txt | 2 |
4 files changed, 193 insertions, 10 deletions
diff --git a/Documentation/DocBook/device-drivers.tmpl b/Documentation/DocBook/device-drivers.tmpl index 2f7fd4360848..9c27e5125dd2 100644 --- a/Documentation/DocBook/device-drivers.tmpl +++ b/Documentation/DocBook/device-drivers.tmpl | |||
@@ -102,9 +102,12 @@ X!Iinclude/linux/kobject.h | |||
102 | !Iinclude/linux/device.h | 102 | !Iinclude/linux/device.h |
103 | </sect1> | 103 | </sect1> |
104 | <sect1><title>Device Drivers Base</title> | 104 | <sect1><title>Device Drivers Base</title> |
105 | !Idrivers/base/init.c | ||
105 | !Edrivers/base/driver.c | 106 | !Edrivers/base/driver.c |
106 | !Edrivers/base/core.c | 107 | !Edrivers/base/core.c |
108 | !Edrivers/base/syscore.c | ||
107 | !Edrivers/base/class.c | 109 | !Edrivers/base/class.c |
110 | !Idrivers/base/node.c | ||
108 | !Edrivers/base/firmware_class.c | 111 | !Edrivers/base/firmware_class.c |
109 | !Edrivers/base/transport_class.c | 112 | !Edrivers/base/transport_class.c |
110 | <!-- Cannot be included, because | 113 | <!-- Cannot be included, because |
@@ -113,7 +116,7 @@ X!Iinclude/linux/kobject.h | |||
113 | exceed allowed 44 characters maximum | 116 | exceed allowed 44 characters maximum |
114 | X!Edrivers/base/attribute_container.c | 117 | X!Edrivers/base/attribute_container.c |
115 | --> | 118 | --> |
116 | !Edrivers/base/sys.c | 119 | !Edrivers/base/dd.c |
117 | <!-- | 120 | <!-- |
118 | X!Edrivers/base/interface.c | 121 | X!Edrivers/base/interface.c |
119 | --> | 122 | --> |
@@ -121,6 +124,11 @@ X!Edrivers/base/interface.c | |||
121 | !Edrivers/base/platform.c | 124 | !Edrivers/base/platform.c |
122 | !Edrivers/base/bus.c | 125 | !Edrivers/base/bus.c |
123 | </sect1> | 126 | </sect1> |
127 | <sect1><title>Device Drivers DMA Management</title> | ||
128 | !Edrivers/base/dma-buf.c | ||
129 | !Edrivers/base/dma-coherent.c | ||
130 | !Edrivers/base/dma-mapping.c | ||
131 | </sect1> | ||
124 | <sect1><title>Device Drivers Power Management</title> | 132 | <sect1><title>Device Drivers Power Management</title> |
125 | !Edrivers/base/power/main.c | 133 | !Edrivers/base/power/main.c |
126 | </sect1> | 134 | </sect1> |
@@ -219,7 +227,7 @@ X!Isound/sound_firmware.c | |||
219 | <chapter id="uart16x50"> | 227 | <chapter id="uart16x50"> |
220 | <title>16x50 UART Driver</title> | 228 | <title>16x50 UART Driver</title> |
221 | !Edrivers/tty/serial/serial_core.c | 229 | !Edrivers/tty/serial/serial_core.c |
222 | !Edrivers/tty/serial/8250.c | 230 | !Edrivers/tty/serial/8250/8250.c |
223 | </chapter> | 231 | </chapter> |
224 | 232 | ||
225 | <chapter id="fbdev"> | 233 | <chapter id="fbdev"> |
diff --git a/Documentation/IRQ-domain.txt b/Documentation/IRQ-domain.txt new file mode 100644 index 000000000000..27dcaabfb4db --- /dev/null +++ b/Documentation/IRQ-domain.txt | |||
@@ -0,0 +1,117 @@ | |||
1 | irq_domain interrupt number mapping library | ||
2 | |||
3 | The current design of the Linux kernel uses a single large number | ||
4 | space where each separate IRQ source is assigned a different number. | ||
5 | This is simple when there is only one interrupt controller, but in | ||
6 | systems with multiple interrupt controllers the kernel must ensure | ||
7 | that each one gets assigned non-overlapping allocations of Linux | ||
8 | IRQ numbers. | ||
9 | |||
10 | The irq_alloc_desc*() and irq_free_desc*() APIs provide allocation of | ||
11 | irq numbers, but they don't provide any support for reverse mapping of | ||
12 | the controller-local IRQ (hwirq) number into the Linux IRQ number | ||
13 | space. | ||
14 | |||
15 | The irq_domain library adds mapping between hwirq and IRQ numbers on | ||
16 | top of the irq_alloc_desc*() API. An irq_domain to manage mapping is | ||
17 | preferred over interrupt controller drivers open coding their own | ||
18 | reverse mapping scheme. | ||
19 | |||
20 | irq_domain also implements translation from Device Tree interrupt | ||
21 | specifiers to hwirq numbers, and can be easily extended to support | ||
22 | other IRQ topology data sources. | ||
23 | |||
24 | === irq_domain usage === | ||
25 | An interrupt controller driver creates and registers an irq_domain by | ||
26 | calling one of the irq_domain_add_*() functions (each mapping method | ||
27 | has a different allocator function, more on that later). The function | ||
28 | will return a pointer to the irq_domain on success. The caller must | ||
29 | provide the allocator function with an irq_domain_ops structure with | ||
30 | the .map callback populated as a minimum. | ||
31 | |||
32 | In most cases, the irq_domain will begin empty without any mappings | ||
33 | between hwirq and IRQ numbers. Mappings are added to the irq_domain | ||
34 | by calling irq_create_mapping() which accepts the irq_domain and a | ||
35 | hwirq number as arguments. If a mapping for the hwirq doesn't already | ||
36 | exist then it will allocate a new Linux irq_desc, associate it with | ||
37 | the hwirq, and call the .map() callback so the driver can perform any | ||
38 | required hardware setup. | ||
39 | |||
40 | When an interrupt is received, irq_find_mapping() function should | ||
41 | be used to find the Linux IRQ number from the hwirq number. | ||
42 | |||
43 | If the driver has the Linux IRQ number or the irq_data pointer, and | ||
44 | needs to know the associated hwirq number (such as in the irq_chip | ||
45 | callbacks) then it can be directly obtained from irq_data->hwirq. | ||
46 | |||
47 | === Types of irq_domain mappings === | ||
48 | There are several mechanisms available for reverse mapping from hwirq | ||
49 | to Linux irq, and each mechanism uses a different allocation function. | ||
50 | Which reverse map type should be used depends on the use case. Each | ||
51 | of the reverse map types are described below: | ||
52 | |||
53 | ==== Linear ==== | ||
54 | irq_domain_add_linear() | ||
55 | |||
56 | The linear reverse map maintains a fixed size table indexed by the | ||
57 | hwirq number. When a hwirq is mapped, an irq_desc is allocated for | ||
58 | the hwirq, and the IRQ number is stored in the table. | ||
59 | |||
60 | The Linear map is a good choice when the maximum number of hwirqs is | ||
61 | fixed and a relatively small number (~ < 256). The advantages of this | ||
62 | map are fixed time lookup for IRQ numbers, and irq_descs are only | ||
63 | allocated for in-use IRQs. The disadvantage is that the table must be | ||
64 | as large as the largest possible hwirq number. | ||
65 | |||
66 | The majority of drivers should use the linear map. | ||
67 | |||
68 | ==== Tree ==== | ||
69 | irq_domain_add_tree() | ||
70 | |||
71 | The irq_domain maintains a radix tree map from hwirq numbers to Linux | ||
72 | IRQs. When an hwirq is mapped, an irq_desc is allocated and the | ||
73 | hwirq is used as the lookup key for the radix tree. | ||
74 | |||
75 | The tree map is a good choice if the hwirq number can be very large | ||
76 | since it doesn't need to allocate a table as large as the largest | ||
77 | hwirq number. The disadvantage is that hwirq to IRQ number lookup is | ||
78 | dependent on how many entries are in the table. | ||
79 | |||
80 | Very few drivers should need this mapping. At the moment, powerpc | ||
81 | iseries is the only user. | ||
82 | |||
83 | ==== No Map ===- | ||
84 | irq_domain_add_nomap() | ||
85 | |||
86 | The No Map mapping is to be used when the hwirq number is | ||
87 | programmable in the hardware. In this case it is best to program the | ||
88 | Linux IRQ number into the hardware itself so that no mapping is | ||
89 | required. Calling irq_create_direct_mapping() will allocate a Linux | ||
90 | IRQ number and call the .map() callback so that driver can program the | ||
91 | Linux IRQ number into the hardware. | ||
92 | |||
93 | Most drivers cannot use this mapping. | ||
94 | |||
95 | ==== Legacy ==== | ||
96 | irq_domain_add_legacy() | ||
97 | irq_domain_add_legacy_isa() | ||
98 | |||
99 | The Legacy mapping is a special case for drivers that already have a | ||
100 | range of irq_descs allocated for the hwirqs. It is used when the | ||
101 | driver cannot be immediately converted to use the linear mapping. For | ||
102 | example, many embedded system board support files use a set of #defines | ||
103 | for IRQ numbers that are passed to struct device registrations. In that | ||
104 | case the Linux IRQ numbers cannot be dynamically assigned and the legacy | ||
105 | mapping should be used. | ||
106 | |||
107 | The legacy map assumes a contiguous range of IRQ numbers has already | ||
108 | been allocated for the controller and that the IRQ number can be | ||
109 | calculated by adding a fixed offset to the hwirq number, and | ||
110 | visa-versa. The disadvantage is that it requires the interrupt | ||
111 | controller to manage IRQ allocations and it requires an irq_desc to be | ||
112 | allocated for every hwirq, even if it is unused. | ||
113 | |||
114 | The legacy map should only be used if fixed IRQ mappings must be | ||
115 | supported. For example, ISA controllers would use the legacy map for | ||
116 | mapping Linux IRQs 0-15 so that existing ISA drivers get the correct IRQ | ||
117 | numbers. | ||
diff --git a/Documentation/input/event-codes.txt b/Documentation/input/event-codes.txt index 23fcb05175be..53305bd08182 100644 --- a/Documentation/input/event-codes.txt +++ b/Documentation/input/event-codes.txt | |||
@@ -17,11 +17,11 @@ reports supported by a device are also provided by sysfs in | |||
17 | class/input/event*/device/capabilities/, and the properties of a device are | 17 | class/input/event*/device/capabilities/, and the properties of a device are |
18 | provided in class/input/event*/device/properties. | 18 | provided in class/input/event*/device/properties. |
19 | 19 | ||
20 | Types: | 20 | Event types: |
21 | ========== | 21 | =========== |
22 | Types are groupings of codes under a logical input construct. Each type has a | 22 | Event types are groupings of codes under a logical input construct. Each |
23 | set of applicable codes to be used in generating events. See the Codes section | 23 | type has a set of applicable codes to be used in generating events. See the |
24 | for details on valid codes for each type. | 24 | Codes section for details on valid codes for each type. |
25 | 25 | ||
26 | * EV_SYN: | 26 | * EV_SYN: |
27 | - Used as markers to separate events. Events may be separated in time or in | 27 | - Used as markers to separate events. Events may be separated in time or in |
@@ -63,9 +63,9 @@ for details on valid codes for each type. | |||
63 | * EV_FF_STATUS: | 63 | * EV_FF_STATUS: |
64 | - Used to receive force feedback device status. | 64 | - Used to receive force feedback device status. |
65 | 65 | ||
66 | Codes: | 66 | Event codes: |
67 | ========== | 67 | =========== |
68 | Codes define the precise type of event. | 68 | Event codes define the precise type of event. |
69 | 69 | ||
70 | EV_SYN: | 70 | EV_SYN: |
71 | ---------- | 71 | ---------- |
@@ -220,6 +220,56 @@ EV_PWR: | |||
220 | EV_PWR events are a special type of event used specifically for power | 220 | EV_PWR events are a special type of event used specifically for power |
221 | mangement. Its usage is not well defined. To be addressed later. | 221 | mangement. Its usage is not well defined. To be addressed later. |
222 | 222 | ||
223 | Device properties: | ||
224 | ================= | ||
225 | Normally, userspace sets up an input device based on the data it emits, | ||
226 | i.e., the event types. In the case of two devices emitting the same event | ||
227 | types, additional information can be provided in the form of device | ||
228 | properties. | ||
229 | |||
230 | INPUT_PROP_DIRECT + INPUT_PROP_POINTER: | ||
231 | -------------------------------------- | ||
232 | The INPUT_PROP_DIRECT property indicates that device coordinates should be | ||
233 | directly mapped to screen coordinates (not taking into account trivial | ||
234 | transformations, such as scaling, flipping and rotating). Non-direct input | ||
235 | devices require non-trivial transformation, such as absolute to relative | ||
236 | transformation for touchpads. Typical direct input devices: touchscreens, | ||
237 | drawing tablets; non-direct devices: touchpads, mice. | ||
238 | |||
239 | The INPUT_PROP_POINTER property indicates that the device is not transposed | ||
240 | on the screen and thus requires use of an on-screen pointer to trace user's | ||
241 | movements. Typical pointer devices: touchpads, tablets, mice; non-pointer | ||
242 | device: touchscreen. | ||
243 | |||
244 | If neither INPUT_PROP_DIRECT or INPUT_PROP_POINTER are set, the property is | ||
245 | considered undefined and the device type should be deduced in the | ||
246 | traditional way, using emitted event types. | ||
247 | |||
248 | INPUT_PROP_BUTTONPAD: | ||
249 | -------------------- | ||
250 | For touchpads where the button is placed beneath the surface, such that | ||
251 | pressing down on the pad causes a button click, this property should be | ||
252 | set. Common in clickpad notebooks and macbooks from 2009 and onwards. | ||
253 | |||
254 | Originally, the buttonpad property was coded into the bcm5974 driver | ||
255 | version field under the name integrated button. For backwards | ||
256 | compatibility, both methods need to be checked in userspace. | ||
257 | |||
258 | INPUT_PROP_SEMI_MT: | ||
259 | ------------------ | ||
260 | Some touchpads, most common between 2008 and 2011, can detect the presence | ||
261 | of multiple contacts without resolving the individual positions; only the | ||
262 | number of contacts and a rectangular shape is known. For such | ||
263 | touchpads, the semi-mt property should be set. | ||
264 | |||
265 | Depending on the device, the rectangle may enclose all touches, like a | ||
266 | bounding box, or just some of them, for instance the two most recent | ||
267 | touches. The diversity makes the rectangle of limited use, but some | ||
268 | gestures can normally be extracted from it. | ||
269 | |||
270 | If INPUT_PROP_SEMI_MT is not set, the device is assumed to be a true MT | ||
271 | device. | ||
272 | |||
223 | Guidelines: | 273 | Guidelines: |
224 | ========== | 274 | ========== |
225 | The guidelines below ensure proper single-touch and multi-finger functionality. | 275 | The guidelines below ensure proper single-touch and multi-finger functionality. |
@@ -240,6 +290,8 @@ used to report when a touch is active on the screen. | |||
240 | BTN_{MOUSE,LEFT,MIDDLE,RIGHT} must not be reported as the result of touch | 290 | BTN_{MOUSE,LEFT,MIDDLE,RIGHT} must not be reported as the result of touch |
241 | contact. BTN_TOOL_<name> events should be reported where possible. | 291 | contact. BTN_TOOL_<name> events should be reported where possible. |
242 | 292 | ||
293 | For new hardware, INPUT_PROP_DIRECT should be set. | ||
294 | |||
243 | Trackpads: | 295 | Trackpads: |
244 | ---------- | 296 | ---------- |
245 | Legacy trackpads that only provide relative position information must report | 297 | Legacy trackpads that only provide relative position information must report |
@@ -250,6 +302,8 @@ location of the touch. BTN_TOUCH should be used to report when a touch is active | |||
250 | on the trackpad. Where multi-finger support is available, BTN_TOOL_<name> should | 302 | on the trackpad. Where multi-finger support is available, BTN_TOOL_<name> should |
251 | be used to report the number of touches active on the trackpad. | 303 | be used to report the number of touches active on the trackpad. |
252 | 304 | ||
305 | For new hardware, INPUT_PROP_POINTER should be set. | ||
306 | |||
253 | Tablets: | 307 | Tablets: |
254 | ---------- | 308 | ---------- |
255 | BTN_TOOL_<name> events must be reported when a stylus or other tool is active on | 309 | BTN_TOOL_<name> events must be reported when a stylus or other tool is active on |
@@ -260,3 +314,5 @@ button may be used for buttons on the tablet except BTN_{MOUSE,LEFT}. | |||
260 | BTN_{0,1,2,etc} are good generic codes for unlabeled buttons. Do not use | 314 | BTN_{0,1,2,etc} are good generic codes for unlabeled buttons. Do not use |
261 | meaningful buttons, like BTN_FORWARD, unless the button is labeled for that | 315 | meaningful buttons, like BTN_FORWARD, unless the button is labeled for that |
262 | purpose on the device. | 316 | purpose on the device. |
317 | |||
318 | For new hardware, both INPUT_PROP_DIRECT and INPUT_PROP_POINTER should be set. | ||
diff --git a/Documentation/sysctl/kernel.txt b/Documentation/sysctl/kernel.txt index 8c20fbd8b42d..6d78841fd416 100644 --- a/Documentation/sysctl/kernel.txt +++ b/Documentation/sysctl/kernel.txt | |||
@@ -601,6 +601,8 @@ can be ORed together: | |||
601 | instead of using the one provided by the hardware. | 601 | instead of using the one provided by the hardware. |
602 | 512 - A kernel warning has occurred. | 602 | 512 - A kernel warning has occurred. |
603 | 1024 - A module from drivers/staging was loaded. | 603 | 1024 - A module from drivers/staging was loaded. |
604 | 2048 - The system is working around a severe firmware bug. | ||
605 | 4096 - An out-of-tree module has been loaded. | ||
604 | 606 | ||
605 | ============================================================== | 607 | ============================================================== |
606 | 608 | ||