diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2013-07-03 11:12:08 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-07-03 11:12:08 -0700 |
commit | ab5348573908dedb62dd906aa60c5989fecfe38f (patch) | |
tree | e98fc37939cc8bf69b5d678171b1edd4f1444c04 /drivers/input | |
parent | 0e97456ab5ba2761892d9e67b7e3b0cac262141c (diff) | |
parent | ee89bd6bc73d1d14555418a2642172448052f1dd (diff) |
Merge branch 'exotic-arch-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/linux-m68k
Pull "exotic" arch fixes from Geert Uytterhoeven:
"This is a collection of several exotic architecture fixes, and a few
other fixes for issues that were detected while doing the former"
* 'exotic-arch-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/linux-m68k: (35 commits)
lib: Move fonts from drivers/video/console/ to lib/fonts/
console/font: Refactor font support code selection logic
Revert "staging/solo6x10: depend on CONFIG_FONTS"
input: cros_ec_keyb_clear_keyboard() depends on CONFIG_PM_SLEEP
score: Wire up asm-generic/xor.h
score: Remove unneeded <asm/dma-mapping.h>
openrisc: Wire up asm-generic/xor.h
h8300/boot: Use POSIX "$((..))" instead of bashism "$[...]"
h8300: Mark H83002 and H83048 CPU support broken
h8300: Switch h8300 to drivers/Kconfig
h8300: Limit timer channel ranges in Kconfig
h8300: Wire up asm-generic/xor.h
h8300: Fill the system call table using a CALL() macro
h8300: Fix <asm/tlb.h>
h8300: Hardcode symbol prefixes in asm sources
h8300: add missing definition for read_barries_depends()
frv: head.S - Remove commented-out initialization code
cris: Wire up asm-generic/vga.h
parport: disable PC-style parallel port support on cris
console: Disable VGA text console support on cris
...
Diffstat (limited to 'drivers/input')
-rw-r--r-- | drivers/input/keyboard/cros_ec_keyb.c | 54 |
1 files changed, 27 insertions, 27 deletions
diff --git a/drivers/input/keyboard/cros_ec_keyb.c b/drivers/input/keyboard/cros_ec_keyb.c index 49557f27bfa..7e8b0a52af2 100644 --- a/drivers/input/keyboard/cros_ec_keyb.c +++ b/drivers/input/keyboard/cros_ec_keyb.c @@ -206,33 +206,6 @@ static int cros_ec_keyb_work(struct notifier_block *nb, return NOTIFY_DONE; } -/* Clear any keys in the buffer */ -static void cros_ec_keyb_clear_keyboard(struct cros_ec_keyb *ckdev) -{ - uint8_t old_state[ckdev->cols]; - uint8_t new_state[ckdev->cols]; - unsigned long duration; - int i, ret; - - /* - * Keep reading until we see that the scan state does not change. - * That indicates that we are done. - * - * Assume that the EC keyscan buffer is at most 32 deep. - */ - duration = jiffies; - ret = cros_ec_keyb_get_state(ckdev, new_state); - for (i = 1; !ret && i < 32; i++) { - memcpy(old_state, new_state, sizeof(old_state)); - ret = cros_ec_keyb_get_state(ckdev, new_state); - if (0 == memcmp(old_state, new_state, sizeof(old_state))) - break; - } - duration = jiffies - duration; - dev_info(ckdev->dev, "Discarded %d keyscan(s) in %dus\n", i, - jiffies_to_usecs(duration)); -} - static int cros_ec_keyb_probe(struct platform_device *pdev) { struct cros_ec_device *ec = dev_get_drvdata(pdev->dev.parent); @@ -299,6 +272,33 @@ static int cros_ec_keyb_probe(struct platform_device *pdev) } #ifdef CONFIG_PM_SLEEP +/* Clear any keys in the buffer */ +static void cros_ec_keyb_clear_keyboard(struct cros_ec_keyb *ckdev) +{ + uint8_t old_state[ckdev->cols]; + uint8_t new_state[ckdev->cols]; + unsigned long duration; + int i, ret; + + /* + * Keep reading until we see that the scan state does not change. + * That indicates that we are done. + * + * Assume that the EC keyscan buffer is at most 32 deep. + */ + duration = jiffies; + ret = cros_ec_keyb_get_state(ckdev, new_state); + for (i = 1; !ret && i < 32; i++) { + memcpy(old_state, new_state, sizeof(old_state)); + ret = cros_ec_keyb_get_state(ckdev, new_state); + if (0 == memcmp(old_state, new_state, sizeof(old_state))) + break; + } + duration = jiffies - duration; + dev_info(ckdev->dev, "Discarded %d keyscan(s) in %dus\n", i, + jiffies_to_usecs(duration)); +} + static int cros_ec_keyb_resume(struct device *dev) { struct cros_ec_keyb *ckdev = dev_get_drvdata(dev); |