diff options
author | Victor Ryabukhin <vryabukhin@nvidia.com> | 2010-12-24 15:01:52 +0900 |
---|---|---|
committer | Dan Willemsen <dwillemsen@nvidia.com> | 2011-11-30 21:46:21 -0800 |
commit | ec38e3dc83b4369e8511b71407819e256e56b085 (patch) | |
tree | 51907e2b95de9424a1fa7a4b01bc16fb519e1fec /arch/arm/mach-tegra/board-whistler-kbc.c | |
parent | a2ff12cc60266df62a02b37a42bc011ff7bfed00 (diff) |
[KBC] Fix KBC implementation for Whistler.
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.
Original-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>
Rebase-Id: R2f3fcdac1d6d0696a5c84112e5c2d54ec88ec36b
Diffstat (limited to 'arch/arm/mach-tegra/board-whistler-kbc.c')
-rw-r--r-- | arch/arm/mach-tegra/board-whistler-kbc.c | 74 |
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; |