#include <linux/bcd.h>
#include <linux/bitops.h>
#include <linux/i2c.h>
#include <linux/kernel.h>
#include <linux/kstrtox.h>
#include <linux/module.h>
#include <linux/rtc.h>
#define RX8025_REG_SEC …
#define RX8025_REG_MIN …
#define RX8025_REG_HOUR …
#define RX8025_REG_WDAY …
#define RX8025_REG_MDAY …
#define RX8025_REG_MONTH …
#define RX8025_REG_YEAR …
#define RX8025_REG_DIGOFF …
#define RX8025_REG_ALWMIN …
#define RX8025_REG_ALWHOUR …
#define RX8025_REG_ALWWDAY …
#define RX8025_REG_ALDMIN …
#define RX8025_REG_ALDHOUR …
#define RX8025_REG_CTRL1 …
#define RX8025_REG_CTRL2 …
#define RX8025_BIT_CTRL1_CT …
#define RX8025_BIT_CTRL1_CT_1HZ …
#define RX8025_BIT_CTRL1_TEST …
#define RX8025_BIT_CTRL1_1224 …
#define RX8025_BIT_CTRL1_DALE …
#define RX8025_BIT_CTRL1_WALE …
#define RX8025_BIT_CTRL2_DAFG …
#define RX8025_BIT_CTRL2_WAFG …
#define RX8025_BIT_CTRL2_CTFG …
#define RX8025_BIT_CTRL2_PON …
#define RX8025_BIT_CTRL2_XST …
#define RX8025_BIT_CTRL2_VDET …
#define RX8035_BIT_HOUR_1224 …
#define RX8025_ADJ_RESOLUTION …
#define RX8025_ADJ_DATA_MAX …
#define RX8025_ADJ_DATA_MIN …
enum rx_model { … };
static const struct i2c_device_id rx8025_id[] = …;
MODULE_DEVICE_TABLE(i2c, rx8025_id);
struct rx8025_data { … };
static s32 rx8025_read_reg(const struct i2c_client *client, u8 number)
{ … }
static int rx8025_read_regs(const struct i2c_client *client,
u8 number, u8 length, u8 *values)
{ … }
static s32 rx8025_write_reg(const struct i2c_client *client, u8 number,
u8 value)
{ … }
static s32 rx8025_write_regs(const struct i2c_client *client,
u8 number, u8 length, const u8 *values)
{ … }
static int rx8025_is_osc_stopped(enum rx_model model, int ctrl2)
{ … }
static int rx8025_check_validity(struct device *dev)
{ … }
static int rx8025_reset_validity(struct i2c_client *client)
{ … }
static irqreturn_t rx8025_handle_irq(int irq, void *dev_id)
{ … }
static int rx8025_get_time(struct device *dev, struct rtc_time *dt)
{ … }
static int rx8025_set_time(struct device *dev, struct rtc_time *dt)
{ … }
static int rx8025_init_client(struct i2c_client *client)
{ … }
static int rx8025_read_alarm(struct device *dev, struct rtc_wkalrm *t)
{ … }
static int rx8025_set_alarm(struct device *dev, struct rtc_wkalrm *t)
{ … }
static int rx8025_alarm_irq_enable(struct device *dev, unsigned int enabled)
{ … }
static int rx8025_read_offset(struct device *dev, long *offset)
{ … }
static int rx8025_set_offset(struct device *dev, long offset)
{ … }
static const struct rtc_class_ops rx8025_rtc_ops = …;
static ssize_t rx8025_sysfs_show_clock_adjust(struct device *dev,
struct device_attribute *attr,
char *buf)
{ … }
static ssize_t rx8025_sysfs_store_clock_adjust(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t count)
{ … }
static DEVICE_ATTR(clock_adjust_ppb, S_IRUGO | S_IWUSR,
rx8025_sysfs_show_clock_adjust,
rx8025_sysfs_store_clock_adjust);
static struct attribute *rx8025_attrs[] = …;
static const struct attribute_group rx8025_attr_group = …;
static int rx8025_probe(struct i2c_client *client)
{ … }
static struct i2c_driver rx8025_driver = …;
module_i2c_driver(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;