X-Git-Url: https://git.openpandora.org/cgi-bin/gitweb.cgi?p=pandora-kernel.git;a=blobdiff_plain;f=drivers%2Finput%2Fkeyboard%2Fpxa27x_keypad.c;h=6f1516f5075072ebde372743713e504685b8d990;hp=45767e73f071e3859ffccebaa7a82d1578019530;hb=8ffa5b65968262ba6bb046329972791c0d960745;hpb=2fceef397f9880b212a74c418290ce69e7ac00eb diff --git a/drivers/input/keyboard/pxa27x_keypad.c b/drivers/input/keyboard/pxa27x_keypad.c index 45767e73f071..6f1516f50750 100644 --- a/drivers/input/keyboard/pxa27x_keypad.c +++ b/drivers/input/keyboard/pxa27x_keypad.c @@ -105,6 +105,8 @@ struct pxa27x_keypad { struct input_dev *input_dev; void __iomem *mmio_base; + int irq; + /* matrix key code map */ unsigned int matrix_keycodes[MAX_MATRIX_KEY_NUM]; @@ -392,6 +394,10 @@ static int pxa27x_keypad_suspend(struct platform_device *pdev, pm_message_t stat struct pxa27x_keypad *keypad = platform_get_drvdata(pdev); clk_disable(keypad->clk); + + if (device_may_wakeup(&pdev->dev)) + enable_irq_wake(keypad->irq); + return 0; } @@ -400,6 +406,9 @@ static int pxa27x_keypad_resume(struct platform_device *pdev) struct pxa27x_keypad *keypad = platform_get_drvdata(pdev); struct input_dev *input_dev = keypad->input_dev; + if (device_may_wakeup(&pdev->dev)) + disable_irq_wake(keypad->irq); + mutex_lock(&input_dev->mutex); if (input_dev->users) { @@ -509,6 +518,8 @@ static int __devinit pxa27x_keypad_probe(struct platform_device *pdev) goto failed_free_dev; } + keypad->irq = irq; + /* Register the input device */ error = input_register_device(input_dev); if (error) { @@ -516,6 +527,8 @@ static int __devinit pxa27x_keypad_probe(struct platform_device *pdev) goto failed_free_irq; } + device_init_wakeup(&pdev->dev, 1); + return 0; failed_free_irq: @@ -539,7 +552,7 @@ static int __devexit pxa27x_keypad_remove(struct platform_device *pdev) struct pxa27x_keypad *keypad = platform_get_drvdata(pdev); struct resource *res; - free_irq(platform_get_irq(pdev, 0), pdev); + free_irq(keypad->irq, pdev); clk_disable(keypad->clk); clk_put(keypad->clk);