Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
rtc-spear.c File Reference
#include <linux/bcd.h>
#include <linux/clk.h>
#include <linux/delay.h>
#include <linux/init.h>
#include <linux/io.h>
#include <linux/irq.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/platform_device.h>
#include <linux/rtc.h>
#include <linux/slab.h>
#include <linux/spinlock.h>

Go to the source code of this file.

Data Structures

struct  spear_rtc_config
 

Macros

#define TIME_REG   0x00
 
#define DATE_REG   0x04
 
#define ALARM_TIME_REG   0x08
 
#define ALARM_DATE_REG   0x0C
 
#define CTRL_REG   0x10
 
#define STATUS_REG   0x14
 
#define SECONDS_UNITS   (0xf<<0) /* seconds units position */
 
#define SECONDS_TENS   (0x7<<4) /* seconds tens position */
 
#define MINUTES_UNITS   (0xf<<8) /* minutes units position */
 
#define MINUTES_TENS   (0x7<<12) /* minutes tens position */
 
#define HOURS_UNITS   (0xf<<16) /* hours units position */
 
#define HOURS_TENS   (0x3<<20) /* hours tens position */
 
#define DAYS_UNITS   (0xf<<0) /* days units position */
 
#define DAYS_TENS   (0x3<<4) /* days tens position */
 
#define MONTHS_UNITS   (0xf<<8) /* months units position */
 
#define MONTHS_TENS   (0x1<<12) /* months tens position */
 
#define YEARS_UNITS   (0xf<<16) /* years units position */
 
#define YEARS_TENS   (0xf<<20) /* years tens position */
 
#define YEARS_HUNDREDS   (0xf<<24) /* years hundereds position */
 
#define YEARS_MILLENIUMS   (0xf<<28) /* years millenium position */
 
#define SECOND_SHIFT   0x00 /* seconds units */
 
#define MINUTE_SHIFT   0x08 /* minutes units position */
 
#define HOUR_SHIFT   0x10 /* hours units position */
 
#define MDAY_SHIFT   0x00 /* Month day shift */
 
#define MONTH_SHIFT   0x08 /* Month shift */
 
#define YEAR_SHIFT   0x10 /* Year shift */
 
#define SECOND_MASK   0x7F
 
#define MIN_MASK   0x7F
 
#define HOUR_MASK   0x3F
 
#define DAY_MASK   0x3F
 
#define MONTH_MASK   0x7F
 
#define YEAR_MASK   0xFFFF
 
#define TIME_BYP   (1<<9)
 
#define INT_ENABLE   (1<<31) /* interrupt enable */
 
#define CLK_UNCONNECTED   (1<<0)
 
#define PEND_WR_TIME   (1<<2)
 
#define PEND_WR_DATE   (1<<3)
 
#define LOST_WR_TIME   (1<<4)
 
#define LOST_WR_DATE   (1<<5)
 
#define RTC_INT_MASK   (1<<31)
 
#define STATUS_BUSY   (PEND_WR_TIME | PEND_WR_DATE)
 
#define STATUS_FAIL   (LOST_WR_TIME | LOST_WR_DATE)
 
#define spear_rtc_suspend   NULL
 
#define spear_rtc_resume   NULL
 

Functions

 module_platform_driver (spear_rtc_driver)
 
 MODULE_ALIAS ("platform:rtc-spear")
 
 MODULE_AUTHOR ("Rajeev Kumar <[email protected]>")
 
 MODULE_DESCRIPTION ("ST SPEAr Realtime Clock Driver (RTC)")
 
 MODULE_LICENSE ("GPL")
 

Macro Definition Documentation

#define ALARM_DATE_REG   0x0C

Definition at line 29 of file rtc-spear.c.

#define ALARM_TIME_REG   0x08

Definition at line 28 of file rtc-spear.c.

#define CLK_UNCONNECTED   (1<<0)

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

#define CTRL_REG   0x10

Definition at line 30 of file rtc-spear.c.

#define DATE_REG   0x04

Definition at line 27 of file rtc-spear.c.

#define DAY_MASK   0x3F

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

#define DAYS_TENS   (0x3<<4) /* days tens position */

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

#define DAYS_UNITS   (0xf<<0) /* days units position */

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

#define HOUR_MASK   0x3F

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

#define HOUR_SHIFT   0x10 /* hours units position */

Definition at line 54 of file rtc-spear.c.

#define HOURS_TENS   (0x3<<20) /* hours tens position */

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

#define HOURS_UNITS   (0xf<<16) /* hours units position */

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

#define INT_ENABLE   (1<<31) /* interrupt enable */

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

#define LOST_WR_DATE   (1<<5)

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

#define LOST_WR_TIME   (1<<4)

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

#define MDAY_SHIFT   0x00 /* Month day shift */

Definition at line 55 of file rtc-spear.c.

#define MIN_MASK   0x7F

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

#define MINUTE_SHIFT   0x08 /* minutes units position */

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

#define MINUTES_TENS   (0x7<<12) /* minutes tens position */

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

#define MINUTES_UNITS   (0xf<<8) /* minutes units position */

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

#define MONTH_MASK   0x7F

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

#define MONTH_SHIFT   0x08 /* Month shift */

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

#define MONTHS_TENS   (0x1<<12) /* months tens position */

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

#define MONTHS_UNITS   (0xf<<8) /* months units position */

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

#define PEND_WR_DATE   (1<<3)

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

#define PEND_WR_TIME   (1<<2)

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

#define RTC_INT_MASK   (1<<31)

Definition at line 76 of file rtc-spear.c.

#define SECOND_MASK   0x7F

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

#define SECOND_SHIFT   0x00 /* seconds units */

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

#define SECONDS_TENS   (0x7<<4) /* seconds tens position */

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

#define SECONDS_UNITS   (0xf<<0) /* seconds units position */

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

#define spear_rtc_resume   NULL

Definition at line 510 of file rtc-spear.c.

#define spear_rtc_suspend   NULL

Definition at line 509 of file rtc-spear.c.

#define STATUS_BUSY   (PEND_WR_TIME | PEND_WR_DATE)

Definition at line 77 of file rtc-spear.c.

#define STATUS_FAIL   (LOST_WR_TIME | LOST_WR_DATE)

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

#define STATUS_REG   0x14

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

#define TIME_BYP   (1<<9)

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

#define TIME_REG   0x00

Definition at line 26 of file rtc-spear.c.

#define YEAR_MASK   0xFFFF

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

#define YEAR_SHIFT   0x10 /* Year shift */

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

#define YEARS_HUNDREDS   (0xf<<24) /* years hundereds position */

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

#define YEARS_MILLENIUMS   (0xf<<28) /* years millenium position */

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

#define YEARS_TENS   (0xf<<20) /* years tens position */

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

#define YEARS_UNITS   (0xf<<16) /* years units position */

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

Function Documentation

MODULE_ALIAS ( "platform:rtc-spear"  )
MODULE_AUTHOR ( "Rajeev Kumar <[email protected]>"  )
MODULE_DESCRIPTION ( "ST SPEAr Realtime Clock Driver (RTC)"  )
MODULE_LICENSE ( "GPL"  )
module_platform_driver ( spear_rtc_driver  )