push-switch.h 716 B

1234567891011121314151617181920212223242526272829303132
  1. #ifndef __ASM_SH_PUSH_SWITCH_H
  2. #define __ASM_SH_PUSH_SWITCH_H
  3. #include <linux/timer.h>
  4. #include <linux/interrupt.h>
  5. #include <linux/workqueue.h>
  6. #include <linux/platform_device.h>
  7. struct push_switch {
  8. /* switch state */
  9. unsigned int state:1;
  10. /* debounce timer */
  11. struct timer_list debounce;
  12. /* workqueue */
  13. struct work_struct work;
  14. /* platform device, for workqueue handler */
  15. struct platform_device *pdev;
  16. };
  17. struct push_switch_platform_info {
  18. /* IRQ handler */
  19. irqreturn_t (*irq_handler)(int irq, void *data);
  20. /* Special IRQ flags */
  21. unsigned int irq_flags;
  22. /* Bit location of switch */
  23. unsigned int bit;
  24. /* Symbolic switch name */
  25. const char *name;
  26. };
  27. #endif /* __ASM_SH_PUSH_SWITCH_H */