Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
rtc-sh.c File Reference
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/bcd.h>
#include <linux/rtc.h>
#include <linux/init.h>
#include <linux/platform_device.h>
#include <linux/seq_file.h>
#include <linux/interrupt.h>
#include <linux/spinlock.h>
#include <linux/io.h>
#include <linux/log2.h>
#include <linux/clk.h>
#include <linux/slab.h>
#include <asm/rtc.h>

Go to the source code of this file.

Data Structures

struct  sh_rtc
 

Macros

#define DRV_NAME   "sh-rtc"
 
#define DRV_VERSION   "0.2.3"
 
#define RTC_REG(r)   ((r) * rtc_reg_size)
 
#define R64CNT   RTC_REG(0)
 
#define RSECCNT   RTC_REG(1) /* RTC sec */
 
#define RMINCNT   RTC_REG(2) /* RTC min */
 
#define RHRCNT   RTC_REG(3) /* RTC hour */
 
#define RWKCNT   RTC_REG(4) /* RTC week */
 
#define RDAYCNT   RTC_REG(5) /* RTC day */
 
#define RMONCNT   RTC_REG(6) /* RTC month */
 
#define RYRCNT   RTC_REG(7) /* RTC year */
 
#define RSECAR   RTC_REG(8) /* ALARM sec */
 
#define RMINAR   RTC_REG(9) /* ALARM min */
 
#define RHRAR   RTC_REG(10) /* ALARM hour */
 
#define RWKAR   RTC_REG(11) /* ALARM week */
 
#define RDAYAR   RTC_REG(12) /* ALARM day */
 
#define RMONAR   RTC_REG(13) /* ALARM month */
 
#define RCR1   RTC_REG(14) /* Control */
 
#define RCR2   RTC_REG(15) /* Control */
 
#define AR_ENB   0x80 /* Enable for alarm cmp */
 
#define PF_HP   0x100 /* Enable Half Period to support 8,32,128Hz */
 
#define PF_COUNT   0x200 /* Half periodic counter */
 
#define PF_OXS   0x400 /* Periodic One x Second */
 
#define PF_KOU   0x800 /* Kernel or User periodic request 1=kernel */
 
#define PF_MASK   0xf00
 
#define RCR1_CF   0x80 /* Carry Flag */
 
#define RCR1_CIE   0x10 /* Carry Interrupt Enable */
 
#define RCR1_AIE   0x08 /* Alarm Interrupt Enable */
 
#define RCR1_AF   0x01 /* Alarm Flag */
 
#define RCR2_PEF   0x80 /* PEriodic interrupt Flag */
 
#define RCR2_PESMASK   0x70 /* Periodic interrupt Set */
 
#define RCR2_RTCEN   0x08 /* ENable RTC */
 
#define RCR2_ADJ   0x04 /* ADJustment (30-second) */
 
#define RCR2_RESET   0x02 /* Reset bit */
 
#define RCR2_START   0x01 /* Start bit */
 

Functions

 module_init (sh_rtc_init)
 
 module_exit (sh_rtc_exit)
 
 MODULE_DESCRIPTION ("SuperH on-chip RTC driver")
 
 MODULE_VERSION (DRV_VERSION)
 
 MODULE_AUTHOR ("Paul Mundt <[email protected]>, ""Jamie Lenehan <[email protected]>, ""Angelo Castello <[email protected]>")
 
 MODULE_LICENSE ("GPL")
 
 MODULE_ALIAS ("platform:"DRV_NAME)
 

Macro Definition Documentation

#define AR_ENB   0x80 /* Enable for alarm cmp */

Definition at line 68 of file rtc-sh.c.

#define DRV_NAME   "sh-rtc"

Definition at line 32 of file rtc-sh.c.

#define DRV_VERSION   "0.2.3"

Definition at line 33 of file rtc-sh.c.

#define PF_COUNT   0x200 /* Half periodic counter */

Definition at line 72 of file rtc-sh.c.

#define PF_HP   0x100 /* Enable Half Period to support 8,32,128Hz */

Definition at line 71 of file rtc-sh.c.

#define PF_KOU   0x800 /* Kernel or User periodic request 1=kernel */

Definition at line 74 of file rtc-sh.c.

#define PF_MASK   0xf00

Definition at line 75 of file rtc-sh.c.

#define PF_OXS   0x400 /* Periodic One x Second */

Definition at line 73 of file rtc-sh.c.

#define R64CNT   RTC_REG(0)

Definition at line 37 of file rtc-sh.c.

#define RCR1   RTC_REG(14) /* Control */

Definition at line 52 of file rtc-sh.c.

#define RCR1_AF   0x01 /* Alarm Flag */

Definition at line 81 of file rtc-sh.c.

#define RCR1_AIE   0x08 /* Alarm Interrupt Enable */

Definition at line 80 of file rtc-sh.c.

#define RCR1_CF   0x80 /* Carry Flag */

Definition at line 78 of file rtc-sh.c.

#define RCR1_CIE   0x10 /* Carry Interrupt Enable */

Definition at line 79 of file rtc-sh.c.

#define RCR2   RTC_REG(15) /* Control */

Definition at line 53 of file rtc-sh.c.

#define RCR2_ADJ   0x04 /* ADJustment (30-second) */

Definition at line 87 of file rtc-sh.c.

#define RCR2_PEF   0x80 /* PEriodic interrupt Flag */

Definition at line 84 of file rtc-sh.c.

#define RCR2_PESMASK   0x70 /* Periodic interrupt Set */

Definition at line 85 of file rtc-sh.c.

#define RCR2_RESET   0x02 /* Reset bit */

Definition at line 88 of file rtc-sh.c.

#define RCR2_RTCEN   0x08 /* ENable RTC */

Definition at line 86 of file rtc-sh.c.

#define RCR2_START   0x01 /* Start bit */

Definition at line 89 of file rtc-sh.c.

#define RDAYAR   RTC_REG(12) /* ALARM day */

Definition at line 50 of file rtc-sh.c.

#define RDAYCNT   RTC_REG(5) /* RTC day */

Definition at line 43 of file rtc-sh.c.

#define RHRAR   RTC_REG(10) /* ALARM hour */

Definition at line 48 of file rtc-sh.c.

#define RHRCNT   RTC_REG(3) /* RTC hour */

Definition at line 41 of file rtc-sh.c.

#define RMINAR   RTC_REG(9) /* ALARM min */

Definition at line 47 of file rtc-sh.c.

#define RMINCNT   RTC_REG(2) /* RTC min */

Definition at line 40 of file rtc-sh.c.

#define RMONAR   RTC_REG(13) /* ALARM month */

Definition at line 51 of file rtc-sh.c.

#define RMONCNT   RTC_REG(6) /* RTC month */

Definition at line 44 of file rtc-sh.c.

#define RSECAR   RTC_REG(8) /* ALARM sec */

Definition at line 46 of file rtc-sh.c.

#define RSECCNT   RTC_REG(1) /* RTC sec */

Definition at line 39 of file rtc-sh.c.

#define RTC_REG (   r)    ((r) * rtc_reg_size)

Definition at line 35 of file rtc-sh.c.

#define RWKAR   RTC_REG(11) /* ALARM week */

Definition at line 49 of file rtc-sh.c.

#define RWKCNT   RTC_REG(4) /* RTC week */

Definition at line 42 of file rtc-sh.c.

#define RYRCNT   RTC_REG(7) /* RTC year */

Definition at line 45 of file rtc-sh.c.

Function Documentation

MODULE_ALIAS ( "platform:"  DRV_NAME)
MODULE_AUTHOR ( "Paul Mundt <[email protected] ,
""Jamie Lenehan< lenehan @twibble.org >  ,
""Angelo Castello< angelo.castello @st.com >"   
)
MODULE_DESCRIPTION ( "SuperH on-chip RTC driver )
module_exit ( sh_rtc_exit  )
module_init ( sh_rtc_init  )
MODULE_LICENSE ( "GPL"  )
MODULE_VERSION ( DRV_VERSION  )