From: David Brownell <david-b@pacbell.net>
To: me@felipebalbi.com
Cc: "Lopez Cruz, Misael" <x0052729@ti.com>,
"linux-omap@vger.kernel.org" <linux-omap@vger.kernel.org>
Subject: Re: Configuring a TWL GPIO pin as an interrupt
Date: Fri, 20 Feb 2009 21:12:23 -0800 [thread overview]
Message-ID: <200902202112.23307.david-b@pacbell.net> (raw)
In-Reply-To: <20090221023924.GD6224@gandalf>
On Friday 20 February 2009, Felipe Balbi wrote:
> On Fri, Feb 20, 2009 at 08:27:54PM -0600, Lopez Cruz, Misael wrote:
> > Hi,
> >
> > I'm interested in bringing headset detection feature for audio. The
> > detection is done through TWL GPIO_2. How can I configure a GPIO pin
> > to generate an interrupt? Is there any API? Could you please point
> > out another driver using that functionality so I can use as reference?
I don't think there is one. I hacked my Beagleboard to test
those ... Rev B boards don't have EHCI, so GPIO-1 is easily
available.
In the setup() callback for the TWL4030 GPIOs:
{
int GPIO_NUMBER = gpio_base + 2;
> gpio_request(GPIO_NUMBER, "Headset IRQ");
> gpio_direction_input(GPIO_NUMBER);
lm8323_board_info.irq = gpio_to_irq(GPIO_NUMBER);
... something registers this board_info ...
...
return 0;
}
and then later the lm8323 driver will use that IRQ:
> request_irq(client->irq, lm8323_irq, flags | IRQF_SHARED, DRIVER_NAME, dev);
>
> that should do it :-)
>
> see that GPIO_NUMBER will be gpio_base + 2, base is board-specific
..... and hence client->irq is also board-specific,
which is why it needs to be set up
next prev parent reply other threads:[~2009-02-21 5:14 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-02-21 2:27 Configuring a TWL GPIO pin as an interrupt Lopez Cruz, Misael
2009-02-21 2:39 ` Felipe Balbi
2009-02-21 5:12 ` David Brownell [this message]
2009-02-23 6:07 ` Lopez Cruz, Misael
2009-02-23 7:26 ` David Brownell
2009-02-23 22:11 ` Lopez Cruz, Misael
2009-02-23 22:20 ` Mark Brown
2009-02-24 17:37 ` Lopez Cruz, Misael
2009-02-24 18:46 ` Mark Brown
2009-02-23 14:17 ` Mark Brown
2009-02-21 10:33 ` Koen Kooi
2009-02-22 20:35 ` Mark Brown
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=200902202112.23307.david-b@pacbell.net \
--to=david-b@pacbell.net \
--cc=linux-omap@vger.kernel.org \
--cc=me@felipebalbi.com \
--cc=x0052729@ti.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