Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 104200
b: refs/heads/master
c: 39ab9dd
h: refs/heads/master
v: v3
  • Loading branch information
Eric Miao authored and Dmitry Torokhov committed Jun 2, 2008
1 parent a77e3d1 commit 71488ba
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e8ef4347099584b49ecf74144ad2089b724292cf
refs/heads/master: 39ab9ddeb3e9573a1ea9a17a1431ea5c81681964
15 changes: 14 additions & 1 deletion trunk/drivers/input/keyboard/pxa27x_keypad.c
Original file line number Diff line number Diff line change
Expand Up @@ -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];

Expand Down Expand Up @@ -385,6 +387,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;
}

Expand All @@ -393,6 +399,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) {
Expand Down Expand Up @@ -497,13 +506,17 @@ 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) {
dev_err(&pdev->dev, "failed to register input device\n");
goto failed_free_irq;
}

device_init_wakeup(&pdev->dev, 1);

return 0;

failed_free_irq:
Expand All @@ -527,7 +540,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);
Expand Down

0 comments on commit 71488ba

Please sign in to comment.