linux-old/drivers/char/nwbutton.h
<<
>>
Prefs
   1#ifndef __NWBUTTON_H
   2#define __NWBUTTON_H
   3
   4/*
   5 *      NetWinder Button Driver-
   6 *      Copyright (C) Alex Holden <alex@linuxhacker.org> 1998, 1999.
   7 */
   8
   9#ifdef __NWBUTTON_C     /* Actually compiling the driver itself */
  10
  11/* Various defines: */
  12
  13#define NUM_PRESSES_REBOOT 2    /* How many presses to activate shutdown */
  14#define BUTTON_DELAY 30         /* How many jiffies for sequence to end */
  15#define VERSION "0.3"           /* Driver version number */
  16#define BUTTON_MINOR 158        /* Major 10, Minor 158, /dev/nwbutton */
  17
  18/* Structure definitions: */
  19
  20struct button_callback {
  21        void (*callback) (void);
  22        int count;
  23};
  24
  25/* Function prototypes: */
  26
  27static void button_sequence_finished (unsigned long parameters);
  28static void button_handler (int irq, void *dev_id, struct pt_regs *regs);
  29static int button_read (struct file *filp, char *buffer,
  30                        size_t count, loff_t *ppos);
  31int button_init (void);
  32int button_add_callback (void (*callback) (void), int count);
  33int button_del_callback (void (*callback) (void));
  34static void button_consume_callbacks (int bpcount);
  35#ifdef MODULE
  36int init_module (void);
  37void cleanup_module (void);
  38#endif /* MODULE */
  39
  40#else /* Not compiling the driver itself */
  41
  42extern int button_add_callback (void (*callback) (void), int count);
  43extern int button_del_callback (void (*callback) (void));
  44
  45#endif /* __NWBUTTON_C */
  46#endif /* __NWBUTTON_H */
  47
lxr.linux.no kindly hosted by Redpill Linpro AS, provider of Linux consulting and operations services since 1995.