linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: "Jon Smirl" <jonsmirl@gmail.com>
To: linuxppc-dev <Linuxppc-dev@ozlabs.org>
Subject: Re: Device treee syntax for expanding mpc5200 gpios
Date: Sun, 14 Sep 2008 22:59:22 -0400	[thread overview]
Message-ID: <9e4733910809141959v4b2b1942u7d6ca23cef87f268@mail.gmail.com> (raw)
In-Reply-To: <20080915024048.GA20312@yookeroo.seuss>

On Sun, Sep 14, 2008 at 10:40 PM, David Gibson
<david@gibson.dropbear.id.au> wrote:
> On Fri, Sep 12, 2008 at 04:43:22PM -0400, Jon Smirl wrote:
>> I need to implement some more of the mpc5200's gpio capabilities.
>>
>> Right now we have:
>> gpios = <&gpio_wkup 0 0>;
>> first cell is index into the bank, and second is unused.
>>
>> What do we need to fully describe a mpc5200 gpio?
>>
>> 1) open drain: 1 enable
>> 2) interrupt: 0 no int, 1 simple, 2 wakeup, 3 both
>> 3) interrupt type: 0 any transition, 1 rising, 2 falling, 3 pulse
>
> Maybe I'm misunderstanding the situation, but 2 and maybe 3 look more
> like configuration than something inherent to the hardware setup.
> Couldn't different drivers potentially choose different interrupt
> modes depending on their needs?  Remember the device tree describes
> the hardware, not how it's used.

This makes sense. Now that I understand more about the Linux interrupt
system I see that there is an API for setting interrupt type - #3.

I had type in there because I was copying from the existing interrupt node:
interrupts = <0x1 0xe 0x0>;
cell 1 = class critical, normal, sdma
cell 2 = number
cell 3 = level

Cell 3 is probably not needed in the existing definitions.

GPIO wake up interrupts come in on two different hardware interrupts
depending if they are normal or wake up.

		gpio_wkup: gpio-wkup@c00 {
			compatible = "fsl,mpc5200b-gpio-wkup","fsl,mpc5200-gpio-wkup";
			reg = <0xc00 0x40>;
			interrupts = <0x1 0x8 0x0 0x0 0x3 0x0>;
			interrupt-parent = <&mpc5200_pic>;
			gpio-controller;
			#gpio-cells = <4>;
		};

There's no existing API in the GPIO system to describe this case. You
have to decide if you want an interrupt to be able to wake the CPU up
from sleep mode. If you want the interrupt to do this, it will trigger
int 3 if the CPU is asleep, otherwise it triggers int 8. Should these
pins have two virqs? or should these two vectors be hidden from the
user of the interrupt?

-- 
Jon Smirl
jonsmirl@gmail.com

  reply	other threads:[~2008-09-15  2:59 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-12 20:43 Device treee syntax for expanding mpc5200 gpios Jon Smirl
2008-09-15  2:40 ` David Gibson
2008-09-15  2:59   ` Jon Smirl [this message]
2008-09-15 13:02 ` Anton Vorontsov
2008-09-15 13:16   ` Jon Smirl

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=9e4733910809141959v4b2b1942u7d6ca23cef87f268@mail.gmail.com \
    --to=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).