nwbutton.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. #ifndef __NWBUTTON_H
  2. #define __NWBUTTON_H
  3. /*
  4. * NetWinder Button Driver-
  5. * Copyright (C) Alex Holden <alex@linuxhacker.org> 1998, 1999.
  6. */
  7. #ifdef __NWBUTTON_C /* Actually compiling the driver itself */
  8. /* Various defines: */
  9. #define NUM_PRESSES_REBOOT 2 /* How many presses to activate shutdown */
  10. #define BUTTON_DELAY 30 /* How many jiffies for sequence to end */
  11. #define VERSION "0.3" /* Driver version number */
  12. #define BUTTON_MINOR 158 /* Major 10, Minor 158, /dev/nwbutton */
  13. /* Structure definitions: */
  14. struct button_callback {
  15. void (*callback) (void);
  16. int count;
  17. };
  18. /* Function prototypes: */
  19. static void button_sequence_finished (unsigned long parameters);
  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 */