Commit c683da3e authored by Illia Smyrnov's avatar Illia Smyrnov Committed by Dmitry Torokhov

Input: omap-keypad - convert to threaded IRQ

Convert to use threaded IRQ.
Signed-off-by: default avatarIllia Smyrnov <illia.smyrnov@ti.com>
Reviewed-by: default avatarFelipe Balbi <balbi@ti.com>
Signed-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
parent 875ad696
...@@ -112,18 +112,28 @@ static void kbd_write_irqreg(struct omap4_keypad *keypad_data, ...@@ -112,18 +112,28 @@ static void kbd_write_irqreg(struct omap4_keypad *keypad_data,
} }
/* Interrupt handler */ /* Interrupt handlers */
static irqreturn_t omap4_keypad_interrupt(int irq, void *dev_id) static irqreturn_t omap4_keypad_irq_handler(int irq, void *dev_id)
{ {
struct omap4_keypad *keypad_data = dev_id; struct omap4_keypad *keypad_data = dev_id;
struct input_dev *input_dev = keypad_data->input;
unsigned char key_state[ARRAY_SIZE(keypad_data->key_state)];
unsigned int col, row, code, changed;
u32 *new_state = (u32 *) key_state;
if (kbd_read_irqreg(keypad_data, OMAP4_KBD_IRQSTATUS)) {
/* Disable interrupts */ /* Disable interrupts */
kbd_write_irqreg(keypad_data, OMAP4_KBD_IRQENABLE, kbd_write_irqreg(keypad_data, OMAP4_KBD_IRQENABLE,
OMAP4_VAL_IRQDISABLE); OMAP4_VAL_IRQDISABLE);
return IRQ_WAKE_THREAD;
}
return IRQ_NONE;
}
static irqreturn_t omap4_keypad_irq_thread_fn(int irq, void *dev_id)
{
struct omap4_keypad *keypad_data = dev_id;
struct input_dev *input_dev = keypad_data->input;
unsigned char key_state[ARRAY_SIZE(keypad_data->key_state)];
unsigned int col, row, code, changed;
u32 *new_state = (u32 *) key_state;
*new_state = kbd_readl(keypad_data, OMAP4_KBD_FULLCODE31_0); *new_state = kbd_readl(keypad_data, OMAP4_KBD_FULLCODE31_0);
*(new_state + 1) = kbd_readl(keypad_data, OMAP4_KBD_FULLCODE63_32); *(new_state + 1) = kbd_readl(keypad_data, OMAP4_KBD_FULLCODE63_32);
...@@ -360,7 +370,8 @@ static int omap4_keypad_probe(struct platform_device *pdev) ...@@ -360,7 +370,8 @@ static int omap4_keypad_probe(struct platform_device *pdev)
goto err_free_keymap; goto err_free_keymap;
} }
error = request_irq(keypad_data->irq, omap4_keypad_interrupt, error = request_threaded_irq(keypad_data->irq, omap4_keypad_irq_handler,
omap4_keypad_irq_thread_fn,
IRQF_TRIGGER_RISING, IRQF_TRIGGER_RISING,
"omap4-keypad", keypad_data); "omap4-keypad", keypad_data);
if (error) { if (error) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment