linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Felix Radensky <felix@embedded-sol.com>
To: Wolfgang Grandegger <wg@grandegger.com>
Cc: "linuxppc-dev@ozlabs.org" <linuxppc-dev@ozlabs.org>,
	Tabi Timur-B04825 <B04825@freescale.com>
Subject: Re: GPIO IRQ on P1022
Date: Sun, 31 Jul 2011 22:28:32 +0300	[thread overview]
Message-ID: <4E35ACE0.3020908@embedded-sol.com> (raw)
In-Reply-To: <4E3595B6.4010406@grandegger.com>

Hi Wolfgang,

On 07/31/2011 08:49 PM, Wolfgang Grandegger wrote:
> Hi Felix,
>
> On 07/31/2011 05:51 PM, Felix Radensky wrote:
>> Hi Wolfgang,
>>
>> On 07/31/2011 06:19 PM, Wolfgang Grandegger wrote:
>>> On 07/31/2011 12:38 PM, Felix Radensky wrote:
>>>> Hi,
>>>>
>>>> I'm running kernel 3.0 on a custom board based on Freescale P1022.
>>>> The interrupt line of on-board FPGA is connected to GPIO2_9. FPGA
>>>> IRQ is level, active low. The GPIOs are mapped like this:
> Here you say that it's a level sensitive interrupt but ...
>
>>>> GPIOs 160-191, /soc@ffe00000/gpio-controller@f200:
>>>>
>>>> GPIOs 192-223, /soc@ffe00000/gpio-controller@f100:
>>>>
>>>> GPIOs 224-255, /soc@ffe00000/gpio-controller@f000:
>>>>
>>>> I've verified that pin mixing is done correctly, and the
>>>> FPGA IRQ line is indeed configured as GPIO.
>>>>
>>>> I have the following code in my driver:
>>>>
>>>>       #define FPGA_IRQ_GPIO 169
>>>>
>>>>       err = gpio_request(FPGA_IRQ_GPIO, "FPGA IRQ");
>>>>       if (err) {
>>>>           printk(KERN_ERR "Failed to request FPGA IRQ GPIO, err=%d\n",
>>>> err);
>>>>           goto out;
>>>>       }
>>>>
>>>>       gpio_direction_input(FPGA_IRQ_GPIO);
>>>>
>>>>       irq = gpio_to_irq(FPGA_IRQ_GPIO);
>>>>       if (irq<   0) {
>>>>           printk(KERN_ERR "Failed to map FPGA GPIO to IRQ\n");
>>>>           goto out;
>>>>       }
>>>>
>>>>       err = request_irq(irq, gsat_interrupt,
>>>>                 IRQF_TRIGGER_FALLING, DRVNAME, priv);
> .. you request here an edge triggered interrupt.

Yes, that is is correct. mpc8xxx_gpio.c driver does not allow
level sensitive interrupts, so I had no choice but to specify
IRQF_TRIGGER_FALLING.

Felix.

      reply	other threads:[~2011-07-31 19:28 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-31 10:38 GPIO IRQ on P1022 Felix Radensky
2011-07-31 13:59 ` Tabi Timur-B04825
2011-07-31 14:56   ` Felix Radensky
2011-08-02 10:47   ` Felix Radensky
2011-07-31 15:19 ` Wolfgang Grandegger
2011-07-31 15:51   ` Felix Radensky
2011-07-31 17:49     ` Wolfgang Grandegger
2011-07-31 19:28       ` Felix Radensky [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=4E35ACE0.3020908@embedded-sol.com \
    --to=felix@embedded-sol.com \
    --cc=B04825@freescale.com \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=wg@grandegger.com \
    /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).