Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
rtc-rs5c348.c File Reference
#include <linux/bcd.h>
#include <linux/delay.h>
#include <linux/device.h>
#include <linux/errno.h>
#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/string.h>
#include <linux/slab.h>
#include <linux/rtc.h>
#include <linux/workqueue.h>
#include <linux/spi/spi.h>
#include <linux/module.h>

Go to the source code of this file.

Data Structures

struct  rs5c348_plat_data
 

Macros

#define DRV_VERSION   "0.2"
 
#define RS5C348_REG_SECS   0
 
#define RS5C348_REG_MINS   1
 
#define RS5C348_REG_HOURS   2
 
#define RS5C348_REG_WDAY   3
 
#define RS5C348_REG_DAY   4
 
#define RS5C348_REG_MONTH   5
 
#define RS5C348_REG_YEAR   6
 
#define RS5C348_REG_CTL1   14
 
#define RS5C348_REG_CTL2   15
 
#define RS5C348_SECS_MASK   0x7f
 
#define RS5C348_MINS_MASK   0x7f
 
#define RS5C348_HOURS_MASK   0x3f
 
#define RS5C348_WDAY_MASK   0x03
 
#define RS5C348_DAY_MASK   0x3f
 
#define RS5C348_MONTH_MASK   0x1f
 
#define RS5C348_BIT_PM   0x20 /* REG_HOURS */
 
#define RS5C348_BIT_Y2K   0x80 /* REG_MONTH */
 
#define RS5C348_BIT_24H   0x20 /* REG_CTL1 */
 
#define RS5C348_BIT_XSTP   0x10 /* REG_CTL2 */
 
#define RS5C348_BIT_VDET   0x40 /* REG_CTL2 */
 
#define RS5C348_CMD_W(addr)   (((addr) << 4) | 0x08) /* single write */
 
#define RS5C348_CMD_R(addr)   (((addr) << 4) | 0x0c) /* single read */
 
#define RS5C348_CMD_MW(addr)   (((addr) << 4) | 0x00) /* burst write */
 
#define RS5C348_CMD_MR(addr)   (((addr) << 4) | 0x04) /* burst read */
 

Functions

 module_spi_driver (rs5c348_driver)
 
 MODULE_AUTHOR ("Atsushi Nemoto <anemo@mba.ocn.ne.jp>")
 
 MODULE_DESCRIPTION ("Ricoh RS5C348 RTC driver")
 
 MODULE_LICENSE ("GPL")
 
 MODULE_VERSION (DRV_VERSION)
 
 MODULE_ALIAS ("spi:rtc-rs5c348")
 

Macro Definition Documentation

#define DRV_VERSION   "0.2"

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

#define RS5C348_BIT_24H   0x20 /* REG_CTL1 */

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

#define RS5C348_BIT_PM   0x20 /* REG_HOURS */

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

#define RS5C348_BIT_VDET   0x40 /* REG_CTL2 */

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

#define RS5C348_BIT_XSTP   0x10 /* REG_CTL2 */

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

#define RS5C348_BIT_Y2K   0x80 /* REG_MONTH */

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

#define RS5C348_CMD_MR (   addr)    (((addr) << 4) | 0x04) /* burst read */

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

#define RS5C348_CMD_MW (   addr)    (((addr) << 4) | 0x00) /* burst write */

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

#define RS5C348_CMD_R (   addr)    (((addr) << 4) | 0x0c) /* single read */

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

#define RS5C348_CMD_W (   addr)    (((addr) << 4) | 0x08) /* single write */

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

#define RS5C348_DAY_MASK   0x3f

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

#define RS5C348_HOURS_MASK   0x3f

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

#define RS5C348_MINS_MASK   0x7f

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

#define RS5C348_MONTH_MASK   0x1f

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

#define RS5C348_REG_CTL1   14

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

#define RS5C348_REG_CTL2   15

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

#define RS5C348_REG_DAY   4

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

#define RS5C348_REG_HOURS   2

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

#define RS5C348_REG_MINS   1

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

#define RS5C348_REG_MONTH   5

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

#define RS5C348_REG_SECS   0

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

#define RS5C348_REG_WDAY   3

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

#define RS5C348_REG_YEAR   6

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

#define RS5C348_SECS_MASK   0x7f

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

#define RS5C348_WDAY_MASK   0x03

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

Function Documentation

MODULE_ALIAS ( "spi:rtc-rs5c348"  )
MODULE_AUTHOR ( "Atsushi Nemoto <anemo@mba.ocn.ne.jp>"  )
MODULE_DESCRIPTION ( "Ricoh RS5C348 RTC driver )
MODULE_LICENSE ( "GPL"  )
module_spi_driver ( rs5c348_driver  )
MODULE_VERSION ( DRV_VERSION  )