Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions
it87_wdt.c File Reference
#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/types.h>
#include <linux/kernel.h>
#include <linux/fs.h>
#include <linux/miscdevice.h>
#include <linux/init.h>
#include <linux/ioport.h>
#include <linux/watchdog.h>
#include <linux/notifier.h>
#include <linux/reboot.h>
#include <linux/uaccess.h>
#include <linux/io.h>

Go to the source code of this file.

Macros

#define pr_fmt(fmt)   KBUILD_MODNAME ": " fmt
 
#define WATCHDOG_VERSION   "1.14"
 
#define WATCHDOG_NAME   "IT87 WDT"
 
#define DRIVER_VERSION   WATCHDOG_NAME " driver, v" WATCHDOG_VERSION "\n"
 
#define WD_MAGIC   'V'
 
#define DEFAULT_NOGAMEPORT   0
 
#define DEFAULT_EXCLUSIVE   1
 
#define DEFAULT_TIMEOUT   60
 
#define DEFAULT_TESTMODE   0
 
#define DEFAULT_NOWAYOUT   WATCHDOG_NOWAYOUT
 
#define REG   0x2e
 
#define VAL   0x2f
 
#define GPIO   0x07
 
#define GAMEPORT   0x09
 
#define CIR   0x0a
 
#define LDNREG   0x07
 
#define CHIPID   0x20
 
#define CHIPREV   0x22
 
#define ACTREG   0x30
 
#define BASEREG   0x60
 
#define NO_DEV_ID   0xffff
 
#define IT8702_ID   0x8702
 
#define IT8705_ID   0x8705
 
#define IT8712_ID   0x8712
 
#define IT8716_ID   0x8716
 
#define IT8718_ID   0x8718
 
#define IT8720_ID   0x8720
 
#define IT8721_ID   0x8721
 
#define IT8726_ID   0x8726 /* the data sheet suggest wrongly 0x8716 */
 
#define IT8728_ID   0x8728
 
#define WDTCTRL   0x71
 
#define WDTCFG   0x72
 
#define WDTVALLSB   0x73
 
#define WDTVALMSB   0x74
 
#define WDT_CIRINT   0x80
 
#define WDT_MOUSEINT   0x40
 
#define WDT_KYBINT   0x20
 
#define WDT_GAMEPORT   0x10 /* not in it8718, it8720, it8721, it8728 */
 
#define WDT_FORCE   0x02
 
#define WDT_ZERO   0x01
 
#define WDT_TOV1   0x80
 
#define WDT_KRST   0x40
 
#define WDT_TOVE   0x20
 
#define WDT_PWROK   0x10 /* not in it8721 */
 
#define WDT_INT_MASK   0x0f
 
#define CIR_ILS   0x70
 
#define CIR_BASE   0x0208
 
#define CIR_DR(b)   (b)
 
#define CIR_IER(b)   (b + 1)
 
#define CIR_RCR(b)   (b + 2)
 
#define CIR_TCR1(b)   (b + 3)
 
#define CIR_TCR2(b)   (b + 4)
 
#define CIR_TSR(b)   (b + 5)
 
#define CIR_RSR(b)   (b + 6)
 
#define CIR_BDLR(b)   (b + 5)
 
#define CIR_BDHR(b)   (b + 6)
 
#define CIR_IIR(b)   (b + 7)
 
#define GP_BASE_DEFAULT   0x0201
 
#define WDTS_TIMER_RUN   0
 
#define WDTS_DEV_OPEN   1
 
#define WDTS_KEEPALIVE   2
 
#define WDTS_LOCKED   3
 
#define WDTS_USE_GP   4
 
#define WDTS_EXPECTED   5
 

Functions

 module_param (nogameport, int, 0)
 
 MODULE_PARM_DESC (nogameport,"Forbid the activation of game port, default="__MODULE_STRING(DEFAULT_NOGAMEPORT))
 
 module_param (exclusive, int, 0)
 
 MODULE_PARM_DESC (exclusive,"Watchdog exclusive device open, default="__MODULE_STRING(DEFAULT_EXCLUSIVE))
 
 module_param (timeout, int, 0)
 
 MODULE_PARM_DESC (timeout,"Watchdog timeout in seconds, default="__MODULE_STRING(DEFAULT_TIMEOUT))
 
 module_param (testmode, int, 0)
 
 MODULE_PARM_DESC (testmode,"Watchdog test mode (1 = no reboot), default="__MODULE_STRING(DEFAULT_TESTMODE))
 
 module_param (nowayout, bool, 0)
 
 MODULE_PARM_DESC (nowayout,"Watchdog cannot be stopped once started, default="__MODULE_STRING(WATCHDOG_NOWAYOUT))
 
 module_init (it87_wdt_init)
 
 module_exit (it87_wdt_exit)
 
 MODULE_AUTHOR ("Oliver Schuster")
 
 MODULE_DESCRIPTION ("Hardware Watchdog Device Driver for IT87xx EC-LPC I/O")
 
 MODULE_LICENSE ("GPL")
 
 MODULE_ALIAS_MISCDEV (WATCHDOG_MINOR)
 

Macro Definition Documentation

#define ACTREG   0x30

Definition at line 75 of file it87_wdt.c.

#define BASEREG   0x60

Definition at line 76 of file it87_wdt.c.

#define CHIPID   0x20

Definition at line 73 of file it87_wdt.c.

#define CHIPREV   0x22

Definition at line 74 of file it87_wdt.c.

#define CIR   0x0a

Definition at line 69 of file it87_wdt.c.

#define CIR_BASE   0x0208

Definition at line 115 of file it87_wdt.c.

#define CIR_BDHR (   b)    (b + 6)

Definition at line 126 of file it87_wdt.c.

#define CIR_BDLR (   b)    (b + 5)

Definition at line 125 of file it87_wdt.c.

#define CIR_DR (   b)    (b)

Definition at line 118 of file it87_wdt.c.

#define CIR_IER (   b)    (b + 1)

Definition at line 119 of file it87_wdt.c.

#define CIR_IIR (   b)    (b + 7)

Definition at line 127 of file it87_wdt.c.

#define CIR_ILS   0x70

Definition at line 112 of file it87_wdt.c.

#define CIR_RCR (   b)    (b + 2)

Definition at line 120 of file it87_wdt.c.

#define CIR_RSR (   b)    (b + 6)

Definition at line 124 of file it87_wdt.c.

#define CIR_TCR1 (   b)    (b + 3)

Definition at line 121 of file it87_wdt.c.

#define CIR_TCR2 (   b)    (b + 4)

Definition at line 122 of file it87_wdt.c.

#define CIR_TSR (   b)    (b + 5)

Definition at line 123 of file it87_wdt.c.

#define DEFAULT_EXCLUSIVE   1

Definition at line 57 of file it87_wdt.c.

#define DEFAULT_NOGAMEPORT   0

Definition at line 56 of file it87_wdt.c.

#define DEFAULT_NOWAYOUT   WATCHDOG_NOWAYOUT

Definition at line 60 of file it87_wdt.c.

#define DEFAULT_TESTMODE   0

Definition at line 59 of file it87_wdt.c.

#define DEFAULT_TIMEOUT   60

Definition at line 58 of file it87_wdt.c.

#define DRIVER_VERSION   WATCHDOG_NAME " driver, v" WATCHDOG_VERSION "\n"

Definition at line 52 of file it87_wdt.c.

#define GAMEPORT   0x09

Definition at line 68 of file it87_wdt.c.

#define GP_BASE_DEFAULT   0x0201

Definition at line 130 of file it87_wdt.c.

#define GPIO   0x07

Definition at line 67 of file it87_wdt.c.

#define IT8702_ID   0x8702

Definition at line 80 of file it87_wdt.c.

#define IT8705_ID   0x8705

Definition at line 81 of file it87_wdt.c.

#define IT8712_ID   0x8712

Definition at line 82 of file it87_wdt.c.

#define IT8716_ID   0x8716

Definition at line 83 of file it87_wdt.c.

#define IT8718_ID   0x8718

Definition at line 84 of file it87_wdt.c.

#define IT8720_ID   0x8720

Definition at line 85 of file it87_wdt.c.

#define IT8721_ID   0x8721

Definition at line 86 of file it87_wdt.c.

#define IT8726_ID   0x8726 /* the data sheet suggest wrongly 0x8716 */

Definition at line 87 of file it87_wdt.c.

#define IT8728_ID   0x8728

Definition at line 88 of file it87_wdt.c.

#define LDNREG   0x07

Definition at line 72 of file it87_wdt.c.

#define NO_DEV_ID   0xffff

Definition at line 79 of file it87_wdt.c.

#define pr_fmt (   fmt)    KBUILD_MODNAME ": " fmt

Definition at line 33 of file it87_wdt.c.

#define REG   0x2e

Definition at line 63 of file it87_wdt.c.

#define VAL   0x2f

Definition at line 64 of file it87_wdt.c.

#define WATCHDOG_NAME   "IT87 WDT"

Definition at line 51 of file it87_wdt.c.

#define WATCHDOG_VERSION   "1.14"

Definition at line 50 of file it87_wdt.c.

#define WD_MAGIC   'V'

Definition at line 53 of file it87_wdt.c.

#define WDT_CIRINT   0x80

Definition at line 97 of file it87_wdt.c.

#define WDT_FORCE   0x02

Definition at line 101 of file it87_wdt.c.

#define WDT_GAMEPORT   0x10 /* not in it8718, it8720, it8721, it8728 */

Definition at line 100 of file it87_wdt.c.

#define WDT_INT_MASK   0x0f

Definition at line 109 of file it87_wdt.c.

#define WDT_KRST   0x40

Definition at line 106 of file it87_wdt.c.

#define WDT_KYBINT   0x20

Definition at line 99 of file it87_wdt.c.

#define WDT_MOUSEINT   0x40

Definition at line 98 of file it87_wdt.c.

#define WDT_PWROK   0x10 /* not in it8721 */

Definition at line 108 of file it87_wdt.c.

#define WDT_TOV1   0x80

Definition at line 105 of file it87_wdt.c.

#define WDT_TOVE   0x20

Definition at line 107 of file it87_wdt.c.

#define WDT_ZERO   0x01

Definition at line 102 of file it87_wdt.c.

#define WDTCFG   0x72

Definition at line 92 of file it87_wdt.c.

#define WDTCTRL   0x71

Definition at line 91 of file it87_wdt.c.

#define WDTS_DEV_OPEN   1

Definition at line 134 of file it87_wdt.c.

#define WDTS_EXPECTED   5

Definition at line 138 of file it87_wdt.c.

#define WDTS_KEEPALIVE   2

Definition at line 135 of file it87_wdt.c.

#define WDTS_LOCKED   3

Definition at line 136 of file it87_wdt.c.

#define WDTS_TIMER_RUN   0

Definition at line 133 of file it87_wdt.c.

#define WDTS_USE_GP   4

Definition at line 137 of file it87_wdt.c.

#define WDTVALLSB   0x73

Definition at line 93 of file it87_wdt.c.

#define WDTVALMSB   0x74

Definition at line 94 of file it87_wdt.c.

Function Documentation

MODULE_ALIAS_MISCDEV ( WATCHDOG_MINOR  )
MODULE_AUTHOR ( "Oliver Schuster"  )
MODULE_DESCRIPTION ( "Hardware Watchdog Device Driver for IT87xx EC-LPC I/O"  )
module_exit ( it87_wdt_exit  )
module_init ( it87_wdt_init  )
MODULE_LICENSE ( "GPL"  )
module_param ( nogameport  ,
int  ,
 
)
module_param ( exclusive  ,
int  ,
 
)
module_param ( timeout  ,
int  ,
 
)
module_param ( testmode  ,
int  ,
 
)
module_param ( nowayout  ,
bool  ,
 
)
MODULE_PARM_DESC ( nogameport  ,
"Forbid the activation of game  port 
)
MODULE_PARM_DESC ( exclusive  ,
"Watchdog exclusive device  open 
)
MODULE_PARM_DESC ( timeout  ,
"Watchdog timeout in  seconds 
)
MODULE_PARM_DESC ( testmode  ,
"Watchdog test mode   1 = no reboot 
)
MODULE_PARM_DESC ( nowayout  ,
"Watchdog cannot be stopped once  started 
)