Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
jz4740_wdt.c File Reference
#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/types.h>
#include <linux/kernel.h>
#include <linux/miscdevice.h>
#include <linux/watchdog.h>
#include <linux/init.h>
#include <linux/platform_device.h>
#include <linux/io.h>
#include <linux/device.h>
#include <linux/clk.h>
#include <linux/slab.h>
#include <linux/err.h>
#include <asm/mach-jz4740/timer.h>

Go to the source code of this file.

Data Structures

struct  jz4740_wdt_drvdata
 

Macros

#define JZ_REG_WDT_TIMER_DATA   0x0
 
#define JZ_REG_WDT_COUNTER_ENABLE   0x4
 
#define JZ_REG_WDT_TIMER_COUNTER   0x8
 
#define JZ_REG_WDT_TIMER_CONTROL   0xC
 
#define JZ_WDT_CLOCK_PCLK   0x1
 
#define JZ_WDT_CLOCK_RTC   0x2
 
#define JZ_WDT_CLOCK_EXT   0x4
 
#define JZ_WDT_CLOCK_DIV_SHIFT   3
 
#define JZ_WDT_CLOCK_DIV_1   (0 << JZ_WDT_CLOCK_DIV_SHIFT)
 
#define JZ_WDT_CLOCK_DIV_4   (1 << JZ_WDT_CLOCK_DIV_SHIFT)
 
#define JZ_WDT_CLOCK_DIV_16   (2 << JZ_WDT_CLOCK_DIV_SHIFT)
 
#define JZ_WDT_CLOCK_DIV_64   (3 << JZ_WDT_CLOCK_DIV_SHIFT)
 
#define JZ_WDT_CLOCK_DIV_256   (4 << JZ_WDT_CLOCK_DIV_SHIFT)
 
#define JZ_WDT_CLOCK_DIV_1024   (5 << JZ_WDT_CLOCK_DIV_SHIFT)
 
#define DEFAULT_HEARTBEAT   5
 
#define MAX_HEARTBEAT   2048
 

Functions

 module_param (nowayout, bool, 0)
 
 MODULE_PARM_DESC (nowayout,"Watchdog cannot be stopped once started (default="__MODULE_STRING(WATCHDOG_NOWAYOUT)")")
 
 module_param (heartbeat, uint, 0)
 
 MODULE_PARM_DESC (heartbeat,"Watchdog heartbeat period in seconds from 1 to "__MODULE_STRING(MAX_HEARTBEAT)", default "__MODULE_STRING(DEFAULT_HEARTBEAT))
 
 module_platform_driver (jz4740_wdt_driver)
 
 MODULE_AUTHOR ("Paul Cercueil <[email protected]>")
 
 MODULE_DESCRIPTION ("jz4740 Watchdog Driver")
 
 MODULE_LICENSE ("GPL")
 
 MODULE_ALIAS_MISCDEV (WATCHDOG_MINOR)
 
 MODULE_ALIAS ("platform:jz4740-wdt")
 

Macro Definition Documentation

#define DEFAULT_HEARTBEAT   5

Definition at line 50 of file jz4740_wdt.c.

#define JZ_REG_WDT_COUNTER_ENABLE   0x4

Definition at line 33 of file jz4740_wdt.c.

#define JZ_REG_WDT_TIMER_CONTROL   0xC

Definition at line 35 of file jz4740_wdt.c.

#define JZ_REG_WDT_TIMER_COUNTER   0x8

Definition at line 34 of file jz4740_wdt.c.

#define JZ_REG_WDT_TIMER_DATA   0x0

Definition at line 32 of file jz4740_wdt.c.

#define JZ_WDT_CLOCK_DIV_1   (0 << JZ_WDT_CLOCK_DIV_SHIFT)

Definition at line 43 of file jz4740_wdt.c.

#define JZ_WDT_CLOCK_DIV_1024   (5 << JZ_WDT_CLOCK_DIV_SHIFT)

Definition at line 48 of file jz4740_wdt.c.

#define JZ_WDT_CLOCK_DIV_16   (2 << JZ_WDT_CLOCK_DIV_SHIFT)

Definition at line 45 of file jz4740_wdt.c.

#define JZ_WDT_CLOCK_DIV_256   (4 << JZ_WDT_CLOCK_DIV_SHIFT)

Definition at line 47 of file jz4740_wdt.c.

#define JZ_WDT_CLOCK_DIV_4   (1 << JZ_WDT_CLOCK_DIV_SHIFT)

Definition at line 44 of file jz4740_wdt.c.

#define JZ_WDT_CLOCK_DIV_64   (3 << JZ_WDT_CLOCK_DIV_SHIFT)

Definition at line 46 of file jz4740_wdt.c.

#define JZ_WDT_CLOCK_DIV_SHIFT   3

Definition at line 41 of file jz4740_wdt.c.

#define JZ_WDT_CLOCK_EXT   0x4

Definition at line 39 of file jz4740_wdt.c.

#define JZ_WDT_CLOCK_PCLK   0x1

Definition at line 37 of file jz4740_wdt.c.

#define JZ_WDT_CLOCK_RTC   0x2

Definition at line 38 of file jz4740_wdt.c.

#define MAX_HEARTBEAT   2048

Definition at line 51 of file jz4740_wdt.c.

Function Documentation

MODULE_ALIAS ( "platform:jz4740-wdt"  )
MODULE_ALIAS_MISCDEV ( WATCHDOG_MINOR  )
MODULE_AUTHOR ( "Paul Cercueil <[email protected]>"  )
MODULE_DESCRIPTION ( "jz4740 Watchdog Driver"  )
MODULE_LICENSE ( "GPL"  )
module_param ( nowayout  ,
bool  ,
 
)
module_param ( heartbeat  ,
uint  ,
 
)
MODULE_PARM_DESC ( nowayout  ,
"Watchdog cannot be stopped once started (default="__MODULE_STRING(WATCHDOG_NOWAYOUT)")"   
)
MODULE_PARM_DESC ( heartbeat  ,
"Watchdog heartbeat period in seconds from 1 to "__MODULE_STRING(MAX_HEARTBEAT)"  ,
default"  __MODULE_STRINGDEFAULT_HEARTBEAT 
)
module_platform_driver ( jz4740_wdt_driver  )