summaryrefslogtreecommitdiff
path: root/drivers/input
diff options
context:
space:
mode:
authorLaxman Dewangan <ldewangan@nvidia.com>2011-11-09 18:53:56 +0530
committerVarun Colbert <vcolbert@nvidia.com>2011-11-15 11:52:20 -0800
commit17039fec9ef8c71bc3ec77ed8bb131f077a3f8a5 (patch)
tree0aba449d9b07d530c46e4778a2a1c0846c888e93 /drivers/input
parentec1c562461090170ce9515147954185c9a5bda44 (diff)
input: tegra-kbc: Support to configure any pins to row/column
Any of the KBC GPIO pins can be configured to either as row or as column. Adding support for this. bug 804531 Reviewed-on: http://git-master/r/59927 (cherry picked from commit 59b90aa62766d34290e623fc6e2dfc8fc630af0e) Change-Id: I01100fc6964278940b97428a3df561616f356f2f Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com> Reviewed-on: http://git-master/r/64034
Diffstat (limited to 'drivers/input')
-rw-r--r--drivers/input/keyboard/tegra-kbc.c8
1 files changed, 4 insertions, 4 deletions
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;