pxa27x_keypad.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. #ifndef __ASM_ARCH_PXA27x_KEYPAD_H
  2. #define __ASM_ARCH_PXA27x_KEYPAD_H
  3. #include <linux/input.h>
  4. #include <linux/input/matrix_keypad.h>
  5. #define MAX_MATRIX_KEY_ROWS (8)
  6. #define MAX_MATRIX_KEY_COLS (8)
  7. /* pxa3xx keypad platform specific parameters
  8. *
  9. * NOTE:
  10. * 1. direct_key_num indicates the number of keys in the direct keypad
  11. * _plus_ the number of rotary-encoder sensor inputs, this can be
  12. * left as 0 if only rotary encoders are enabled, the driver will
  13. * automatically calculate this
  14. *
  15. * 2. direct_key_map is the key code map for the direct keys, if rotary
  16. * encoder(s) are enabled, direct key 0/1(2/3) will be ignored
  17. *
  18. * 3. rotary can be either interpreted as a relative input event (e.g.
  19. * REL_WHEEL/REL_HWHEEL) or specific keys (e.g. UP/DOWN/LEFT/RIGHT)
  20. *
  21. * 4. matrix key and direct key will use the same debounce_interval by
  22. * default, which should be sufficient in most cases
  23. */
  24. struct pxa27x_keypad_platform_data {
  25. /* code map for the matrix keys */
  26. unsigned int matrix_key_rows;
  27. unsigned int matrix_key_cols;
  28. unsigned int *matrix_key_map;
  29. int matrix_key_map_size;
  30. /* direct keys */
  31. int direct_key_num;
  32. unsigned int direct_key_map[8];
  33. /* rotary encoders 0 */
  34. int enable_rotary0;
  35. int rotary0_rel_code;
  36. int rotary0_up_key;
  37. int rotary0_down_key;
  38. /* rotary encoders 1 */
  39. int enable_rotary1;
  40. int rotary1_rel_code;
  41. int rotary1_up_key;
  42. int rotary1_down_key;
  43. /* key debounce interval */
  44. unsigned int debounce_interval;
  45. };
  46. extern void pxa_set_keypad_info(struct pxa27x_keypad_platform_data *info);
  47. #endif /* __ASM_ARCH_PXA27x_KEYPAD_H */