linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/1] input: keyboard: Set configuration registers
@ 2011-12-09  7:29 Shridhar Rasal
  2011-12-09 20:10 ` Stephen Warren
  0 siblings, 1 reply; 12+ messages in thread
From: Shridhar Rasal @ 2011-12-09  7:29 UTC (permalink / raw)
  To: dmitry.torokhov
  Cc: rydberg, swarren, riyer, linux-kernel, linux-input, linux-tegra,
	Shridhar Rasal

-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


^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2012-03-29 15:49 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-12-09  7:29 [PATCH 1/1] input: keyboard: Set configuration registers Shridhar Rasal
2011-12-09 20:10 ` Stephen Warren
2011-12-09 21:25   ` Dmitry Torokhov
2011-12-09 23:17     ` Stephen Warren
     [not found]       ` <74CDBE0F657A3D45AFBB94109FB122FF17518605E5-C7FfzLzN0UxDw2glCA4ptUEOCMrvLtNR@public.gmane.org>
2011-12-30  3:25         ` Dmitry Torokhov
2012-01-31 19:09           ` Dmitry Torokhov
2012-01-31 19:29             ` Stephen Warren
2012-01-31 19:47               ` Dmitry Torokhov
2012-01-31 19:51                 ` Stephen Warren
     [not found]                 ` <20120131194735.GA22872-WlK9ik9hQGAhIp7JRqBPierSzoNAToWh@public.gmane.org>
2012-03-27  5:17                   ` Shridhar Rasal
     [not found]                     ` <4F714D5C.1050400-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2012-03-27 15:22                       ` Stephen Warren
2012-03-29 15:49                         ` Stephen Warren

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).