blob: f2b9fdc1f9ead5cf3109ff6b7d6ec75227d6232b [file] [log] [blame]
Greg Kroah-Hartmanb2441312017-11-01 15:07:57 +01001/* SPDX-License-Identifier: GPL-2.0 */
Linus Torvalds1da177e2005-04-16 15:20:36 -07002#ifndef __NWBUTTON_H
3#define __NWBUTTON_H
4
5/*
6 * NetWinder Button Driver-
7 * Copyright (C) Alex Holden <alex@linuxhacker.org> 1998, 1999.
8 */
9
10#ifdef __NWBUTTON_C /* Actually compiling the driver itself */
11
12/* Various defines: */
13
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 */
Linus Torvalds1da177e2005-04-16 15:20:36 -070017
18/* Structure definitions: */
19
20struct button_callback {
21 void (*callback) (void);
22 int count;
23};
24
25/* Function prototypes: */
26
Kees Cook24ed9602017-08-28 11:28:21 -070027static void button_sequence_finished(struct timer_list *unused);
David Howells7d12e782006-10-05 14:55:46 +010028static irqreturn_t button_handler (int irq, void *dev_id);
Linus Torvalds1da177e2005-04-16 15:20:36 -070029int button_init (void);
30int button_add_callback (void (*callback) (void), int count);
31int button_del_callback (void (*callback) (void));
32static void button_consume_callbacks (int bpcount);
33
34#else /* Not compiling the driver itself */
35
36extern int button_add_callback (void (*callback) (void), int count);
37extern int button_del_callback (void (*callback) (void));
38
39#endif /* __NWBUTTON_C */
40#endif /* __NWBUTTON_H */