Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 178655
b: refs/heads/master
c: dd21923
h: refs/heads/master
i:
  178653: 12a3100
  178651: 87e486b
  178647: 706cbbf
  178639: 2495902
  178623: 2fe96de
v: v3
  • Loading branch information
Dmitry Torokhov committed Dec 25, 2009
1 parent acc9cc9 commit 610a9d3
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 8 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: 98b7fb0472f828536a7786df6bd517322c0c17dc
refs/heads/master: dd219234d201431d0fc56a74e3a4a97ca3eb4589
29 changes: 22 additions & 7 deletions trunk/drivers/input/keyboard/matrix_keypad.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,13 @@ struct matrix_keypad {
unsigned short *keycodes;
unsigned int row_shift;

DECLARE_BITMAP(disabled_gpios, MATRIX_MAX_ROWS);

uint32_t last_key_state[MATRIX_MAX_COLS];
struct delayed_work work;
spinlock_t lock;
bool scan_pending;
bool stopped;
spinlock_t lock;
};

/*
Expand Down Expand Up @@ -222,9 +224,16 @@ static int matrix_keypad_suspend(struct device *dev)

matrix_keypad_stop(keypad->input_dev);

if (device_may_wakeup(&pdev->dev))
for (i = 0; i < pdata->num_row_gpios; i++)
enable_irq_wake(gpio_to_irq(pdata->row_gpios[i]));
if (device_may_wakeup(&pdev->dev)) {
for (i = 0; i < pdata->num_row_gpios; i++) {
if (!test_bit(i, keypad->disabled_gpios)) {
unsigned int gpio = pdata->row_gpios[i];

if (enable_irq_wake(gpio_to_irq(gpio)) == 0)
__set_bit(i, keypad->disabled_gpios);
}
}
}

return 0;
}
Expand All @@ -236,9 +245,15 @@ static int matrix_keypad_resume(struct device *dev)
const struct matrix_keypad_platform_data *pdata = keypad->pdata;
int i;

if (device_may_wakeup(&pdev->dev))
for (i = 0; i < pdata->num_row_gpios; i++)
disable_irq_wake(gpio_to_irq(pdata->row_gpios[i]));
if (device_may_wakeup(&pdev->dev)) {
for (i = 0; i < pdata->num_row_gpios; i++) {
if (test_and_clear_bit(i, keypad->disabled_gpios)) {
unsigned int gpio = pdata->row_gpios[i];

disable_irq_wake(gpio_to_irq(gpio));
}
}
}

matrix_keypad_start(keypad->input_dev);

Expand Down

0 comments on commit 610a9d3

Please sign in to comment.