diff options
Diffstat (limited to 'Documentation/DocBook/uio-howto.tmpl')
-rw-r--r-- | Documentation/DocBook/uio-howto.tmpl | 63 |
1 files changed, 51 insertions, 12 deletions
diff --git a/Documentation/DocBook/uio-howto.tmpl b/Documentation/DocBook/uio-howto.tmpl index fdd7f4f887b7..df87d1b93605 100644 --- a/Documentation/DocBook/uio-howto.tmpl +++ b/Documentation/DocBook/uio-howto.tmpl | |||
@@ -21,6 +21,18 @@ | |||
21 | </affiliation> | 21 | </affiliation> |
22 | </author> | 22 | </author> |
23 | 23 | ||
24 | <copyright> | ||
25 | <year>2006-2008</year> | ||
26 | <holder>Hans-Jürgen Koch.</holder> | ||
27 | </copyright> | ||
28 | |||
29 | <legalnotice> | ||
30 | <para> | ||
31 | This documentation is Free Software licensed under the terms of the | ||
32 | GPL version 2. | ||
33 | </para> | ||
34 | </legalnotice> | ||
35 | |||
24 | <pubdate>2006-12-11</pubdate> | 36 | <pubdate>2006-12-11</pubdate> |
25 | 37 | ||
26 | <abstract> | 38 | <abstract> |
@@ -30,6 +42,12 @@ | |||
30 | 42 | ||
31 | <revhistory> | 43 | <revhistory> |
32 | <revision> | 44 | <revision> |
45 | <revnumber>0.5</revnumber> | ||
46 | <date>2008-05-22</date> | ||
47 | <authorinitials>hjk</authorinitials> | ||
48 | <revremark>Added description of write() function.</revremark> | ||
49 | </revision> | ||
50 | <revision> | ||
33 | <revnumber>0.4</revnumber> | 51 | <revnumber>0.4</revnumber> |
34 | <date>2007-11-26</date> | 52 | <date>2007-11-26</date> |
35 | <authorinitials>hjk</authorinitials> | 53 | <authorinitials>hjk</authorinitials> |
@@ -57,20 +75,9 @@ | |||
57 | </bookinfo> | 75 | </bookinfo> |
58 | 76 | ||
59 | <chapter id="aboutthisdoc"> | 77 | <chapter id="aboutthisdoc"> |
60 | <?dbhtml filename="about.html"?> | 78 | <?dbhtml filename="aboutthis.html"?> |
61 | <title>About this document</title> | 79 | <title>About this document</title> |
62 | 80 | ||
63 | <sect1 id="copyright"> | ||
64 | <?dbhtml filename="copyright.html"?> | ||
65 | <title>Copyright and License</title> | ||
66 | <para> | ||
67 | Copyright (c) 2006 by Hans-Jürgen Koch.</para> | ||
68 | <para> | ||
69 | This documentation is Free Software licensed under the terms of the | ||
70 | GPL version 2. | ||
71 | </para> | ||
72 | </sect1> | ||
73 | |||
74 | <sect1 id="translations"> | 81 | <sect1 id="translations"> |
75 | <?dbhtml filename="translations.html"?> | 82 | <?dbhtml filename="translations.html"?> |
76 | <title>Translations</title> | 83 | <title>Translations</title> |
@@ -189,6 +196,30 @@ interested in translating it, please email me | |||
189 | represents the total interrupt count. You can use this number | 196 | represents the total interrupt count. You can use this number |
190 | to figure out if you missed some interrupts. | 197 | to figure out if you missed some interrupts. |
191 | </para> | 198 | </para> |
199 | <para> | ||
200 | For some hardware that has more than one interrupt source internally, | ||
201 | but not separate IRQ mask and status registers, there might be | ||
202 | situations where userspace cannot determine what the interrupt source | ||
203 | was if the kernel handler disables them by writing to the chip's IRQ | ||
204 | register. In such a case, the kernel has to disable the IRQ completely | ||
205 | to leave the chip's register untouched. Now the userspace part can | ||
206 | determine the cause of the interrupt, but it cannot re-enable | ||
207 | interrupts. Another cornercase is chips where re-enabling interrupts | ||
208 | is a read-modify-write operation to a combined IRQ status/acknowledge | ||
209 | register. This would be racy if a new interrupt occurred | ||
210 | simultaneously. | ||
211 | </para> | ||
212 | <para> | ||
213 | To address these problems, UIO also implements a write() function. It | ||
214 | is normally not used and can be ignored for hardware that has only a | ||
215 | single interrupt source or has separate IRQ mask and status registers. | ||
216 | If you need it, however, a write to <filename>/dev/uioX</filename> | ||
217 | will call the <function>irqcontrol()</function> function implemented | ||
218 | by the driver. You have to write a 32-bit value that is usually either | ||
219 | 0 or 1 to disable or enable interrupts. If a driver does not implement | ||
220 | <function>irqcontrol()</function>, <function>write()</function> will | ||
221 | return with <varname>-ENOSYS</varname>. | ||
222 | </para> | ||
192 | 223 | ||
193 | <para> | 224 | <para> |
194 | To handle interrupts properly, your custom kernel module can | 225 | To handle interrupts properly, your custom kernel module can |
@@ -362,6 +393,14 @@ device is actually used. | |||
362 | <function>open()</function>, you will probably also want a custom | 393 | <function>open()</function>, you will probably also want a custom |
363 | <function>release()</function> function. | 394 | <function>release()</function> function. |
364 | </para></listitem> | 395 | </para></listitem> |
396 | |||
397 | <listitem><para> | ||
398 | <varname>int (*irqcontrol)(struct uio_info *info, s32 irq_on) | ||
399 | </varname>: Optional. If you need to be able to enable or disable | ||
400 | interrupts from userspace by writing to <filename>/dev/uioX</filename>, | ||
401 | you can implement this function. The parameter <varname>irq_on</varname> | ||
402 | will be 0 to disable interrupts and 1 to enable them. | ||
403 | </para></listitem> | ||
365 | </itemizedlist> | 404 | </itemizedlist> |
366 | 405 | ||
367 | <para> | 406 | <para> |