#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/init.h>
#include <linux/miscdevice.h>
#include <linux/watchdog.h>
#include <linux/notifier.h>
#include <linux/reboot.h>
#include <linux/fs.h>
#include <linux/spinlock.h>
#include <linux/uaccess.h>
#include <linux/io.h>
#include <linux/ioport.h>
Go to the source code of this file.
|
#define | pr_fmt(fmt) KBUILD_MODNAME ": " fmt |
|
#define | DEBUG |
|
#define | NAME "it8712f_wdt" |
|
#define | REG 0x2e /* The register to read/write */ |
|
#define | VAL 0x2f /* The value to read/write */ |
|
#define | LDN 0x07 /* Register: Logical device select */ |
|
#define | DEVID 0x20 /* Register: Device ID */ |
|
#define | DEVREV 0x22 /* Register: Device Revision */ |
|
#define | ACT_REG 0x30 /* LDN Register: Activation */ |
|
#define | BASE_REG 0x60 /* LDN Register: Base address */ |
|
#define | IT8712F_DEVID 0x8712 |
|
#define | LDN_GPIO 0x07 /* GPIO and Watch Dog Timer */ |
|
#define | LDN_GAME 0x09 /* Game Port */ |
|
#define | WDT_CONTROL 0x71 /* WDT Register: Control */ |
|
#define | WDT_CONFIG 0x72 /* WDT Register: Configuration */ |
|
#define | WDT_TIMEOUT 0x73 /* WDT Register: Timeout Value */ |
|
#define | WDT_RESET_GAME 0x10 /* Reset timer on read or write to game port */ |
|
#define | WDT_RESET_KBD 0x20 /* Reset timer on keyboard interrupt */ |
|
#define | WDT_RESET_MOUSE 0x40 /* Reset timer on mouse interrupt */ |
|
#define | WDT_RESET_CIR 0x80 /* Reset timer on consumer IR interrupt */ |
|
#define | WDT_UNIT_SEC 0x80 /* If 0 in MINUTES */ |
|
#define | WDT_OUT_PWROK 0x10 /* Pulse PWROK on timeout */ |
|
#define | WDT_OUT_KRST 0x40 /* Pulse reset on timeout */ |
|
|
| MODULE_AUTHOR ("Jorge Boncompte - DTI2 <[email protected]>") |
|
| MODULE_DESCRIPTION ("IT8712F Watchdog Driver") |
|
| MODULE_LICENSE ("GPL") |
|
| MODULE_ALIAS_MISCDEV (WATCHDOG_MINOR) |
|
| module_param (margin, int, 0) |
|
| MODULE_PARM_DESC (margin,"Watchdog margin in seconds") |
|
| module_param (nowayout, bool, 0) |
|
| MODULE_PARM_DESC (nowayout,"Disable watchdog shutdown on close") |
|
| module_param (wdt_control_reg, int, 0) |
|
| MODULE_PARM_DESC (wdt_control_reg,"Value to write to watchdog control ""register. The default WDT_RESET_GAME resets the timer on ""game port reads that this driver generates. You can also ""use KBD, MOUSE or CIR if you have some external way to ""generate those interrupts.") |
|
| module_init (it8712f_wdt_init) |
|
| module_exit (it8712f_wdt_exit) |
|
#define ACT_REG 0x30 /* LDN Register: Activation */ |
#define BASE_REG 0x60 /* LDN Register: Base address */ |
#define DEVID 0x20 /* Register: Device ID */ |
#define DEVREV 0x22 /* Register: Device Revision */ |
#define IT8712F_DEVID 0x8712 |
#define LDN 0x07 /* Register: Logical device select */ |
#define LDN_GAME 0x09 /* Game Port */ |
#define LDN_GPIO 0x07 /* GPIO and Watch Dog Timer */ |
#define NAME "it8712f_wdt" |
#define pr_fmt |
( |
|
fmt | ) |
KBUILD_MODNAME ": " fmt |
#define REG 0x2e /* The register to read/write */ |
#define VAL 0x2f /* The value to read/write */ |
#define WDT_CONFIG 0x72 /* WDT Register: Configuration */ |
#define WDT_CONTROL 0x71 /* WDT Register: Control */ |
#define WDT_OUT_KRST 0x40 /* Pulse reset on timeout */ |
#define WDT_OUT_PWROK 0x10 /* Pulse PWROK on timeout */ |
#define WDT_RESET_CIR 0x80 /* Reset timer on consumer IR interrupt */ |
#define WDT_RESET_GAME 0x10 /* Reset timer on read or write to game port */ |
#define WDT_RESET_KBD 0x20 /* Reset timer on keyboard interrupt */ |
#define WDT_RESET_MOUSE 0x40 /* Reset timer on mouse interrupt */ |
#define WDT_TIMEOUT 0x73 /* WDT Register: Timeout Value */ |
#define WDT_UNIT_SEC 0x80 /* If 0 in MINUTES */ |
MODULE_DESCRIPTION |
( |
"IT8712F Watchdog Driver" |
| ) |
|
module_exit |
( |
it8712f_wdt_exit |
| ) |
|
module_init |
( |
it8712f_wdt_init |
| ) |
|
module_param |
( |
margin |
, |
|
|
int |
, |
|
|
0 |
|
|
) |
| |
module_param |
( |
nowayout |
, |
|
|
bool |
, |
|
|
0 |
|
|
) |
| |
module_param |
( |
wdt_control_reg |
, |
|
|
int |
, |
|
|
0 |
|
|
) |
| |
MODULE_PARM_DESC |
( |
margin |
, |
|
|
"Watchdog margin in seconds" |
|
|
) |
| |