Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions
rtc-ds1307.c File Reference
#include <linux/module.h>
#include <linux/init.h>
#include <linux/slab.h>
#include <linux/i2c.h>
#include <linux/string.h>
#include <linux/rtc.h>
#include <linux/bcd.h>
#include <linux/rtc/ds1307.h>

Go to the source code of this file.

Data Structures

struct  ds1307
 
struct  chip_desc
 

Macros

#define DS1307_REG_SECS   0x00 /* 00-59 */
 
#define DS1307_BIT_CH   0x80
 
#define DS1340_BIT_nEOSC   0x80
 
#define MCP7941X_BIT_ST   0x80
 
#define DS1307_REG_MIN   0x01 /* 00-59 */
 
#define DS1307_REG_HOUR   0x02 /* 00-23, or 1-12{am,pm} */
 
#define DS1307_BIT_12HR   0x40 /* in REG_HOUR */
 
#define DS1307_BIT_PM   0x20 /* in REG_HOUR */
 
#define DS1340_BIT_CENTURY_EN   0x80 /* in REG_HOUR */
 
#define DS1340_BIT_CENTURY   0x40 /* in REG_HOUR */
 
#define DS1307_REG_WDAY   0x03 /* 01-07 */
 
#define MCP7941X_BIT_VBATEN   0x08
 
#define DS1307_REG_MDAY   0x04 /* 01-31 */
 
#define DS1307_REG_MONTH   0x05 /* 01-12 */
 
#define DS1337_BIT_CENTURY   0x80 /* in REG_MONTH */
 
#define DS1307_REG_YEAR   0x06 /* 00-99 */
 
#define DS1307_REG_CONTROL   0x07 /* or ds1338 */
 
#define DS1307_BIT_OUT   0x80
 
#define DS1338_BIT_OSF   0x20
 
#define DS1307_BIT_SQWE   0x10
 
#define DS1307_BIT_RS1   0x02
 
#define DS1307_BIT_RS0   0x01
 
#define DS1337_REG_CONTROL   0x0e
 
#define DS1337_BIT_nEOSC   0x80
 
#define DS1339_BIT_BBSQI   0x20
 
#define DS3231_BIT_BBSQW   0x40 /* same as BBSQI */
 
#define DS1337_BIT_RS2   0x10
 
#define DS1337_BIT_RS1   0x08
 
#define DS1337_BIT_INTCN   0x04
 
#define DS1337_BIT_A2IE   0x02
 
#define DS1337_BIT_A1IE   0x01
 
#define DS1340_REG_CONTROL   0x07
 
#define DS1340_BIT_OUT   0x80
 
#define DS1340_BIT_FT   0x40
 
#define DS1340_BIT_CALIB_SIGN   0x20
 
#define DS1340_M_CALIBRATION   0x1f
 
#define DS1340_REG_FLAG   0x09
 
#define DS1340_BIT_OSF   0x80
 
#define DS1337_REG_STATUS   0x0f
 
#define DS1337_BIT_OSF   0x80
 
#define DS1337_BIT_A2I   0x02
 
#define DS1337_BIT_A1I   0x01
 
#define DS1339_REG_ALARM1_SECS   0x07
 
#define DS13XX_TRICKLE_CHARGER_MAGIC   0xa0
 
#define RX8025_REG_CTRL1   0x0e
 
#define RX8025_BIT_2412   0x20
 
#define RX8025_REG_CTRL2   0x0f
 
#define RX8025_BIT_PON   0x10
 
#define RX8025_BIT_VDET   0x40
 
#define RX8025_BIT_XST   0x20
 
#define HAS_NVRAM   0 /* bit 0 == sysfs file active */
 
#define HAS_ALARM   1 /* bit 1 == irq claimed */
 
#define BLOCK_DATA_MAX_TRIES   10
 

Enumerations

enum  ds_type {
  ds_1307, ds_1337, ds_1338, ds_1339,
  ds_1340, ds_1388, ds_3231, m41t00,
  mcp7941x, rx_8025, last_ds_type
}
 

Functions

 MODULE_DEVICE_TABLE (i2c, ds1307_id)
 
 module_i2c_driver (ds1307_driver)
 
 MODULE_DESCRIPTION ("RTC driver for DS1307 and similar chips")
 
 MODULE_LICENSE ("GPL")
 

Macro Definition Documentation

#define BLOCK_DATA_MAX_TRIES   10

Definition at line 180 of file rtc-ds1307.c.

#define DS1307_BIT_12HR   0x40 /* in REG_HOUR */

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

#define DS1307_BIT_CH   0x80

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

#define DS1307_BIT_OUT   0x80

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

#define DS1307_BIT_PM   0x20 /* in REG_HOUR */

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

#define DS1307_BIT_RS0   0x01

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

#define DS1307_BIT_RS1   0x02

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

#define DS1307_BIT_SQWE   0x10

Definition at line 70 of file rtc-ds1307.c.

#define DS1307_REG_CONTROL   0x07 /* or ds1338 */

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

#define DS1307_REG_HOUR   0x02 /* 00-23, or 1-12{am,pm} */

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

#define DS1307_REG_MDAY   0x04 /* 01-31 */

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

#define DS1307_REG_MIN   0x01 /* 00-59 */

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

#define DS1307_REG_MONTH   0x05 /* 01-12 */

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

#define DS1307_REG_SECS   0x00 /* 00-59 */

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

#define DS1307_REG_WDAY   0x03 /* 01-07 */

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

#define DS1307_REG_YEAR   0x06 /* 00-99 */

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

#define DS1337_BIT_A1I   0x01

Definition at line 92 of file rtc-ds1307.c.

#define DS1337_BIT_A1IE   0x01

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

#define DS1337_BIT_A2I   0x02

Definition at line 91 of file rtc-ds1307.c.

#define DS1337_BIT_A2IE   0x02

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

#define DS1337_BIT_CENTURY   0x80 /* in REG_MONTH */

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

#define DS1337_BIT_INTCN   0x04

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

#define DS1337_BIT_nEOSC   0x80

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

#define DS1337_BIT_OSF   0x80

Definition at line 90 of file rtc-ds1307.c.

#define DS1337_BIT_RS1   0x08

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

#define DS1337_BIT_RS2   0x10

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

#define DS1337_REG_CONTROL   0x0e

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

#define DS1337_REG_STATUS   0x0f

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

#define DS1338_BIT_OSF   0x20

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

#define DS1339_BIT_BBSQI   0x20

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

#define DS1339_REG_ALARM1_SECS   0x07

Definition at line 93 of file rtc-ds1307.c.

#define DS1340_BIT_CALIB_SIGN   0x20

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

#define DS1340_BIT_CENTURY   0x40 /* in REG_HOUR */

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

#define DS1340_BIT_CENTURY_EN   0x80 /* in REG_HOUR */

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

#define DS1340_BIT_FT   0x40

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

#define DS1340_BIT_nEOSC   0x80

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

#define DS1340_BIT_OSF   0x80

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

#define DS1340_BIT_OUT   0x80

Definition at line 83 of file rtc-ds1307.c.

#define DS1340_M_CALIBRATION   0x1f

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

#define DS1340_REG_CONTROL   0x07

Definition at line 82 of file rtc-ds1307.c.

#define DS1340_REG_FLAG   0x09

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

#define DS13XX_TRICKLE_CHARGER_MAGIC   0xa0

Definition at line 95 of file rtc-ds1307.c.

#define DS3231_BIT_BBSQW   0x40 /* same as BBSQI */

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

#define HAS_ALARM   1 /* bit 1 == irq claimed */

Definition at line 113 of file rtc-ds1307.c.

#define HAS_NVRAM   0 /* bit 0 == sysfs file active */

Definition at line 112 of file rtc-ds1307.c.

#define MCP7941X_BIT_ST   0x80

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

#define MCP7941X_BIT_VBATEN   0x08

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

#define RX8025_BIT_2412   0x20

Definition at line 98 of file rtc-ds1307.c.

#define RX8025_BIT_PON   0x10

Definition at line 100 of file rtc-ds1307.c.

#define RX8025_BIT_VDET   0x40

Definition at line 101 of file rtc-ds1307.c.

#define RX8025_BIT_XST   0x20

Definition at line 102 of file rtc-ds1307.c.

#define RX8025_REG_CTRL1   0x0e

Definition at line 97 of file rtc-ds1307.c.

#define RX8025_REG_CTRL2   0x0f

Definition at line 99 of file rtc-ds1307.c.

Enumeration Type Documentation

enum ds_type
Enumerator:
ds_1307 
ds_1337 
ds_1338 
ds_1339 
ds_1340 
ds_1388 
ds_3231 
m41t00 
mcp7941x 
rx_8025 
last_ds_type 

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

Function Documentation

MODULE_DESCRIPTION ( "RTC driver for DS1307 and similar chips )
MODULE_DEVICE_TABLE ( i2c  ,
ds1307_id   
)
module_i2c_driver ( ds1307_driver  )
MODULE_LICENSE ( "GPL"  )