summaryrefslogtreecommitdiff
path: root/drivers/input
diff options
context:
space:
mode:
authorSrinivasarao P <spathi@codeaurora.org>2018-12-24 12:22:31 +0530
committerSrinivasarao P <spathi@codeaurora.org>2018-12-24 12:23:20 +0530
commit52be7fe1faa3ab55f76c8eddb9ce07b31720524d (patch)
tree53ad5a8fa8634bab8b6f41b94edb43d4c1d244c0 /drivers/input
parent8271e2f79c2cbf13887cf0c58daa9375d65939db (diff)
parentdfca92bab267c629c7aff059de9217d2fb1ab21e (diff)
Merge android-4.4.169 (dfca92b) into msm-4.4
* refs/heads/tmp-dfca92b Linux 4.4.169 ALSA: isa/wavefront: prevent some out of bound writes rtc: snvs: Add timeouts to avoid kernel lockups rtc: snvs: add a missing write sync i2c: scmi: Fix probe error on devices with an empty SMB0001 ACPI device node i2c: axxia: properly handle master timeout cifs: In Kconfig CONFIG_CIFS_POSIX needs depends on legacy (insecure cifs) ARM: 8814/1: mm: improve/fix ARM v7_dma_inv_range() unaligned address handling mv88e6060: disable hardware level MAC learning libata: whitelist all SAMSUNG MZ7KM* solid-state disks Input: omap-keypad - fix keyboard debounce configuration clk: mmp: Off by one in mmp_clk_add() ide: pmac: add of_node_put() drivers/tty: add missing of_node_put() drivers/sbus/char: add of_node_put() sbus: char: add of_node_put() SUNRPC: Fix a potential race in xprt_connect() bonding: fix 802.3ad state sent to partner when unbinding slave ARC: io.h: Implement reads{x}()/writes{x}() drm/msm: Grab a vblank reference when waiting for commit_done x86/earlyprintk/efi: Fix infinite loop on some screen widths scsi: vmw_pscsi: Rearrange code to avoid multiple calls to free_irq during unload scsi: libiscsi: Fix NULL pointer dereference in iscsi_eh_session_reset mac80211_hwsim: fix module init error paths for netlink mac80211: Fix condition validating WMM IE mac80211: don't WARN on bad WMM parameters from buggy APs f2fs: fix a panic caused by NULL flush_cmd_control Revert "drm/rockchip: Allow driver to be shutdown on reboot/kexec" powerpc/msi: Fix NULL pointer access in teardown code tracing: Fix memory leak of instance function hash filters tracing: Fix memory leak in set_trigger_filter() MMC: OMAP: fix broken MMC on OMAP15XX/OMAP5910/OMAP310 aio: fix spectre gadget in lookup_ioctx pinctrl: sunxi: a83t: Fix IRQ offset typo for PH11 powerpc/boot: Fix random libfdt related build errors timer/debug: Change /proc/timer_list from 0444 to 0400 lib/interval_tree_test.c: allow users to limit scope of endpoint lib/rbtree-test: lower default params lib/rbtree_test.c: make input module parameters lib/interval_tree_test.c: allow full tree search lib/interval_tree_test.c: make test options module parameters ANDROID: Revert fs/squashfs back to linux-4.4.y Conflicts: drivers/gpu/drm/msm/msm_atomic.c Change-Id: Iecec05c300fb06c0bcdd44a797795e854ea0d0fd Signed-off-by: Srinivasarao P <spathi@codeaurora.org>
Diffstat (limited to 'drivers/input')
-rw-r--r--drivers/input/keyboard/omap4-keypad.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/drivers/input/keyboard/omap4-keypad.c b/drivers/input/keyboard/omap4-keypad.c
index 6639b2b8528a..f78c464899db 100644
--- a/drivers/input/keyboard/omap4-keypad.c
+++ b/drivers/input/keyboard/omap4-keypad.c
@@ -60,8 +60,18 @@
/* OMAP4 values */
#define OMAP4_VAL_IRQDISABLE 0x0
-#define OMAP4_VAL_DEBOUNCINGTIME 0x7
-#define OMAP4_VAL_PVT 0x7
+
+/*
+ * Errata i689: If a key is released for a time shorter than debounce time,
+ * the keyboard will idle and never detect the key release. The workaround
+ * is to use at least a 12ms debounce time. See omap5432 TRM chapter
+ * "26.4.6.2 Keyboard Controller Timer" for more information.
+ */
+#define OMAP4_KEYPAD_PTV_DIV_128 0x6
+#define OMAP4_KEYPAD_DEBOUNCINGTIME_MS(dbms, ptv) \
+ ((((dbms) * 1000) / ((1 << ((ptv) + 1)) * (1000000 / 32768))) - 1)
+#define OMAP4_VAL_DEBOUNCINGTIME_16MS \
+ OMAP4_KEYPAD_DEBOUNCINGTIME_MS(16, OMAP4_KEYPAD_PTV_DIV_128)
enum {
KBD_REVISION_OMAP4 = 0,
@@ -181,9 +191,9 @@ static int omap4_keypad_open(struct input_dev *input)
kbd_writel(keypad_data, OMAP4_KBD_CTRL,
OMAP4_DEF_CTRL_NOSOFTMODE |
- (OMAP4_VAL_PVT << OMAP4_DEF_CTRL_PTV_SHIFT));
+ (OMAP4_KEYPAD_PTV_DIV_128 << OMAP4_DEF_CTRL_PTV_SHIFT));
kbd_writel(keypad_data, OMAP4_KBD_DEBOUNCINGTIME,
- OMAP4_VAL_DEBOUNCINGTIME);
+ OMAP4_VAL_DEBOUNCINGTIME_16MS);
/* clear pending interrupts */
kbd_write_irqreg(keypad_data, OMAP4_KBD_IRQSTATUS,
kbd_read_irqreg(keypad_data, OMAP4_KBD_IRQSTATUS));