#include <linux/module.h>
#include <linux/rtc.h>
#include <linux/i2c.h>
#include <linux/bitrev.h>
#include <linux/bcd.h>
#include <linux/slab.h>
#include <linux/delay.h>
#define S35390A_CMD_STATUS1 …
#define S35390A_CMD_STATUS2 …
#define S35390A_CMD_TIME1 …
#define S35390A_CMD_TIME2 …
#define S35390A_CMD_INT2_REG1 …
#define S35390A_BYTE_YEAR …
#define S35390A_BYTE_MONTH …
#define S35390A_BYTE_DAY …
#define S35390A_BYTE_WDAY …
#define S35390A_BYTE_HOURS …
#define S35390A_BYTE_MINS …
#define S35390A_BYTE_SECS …
#define S35390A_ALRM_BYTE_WDAY …
#define S35390A_ALRM_BYTE_HOURS …
#define S35390A_ALRM_BYTE_MINS …
#define S35390A_FLAG_POC …
#define S35390A_FLAG_BLD …
#define S35390A_FLAG_INT2 …
#define S35390A_FLAG_24H …
#define S35390A_FLAG_RESET …
#define S35390A_FLAG_TEST …
#define S35390A_INT2_MODE_MASK …
#define S35390A_INT2_MODE_NOINTR …
#define S35390A_INT2_MODE_ALARM …
#define S35390A_INT2_MODE_PMIN_EDG …
#define S35390A_INT2_MODE_FREQ …
#define S35390A_INT2_MODE_PMIN …
static const struct i2c_device_id s35390a_id[] = …;
MODULE_DEVICE_TABLE(i2c, s35390a_id);
static const __maybe_unused struct of_device_id s35390a_of_match[] = …;
MODULE_DEVICE_TABLE(of, s35390a_of_match);
struct s35390a { … };
static int s35390a_set_reg(struct s35390a *s35390a, int reg, char *buf, int len)
{ … }
static int s35390a_get_reg(struct s35390a *s35390a, int reg, char *buf, int len)
{ … }
static int s35390a_init(struct s35390a *s35390a)
{ … }
static int s35390a_read_status(struct s35390a *s35390a, char *status1)
{ … }
static int s35390a_disable_test_mode(struct s35390a *s35390a)
{ … }
static char s35390a_hr2reg(struct s35390a *s35390a, int hour)
{ … }
static int s35390a_reg2hr(struct s35390a *s35390a, char reg)
{ … }
static int s35390a_rtc_set_time(struct device *dev, struct rtc_time *tm)
{ … }
static int s35390a_rtc_read_time(struct device *dev, struct rtc_time *tm)
{ … }
static int s35390a_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alm)
{ … }
static int s35390a_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alm)
{ … }
static int s35390a_rtc_ioctl(struct device *dev, unsigned int cmd,
unsigned long arg)
{ … }
static const struct rtc_class_ops s35390a_rtc_ops = …;
static int s35390a_probe(struct i2c_client *client)
{ … }
static struct i2c_driver s35390a_driver = …;
module_i2c_driver(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;