Latest LQ Deal: Linux Power User Bundle
Go Back > Forums > Linux Forums > Linux - General
User Name
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.


  Search this Thread
Old 02-21-2008, 11:10 AM   #1
LQ Newbie
Registered: Feb 2008
Posts: 2

Rep: Reputation: 0
Keyboard interrupt - request_irq()

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>


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

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;

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?


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Keyboard interrupt handler and more john_crichton Programming 5 07-16-2009 11:30 AM
request_irq() handling. ksrinivas Linux - Kernel 0 08-07-2007 04:07 AM
Screensaver interrupt only by Keyboard. duffmckagan Linux - Software 0 02-19-2007 12:05 AM
simulating keyboard interrupt 03mcmt02 General 4 04-03-2005 09:27 PM
undefined reference to 'request_irq()' deimosSan Programming 2 11-10-2003 09:15 AM > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 02:25 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration