summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVictor Ryabukhin <vryabukhin@nvidia.com>2010-12-24 15:01:52 +0900
committerBharat Nihalani <bnihalani@nvidia.com>2010-12-28 00:15:14 -0800
commit5ac19d31ee6bc219a27b1ebe7a04a1cfc9290078 (patch)
treec88e1cd80589b6d1f91c8157762a462d87b87212
parent317266dc03734e76ba5189654a779e7a6e3e0100 (diff)
[KBC] Fix KBC implementation for Whistler.tegra-10.11.0
See bug 773201. Previous implementation defined all possible pins as KBC pins, which caused some conflicts. New implementation uses only Row0/1/2 and Col0/1 as KBC. Change-Id: I0d599c3fe9c076ea930ee8e9ae682be865b54361 Reviewed-on: http://git-master/r/14217 Tested-by: Victor Ryabukhin <vryabukhin@nvidia.com> Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com> Reviewed-by: Sachin Nikam <snikam@nvidia.com> Tested-by: Sachin Nikam <snikam@nvidia.com> Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
-rw-r--r--arch/arm/mach-tegra/board-whistler-kbc.c74
1 files changed, 48 insertions, 26 deletions
diff --git a/arch/arm/mach-tegra/board-whistler-kbc.c b/arch/arm/mach-tegra/board-whistler-kbc.c
index 2d1c5474eddf..6dbe66911e17 100644
--- a/arch/arm/mach-tegra/board-whistler-kbc.c
+++ b/arch/arm/mach-tegra/board-whistler-kbc.c
@@ -33,18 +33,31 @@
#include <asm/mach-types.h>
#include <asm/mach/arch.h>
+/*
+* Scrollwheel is connected to KBC pins but has it's own
+* driver using those pins as gpio.
+* In case of using scrollwheel Row3 and Col3/4/5
+* should NOT be configured as KBC
+*/
+#ifdef CONFIG_INPUT_ALPS_GPIO_SCROLLWHEEL
+#define KBC_ROWS 3
+#define KBC_COLS 2
+#else
+#define KBC_ROWS 4
+#define KBC_COLS 6
+#endif
static int plain_kbd_keycode[] = {
- KEY_POWER, KEY_DOWN, KEY_RIGHT, KEY_SELECT,
- KEY_LEFT, KEY_UP, KEY_RESERVED, KEY_RESERVED,
- KEY_HOME, KEY_BACK, KEY_NUMERIC_6, KEY_NUMERIC_9,
- KEY_NUMERIC_8, KEY_NUMERIC_POUND, KEY_DOT, KEY_RESERVED,
- KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_NUMERIC_3,
- KEY_NUMERIC_5, KEY_NUMERIC_2, KEY_NUMERIC_7, KEY_RESERVED,
+ KEY_POWER, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED,
+ KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED,
+ KEY_HOME, KEY_BACK, KEY_RESERVED, KEY_RESERVED,
+ KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED,
+ KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED,
+ KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED,
KEY_VOLUMEDOWN, KEY_VOLUMEUP, KEY_RESERVED, KEY_RESERVED,
- KEY_RESERVED, KEY_RESERVED, KEY_NUMERIC_4, KEY_RESERVED,
- KEY_END, KEY_BACK, KEY_RESERVED, KEY_MENU,
- KEY_RESERVED, KEY_RESERVED, KEY_NUMERIC_1, KEY_RESERVED,
+ KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED,
+ KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED,
+ KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED,
KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED,
KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED,
KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED,
@@ -70,16 +83,16 @@ static int plain_kbd_keycode[] = {
};
static int fn_kbd_keycode[] = {
- KEY_POWER, KEY_DOWN, KEY_RIGHT, KEY_SELECT,
- KEY_LEFT, KEY_UP, KEY_RESERVED, KEY_RESERVED,
- KEY_HOME, KEY_BACK, KEY_NUMERIC_6, KEY_NUMERIC_9,
- KEY_NUMERIC_8, KEY_NUMERIC_POUND, KEY_DOT, KEY_RESERVED,
- KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_NUMERIC_3,
- KEY_NUMERIC_5, KEY_NUMERIC_2, KEY_NUMERIC_7, KEY_RESERVED,
+ KEY_POWER, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED,
+ KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED,
+ KEY_HOME, KEY_BACK, KEY_RESERVED, KEY_RESERVED,
+ KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED,
+ KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED,
+ KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED,
KEY_VOLUMEDOWN, KEY_VOLUMEUP, KEY_RESERVED, KEY_RESERVED,
- KEY_RESERVED, KEY_RESERVED, KEY_NUMERIC_4, KEY_RESERVED,
- KEY_END, KEY_BACK, KEY_RESERVED, KEY_MENU,
- KEY_RESERVED, KEY_RESERVED, KEY_NUMERIC_1, KEY_RESERVED,
+ KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED,
+ KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED,
+ KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED,
KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED,
KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED,
KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED,
@@ -159,18 +172,27 @@ int __init whistler_kbc_init(void)
* Setup the pin configuration information.
*/
for (i = 0; i < KBC_MAX_ROW; i++) {
- data->pin_cfg[i].num = i;
- data->pin_cfg[i].is_row = true;
- data->pin_cfg[i].is_col = false;
+ if (i < KBC_ROWS) {
+ data->pin_cfg[i].num = i;
+ data->pin_cfg[i].is_row = true;
+ data->pin_cfg[i].is_col = false;
+ } else {
+ data->pin_cfg[i].is_row = false;
+ data->pin_cfg[i].is_col = false;
+ }
}
- for (j = 0; j < 7/*KBC_MAX_COL*/; j++) {
- data->pin_cfg[i + j].num = j;
- data->pin_cfg[i + j].is_row = false;
- data->pin_cfg[i + j].is_col = true;
+ for (j = 0; j < KBC_MAX_COL; j++) {
+ if (j < KBC_COLS) {
+ data->pin_cfg[i + j].num = j;
+ data->pin_cfg[i + j].is_row = false;
+ data->pin_cfg[i + j].is_col = true;
+ } else {
+ data->pin_cfg[i + j].is_row = false;
+ data->pin_cfg[i + j].is_col = false;
+ }
}
- /* tegra-kbc will use default keycodes. */
data->plain_keycode = plain_kbd_keycode;
data->fn_keycode = fn_kbd_keycode;
data->filter_keys = true;