gpio_keys.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. #ifndef _GPIO_KEYS_H
  2. #define _GPIO_KEYS_H
  3. /* DVFS feature : HOME_KEY BOOSTER */
  4. #define KEY_BOOSTER
  5. #ifdef KEY_BOOSTER
  6. #include <linux/cpufreq.h>
  7. #define KEY_BOOSTER_OFF_TIME 500
  8. #define KEY_BOOSTER_CHG_TIME 130
  9. #endif
  10. extern struct class *sec_class;
  11. struct device;
  12. struct gpio_keys_button {
  13. /* Configuration parameters */
  14. unsigned int code; /* input event code (KEY_*, SW_*) */
  15. int gpio; /* -1 if this key does not support gpio */
  16. int active_low;
  17. const char *desc;
  18. unsigned int type; /* input event type (EV_KEY, EV_SW, EV_ABS) */
  19. int wakeup; /* configure the button as a wake-up source */
  20. int debounce_interval; /* debounce ticks interval in msecs */
  21. bool can_disable;
  22. int value; /* axis value for EV_ABS */
  23. unsigned int irq; /* Irq number in case of interrupt keys */
  24. };
  25. struct gpio_keys_platform_data {
  26. struct gpio_keys_button *buttons;
  27. int nbuttons;
  28. unsigned int poll_interval; /* polling interval in msecs -
  29. for polling driver only */
  30. unsigned int rep:1; /* enable input subsystem auto repeat */
  31. int (*enable)(struct device *dev);
  32. void (*disable)(struct device *dev);
  33. const char *name; /* input device name */
  34. #ifdef CONFIG_SENSORS_HALL
  35. int gpio_flip_cover;
  36. int flip_code;
  37. #endif
  38. #ifdef CONFIG_SENSORS_HALL_IRQ_CTRL
  39. bool workaround_set;
  40. #endif
  41. #ifdef CONFIG_SENSORS_HALL_DEBOUNCE
  42. bool debounce_set;
  43. #endif
  44. };
  45. #ifdef CONFIG_SENSORS_HALL_IRQ_CTRL
  46. extern void gpio_hall_irq_set(int state, bool auth_changed);
  47. enum state {
  48. disable = 0,
  49. enable
  50. };
  51. #endif
  52. #endif