[PATCH 1/1] input: keyboard: Set configuration registers

December 09th, 2011 - 02:30 am ET by Shridhar Rasal | Report spam
-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

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
email Follow the discussionReplies 4 repliesReplies Make a reply

Replies

#1 Stephen Warren
December 09th, 2011 - 03:20 pm ET | Report spam
Shridhar Rasal wrote at Friday, December 09, 2011 12:29 AM:
To:
Cc: ; Stephen Warren; Rakesh Iyer; ; linux-
; ; Shridhar Rasal
Subject: [PATCH 1/1] input: keyboard: Set configuration registers

-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



I wondered if num==0 could be used instead of a new en field, but 0 is a
valid row/column number, so no. As such,

Acked-by: Stephen Warren

nvpublic

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

Similar topics