pxa27x_keypad.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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. struct pxa27x_keypad_platform_data {
  21. /* code map for the matrix keys */
  22. unsigned int matrix_key_rows;
  23. unsigned int matrix_key_cols;
  24. unsigned int *matrix_key_map;
  25. int matrix_key_map_size;
  26. /* direct keys */
  27. int direct_key_num;
  28. unsigned int direct_key_map[8];
  29. /* rotary encoders 0 */
  30. int enable_rotary0;
  31. int rotary0_rel_code;
  32. int rotary0_up_key;
  33. int rotary0_down_key;
  34. /* rotary encoders 1 */
  35. int enable_rotary1;
  36. int rotary1_rel_code;
  37. int rotary1_up_key;
  38. int rotary1_down_key;
  39. };
  40. #define KEY(row, col, val) (((row) << 28) | ((col) << 24) | (val))
  41. #endif /* __ASM_ARCH_PXA27x_KEYPAD_H */