From: Grant Likely <grant.likely@secretlab.ca>
To: Jon Smirl <jonsmirl@gmail.com>
Cc: linuxppc-dev@ozlabs.org
Subject: Re: [RFC 1/2] powerpc/5200: add general purpose timer API for the MPC5200
Date: Fri, 6 Mar 2009 14:39:45 -0700 [thread overview]
Message-ID: <fa686aa40903061339w63dd2b75n1fb40f890f2ae54e@mail.gmail.com> (raw)
In-Reply-To: <9e4733910903061329n202725edibb8af1b979920d5b@mail.gmail.com>
On Fri, Mar 6, 2009 at 2:29 PM, Jon Smirl <jonsmirl@gmail.com> wrote:
> I'm using a GPT pin in input capture mode to implement IR. I attached
> my GPT driver code. I can convert to your API. That's a really cheap
> way to do IR, just IR sensor, resistor and a cap.
The driver I posted can't do input capture mode yet, but it shouldn't
be too difficult to add. Just another api function for setting the
mode I think. I don't have a use for that yet, so I haven't thought
much about it. Feel free to suggest what you think the API should
look like.
> This is my old device tree, what should the new one look like?
>
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0ir0@670 { /* General Purpose Timer 6 in In=
put mode */
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0compatible =3D "gpt-ir";
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0cell-index =3D <7>;
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0reg =3D <0x670 0x10>;
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0interrupts =3D <0x1 0x10 0=
x0>;
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0interrupt-parent =3D <&mpc=
5200_pic>;
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0};
You'd want a node for the IR device which uses the GPT node as its
interrupt controller.
so:
gpt7: gpt@670 {
compatible =3D "fsl,mpc5200b-gpt"
reg =3D <0x670 0x10>;
interrupt =3D <1 16 0>;
interrupt-controller;
#interrupt-cells =3D <1>;
};
Then elsewhere:
ir {
compatible =3D "digispeaker,ir"; // or whatever best matches your =
board
interrupt-parent =3D <&gpt>;
interrupts =3D <0>; // IIRC, '0' means irq on both edges for
the GPT irq controller
};
g.
--=20
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
prev parent reply other threads:[~2009-03-06 21:39 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-03-06 21:12 [RFC 1/2] powerpc/5200: add general purpose timer API for the MPC5200 Grant Likely
2009-03-06 21:13 ` [RFC 2/2] powerpc/5200: add LocalPlus bus FIFO device driver Grant Likely
2009-03-06 21:29 ` [RFC 1/2] powerpc/5200: add general purpose timer API for the MPC5200 Jon Smirl
2009-03-06 21:39 ` 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=fa686aa40903061339w63dd2b75n1fb40f890f2ae54e@mail.gmail.com \
--to=grant.likely@secretlab.ca \
--cc=jonsmirl@gmail.com \
--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).