Skip to content

Commit bf7f531

Browse files
Alban Bedeldtor
authored andcommitted
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>
1 parent e89e29b commit bf7f531

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

‎drivers/input/keyboard/tca8418_keypad.c‎

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -224,16 +224,18 @@ static irqreturn_t tca8418_irq_handler(int irq, void *dev_id)
224224
if (error) {
225225
dev_err(&keypad_data->client->dev,
226226
"unable to read REG_INT_STAT\n");
227-
goto exit;
227+
return IRQ_NONE;
228228
}
229229

230+
if (!reg)
231+
return IRQ_NONE;
232+
230233
if (reg & INT_STAT_OVR_FLOW_INT)
231234
dev_warn(&keypad_data->client->dev, "overflow occurred\n");
232235

233236
if (reg & INT_STAT_K_INT)
234237
tca8418_read_keypad(keypad_data);
235238

236-
exit:
237239
/* Clear all interrupts, even IRQs we didn't check (GPI, CAD, LCK) */
238240
reg = 0xff;
239241
error = tca8418_write_byte(keypad_data, REG_INT_STAT, reg);
@@ -374,7 +376,9 @@ static int tca8418_keypad_probe(struct i2c_client *client,
374376
client->irq = gpio_to_irq(client->irq);
375377

376378
error = request_threaded_irq(client->irq, NULL, tca8418_irq_handler,
377-
IRQF_TRIGGER_FALLING | IRQF_ONESHOT,
379+
IRQF_TRIGGER_FALLING |
380+
IRQF_SHARED |
381+
IRQF_ONESHOT,
378382
client->name, keypad_data);
379383
if (error) {
380384
dev_dbg(&client->dev,

0 commit comments

Comments
 (0)