Op 21 feb 2009, om 03:39 heeft Felipe Balbi het volgende geschreven:

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 :-)

Don't forget to use the proper API for it: 
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=blob;f=include/sound/jack.h;hb=master

regards,

Koen

Attachment: PGP.sig
Description: Dit deel van het bericht is digitaal ondertekend

Reply via email to