gpio_mouse.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. /*
  2. * Driver for simulating a mouse on GPIO lines.
  3. *
  4. * Copyright (C) 2007 Atmel Corporation
  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 _GPIO_MOUSE_H
  11. #define _GPIO_MOUSE_H
  12. #define GPIO_MOUSE_POLARITY_ACT_HIGH 0x00
  13. #define GPIO_MOUSE_POLARITY_ACT_LOW 0x01
  14. #define GPIO_MOUSE_PIN_UP 0
  15. #define GPIO_MOUSE_PIN_DOWN 1
  16. #define GPIO_MOUSE_PIN_LEFT 2
  17. #define GPIO_MOUSE_PIN_RIGHT 3
  18. #define GPIO_MOUSE_PIN_BLEFT 4
  19. #define GPIO_MOUSE_PIN_BMIDDLE 5
  20. #define GPIO_MOUSE_PIN_BRIGHT 6
  21. #define GPIO_MOUSE_PIN_MAX 7
  22. /**
  23. * struct gpio_mouse_platform_data
  24. * @scan_ms: integer in ms specifying the scan periode.
  25. * @polarity: Pin polarity, active high or low.
  26. * @up: GPIO line for up value.
  27. * @down: GPIO line for down value.
  28. * @left: GPIO line for left value.
  29. * @right: GPIO line for right value.
  30. * @bleft: GPIO line for left button.
  31. * @bmiddle: GPIO line for middle button.
  32. * @bright: GPIO line for right button.
  33. *
  34. * This struct must be added to the platform_device in the board code.
  35. * It is used by the gpio_mouse driver to setup GPIO lines and to
  36. * calculate mouse movement.
  37. */
  38. struct gpio_mouse_platform_data {
  39. int scan_ms;
  40. int polarity;
  41. union {
  42. struct {
  43. int up;
  44. int down;
  45. int left;
  46. int right;
  47. int bleft;
  48. int bmiddle;
  49. int bright;
  50. };
  51. int pins[GPIO_MOUSE_PIN_MAX];
  52. };
  53. };
  54. #endif /* _GPIO_MOUSE_H */