From: plagnioj@jcrosoft•com (Jean-Christophe PLAGNIOL-VILLARD)
To: linux-arm-kernel@lists•infradead.org
Subject: at91 gpio irq discrepancy in behavior vs. documentation
Date: Sat, 22 Dec 2012 18:18:18 +0100 [thread overview]
Message-ID: <20121222171818.GS23971@game.jcrosoft.org> (raw)
In-Reply-To: <CAG4_upQTZW0_+cRsyqOi031Gm4BTwXPqxYxKS1W-OtZUrVfOjw@mail.gmail.com>
On 21:51 Fri 21 Dec , Chris Verges wrote:
> Hi all,
>
> In gpio.c for the mach-at91 family, there is a comment above the
> gpio_irq_mask() function which indicates that the AT91_PIN_* macros can
> be used directly as inputs into the request_irq() function. (See
> arch/arm/mach-at91/gpio.c Line 489 in a 3.4.10 kernel if you aren't
> familiar with this comment block.)
>
> Following this comment block, to register an IRQ on the GPIO pin PA0,
> for example, one could do the following:
>
> err = request_irq(AT91_PIN_PA0, ...);
this is not true for some release you must use gpio_to_irq now
we drop this when cleaniing the gpio support and switch to the irq domain
>
> I recently tested this on a board using an at91sam9g20 processor. The
> image was running a vanilla 3.4.10 (no patches). The request_irq() call
> succeeded, but in looking at /proc/interrupts, it seems like this causes
> an interrupt to be assign to the Advanced Interrupt Controller (AIC) on
> the processor:
>
> $ cat /proc/interrupts
> CPU0
> >>> 0: 0 AIC my_irq_handler
> 1: 2478772 AIC at91_tick, rtc0, ttyS0
> 7: 0 AIC ttyS2
> 8: 150 AIC
> 9: 26 AIC mmc0
> 12: 474 AIC
> 20: 62796 AIC ohci_hcd:usb1
> Err: 0
>
> Toggling the pin PA0 does not cause an interrupt.
>
> What I found works is wrapping the pin macro with gpio_to_irq():
>
> err = request_irq(gpio_to_irq(AT91_PIN_PA0), ...);
>
> $ cat /proc/interrupts
> CPU0
> 1: 2478772 AIC at91_tick, rtc0, ttyS0
> 7: 0 AIC ttyS2
> 8: 150 AIC
> 9: 26 AIC mmc0
> 12: 474 AIC
> 20: 62796 AIC ohci_hcd:usb1
> >>> 32: 0 GPIO my_irq_handler
> Err: 0
>
> Since this behavior is so contrary to the comment block in the gpio.c
> file, I'm wondering why there is such a discrepancy in behavior. Is the
> comment block simply out of date? I'm more than happy to submit a patch
> to update the documentation if that's the case.
this driver is now deprecated anyway as we switch to pinctrl now, that include
both pintrcl and gpio
We just keep it for old style platform for dt we do not use it
And any mainline board will now be DT
Best Regards,
J.
prev parent reply other threads:[~2012-12-22 17:18 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-12-22 5:51 at91 gpio irq discrepancy in behavior vs. documentation Chris Verges
2012-12-22 17:18 ` Jean-Christophe PLAGNIOL-VILLARD [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=20121222171818.GS23971@game.jcrosoft.org \
--to=plagnioj@jcrosoft$(echo .)com \
--cc=linux-arm-kernel@lists$(echo .)infradead.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