#include <linux/module.h>
#include <linux/i2c.h>
#include <linux/slab.h>
#include <linux/rtc.h>
#include <linux/init.h>
#include <linux/err.h>
#include <linux/errno.h>
#include <linux/bcd.h>
struct rtc_mem { … };
struct pcf8583 { … };
#define CTRL_STOP …
#define CTRL_HOLD …
#define CTRL_32KHZ …
#define CTRL_MASK …
#define CTRL_ALARMEN …
#define CTRL_ALARM …
#define CTRL_TIMER …
static struct i2c_driver pcf8583_driver;
#define get_ctrl(x) …
#define set_ctrl(x, v) …
#define CMOS_YEAR …
#define CMOS_CHECKSUM …
static int pcf8583_get_datetime(struct i2c_client *client, struct rtc_time *dt)
{ … }
static int pcf8583_set_datetime(struct i2c_client *client, struct rtc_time *dt, int datetoo)
{ … }
static int pcf8583_get_ctrl(struct i2c_client *client, unsigned char *ctrl)
{ … }
static int pcf8583_set_ctrl(struct i2c_client *client, unsigned char *ctrl)
{ … }
static int pcf8583_read_mem(struct i2c_client *client, struct rtc_mem *mem)
{ … }
static int pcf8583_write_mem(struct i2c_client *client, struct rtc_mem *mem)
{ … }
static int pcf8583_rtc_read_time(struct device *dev, struct rtc_time *tm)
{ … }
static int pcf8583_rtc_set_time(struct device *dev, struct rtc_time *tm)
{ … }
static const struct rtc_class_ops pcf8583_rtc_ops = …;
static int pcf8583_probe(struct i2c_client *client)
{ … }
static const struct i2c_device_id pcf8583_id[] = …;
MODULE_DEVICE_TABLE(i2c, pcf8583_id);
static struct i2c_driver pcf8583_driver = …;
module_i2c_driver(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;