nwbutton.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #ifndef __NWBUTTON_H
  3. #define __NWBUTTON_H
  4. /*
  5. * NetWinder Button Driver-
  6. * Copyright (C) Alex Holden <alex@linuxhacker.org> 1998, 1999.
  7. */
  8. #ifdef __NWBUTTON_C /* Actually compiling the driver itself */
  9. /* Various defines: */
  10. #define NUM_PRESSES_REBOOT 2 /* How many presses to activate shutdown */
  11. #define BUTTON_DELAY 30 /* How many jiffies for sequence to end */
  12. #define VERSION "0.3" /* Driver version number */
  13. /* Structure definitions: */
  14. struct button_callback {
  15. void (*callback) (void);
  16. int count;
  17. };
  18. /* Function prototypes: */
  19. static void button_sequence_finished(struct timer_list *unused);
  20. static irqreturn_t button_handler (int irq, void *dev_id);
  21. int button_init (void);
  22. int button_add_callback (void (*callback) (void), int count);
  23. int button_del_callback (void (*callback) (void));
  24. static void button_consume_callbacks (int bpcount);
  25. #else /* Not compiling the driver itself */
  26. extern int button_add_callback (void (*callback) (void), int count);
  27. extern int button_del_callback (void (*callback) (void));
  28. #endif /* __NWBUTTON_C */
  29. #endif /* __NWBUTTON_H */