]> git.karo-electronics.de Git - karo-tx-linux.git/commit
Input: twl40300-keypad - fix handling of "all ground" rows
authorDmitry Torokhov <dmitry.torokhov@gmail.com>
Wed, 21 Jul 2010 03:25:35 +0000 (20:25 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 2 Aug 2010 17:26:40 +0000 (10:26 -0700)
commit2d0c02c7e6ab569c967d56fc94fc8939ed8e2ccf
tree05ab0beebdc3f8dc4f99be7312bb5a4f169ec43c
parent5905db7eb052d833b05a487d1aace0296c3d419d
Input: twl40300-keypad - fix handling of "all ground" rows

commit 3fea60261e73dbf4a51130d40cafcc8465b0f2c3 upstream.

The Nokia RX51 board code (arch/arm/mach-omap2/board-rx51-peripherals.c)
defines a key map for the matrix keypad keyboard. The hardware seems to
use all of the 8 rows and 8 columns of the keypad, although not all
possible locations are used.

The TWL4030 supports keypads with at most 8 rows and 8 columns. Most keys
are defined with a row and column number between 0 and 7, except

        KEY(0xff, 2, KEY_F9),
        KEY(0xff, 4, KEY_F10),
        KEY(0xff, 5, KEY_F11),

which represent keycodes that should be emitted when entire row is
connected to the ground.  since the driver handles this case as if we
had an extra column in the key matrix. Unfortunately we do not allocate
enough space and end up owerwriting some random memory.

Reported-and-tested-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
arch/arm/mach-omap2/board-rx51-peripherals.c
drivers/input/keyboard/twl4030_keypad.c