From: Bill Gatliff <bgat@billgatliff.com>
To: Peter Korsgaard <jacmet@sunsite.dk>
Cc: Linux/PPC Development <linuxppc-dev@ozlabs.org>
Subject: Re: Does gpio_to_irq() work for MPC52xx gpios?
Date: Wed, 23 Dec 2009 23:38:11 -0600 [thread overview]
Message-ID: <4B32FE43.1030905@billgatliff.com> (raw)
In-Reply-To: <4B327FEC.9030801@billgatliff.com>
Guys:
Ok, I have gpio_to_irq() more-or-less showing signs of life for the
MPC5200. But I'm having some trouble using it the way I want to.
Recall that I have a rotary encoder that's tied to IRQ2 and
GPIO_WKUP_7. I want to be able to describe it something like this:
rotary-encoder {
compatible = "linux,rotary-encoder","rotary-encoder";
interrupts = <&mpc5200_pic 2 3 &gpio_wkup 0 1>; // "IRQ2 on the
MPC5200 PIC,
// and pin 0 on GPIO_WKUP"
type = <1>; // what event signal to generate
val-ccw = <0x4a>; // what code to use for counter-clockwise rotation
val-cw = <78>; // what code to use for clockwise rotation
};
I've had some limited success with this, but not for any good reason.
It turns out that the explanation for why I was getting a valid number
for the first interrupt specification was because the device tree
compiler was assuming that the interrupt-parent was the mpc5200_pic; my
reference to the node in that list was utterly meaningless. The dtc
also appears to have ignored the &gpio_wkup word, and interpreted the
following zero as being the zero-th interrupt channel in the
mpc5200_pic. Or something like that. Clearly, I don't understand the
device tree syntax at all yet.
Anyway, when I change the statement to this:
rotary-encoder {
compatible = "linux,rotary-encoder","rotary-encoder";
interrupt-parent = <&gpio_wkup>;
interrupts = <0 0>;
type = <1>;
val-ccw = <0x4a>;
val-cw = <78>;
};
... then the magic number that the dtc comes up with is causing my new
chained interrupt handler for the gpio_wkup peripheral to come alive.
(Of course it doesn't actually work yet, but that's not the point!)
So here's my question: does the device tree compiler/syntax limit you to
only one interrupt parent?
I think the answer is no, because what I'm trying to do doesn't seem
that much different from how one specifies GPIO pins coming from
different controllers.
Any suggestions?
b.g.
--
Bill Gatliff
bgat@billgatliff.com
next prev parent reply other threads:[~2009-12-24 5:37 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-12-22 20:40 Does gpio_to_irq() work for MPC52xx gpios? Bill Gatliff
2009-12-22 21:00 ` Peter Korsgaard
2009-12-23 16:47 ` Bill Gatliff
2009-12-23 20:39 ` Bill Gatliff
2009-12-24 5:38 ` Bill Gatliff [this message]
2009-12-24 6:52 ` Bill Gatliff
2009-12-30 6:27 ` Bill Gatliff
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=4B32FE43.1030905@billgatliff.com \
--to=bgat@billgatliff.com \
--cc=jacmet@sunsite.dk \
--cc=linuxppc-dev@ozlabs.org \
/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).