lkml.org 
[lkml]   [2011]   [Dec]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 1/1] input: keyboard: Set configuration registers
Date
-Set only REQUIRED row and column configuration register to
PROPER values to avoid continuously generating KBC input events.
-Use *en* field in pin_cfg, to check GPIO_x_ROW_EN register
should be set or clear.

Signed-off-by: Shridhar Rasal <srasal@nvidia.com>
---
arch/arm/mach-tegra/include/mach/kbc.h | 1 +
drivers/input/keyboard/tegra-kbc.c | 13 ++++++++-----
2 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/arch/arm/mach-tegra/include/mach/kbc.h b/arch/arm/mach-tegra/include/mach/kbc.h
index 4f3572a..2212284 100644
--- a/arch/arm/mach-tegra/include/mach/kbc.h
+++ b/arch/arm/mach-tegra/include/mach/kbc.h
@@ -38,6 +38,7 @@

struct tegra_kbc_pin_cfg {
bool is_row;
+ bool en;
unsigned char num;
};

diff --git a/drivers/input/keyboard/tegra-kbc.c b/drivers/input/keyboard/tegra-kbc.c
index cf3228b..faf4f3e 100644
--- a/drivers/input/keyboard/tegra-kbc.c
+++ b/drivers/input/keyboard/tegra-kbc.c
@@ -447,11 +447,14 @@ static void tegra_kbc_config_pins(struct tegra_kbc *kbc)
row_cfg &= ~r_mask;
col_cfg &= ~c_mask;

- if (pdata->pin_cfg[i].is_row)
- row_cfg |= ((pdata->pin_cfg[i].num << 1) | 1) << r_shft;
- else
- col_cfg |= ((pdata->pin_cfg[i].num << 1) | 1) << c_shft;
-
+ if (pdata->pin_cfg[i].en) {
+ if (pdata->pin_cfg[i].is_row)
+ row_cfg |= ((pdata->pin_cfg[i].num << 1) | 1)
+ << r_shft;
+ else
+ col_cfg |= ((pdata->pin_cfg[i].num << 1) | 1)
+ << c_shft;
+ }
writel(row_cfg, kbc->mmio + r_offs);
writel(col_cfg, kbc->mmio + c_offs);
}
--
1.7.1


\
 
 \ /
  Last update: 2011-12-09 08:29    [W:0.063 / U:5.020 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site