Skip to contentSkip to conversation

max7359_keypad: Do not set MAX7359_CFG_INTERRUPT flag

PATCH Applied Evgeniy Dushistov 2 participants 2 messages May 14, 2015 – May 15, 2015

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/3 max7359_keypad: Do not set MAX7359_CFG_INTERRUPT flag

max7359_keypad: Do not set MAX7359_CFG_INTERRUPT flag.
In datasheet of max7359, there is description of this flag:
0 - INT cleared when FIFO empty,
1 - INT cleared after host read. In this mode, I2C should read
FIFO until interrupt condition removed, or further INT may be lost.

So, if we set this flag, we have to read FIFO until it become empty. But in interrupt we read FIFO just once. This lead to "keyboard" hang until reboot, if we press several keys, because of interrupt handler read just one "press" from FIFO and clear interrupt.

---
 drivers/input/keyboard/max7359_keypad.c | 1 -
 1 file changed, 1 deletion(-)
drivers/input/keyboard/max7359_keypad.c +0 -1
index faa6da5..4e35904 100644
@@ -166,7 +166,6 @@ static void max7359_close(struct input_dev *dev)
 static void max7359_initialize(struct i2c_client *client)
 {
 	max7359_write_reg(client, MAX7359_REG_CONFIG,
-		MAX7359_CFG_INTERRUPT | /* Irq clears after host read */
 		MAX7359_CFG_KEY_RELEASE | /* Key release enable */
 		MAX7359_CFG_WAKEUP); /* Key press wakeup enable */
 
Signature · 4 lines
2.3.6

-- 
/Evgeniy
maintainer Applied
#1 lore raw
Quoted 6 lines · Evgeniy Dushistov

max7359_keypad: Do not set MAX7359_CFG_INTERRUPT flag.
In datasheet of max7359, there is description of this flag:
0 - INT cleared when FIFO empty,
1 - INT cleared after host read. In this mode, I2C should read
FIFO until interrupt condition removed, or further INT may be lost.

Quoted 7 lines

So, if we set this flag, we have to read FIFO until it become empty. But in interrupt we read FIFO just once. This lead to "keyboard" hang until reboot, if we press several keys, because of interrupt handler read just one "press" from FIFO and clear interrupt.

Applied, thank you.

Quoted 21 lines
---
 drivers/input/keyboard/max7359_keypad.c | 1 -
 1 file changed, 1 deletion(-)
drivers/input/keyboard/max7359_keypad.c +0 -1
index faa6da5..4e35904 100644
@@ -166,7 +166,6 @@ static void max7359_close(struct input_dev *dev)
 static void max7359_initialize(struct i2c_client *client)
 {
 	max7359_write_reg(client, MAX7359_REG_CONFIG,
-		MAX7359_CFG_INTERRUPT | /* Irq clears after host read */
 		MAX7359_CFG_KEY_RELEASE | /* Key release enable */
 		MAX7359_CFG_WAKEUP); /* Key press wakeup enable */
 
Signature · 4 lines
2.3.6

-- 
/Evgeniy
Signature · 1 line
Dmitry