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

Go to the source code of this file.

Data Structures

struct  m41t80_data
 

Macros

#define M41T80_REG_SSEC   0
 
#define M41T80_REG_SEC   1
 
#define M41T80_REG_MIN   2
 
#define M41T80_REG_HOUR   3
 
#define M41T80_REG_WDAY   4
 
#define M41T80_REG_DAY   5
 
#define M41T80_REG_MON   6
 
#define M41T80_REG_YEAR   7
 
#define M41T80_REG_ALARM_MON   0xa
 
#define M41T80_REG_ALARM_DAY   0xb
 
#define M41T80_REG_ALARM_HOUR   0xc
 
#define M41T80_REG_ALARM_MIN   0xd
 
#define M41T80_REG_ALARM_SEC   0xe
 
#define M41T80_REG_FLAGS   0xf
 
#define M41T80_REG_SQW   0x13
 
#define M41T80_DATETIME_REG_SIZE   (M41T80_REG_YEAR + 1)
 
#define M41T80_ALARM_REG_SIZE   (M41T80_REG_ALARM_SEC + 1 - M41T80_REG_ALARM_MON)
 
#define M41T80_SEC_ST   (1 << 7) /* ST: Stop Bit */
 
#define M41T80_ALMON_AFE   (1 << 7) /* AFE: AF Enable Bit */
 
#define M41T80_ALMON_SQWE   (1 << 6) /* SQWE: SQW Enable Bit */
 
#define M41T80_ALHOUR_HT   (1 << 6) /* HT: Halt Update Bit */
 
#define M41T80_FLAGS_AF   (1 << 6) /* AF: Alarm Flag Bit */
 
#define M41T80_FLAGS_BATT_LOW   (1 << 4) /* BL: Battery Low Bit */
 
#define M41T80_WATCHDOG_RB2   (1 << 7) /* RB: Watchdog resolution */
 
#define M41T80_WATCHDOG_RB1   (1 << 1) /* RB: Watchdog resolution */
 
#define M41T80_WATCHDOG_RB0   (1 << 0) /* RB: Watchdog resolution */
 
#define M41T80_FEATURE_HT   (1 << 0) /* Halt feature */
 
#define M41T80_FEATURE_BL   (1 << 1) /* Battery low indicator */
 
#define M41T80_FEATURE_SQ   (1 << 2) /* Squarewave feature */
 
#define M41T80_FEATURE_WD   (1 << 3) /* Extra watchdog resolution */
 
#define M41T80_FEATURE_SQ_ALT   (1 << 4) /* RSx bits are in reg 4 */
 
#define DRV_VERSION   "0.05"
 
#define m41t80_rtc_proc   NULL
 

Functions

 MODULE_DEVICE_TABLE (i2c, m41t80_id)
 
 module_i2c_driver (m41t80_driver)
 
 MODULE_AUTHOR ("Alexander Bigga <[email protected]>")
 
 MODULE_DESCRIPTION ("ST Microelectronics M41T80 series RTC I2C Client Driver")
 
 MODULE_LICENSE ("GPL")
 
 MODULE_VERSION (DRV_VERSION)
 

Macro Definition Documentation

#define DRV_VERSION   "0.05"

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

#define M41T80_ALARM_REG_SIZE   (M41T80_REG_ALARM_SEC + 1 - M41T80_REG_ALARM_MON)

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

#define M41T80_ALHOUR_HT   (1 << 6) /* HT: Halt Update Bit */

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

#define M41T80_ALMON_AFE   (1 << 7) /* AFE: AF Enable Bit */

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

#define M41T80_ALMON_SQWE   (1 << 6) /* SQWE: SQW Enable Bit */

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

#define M41T80_DATETIME_REG_SIZE   (M41T80_REG_YEAR + 1)

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

#define M41T80_FEATURE_BL   (1 << 1) /* Battery low indicator */

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

#define M41T80_FEATURE_HT   (1 << 0) /* Halt feature */

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

#define M41T80_FEATURE_SQ   (1 << 2) /* Squarewave feature */

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

#define M41T80_FEATURE_SQ_ALT   (1 << 4) /* RSx bits are in reg 4 */

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

#define M41T80_FEATURE_WD   (1 << 3) /* Extra watchdog resolution */

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

#define M41T80_FLAGS_AF   (1 << 6) /* AF: Alarm Flag Bit */

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

#define M41T80_FLAGS_BATT_LOW   (1 << 4) /* BL: Battery Low Bit */

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

#define M41T80_REG_ALARM_DAY   0xb

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

#define M41T80_REG_ALARM_HOUR   0xc

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

#define M41T80_REG_ALARM_MIN   0xd

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

#define M41T80_REG_ALARM_MON   0xa

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

#define M41T80_REG_ALARM_SEC   0xe

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

#define M41T80_REG_DAY   5

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

#define M41T80_REG_FLAGS   0xf

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

#define M41T80_REG_HOUR   3

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

#define M41T80_REG_MIN   2

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

#define M41T80_REG_MON   6

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

#define M41T80_REG_SEC   1

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

#define M41T80_REG_SQW   0x13

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

#define M41T80_REG_SSEC   0

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

#define M41T80_REG_WDAY   4

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

#define M41T80_REG_YEAR   7

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

#define m41t80_rtc_proc   NULL

Definition at line 203 of file rtc-m41t80.c.

#define M41T80_SEC_ST   (1 << 7) /* ST: Stop Bit */

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

#define M41T80_WATCHDOG_RB0   (1 << 0) /* RB: Watchdog resolution */

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

#define M41T80_WATCHDOG_RB1   (1 << 1) /* RB: Watchdog resolution */

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

#define M41T80_WATCHDOG_RB2   (1 << 7) /* RB: Watchdog resolution */

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

Function Documentation

MODULE_AUTHOR ( "Alexander Bigga <[email protected]>"  )
MODULE_DESCRIPTION ( "ST Microelectronics M41T80 series RTC I2C Client Driver"  )
MODULE_DEVICE_TABLE ( i2c  ,
m41t80_id   
)
module_i2c_driver ( m41t80_driver  )
MODULE_LICENSE ( "GPL"  )
MODULE_VERSION ( DRV_VERSION  )