#include <linux/bcd.h>
#include <linux/init.h>
#include <linux/io.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/rtc.h>
#include <linux/spi/spi.h>
#define RTC_CMD_READ …
#define RTC_CMD_WRITE …
#define RTC_CMD_WRITE_ENABLE …
#define RTC_CMD_WRITE_DISABLE …
#define RTC_ADDR_RAM0 …
#define RTC_ADDR_TCR …
#define RTC_CLCK_BURST …
#define RTC_CLCK_LEN …
#define RTC_ADDR_CTRL …
#define RTC_ADDR_YEAR …
#define RTC_ADDR_DAY …
#define RTC_ADDR_MON …
#define RTC_ADDR_DATE …
#define RTC_ADDR_HOUR …
#define RTC_ADDR_MIN …
#define RTC_ADDR_SEC …
static int ds1302_rtc_set_time(struct device *dev, struct rtc_time *time)
{ … }
static int ds1302_rtc_get_time(struct device *dev, struct rtc_time *time)
{ … }
static const struct rtc_class_ops ds1302_rtc_ops = …;
static int ds1302_probe(struct spi_device *spi)
{ … }
#ifdef CONFIG_OF
static const struct of_device_id ds1302_dt_ids[] = …;
MODULE_DEVICE_TABLE(of, ds1302_dt_ids);
#endif
static const struct spi_device_id ds1302_spi_ids[] = …;
MODULE_DEVICE_TABLE(spi, ds1302_spi_ids);
static struct spi_driver ds1302_driver = …;
module_spi_driver(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_AUTHOR(…) …;
MODULE_LICENSE(…) …;