nwbutton.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  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. #define BUTTON_MINOR 158 /* Major 10, Minor 158, /dev/nwbutton */
  14. /* Structure definitions: */
  15. struct button_callback {
  16. void (*callback) (void);
  17. int count;
  18. };
  19. /* Function prototypes: */
  20. static void button_sequence_finished(struct timer_list *unused);
  21. static irqreturn_t button_handler (int irq, void *dev_id);
  22. int button_init (void);
  23. int button_add_callback (void (*callback) (void), int count);
  24. int button_del_callback (void (*callback) (void));
  25. static void button_consume_callbacks (int bpcount);
  26. #else /* Not compiling the driver itself */
  27. extern int button_add_callback (void (*callback) (void), int count);
  28. extern int button_del_callback (void (*callback) (void));
  29. #endif /* __NWBUTTON_C */
  30. #endif /* __NWBUTTON_H */