linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* Does anyone have a simple UIO driver that uses an interrupt handler?
@ 2008-02-17 23:13 Nick Droogh
  2008-02-18 13:09 ` Hans-Jürgen Koch
  0 siblings, 1 reply; 2+ messages in thread
From: Nick Droogh @ 2008-02-17 23:13 UTC (permalink / raw)
  To: linuxppc-embedded

[-- Attachment #1: Type: text/plain, Size: 244 bytes --]

Hi everyone,

I am looking for a driver example for a user space driver utilizing an 
interrupt handler.  I am having trouble registering a handler in my 
driver attempt and would like to see an example of a working UIO driver.

Thanks,

Nick


[-- Attachment #2: ndroogh.vcf --]
[-- Type: text/x-vcard, Size: 220 bytes --]

begin:vcard
fn:Nick Droogh
n:Droogh;Nick
org:CADlink Technology
adr:Suite 100;;2440 Don Reid Drive;Ottawa;Ontario;K1H 1E1;Canada
email;internet:ndroogh@cadlink.com
title:Senior Technical Architect
version:2.1
end:vcard


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Does anyone have a simple UIO driver that uses an interrupt handler?
  2008-02-17 23:13 Does anyone have a simple UIO driver that uses an interrupt handler? Nick Droogh
@ 2008-02-18 13:09 ` Hans-Jürgen Koch
  0 siblings, 0 replies; 2+ messages in thread
From: Hans-Jürgen Koch @ 2008-02-18 13:09 UTC (permalink / raw)
  To: ndroogh; +Cc: linuxppc-embedded

Am Sun, 17 Feb 2008 18:13:07 -0500
schrieb Nick Droogh <ndroogh@cadlink.com>:

> Hi everyone,

Hi Nick,

> 
> I am looking for a driver example for a user space driver utilizing
> an interrupt handler.  I am having trouble registering a handler in
> my driver attempt and would like to see an example of a working UIO
> driver.

Did you have a look at uio-howto in Documentation/DocBook/ in the
kernel sources? Just do a "make htmldocs", and you get the UIO howto in
html format in its own subdirectory.

You don't have to "register" the userspace part of an UIO driver. You
simply open /dev/uio0, mmap() your device's memory, and wait for
interrupts using a blocking read() or select() on /dev/uio0.

If you want to do it properly, you should use sysfs to find the right
UIO device (there could be others...) and the size of the memory to
map. Have a look at the sources of lsuio to see how this is done:

http://www.osadl.org/projects/downloads/UIO/user/

You find the userspace part of the uio_cif driver there, too.

If you still got problems after reading this, feel free to ask me. Note
that I'm not subscribed to linuxppc-embedded. The preferred list for
UIO questions is LKML. If you don't want to subscribe to LKML, you can
also ask me by private mail. You should ask detailed questions, ideally
accompanied by a piece of your code that shows the problem.

Thanks,
Hans

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-02-18 14:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-02-17 23:13 Does anyone have a simple UIO driver that uses an interrupt handler? Nick Droogh
2008-02-18 13:09 ` Hans-Jürgen Koch

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).