linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: "Grant Likely" <grant.likely@secretlab.ca>
To: mtwallet <mike_timmons@trimble.com>
Cc: linuxppc-embedded@ozlabs.org
Subject: Re: mpc5200 arch=powerpc kernel=2.6.24: how do I request external IRQ0-3?
Date: Sat, 26 Apr 2008 23:01:24 -0600	[thread overview]
Message-ID: <fa686aa40804262201i158a9c63pf8fdfd766ba3d0@mail.gmail.com> (raw)
In-Reply-To: <16918127.post@talk.nabble.com>

On Sat, Apr 26, 2008 at 7:58 PM, mtwallet <mike_timmons@trimble.com> wrote:
>
>  I got something working. I created a "device" child in the DTS file and used
>  th platform driver subsystem to register my module and get the virtual IRQ
>  as derived from the interrupt triplet-style spec in the dts file.

Sorry I didn't get back to you right away.  Yes, the best/right thing
to do is put a node in your device tree to capture the interrupt and
other interfaces to your custom device.

You should consider using the of_platform infrastructure for
registering your device.  Your driver code can extract its register
locations and interrupts directly from a device tree node.  For an
example, look at the ulite_of_probe and ulite_of_driver in
driver/serial/uartlite.c.

>  I'm still not real content as my child is nested with the SOC peripherals,
>  but this is more of a style/readability hang-up for me, for now. At least
>  now I can get the virtual irq by registering a platform driver, requesting
>  the irq number, and successfully requesting the irq.
>
>  I welcome any advice if I have used the dts file in an unintended fashion,
>  but it feels like the right place to specify a "device", even if all the
>  device embodies is an IRQ. Newbie conceptual difficulty overcome.

Your part of the way there.  Your node should be a child of the device
that it is connected to.  Is it attached to the local bus?  or i2c?
It should have a "compatible" property so that your device driver can
find it (in the form 'compatible = "<manufacturer>,<device>";').  It
should have both an 'interrupt-parent' and an 'interrupts' property
for specifying the interrupt.  If the device is addressable, it should
have a 'reg' property.

You're right that it shouldn't be mixed in with the SoC nodes because
that doesn't accurately describe your platform.  But, it is perfectly
fine for it to be a child of one of the SoC nodes (for example if it
is attached to one of the i2c busses).

Cheers,
g.

-- 
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.

      reply	other threads:[~2008-04-27  5:01 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-25 16:14 mpc5200 arch=powerpc kernel=2.6.24: how do I request external IRQ0-3? Mike Timmons
2008-04-27  1:58 ` mtwallet
2008-04-27  5:01   ` Grant Likely [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=fa686aa40804262201i158a9c63pf8fdfd766ba3d0@mail.gmail.com \
    --to=grant.likely@secretlab.ca \
    --cc=linuxppc-embedded@ozlabs.org \
    --cc=mike_timmons@trimble.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).