Commit 24e4d21c authored by Lothar Waßmann's avatar Lothar Waßmann Committed by Dmitry Torokhov

Input: matrix_keypad - use request_any_context_irq()

When trying to use the matrix-keypad driver with GPIO drivers that
require nested irq handlers (e.g. I2C GPIO adapters like PCA9554),
request_irq() fails because the GPIO driver requires a threaded
interrupt handler.

Use request_any_context_irq() to be able to use any GPIO driver as
keypad driver.
Signed-off-by: default avatarLothar Waßmann <LW@KARO-electronics.de>
Signed-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
parent 651b4608
...@@ -332,23 +332,24 @@ static int matrix_keypad_init_gpio(struct platform_device *pdev, ...@@ -332,23 +332,24 @@ static int matrix_keypad_init_gpio(struct platform_device *pdev,
} }
if (pdata->clustered_irq > 0) { if (pdata->clustered_irq > 0) {
err = request_irq(pdata->clustered_irq, err = request_any_context_irq(pdata->clustered_irq,
matrix_keypad_interrupt, matrix_keypad_interrupt,
pdata->clustered_irq_flags, pdata->clustered_irq_flags,
"matrix-keypad", keypad); "matrix-keypad", keypad);
if (err) { if (err < 0) {
dev_err(&pdev->dev, dev_err(&pdev->dev,
"Unable to acquire clustered interrupt\n"); "Unable to acquire clustered interrupt\n");
goto err_free_rows; goto err_free_rows;
} }
} else { } else {
for (i = 0; i < pdata->num_row_gpios; i++) { for (i = 0; i < pdata->num_row_gpios; i++) {
err = request_irq(gpio_to_irq(pdata->row_gpios[i]), err = request_any_context_irq(
gpio_to_irq(pdata->row_gpios[i]),
matrix_keypad_interrupt, matrix_keypad_interrupt,
IRQF_TRIGGER_RISING | IRQF_TRIGGER_RISING |
IRQF_TRIGGER_FALLING, IRQF_TRIGGER_FALLING,
"matrix-keypad", keypad); "matrix-keypad", keypad);
if (err) { if (err < 0) {
dev_err(&pdev->dev, dev_err(&pdev->dev,
"Unable to acquire interrupt for GPIO line %i\n", "Unable to acquire interrupt for GPIO line %i\n",
pdata->row_gpios[i]); pdata->row_gpios[i]);
......
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