Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
cpwd.c File Reference
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/fs.h>
#include <linux/errno.h>
#include <linux/major.h>
#include <linux/init.h>
#include <linux/miscdevice.h>
#include <linux/interrupt.h>
#include <linux/ioport.h>
#include <linux/timer.h>
#include <linux/slab.h>
#include <linux/mutex.h>
#include <linux/io.h>
#include <linux/of.h>
#include <linux/of_device.h>
#include <linux/uaccess.h>
#include <asm/irq.h>
#include <asm/watchdog.h>

Go to the source code of this file.

Data Structures

struct  cpwd
 

Macros

#define pr_fmt(fmt)   KBUILD_MODNAME ": " fmt
 
#define DRIVER_NAME   "cpwd"
 
#define WD_OBPNAME   "watchdog"
 
#define WD_BADMODEL   "SUNW,501-5336"
 
#define WD_BTIMEOUT   (jiffies + (HZ * 1000))
 
#define WD_BLIMIT   0xFFFF
 
#define WD0_MINOR   212
 
#define WD1_MINOR   213
 
#define WD2_MINOR   214
 
#define WD0_ID   0
 
#define WD1_ID   1
 
#define WD2_ID   2
 
#define WD_NUMDEVS   3
 
#define WD_INTR_OFF   0
 
#define WD_INTR_ON   1
 
#define WD_STAT_INIT   0x01 /* Watchdog timer is initialized */
 
#define WD_STAT_BSTOP   0x02 /* Watchdog timer is brokenstopped */
 
#define WD_STAT_SVCD   0x04 /* Watchdog interrupt occurred */
 
#define WD0_INTR_MASK   0x01 /* Watchdog device interrupt masks */
 
#define WD1_INTR_MASK   0x02
 
#define WD2_INTR_MASK   0x04
 
#define WD_S_RUNNING   0x01 /* Watchdog device status running */
 
#define WD_S_EXPIRED   0x02 /* Watchdog device status expired */
 
#define WD_TIMER_REGSZ   16
 
#define WD0_OFF   0
 
#define WD1_OFF   (WD_TIMER_REGSZ * 1)
 
#define WD2_OFF   (WD_TIMER_REGSZ * 2)
 
#define PLD_OFF   (WD_TIMER_REGSZ * 3)
 
#define WD_DCNTR   0x00
 
#define WD_LIMIT   0x04
 
#define WD_STATUS   0x08
 
#define PLD_IMASK   (PLD_OFF + 0x00)
 
#define PLD_STATUS   (PLD_OFF + 0x04)
 

Functions

 module_param (wd0_timeout, int, 0)
 
 MODULE_PARM_DESC (wd0_timeout,"Default watchdog0 timeout in 1/10secs")
 
 module_param (wd1_timeout, int, 0)
 
 MODULE_PARM_DESC (wd1_timeout,"Default watchdog1 timeout in 1/10secs")
 
 module_param (wd2_timeout, int, 0)
 
 MODULE_PARM_DESC (wd2_timeout,"Default watchdog2 timeout in 1/10secs")
 
 MODULE_AUTHOR ("Eric Brower <[email protected]>")
 
 MODULE_DESCRIPTION ("Hardware watchdog driver for Sun Microsystems CP1400/1500")
 
 MODULE_LICENSE ("GPL")
 
 MODULE_SUPPORTED_DEVICE ("watchdog")
 
 MODULE_DEVICE_TABLE (of, cpwd_match)
 
 module_platform_driver (cpwd_driver)
 

Macro Definition Documentation

#define DRIVER_NAME   "cpwd"

Definition at line 39 of file cpwd.c.

#define PLD_IMASK   (PLD_OFF + 0x00)

Definition at line 155 of file cpwd.c.

#define PLD_OFF   (WD_TIMER_REGSZ * 3)

Definition at line 149 of file cpwd.c.

#define PLD_STATUS   (PLD_OFF + 0x04)

Definition at line 156 of file cpwd.c.

#define pr_fmt (   fmt)    KBUILD_MODNAME ": " fmt

Definition at line 17 of file cpwd.c.

#define WD0_ID   0

Definition at line 51 of file cpwd.c.

#define WD0_INTR_MASK   0x01 /* Watchdog device interrupt masks */

Definition at line 65 of file cpwd.c.

#define WD0_MINOR   212

Definition at line 46 of file cpwd.c.

#define WD0_OFF   0

Definition at line 146 of file cpwd.c.

#define WD1_ID   1

Definition at line 52 of file cpwd.c.

#define WD1_INTR_MASK   0x02

Definition at line 66 of file cpwd.c.

#define WD1_MINOR   213

Definition at line 47 of file cpwd.c.

#define WD1_OFF   (WD_TIMER_REGSZ * 1)

Definition at line 147 of file cpwd.c.

#define WD2_ID   2

Definition at line 53 of file cpwd.c.

#define WD2_INTR_MASK   0x04

Definition at line 67 of file cpwd.c.

#define WD2_MINOR   214

Definition at line 48 of file cpwd.c.

#define WD2_OFF   (WD_TIMER_REGSZ * 2)

Definition at line 148 of file cpwd.c.

#define WD_BADMODEL   "SUNW,501-5336"

Definition at line 42 of file cpwd.c.

#define WD_BLIMIT   0xFFFF

Definition at line 44 of file cpwd.c.

#define WD_BTIMEOUT   (jiffies + (HZ * 1000))

Definition at line 43 of file cpwd.c.

#define WD_DCNTR   0x00

Definition at line 151 of file cpwd.c.

#define WD_INTR_OFF   0

Definition at line 56 of file cpwd.c.

#define WD_INTR_ON   1

Definition at line 57 of file cpwd.c.

#define WD_LIMIT   0x04

Definition at line 152 of file cpwd.c.

#define WD_NUMDEVS   3

Definition at line 54 of file cpwd.c.

#define WD_OBPNAME   "watchdog"

Definition at line 41 of file cpwd.c.

#define WD_S_EXPIRED   0x02 /* Watchdog device status expired */

Definition at line 70 of file cpwd.c.

#define WD_S_RUNNING   0x01 /* Watchdog device status running */

Definition at line 69 of file cpwd.c.

#define WD_STAT_BSTOP   0x02 /* Watchdog timer is brokenstopped */

Definition at line 60 of file cpwd.c.

#define WD_STAT_INIT   0x01 /* Watchdog timer is initialized */

Definition at line 59 of file cpwd.c.

#define WD_STAT_SVCD   0x04 /* Watchdog interrupt occurred */

Definition at line 61 of file cpwd.c.

#define WD_STATUS   0x08

Definition at line 153 of file cpwd.c.

#define WD_TIMER_REGSZ   16

Definition at line 145 of file cpwd.c.

Function Documentation

MODULE_AUTHOR ( "Eric Brower <[email protected]>"  )
MODULE_DESCRIPTION ( "Hardware watchdog driver for Sun Microsystems CP1400/1500"  )
MODULE_DEVICE_TABLE ( of  ,
cpwd_match   
)
MODULE_LICENSE ( "GPL"  )
module_param ( wd0_timeout  ,
int  ,
 
)
module_param ( wd1_timeout  ,
int  ,
 
)
module_param ( wd2_timeout  ,
int  ,
 
)
MODULE_PARM_DESC ( wd0_timeout  ,
"Default watchdog0 timeout in 1/10secs"   
)
MODULE_PARM_DESC ( wd1_timeout  ,
"Default watchdog1 timeout in 1/10secs"   
)
MODULE_PARM_DESC ( wd2_timeout  ,
"Default watchdog2 timeout in 1/10secs"   
)
module_platform_driver ( cpwd_driver  )
MODULE_SUPPORTED_DEVICE ( "watchdog"  )