Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Input: pxa27x_keypad - add wakeup support

Signed-off-by: Eric Miao <eric.miao@marvell.com>
Acked-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>

authored by

Eric Miao and committed by
Dmitry Torokhov
39ab9dde e8ef4347

+14 -1
+14 -1
drivers/input/keyboard/pxa27x_keypad.c
··· 105 105 struct input_dev *input_dev; 106 106 void __iomem *mmio_base; 107 107 108 + int irq; 109 + 108 110 /* matrix key code map */ 109 111 unsigned int matrix_keycodes[MAX_MATRIX_KEY_NUM]; 110 112 ··· 387 385 struct pxa27x_keypad *keypad = platform_get_drvdata(pdev); 388 386 389 387 clk_disable(keypad->clk); 388 + 389 + if (device_may_wakeup(&pdev->dev)) 390 + enable_irq_wake(keypad->irq); 391 + 390 392 return 0; 391 393 } 392 394 ··· 398 392 { 399 393 struct pxa27x_keypad *keypad = platform_get_drvdata(pdev); 400 394 struct input_dev *input_dev = keypad->input_dev; 395 + 396 + if (device_may_wakeup(&pdev->dev)) 397 + disable_irq_wake(keypad->irq); 401 398 402 399 mutex_lock(&input_dev->mutex); 403 400 ··· 506 497 goto failed_free_dev; 507 498 } 508 499 500 + keypad->irq = irq; 501 + 509 502 /* Register the input device */ 510 503 error = input_register_device(input_dev); 511 504 if (error) { 512 505 dev_err(&pdev->dev, "failed to register input device\n"); 513 506 goto failed_free_irq; 514 507 } 508 + 509 + device_init_wakeup(&pdev->dev, 1); 515 510 516 511 return 0; 517 512 ··· 540 527 struct pxa27x_keypad *keypad = platform_get_drvdata(pdev); 541 528 struct resource *res; 542 529 543 - free_irq(platform_get_irq(pdev, 0), pdev); 530 + free_irq(keypad->irq, pdev); 544 531 545 532 clk_disable(keypad->clk); 546 533 clk_put(keypad->clk);