Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 #ifndef __NWBUTTON_H
0003 #define __NWBUTTON_H
0004 
0005 /*
0006  *  NetWinder Button Driver-
0007  *  Copyright (C) Alex Holden <alex@linuxhacker.org> 1998, 1999.
0008  */
0009 
0010 #ifdef __NWBUTTON_C /* Actually compiling the driver itself */
0011 
0012 /* Various defines: */
0013 
0014 #define NUM_PRESSES_REBOOT 2    /* How many presses to activate shutdown */
0015 #define BUTTON_DELAY 30     /* How many jiffies for sequence to end */
0016 #define VERSION "0.3"       /* Driver version number */
0017 
0018 /* Structure definitions: */
0019 
0020 struct button_callback {
0021     void (*callback) (void);
0022     int count;
0023 };
0024 
0025 /* Function prototypes: */
0026 
0027 static void button_sequence_finished(struct timer_list *unused);
0028 static irqreturn_t button_handler (int irq, void *dev_id);
0029 int button_init (void);
0030 int button_add_callback (void (*callback) (void), int count);
0031 int button_del_callback (void (*callback) (void));
0032 static void button_consume_callbacks (int bpcount);
0033 
0034 #else /* Not compiling the driver itself */
0035 
0036 extern int button_add_callback (void (*callback) (void), int count);
0037 extern int button_del_callback (void (*callback) (void));
0038 
0039 #endif /* __NWBUTTON_C */
0040 #endif /* __NWBUTTON_H */