pxa27x_keypad.h 1.6 KB

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