public inbox for linuxppc-dev@ozlabs.org 
 help / color / mirror / Atom feed
From: Guillaume Dargaud <dargaud@lpsc•in2p3.fr>
To: linuxppc-dev@lists•ozlabs.org
Subject: Getting the IRQ number (Was: Basic driver devel questions ?)
Date: Wed, 1 Dec 2010 17:35:58 +0100	[thread overview]
Message-ID: <201012011735.58769.dargaud@lpsc.in2p3.fr> (raw)
In-Reply-To: <1291205941.11595.9.camel@concordia>

> I guess it depends how basic they are :)
> 
> If they're basic _powerpc_ driver questions then this is probably the
> right place.
> 
> But I'd say just ask and maybe someone will be able to help, or maybe
> they'll point you somewhere else.

OK, here goes then: how do I get the IRQ number so that I can install an 
interrupt handler on it ?

In my dts file I have:
		xps_acqui_data_0: xps-acqui-data@c9800000 {
			compatible = "xlnx,xps-acqui-data-3.00.a";
			interrupt-parent = <&xps_intc_0>;
			interrupts = < 0 2 >;
			reg = < 0xc9800000 0x10000 >;
			xlnx,family = "virtex4";
			xlnx,include-dphase-timer = <0x1>;
			xlnx,mplb-awidth = <0x20>;
			xlnx,mplb-clk-period-ps = <0x2710>;
			xlnx,mplb-dwidth = <0x40>;
			xlnx,mplb-native-dwidth = <0x40>;
			xlnx,mplb-p2p = <0x0>;
			xlnx,mplb-smallest-slave = <0x20>;
		} ;

In my minimal driver init, I have:
  first = MKDEV (my_major, my_minor);
  register_chrdev_region(first, count, NAME);
  cdev_init(my_cdev, &fops);
  cdev_add (my_cdev, first, count);
So far so good.

Now how do I connect the dots between the hardware definitions from the dts and 
my driver ?
I have:
# ll /proc/device-tree/plb@0/xps-acqui-data@c9800000/
-r--r--r--    1 root     root          27 Dec  1 16:26 compatible
-r--r--r--    1 root     root           4 Dec  1 16:26 interrupt-parent
-r--r--r--    1 root     root           8 Dec  1 16:26 interrupts
-r--r--r--    1 root     root          15 Dec  1 16:26 name
-r--r--r--    1 root     root           8 Dec  1 16:26 reg
-r--r--r--    1 root     root           8 Dec  1 16:26 xlnx,family
-r--r--r--    1 root     root           4 Dec  1 16:26 xlnx,include-dphase-
timer
-r--r--r--    1 root     root           4 Dec  1 16:26 xlnx,mplb-awidth
-r--r--r--    1 root     root           4 Dec  1 16:26 xlnx,mplb-clk-period-ps
-r--r--r--    1 root     root           4 Dec  1 16:26 xlnx,mplb-dwidth
-r--r--r--    1 root     root           4 Dec  1 16:26 xlnx,mplb-native-dwidth
-r--r--r--    1 root     root           4 Dec  1 16:26 xlnx,mplb-p2p
-r--r--r--    1 root     root           4 Dec  1 16:26 xlnx,mplb-smallest-
slave

But first I'm not sure where to find the IRQ in there, and also I'm not sure if 
reading the filesystem from a module is allowed.

How do I know if this interrupt is shared or not (is it important ?)

Thanks
-- 
Guillaume Dargaud
http://www.gdargaud.net/

  reply	other threads:[~2010-12-01 16:36 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-01 10:15 Basic driver devel questions ? Guillaume Dargaud
2010-12-01 12:19 ` Michael Ellerman
2010-12-01 16:35   ` Guillaume Dargaud [this message]
2010-12-01 18:29     ` Getting the IRQ number (Was: Basic driver devel questions ?) Philipp Ittershagen
2010-12-01 18:41     ` Scott Wood
2010-12-02 15:36       ` Guillaume Dargaud
2010-12-02 16:17         ` Timur Tabi
2010-12-02 17:47           ` Guillaume Dargaud
2010-12-02 20:22             ` Benjamin Herrenschmidt
2010-12-03 14:58               ` Guillaume Dargaud
2010-12-03 15:37                 ` Martyn Welch
2010-12-06  5:29                 ` Michael Ellerman
2010-12-06  6:35                   ` Jeremy Kerr
2010-12-06 11:56                     ` Michael Ellerman
2010-12-06  9:58                   ` Guillaume Dargaud
2010-12-06 12:07                     ` Michael Ellerman
2010-12-06 14:44                       ` Guillaume Dargaud
2010-12-06 14:47                         ` David Laight
2010-12-08  1:03                         ` Michael Ellerman
2010-12-08 10:18                           ` Guillaume Dargaud
2010-12-08 13:45                             ` Michael Ellerman
2010-12-08 15:52                               ` Guillaume Dargaud
2010-12-09  0:22                                 ` Michael Ellerman
2010-12-10 16:21                                   ` Guillaume Dargaud
2010-12-12 21:46                                     ` Michael Ellerman
2010-12-08 19:20                               ` Joachim Förster
2010-12-06 12:17                     ` David Laight
2010-12-07 12:46                   ` Guillaume Dargaud
2010-12-08  0:50                     ` Michael Ellerman

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=201012011735.58769.dargaud@lpsc.in2p3.fr \
    --to=dargaud@lpsc$(echo .)in2p3.fr \
    --cc=linuxppc-dev@lists$(echo .)ozlabs.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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