diff options
-rw-r--r-- | arch/arm/mach-tegra/include/mach/kbc.h | 28 | ||||
-rw-r--r-- | drivers/input/keyboard/tegra-kbc.c | 8 |
2 files changed, 31 insertions, 5 deletions
diff --git a/arch/arm/mach-tegra/include/mach/kbc.h b/arch/arm/mach-tegra/include/mach/kbc.h index 44d686fbe45e..88c1f93c3e72 100644 --- a/arch/arm/mach-tegra/include/mach/kbc.h +++ b/arch/arm/mach-tegra/include/mach/kbc.h @@ -27,8 +27,34 @@ #define KBC_MAX_ROW 16 #define KBC_MAX_COL 8 -#define KBC_MAX_GPIO (KBC_MAX_ROW + KBC_MAX_COL) #define KBC_MAX_KPRESS_EVENT 8 + +#define KBC_PIN_GPIO_0 0 +#define KBC_PIN_GPIO_1 1 +#define KBC_PIN_GPIO_2 2 +#define KBC_PIN_GPIO_3 3 +#define KBC_PIN_GPIO_4 4 +#define KBC_PIN_GPIO_5 5 +#define KBC_PIN_GPIO_6 6 +#define KBC_PIN_GPIO_7 7 +#define KBC_PIN_GPIO_8 8 +#define KBC_PIN_GPIO_9 9 +#define KBC_PIN_GPIO_10 10 +#define KBC_PIN_GPIO_11 11 +#define KBC_PIN_GPIO_12 12 +#define KBC_PIN_GPIO_13 13 +#define KBC_PIN_GPIO_14 14 +#define KBC_PIN_GPIO_15 15 +#define KBC_PIN_GPIO_16 16 +#define KBC_PIN_GPIO_17 17 +#define KBC_PIN_GPIO_18 18 +#define KBC_PIN_GPIO_19 19 +#define KBC_PIN_GPIO_20 20 +#define KBC_PIN_GPIO_21 21 +#define KBC_PIN_GPIO_22 22 +#define KBC_PIN_GPIO_23 23 + +#define KBC_MAX_GPIO (KBC_MAX_ROW + KBC_MAX_COL) #define KBC_MAX_KEY (KBC_MAX_ROW * KBC_MAX_COL) enum { diff --git a/drivers/input/keyboard/tegra-kbc.c b/drivers/input/keyboard/tegra-kbc.c index 61db75e512ce..67f07678e765 100644 --- a/drivers/input/keyboard/tegra-kbc.c +++ b/drivers/input/keyboard/tegra-kbc.c @@ -339,8 +339,8 @@ static void tegra_kbc_config_pins(struct tegra_kbc *kbc) col_config[i] = 0; for (i = 0; i < KBC_MAX_GPIO; i++) { - u32 r_shift = 5 * (pdata->pin_cfg[i].num % 6); - u32 c_shift = 4 * (pdata->pin_cfg[i].num % 8); + u32 r_shift = 5 * (i % 6); + u32 c_shift = 4 * (i % 8); u32 r_mask = 0x1f << r_shift; u32 c_mask = 0xf << c_shift; u32 index; @@ -349,12 +349,12 @@ static void tegra_kbc_config_pins(struct tegra_kbc *kbc) continue; if (pdata->pin_cfg[i].pin_type == kbc_pin_row) { - index = pdata->pin_cfg[i].num / 6; + index = i / 6; row_config[index] &= ~r_mask; row_config[index] |= ((pdata->pin_cfg[i].num << 1) | 1) << r_shift; } else { - index = (pdata->pin_cfg[i].num + KBC_MAX_ROW) / 8; + index = i / 8; col_config[index] &= ~c_mask; col_config[index] |= ((pdata->pin_cfg[i].num << 1) | 1) << c_shift; |