Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 318278
b: refs/heads/master
c: 84b63ad
h: refs/heads/master
v: v3
  • Loading branch information
Naveen Kumar Gaddipati authored and Dmitry Torokhov committed Jun 25, 2012
1 parent 3c42230 commit a9c326c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 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: af77c88b8971232f23b4cba7a46fc7a43914bf22
refs/heads/master: 84b63ad8477c822edbeb1e310b201609f33522ec
11 changes: 8 additions & 3 deletions trunk/drivers/input/keyboard/nomadik-ske-keypad.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
#define SKE_ASR3 0x2C

#define SKE_NUM_ASRX_REGISTERS (4)
#define KEY_PRESSED_DELAY 10

/**
* struct ske_keypad - data structure used by keypad driver
Expand Down Expand Up @@ -92,7 +93,7 @@ static void ske_keypad_set_bits(struct ske_keypad *keypad, u16 addr,
static int __init ske_keypad_chip_init(struct ske_keypad *keypad)
{
u32 value;
int timeout = 50;
int timeout = keypad->board->debounce_ms;

/* check SKE_RIS to be 0 */
while ((readl(keypad->reg_base + SKE_RIS) != 0x00000000) && timeout--)
Expand Down Expand Up @@ -196,18 +197,22 @@ static void ske_keypad_read_data(struct ske_keypad *keypad)
static irqreturn_t ske_keypad_irq(int irq, void *dev_id)
{
struct ske_keypad *keypad = dev_id;
int retries = 20;
int timeout = keypad->board->debounce_ms;

/* disable auto scan interrupt; mask the interrupt generated */
ske_keypad_set_bits(keypad, SKE_IMSC, ~SKE_KPIMA, 0x0);
ske_keypad_set_bits(keypad, SKE_ICR, 0x0, SKE_KPICA);

while ((readl(keypad->reg_base + SKE_CR) & SKE_KPASON) && --retries)
while ((readl(keypad->reg_base + SKE_CR) & SKE_KPASON) && --timeout)
cpu_relax();

/* SKEx registers are stable and can be read */
ske_keypad_read_data(keypad);

/* wait until raw interrupt is clear */
while ((readl(keypad->reg_base + SKE_RIS)) && --timeout)
msleep(KEY_PRESSED_DELAY);

/* enable auto scan interrupts */
ske_keypad_set_bits(keypad, SKE_IMSC, 0x0, SKE_KPIMA);

Expand Down

0 comments on commit a9c326c

Please sign in to comment.