aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/keyboard
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-07-03 14:12:08 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2013-07-03 14:12:08 -0400
commitab5348573908dedb62dd906aa60c5989fecfe38f (patch)
treee98fc37939cc8bf69b5d678171b1edd4f1444c04 /drivers/input/keyboard
parent0e97456ab5ba2761892d9e67b7e3b0cac262141c (diff)
parentee89bd6bc73d1d14555418a2642172448052f1dd (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/keyboard')
-rw-r--r--drivers/input/keyboard/cros_ec_keyb.c54
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 49557f27bfa6..7e8b0a52af25 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,
206 return NOTIFY_DONE; 206 return NOTIFY_DONE;
207} 207}
208 208
209/* Clear any keys in the buffer */
210static void cros_ec_keyb_clear_keyboard(struct cros_ec_keyb *ckdev)
211{
212 uint8_t old_state[ckdev->cols];
213 uint8_t new_state[ckdev->cols];
214 unsigned long duration;
215 int i, ret;
216
217 /*
218 * Keep reading until we see that the scan state does not change.
219 * That indicates that we are done.
220 *
221 * Assume that the EC keyscan buffer is at most 32 deep.
222 */
223 duration = jiffies;
224 ret = cros_ec_keyb_get_state(ckdev, new_state);
225 for (i = 1; !ret && i < 32; i++) {
226 memcpy(old_state, new_state, sizeof(old_state));
227 ret = cros_ec_keyb_get_state(ckdev, new_state);
228 if (0 == memcmp(old_state, new_state, sizeof(old_state)))
229 break;
230 }
231 duration = jiffies - duration;
232 dev_info(ckdev->dev, "Discarded %d keyscan(s) in %dus\n", i,
233 jiffies_to_usecs(duration));
234}
235
236static int cros_ec_keyb_probe(struct platform_device *pdev) 209static int cros_ec_keyb_probe(struct platform_device *pdev)
237{ 210{
238 struct cros_ec_device *ec = dev_get_drvdata(pdev->dev.parent); 211 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)
299} 272}
300 273
301#ifdef CONFIG_PM_SLEEP 274#ifdef CONFIG_PM_SLEEP
275/* Clear any keys in the buffer */
276static void cros_ec_keyb_clear_keyboard(struct cros_ec_keyb *ckdev)
277{
278 uint8_t old_state[ckdev->cols];
279 uint8_t new_state[ckdev->cols];
280 unsigned long duration;
281 int i, ret;
282
283 /*
284 * Keep reading until we see that the scan state does not change.
285 * That indicates that we are done.
286 *
287 * Assume that the EC keyscan buffer is at most 32 deep.
288 */
289 duration = jiffies;
290 ret = cros_ec_keyb_get_state(ckdev, new_state);
291 for (i = 1; !ret && i < 32; i++) {
292 memcpy(old_state, new_state, sizeof(old_state));
293 ret = cros_ec_keyb_get_state(ckdev, new_state);
294 if (0 == memcmp(old_state, new_state, sizeof(old_state)))
295 break;
296 }
297 duration = jiffies - duration;
298 dev_info(ckdev->dev, "Discarded %d keyscan(s) in %dus\n", i,
299 jiffies_to_usecs(duration));
300}
301
302static int cros_ec_keyb_resume(struct device *dev) 302static int cros_ec_keyb_resume(struct device *dev)
303{ 303{
304 struct cros_ec_keyb *ckdev = dev_get_drvdata(dev); 304 struct cros_ec_keyb *ckdev = dev_get_drvdata(dev);