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