linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: "Hans-Jürgen Koch" <hjk@linutronix.de>
To: ndroogh@cadlink.com
Cc: linuxppc-embedded@ozlabs.org
Subject: Re: Does anyone have a simple UIO driver that uses an interrupt handler?
Date: Mon, 18 Feb 2008 14:09:33 +0100	[thread overview]
Message-ID: <20080218140933.23812526@dilbert.local> (raw)
In-Reply-To: <47B8BF83.2070907@cadlink.com>

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

      reply	other threads:[~2008-02-18 14:03 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080218140933.23812526@dilbert.local \
    --to=hjk@linutronix.de \
    --cc=linuxppc-embedded@ozlabs.org \
    --cc=ndroogh@cadlink.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).