public inbox for linuxppc-dev@ozlabs.org 
 help / color / mirror / Atom feed
From: Bill Gatliff <bgat@billgatliff•com>
To: Grant Likely <grant.likely@secretlab•ca>
Cc: Linux/PPC Development <linuxppc-dev@ozlabs•org>
Subject: Re: Question on MPC52xx IRQ[123] pins
Date: Thu, 31 Dec 2009 08:34:36 -0600	[thread overview]
Message-ID: <4B3CB67C.9060408@billgatliff.com> (raw)
In-Reply-To: <fa686aa40912211516u4a079693h74e39fd887cb421d@mail.gmail.com>

Grant Likely wrote:
> Correct.  IRQ2 can only be used as IRQ2.  It cannot be used a GPIO.
> (Well, I suppose you *could* try to hack into the interrupt controller
> driver and fetch the pin state that way; but I don't know if you can
> read the state of masked out IRQ pins, and it sure would be ugly.)
>   

Actually, I did think of a way you could do this.  You could register an
interrupt handler on the line, and set the irq type to level-low or
level-high.  Depending on whether the handler fires right away, you know
what the state of the pin must be.  And when the interrupt handler does
fire, you switch the irq type to the opposite setting.

I think that approach rates pretty high on the "ugly scale" too, but
perhaps tolerably so.  In fact, were I to actually need to interface one
of the IRQ lines to gpiolib, I might attempt this...


b.g.

-- 
Bill Gatliff
Embedded systems training and consulting
http://billgatliff.com
bgat@billgatliff•com

      reply	other threads:[~2009-12-31 14:34 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-21 22:30 Question on MPC52xx IRQ[123] pins Bill Gatliff
2009-12-21 23:16 ` Grant Likely
2009-12-31 14:34   ` Bill Gatliff [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=4B3CB67C.9060408@billgatliff.com \
    --to=bgat@billgatliff$(echo .)com \
    --cc=grant.likely@secretlab$(echo .)ca \
    --cc=linuxppc-dev@ozlabs$(echo .)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