keypad.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. /*
  2. * arch/arm/plat-omap/include/mach/keypad.h
  3. *
  4. * Copyright (C) 2006 Komal Shah <komal_shah802003@yahoo.com>
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License version 2 as
  8. * published by the Free Software Foundation.
  9. */
  10. #ifndef ASMARM_ARCH_KEYPAD_H
  11. #define ASMARM_ARCH_KEYPAD_H
  12. #ifndef CONFIG_ARCH_OMAP1
  13. #warning Please update the board to use matrix-keypad driver
  14. #define omap_readw(reg) 0
  15. #define omap_writew(val, reg) do {} while (0)
  16. #endif
  17. #include <linux/input/matrix_keypad.h>
  18. struct omap_kp_platform_data {
  19. int rows;
  20. int cols;
  21. const struct matrix_keymap_data *keymap_data;
  22. bool rep;
  23. unsigned long delay;
  24. bool dbounce;
  25. /* specific to OMAP242x*/
  26. unsigned int *row_gpios;
  27. unsigned int *col_gpios;
  28. };
  29. /* Group (0..3) -- when multiple keys are pressed, only the
  30. * keys pressed in the same group are considered as pressed. This is
  31. * in order to workaround certain crappy HW designs that produce ghost
  32. * keypresses. Two free bits, not used by neither row/col nor keynum,
  33. * must be available for use as group bits. The below GROUP_SHIFT
  34. * macro definition is based on some prior knowledge of the
  35. * matrix_keypad defined KEY() macro internals.
  36. */
  37. #define GROUP_SHIFT 14
  38. #define GROUP_0 (0 << GROUP_SHIFT)
  39. #define GROUP_1 (1 << GROUP_SHIFT)
  40. #define GROUP_2 (2 << GROUP_SHIFT)
  41. #define GROUP_3 (3 << GROUP_SHIFT)
  42. #define GROUP_MASK GROUP_3
  43. #if KEY_MAX & GROUP_MASK
  44. #error Group bits in conflict with keynum bits
  45. #endif
  46. #endif