Linux on ARM based TI OMAP SoCs
 help / color / mirror / Atom feed
From: Felipe Balbi <me@felipebalbi.com>
To: "Lopez Cruz, Misael" <x0052729@ti.com>
Cc: "linux-omap@vger.kernel.org" <linux-omap@vger.kernel.org>
Subject: Re: Configuring a TWL GPIO pin as an interrupt
Date: Sat, 21 Feb 2009 04:39:24 +0200	[thread overview]
Message-ID: <20090221023924.GD6224@gandalf> (raw)
In-Reply-To: <2C7D3DF36ADFFC479B44490D912B616705D6329B7D@dlee07.ent.ti.com>

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?

gpio_request(GPIO_NUMBER, "Headset IRQ");
gpio_direction_input(GPIO_NUMBER);
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

-- 
balbi

  reply	other threads:[~2009-02-21  2:39 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 [this message]
2009-02-21  5:12   ` David Brownell
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=20090221023924.GD6224@gandalf \
    --to=me@felipebalbi.com \
    --cc=linux-omap@vger.kernel.org \
    --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