summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xarch/arm/mach-tegra/board-nvodm.c10
-rw-r--r--arch/arm/mach-tegra/include/mach/kbc.h3
-rw-r--r--arch/arm/mach-tegra/include/nvodm_query_kbc.h3
-rwxr-xr-xdrivers/input/keyboard/tegra-kbc.c5
4 files changed, 21 insertions, 0 deletions
diff --git a/arch/arm/mach-tegra/board-nvodm.c b/arch/arm/mach-tegra/board-nvodm.c
index 1e93c42b4f7d..16adcb6f8ea1 100755
--- a/arch/arm/mach-tegra/board-nvodm.c
+++ b/arch/arm/mach-tegra/board-nvodm.c
@@ -753,8 +753,18 @@ static noinline void __init tegra_setup_kbc(void)
/* debounce time is reported from ODM in terms of clock ticks. */
pdata->debounce_cnt = temp;
+ /* Get the scanning timeout in terms of MilliSeconds.*/
+ temp = 0;
+ NvOdmKbcGetParameter(NvOdmKbcParameter_KeyScanTimeout, 1, &temp);
+ /* If value is 0 then set it to 5 second as default */
+ if (!temp)
+ temp = 5000;
+ /* Convert Milliseconds to clock count of 32Kz */
+ pdata->scan_timeout_cnt = temp*32;
+
/* repeat cycle is reported from ODM in milliseconds,
* but needs to be specified in 32KHz ticks */
+ temp = 0;
NvOdmKbcGetParameter(NvOdmKbcParameter_RepeatCycleTime, 1, &temp);
pdata->repeat_cnt = temp * 32;
diff --git a/arch/arm/mach-tegra/include/mach/kbc.h b/arch/arm/mach-tegra/include/mach/kbc.h
index 83810aef2612..ab2ee0a879b8 100644
--- a/arch/arm/mach-tegra/include/mach/kbc.h
+++ b/arch/arm/mach-tegra/include/mach/kbc.h
@@ -52,6 +52,9 @@ struct tegra_kbc_wake_key {
struct tegra_kbc_plat {
unsigned int debounce_cnt;
unsigned int repeat_cnt;
+ /* Number of clock count (32KHz) to keep scanning of key after
+ * Key is pressed. */
+ unsigned int scan_timeout_cnt;
int wake_cnt; /* 0:wake on any key >1:wake on wake_cfg */
struct tegra_kbc_pin_cfg pin_cfg[KBC_MAX_GPIO];
struct tegra_kbc_wake_key *wake_cfg;
diff --git a/arch/arm/mach-tegra/include/nvodm_query_kbc.h b/arch/arm/mach-tegra/include/nvodm_query_kbc.h
index f8078961978e..08ea045b2ff6 100644
--- a/arch/arm/mach-tegra/include/nvodm_query_kbc.h
+++ b/arch/arm/mach-tegra/include/nvodm_query_kbc.h
@@ -62,6 +62,9 @@ typedef enum
NvOdmKbcParameter_NumOfColumns,
NvOdmKbcParameter_DebounceTime,
NvOdmKbcParameter_RepeatCycleTime,
+ /* Amount of time in MilliSecond to continue the scanning of key
+ * once key is pressed. */
+ NvOdmKbcParameter_KeyScanTimeout,
NvOdmKbcParameter_Force32 = 0x7FFFFFFF
} NvOdmKbcParameter;
diff --git a/drivers/input/keyboard/tegra-kbc.c b/drivers/input/keyboard/tegra-kbc.c
index 692ca225ea7e..d0b578b7f7b4 100755
--- a/drivers/input/keyboard/tegra-kbc.c
+++ b/drivers/input/keyboard/tegra-kbc.c
@@ -40,6 +40,7 @@
#define KBC_INT_0 4
#define KBC_ROW_CFG0_0 8
#define KBC_COL_CFG0_0 0x18
+#define KBC_TO_CNT_0 0x24
#define KBC_RPT_DLY_0 0x2c
#define KBC_KP_ENT0_0 0x30
#define KBC_KP_ENT1_0 0x34
@@ -307,6 +308,10 @@ static int tegra_kbc_open(struct input_dev *dev)
val |= 1; /* enable */
writel(val, kbc->mmio + KBC_CONTROL_0);
+ /* Bit 19:0 is for scan timeout count */
+ kbc->pdata->scan_timeout_cnt &= 0xFFFFF;
+ writel(kbc->pdata->scan_timeout_cnt, kbc->mmio + KBC_TO_CNT_0);
+
/* atomically clear out any remaining entries in the key FIFO
* and enable keyboard interrupts */
spin_lock_irqsave(&kbc->lock, flags);