Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
rtc-pl031.c File Reference
#include <linux/module.h>
#include <linux/rtc.h>
#include <linux/init.h>
#include <linux/interrupt.h>
#include <linux/amba/bus.h>
#include <linux/io.h>
#include <linux/bcd.h>
#include <linux/delay.h>
#include <linux/slab.h>

Go to the source code of this file.

Data Structures

struct  pl031_vendor_data
 
struct  pl031_local
 

Macros

#define RTC_DR   0x00 /* Data read register */
 
#define RTC_MR   0x04 /* Match register */
 
#define RTC_LR   0x08 /* Data load register */
 
#define RTC_CR   0x0c /* Control register */
 
#define RTC_IMSC   0x10 /* Interrupt mask and set register */
 
#define RTC_RIS   0x14 /* Raw interrupt status register */
 
#define RTC_MIS   0x18 /* Masked interrupt status register */
 
#define RTC_ICR   0x1c /* Interrupt clear register */
 
#define RTC_TDR   0x20 /* Timer data read register */
 
#define RTC_TLR   0x24 /* Timer data load register */
 
#define RTC_TCR   0x28 /* Timer control register */
 
#define RTC_YDR   0x30 /* Year data read register */
 
#define RTC_YMR   0x34 /* Year match register */
 
#define RTC_YLR   0x38 /* Year data load register */
 
#define RTC_CR_CWEN   (1 << 26) /* Clockwatch enable bit */
 
#define RTC_TCR_EN   (1 << 1) /* Periodic timer enable bit */
 
#define RTC_BIT_AI   (1 << 0) /* Alarm interrupt bit */
 
#define RTC_BIT_PI   (1 << 1) /* Periodic interrupt bit. ST variants only. */
 
#define RTC_SEC_SHIFT   0
 
#define RTC_SEC_MASK   (0x3F << RTC_SEC_SHIFT) /* Second [0-59] */
 
#define RTC_MIN_SHIFT   6
 
#define RTC_MIN_MASK   (0x3F << RTC_MIN_SHIFT) /* Minute [0-59] */
 
#define RTC_HOUR_SHIFT   12
 
#define RTC_HOUR_MASK   (0x1F << RTC_HOUR_SHIFT) /* Hour [0-23] */
 
#define RTC_WDAY_SHIFT   17
 
#define RTC_WDAY_MASK   (0x7 << RTC_WDAY_SHIFT) /* Day of Week [1-7] 1=Sunday */
 
#define RTC_MDAY_SHIFT   20
 
#define RTC_MDAY_MASK   (0x1F << RTC_MDAY_SHIFT) /* Day of Month [1-31] */
 
#define RTC_MON_SHIFT   25
 
#define RTC_MON_MASK   (0xF << RTC_MON_SHIFT) /* Month [1-12] 1=January */
 
#define RTC_TIMER_FREQ   32768
 

Functions

 MODULE_DEVICE_TABLE (amba, pl031_ids)
 
 module_amba_driver (pl031_driver)
 
 MODULE_AUTHOR ("Deepak Saxena <[email protected]")
 
 MODULE_DESCRIPTION ("ARM AMBA PL031 RTC Driver")
 
 MODULE_LICENSE ("GPL")
 

Macro Definition Documentation

#define RTC_BIT_AI   (1 << 0) /* Alarm interrupt bit */

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

#define RTC_BIT_PI   (1 << 1) /* Periodic interrupt bit. ST variants only. */

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

#define RTC_CR   0x0c /* Control register */

Definition at line 34 of file rtc-pl031.c.

#define RTC_CR_CWEN   (1 << 26) /* Clockwatch enable bit */

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

#define RTC_DR   0x00 /* Data read register */

Definition at line 31 of file rtc-pl031.c.

#define RTC_HOUR_MASK   (0x1F << RTC_HOUR_SHIFT) /* Hour [0-23] */

Definition at line 61 of file rtc-pl031.c.

#define RTC_HOUR_SHIFT   12

Definition at line 60 of file rtc-pl031.c.

#define RTC_ICR   0x1c /* Interrupt clear register */

Definition at line 38 of file rtc-pl031.c.

#define RTC_IMSC   0x10 /* Interrupt mask and set register */

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

#define RTC_LR   0x08 /* Data load register */

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

#define RTC_MDAY_MASK   (0x1F << RTC_MDAY_SHIFT) /* Day of Month [1-31] */

Definition at line 65 of file rtc-pl031.c.

#define RTC_MDAY_SHIFT   20

Definition at line 64 of file rtc-pl031.c.

#define RTC_MIN_MASK   (0x3F << RTC_MIN_SHIFT) /* Minute [0-59] */

Definition at line 59 of file rtc-pl031.c.

#define RTC_MIN_SHIFT   6

Definition at line 58 of file rtc-pl031.c.

#define RTC_MIS   0x18 /* Masked interrupt status register */

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

#define RTC_MON_MASK   (0xF << RTC_MON_SHIFT) /* Month [1-12] 1=January */

Definition at line 67 of file rtc-pl031.c.

#define RTC_MON_SHIFT   25

Definition at line 66 of file rtc-pl031.c.

#define RTC_MR   0x04 /* Match register */

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

#define RTC_RIS   0x14 /* Raw interrupt status register */

Definition at line 36 of file rtc-pl031.c.

#define RTC_SEC_MASK   (0x3F << RTC_SEC_SHIFT) /* Second [0-59] */

Definition at line 57 of file rtc-pl031.c.

#define RTC_SEC_SHIFT   0

Definition at line 56 of file rtc-pl031.c.

#define RTC_TCR   0x28 /* Timer control register */

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

#define RTC_TCR_EN   (1 << 1) /* Periodic timer enable bit */

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

#define RTC_TDR   0x20 /* Timer data read register */

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

#define RTC_TIMER_FREQ   32768

Definition at line 69 of file rtc-pl031.c.

#define RTC_TLR   0x24 /* Timer data load register */

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

#define RTC_WDAY_MASK   (0x7 << RTC_WDAY_SHIFT) /* Day of Week [1-7] 1=Sunday */

Definition at line 63 of file rtc-pl031.c.

#define RTC_WDAY_SHIFT   17

Definition at line 62 of file rtc-pl031.c.

#define RTC_YDR   0x30 /* Year data read register */

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

#define RTC_YLR   0x38 /* Year data load register */

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

#define RTC_YMR   0x34 /* Year match register */

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

Function Documentation

module_amba_driver ( pl031_driver  )
MODULE_AUTHOR ( )
MODULE_DESCRIPTION ( "ARM AMBA PL031 RTC Driver"  )
MODULE_DEVICE_TABLE ( amba  ,
pl031_ids   
)
MODULE_LICENSE ( "GPL"  )