1 /* SPDX-License-Identifier: GPL-2.0 */
6 * NetWinder Button Driver-
7 * Copyright (C) Alex Holden <alex@linuxhacker.org> 1998, 1999.
10 #ifdef __NWBUTTON_C /* Actually compiling the driver itself */
12 /* Various defines: */
14 #define NUM_PRESSES_REBOOT 2 /* How many presses to activate shutdown */
15 #define BUTTON_DELAY 30 /* How many jiffies for sequence to end */
16 #define VERSION "0.3" /* Driver version number */
17 #define BUTTON_MINOR 158 /* Major 10, Minor 158, /dev/nwbutton */
19 /* Structure definitions: */
21 struct button_callback
{
22 void (*callback
) (void);
26 /* Function prototypes: */
28 static void button_sequence_finished(struct timer_list
*unused
);
29 static irqreturn_t
button_handler (int irq
, void *dev_id
);
30 int button_init (void);
31 int button_add_callback (void (*callback
) (void), int count
);
32 int button_del_callback (void (*callback
) (void));
33 static void button_consume_callbacks (int bpcount
);
35 #else /* Not compiling the driver itself */
37 extern int button_add_callback (void (*callback
) (void), int count
);
38 extern int button_del_callback (void (*callback
) (void));
40 #endif /* __NWBUTTON_C */
41 #endif /* __NWBUTTON_H */