linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Shridhar Rasal <srasal@nvidia.com>
To: dmitry.torokhov@gmail.com
Cc: rydberg@euromail.se, swarren@nvidia.com, riyer@nvidia.com,
	linux-kernel@vger.kernel.org, linux-input@vger.kernel.org,
	linux-tegra@vger.kernel.org, Shridhar Rasal <srasal@nvidia.com>
Subject: [PATCH 1/1] input: keyboard: Set configuration registers
Date: Fri,  9 Dec 2011 12:59:18 +0530	[thread overview]
Message-ID: <1323415758-16822-1-git-send-email-srasal@nvidia.com> (raw)

-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


             reply	other threads:[~2011-12-09  7:26 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-09  7:29 Shridhar Rasal [this message]
2011-12-09 20:10 ` [PATCH 1/1] input: keyboard: Set configuration registers 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1323415758-16822-1-git-send-email-srasal@nvidia.com \
    --to=srasal@nvidia.com \
    --cc=dmitry.torokhov@gmail.com \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=riyer@nvidia.com \
    --cc=rydberg@euromail.se \
    --cc=swarren@nvidia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).