public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Keyboard interrupt - request_irq()
@ 2008-02-21 16:04 Pioz
  2008-02-22  9:28 ` Jiri Kosina
  0 siblings, 1 reply; 3+ messages in thread
From: Pioz @ 2008-02-21 16:04 UTC (permalink / raw)
  To: linux-kernel

Hi all,
  I have a problem.
I want handle the keyboard interrupt and for this purpose I have write
this module (I have kernel 2.6.23):


#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/interrupt.h>

[...]

irqreturn_t
irq_myhandler (int irqn, void *dev)
{
        printk (KERN_INFO "Key pressed...\n");
        return IRQ_HANDLED;
}

int
init_module ()
{
        int res;
        printk (KERN_INFO "Hello World!\n");
        free_irq (1, NULL);
        res = request_irq (1, irq_myhandler, IRQF_SHARED, "bao", dev_id);
        printk (KERN_INFO "res: %d\n", res);
        return 0;
}

void
cleanup_module ()
{
        free_irq (1, NULL);
        printk (KERN_INFO "Goodbye World!\n");
}


The return value of request_irq() function is -EBUSY. Why? Is the
default handler? How can I do to change handler with my function?
Thanks...

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2008-02-22  9:28 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <fa.Q5fldlauC9khAhVFQXr2Stx54+I@ifi.uio.no>
2008-02-22  4:04 ` Keyboard interrupt - request_irq() Robert Hancock
2008-02-21 16:04 Pioz
2008-02-22  9:28 ` Jiri Kosina

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox