#include <linux/i2c.h>
#include <linux/bcd.h>
#include <linux/rtc.h>
#include <linux/delay.h>
#include <linux/module.h>
#include <linux/bitops.h>
#define CCR_SEC …
#define CCR_MIN …
#define CCR_HOUR …
#define CCR_MDAY …
#define CCR_MONTH …
#define CCR_YEAR …
#define CCR_WDAY …
#define CCR_Y2K …
#define X1205_REG_SR …
#define X1205_REG_Y2K …
#define X1205_REG_DW …
#define X1205_REG_YR …
#define X1205_REG_MO …
#define X1205_REG_DT …
#define X1205_REG_HR …
#define X1205_REG_MN …
#define X1205_REG_SC …
#define X1205_REG_DTR …
#define X1205_REG_ATR …
#define X1205_REG_INT …
#define X1205_REG_0 …
#define X1205_REG_Y2K1 …
#define X1205_REG_DWA1 …
#define X1205_REG_YRA1 …
#define X1205_REG_MOA1 …
#define X1205_REG_DTA1 …
#define X1205_REG_HRA1 …
#define X1205_REG_MNA1 …
#define X1205_REG_SCA1 …
#define X1205_REG_Y2K0 …
#define X1205_REG_DWA0 …
#define X1205_REG_YRA0 …
#define X1205_REG_MOA0 …
#define X1205_REG_DTA0 …
#define X1205_REG_HRA0 …
#define X1205_REG_MNA0 …
#define X1205_REG_SCA0 …
#define X1205_CCR_BASE …
#define X1205_ALM0_BASE …
#define X1205_SR_RTCF …
#define X1205_SR_WEL …
#define X1205_SR_RWEL …
#define X1205_SR_AL0 …
#define X1205_DTR_DTR0 …
#define X1205_DTR_DTR1 …
#define X1205_DTR_DTR2 …
#define X1205_HR_MIL …
#define X1205_INT_AL0E …
static struct i2c_driver x1205_driver;
static int x1205_get_datetime(struct i2c_client *client, struct rtc_time *tm,
unsigned char reg_base)
{ … }
static int x1205_get_status(struct i2c_client *client, unsigned char *sr)
{ … }
static int x1205_set_datetime(struct i2c_client *client, struct rtc_time *tm,
u8 reg_base, unsigned char alm_enable)
{ … }
static int x1205_fix_osc(struct i2c_client *client)
{ … }
static int x1205_get_dtrim(struct i2c_client *client, int *trim)
{ … }
static int x1205_get_atrim(struct i2c_client *client, int *trim)
{ … }
struct x1205_limit { … };
static int x1205_validate_client(struct i2c_client *client)
{ … }
static int x1205_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alrm)
{ … }
static int x1205_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alrm)
{ … }
static int x1205_rtc_read_time(struct device *dev, struct rtc_time *tm)
{ … }
static int x1205_rtc_set_time(struct device *dev, struct rtc_time *tm)
{ … }
static int x1205_rtc_proc(struct device *dev, struct seq_file *seq)
{ … }
static const struct rtc_class_ops x1205_rtc_ops = …;
static ssize_t x1205_sysfs_show_atrim(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static DEVICE_ATTR(atrim, S_IRUGO, x1205_sysfs_show_atrim, NULL);
static ssize_t x1205_sysfs_show_dtrim(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static DEVICE_ATTR(dtrim, S_IRUGO, x1205_sysfs_show_dtrim, NULL);
static int x1205_sysfs_register(struct device *dev)
{ … }
static void x1205_sysfs_unregister(struct device *dev)
{ … }
static int x1205_probe(struct i2c_client *client)
{ … }
static void x1205_remove(struct i2c_client *client)
{ … }
static const struct i2c_device_id x1205_id[] = …;
MODULE_DEVICE_TABLE(i2c, x1205_id);
static const struct of_device_id x1205_dt_ids[] = …;
MODULE_DEVICE_TABLE(of, x1205_dt_ids);
static struct i2c_driver x1205_driver = …;
module_i2c_driver(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;