push-switch.h 755 B

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