summaryrefslogtreecommitdiff
path: root/drivers/input/keyboard/tca8418_keypad.c
diff options
context:
space:
mode:
authorAlban Bedel <alban.bedel@avionic-design.de>2012-11-08 20:57:55 +0400
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2012-11-29 21:29:05 +0400
commitbf7f5316cbacbcb7d3c337eba36322cab255dec0 (patch)
tree31d9712bc4ff87463c7e6dd213f3892241336dee /drivers/input/keyboard/tca8418_keypad.c
parente89e29b8585379c844b03fb3aa2cca73e2bc5b26 (diff)
downloadlinux-bf7f5316cbacbcb7d3c337eba36322cab255dec0.tar.xz
Input: tca8418_keypad - add support for shared interrupt
Signed-off-by: Alban Bedel <alban.bedel@avionic-design.de> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Diffstat (limited to 'drivers/input/keyboard/tca8418_keypad.c')
-rw-r--r--drivers/input/keyboard/tca8418_keypad.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/input/keyboard/tca8418_keypad.c b/drivers/input/keyboard/tca8418_keypad.c
index 1a2894dd03ca..ac4ff13f51cc 100644
--- a/drivers/input/keyboard/tca8418_keypad.c
+++ b/drivers/input/keyboard/tca8418_keypad.c
@@ -224,16 +224,18 @@ static irqreturn_t tca8418_irq_handler(int irq, void *dev_id)
if (error) {
dev_err(&keypad_data->client->dev,
"unable to read REG_INT_STAT\n");
- goto exit;
+ return IRQ_NONE;
}
+ if (!reg)
+ return IRQ_NONE;
+
if (reg & INT_STAT_OVR_FLOW_INT)
dev_warn(&keypad_data->client->dev, "overflow occurred\n");
if (reg & INT_STAT_K_INT)
tca8418_read_keypad(keypad_data);
-exit:
/* Clear all interrupts, even IRQs we didn't check (GPI, CAD, LCK) */
reg = 0xff;
error = tca8418_write_byte(keypad_data, REG_INT_STAT, reg);
@@ -374,7 +376,9 @@ static int tca8418_keypad_probe(struct i2c_client *client,
client->irq = gpio_to_irq(client->irq);
error = request_threaded_irq(client->irq, NULL, tca8418_irq_handler,
- IRQF_TRIGGER_FALLING | IRQF_ONESHOT,
+ IRQF_TRIGGER_FALLING |
+ IRQF_SHARED |
+ IRQF_ONESHOT,
client->name, keypad_data);
if (error) {
dev_dbg(&client->dev,