diff options
author | Illia Smyrnov <illia.smyrnov@ti.com> | 2013-08-26 02:25:50 -0400 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2013-08-26 03:15:50 -0400 |
commit | c683da3ec985bcf0e69890f372cffaba47a1a537 (patch) | |
tree | a8f8b24520f56b87399ef4d351746dfad83d1378 /drivers/input | |
parent | 875ad6966ec6f7c4ddb36cf363bffbffa6961ab5 (diff) |
Input: omap-keypad - convert to threaded IRQ
Convert to use threaded IRQ.
Signed-off-by: Illia Smyrnov <illia.smyrnov@ti.com>
Reviewed-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Diffstat (limited to 'drivers/input')
-rw-r--r-- | drivers/input/keyboard/omap4-keypad.c | 29 |
1 files changed, 20 insertions, 9 deletions
diff --git a/drivers/input/keyboard/omap4-keypad.c b/drivers/input/keyboard/omap4-keypad.c index c7275481a74e..b876a0d8c6be 100644 --- a/drivers/input/keyboard/omap4-keypad.c +++ b/drivers/input/keyboard/omap4-keypad.c | |||
@@ -112,8 +112,22 @@ static void kbd_write_irqreg(struct omap4_keypad *keypad_data, | |||
112 | } | 112 | } |
113 | 113 | ||
114 | 114 | ||
115 | /* Interrupt handler */ | 115 | /* Interrupt handlers */ |
116 | static irqreturn_t omap4_keypad_interrupt(int irq, void *dev_id) | 116 | static irqreturn_t omap4_keypad_irq_handler(int irq, void *dev_id) |
117 | { | ||
118 | struct omap4_keypad *keypad_data = dev_id; | ||
119 | |||
120 | if (kbd_read_irqreg(keypad_data, OMAP4_KBD_IRQSTATUS)) { | ||
121 | /* Disable interrupts */ | ||
122 | kbd_write_irqreg(keypad_data, OMAP4_KBD_IRQENABLE, | ||
123 | OMAP4_VAL_IRQDISABLE); | ||
124 | return IRQ_WAKE_THREAD; | ||
125 | } | ||
126 | |||
127 | return IRQ_NONE; | ||
128 | } | ||
129 | |||
130 | static irqreturn_t omap4_keypad_irq_thread_fn(int irq, void *dev_id) | ||
117 | { | 131 | { |
118 | struct omap4_keypad *keypad_data = dev_id; | 132 | struct omap4_keypad *keypad_data = dev_id; |
119 | struct input_dev *input_dev = keypad_data->input; | 133 | struct input_dev *input_dev = keypad_data->input; |
@@ -121,10 +135,6 @@ static irqreturn_t omap4_keypad_interrupt(int irq, void *dev_id) | |||
121 | unsigned int col, row, code, changed; | 135 | unsigned int col, row, code, changed; |
122 | u32 *new_state = (u32 *) key_state; | 136 | u32 *new_state = (u32 *) key_state; |
123 | 137 | ||
124 | /* Disable interrupts */ | ||
125 | kbd_write_irqreg(keypad_data, OMAP4_KBD_IRQENABLE, | ||
126 | OMAP4_VAL_IRQDISABLE); | ||
127 | |||
128 | *new_state = kbd_readl(keypad_data, OMAP4_KBD_FULLCODE31_0); | 138 | *new_state = kbd_readl(keypad_data, OMAP4_KBD_FULLCODE31_0); |
129 | *(new_state + 1) = kbd_readl(keypad_data, OMAP4_KBD_FULLCODE63_32); | 139 | *(new_state + 1) = kbd_readl(keypad_data, OMAP4_KBD_FULLCODE63_32); |
130 | 140 | ||
@@ -360,9 +370,10 @@ static int omap4_keypad_probe(struct platform_device *pdev) | |||
360 | goto err_free_keymap; | 370 | goto err_free_keymap; |
361 | } | 371 | } |
362 | 372 | ||
363 | error = request_irq(keypad_data->irq, omap4_keypad_interrupt, | 373 | error = request_threaded_irq(keypad_data->irq, omap4_keypad_irq_handler, |
364 | IRQF_TRIGGER_RISING, | 374 | omap4_keypad_irq_thread_fn, |
365 | "omap4-keypad", keypad_data); | 375 | IRQF_TRIGGER_RISING, |
376 | "omap4-keypad", keypad_data); | ||
366 | if (error) { | 377 | if (error) { |
367 | dev_err(&pdev->dev, "failed to register interrupt\n"); | 378 | dev_err(&pdev->dev, "failed to register interrupt\n"); |
368 | goto err_free_input; | 379 | goto err_free_input; |