#include <linux/init.h>
#include <linux/module.h>
#include <linux/platform_device.h>
#include <linux/rtc.h>
#include <linux/spi/spi.h>
#include <linux/bcd.h>
#include <linux/slab.h>
#include <linux/of.h>
#define DS1390_REG_100THS …
#define DS1390_REG_SECONDS …
#define DS1390_REG_MINUTES …
#define DS1390_REG_HOURS …
#define DS1390_REG_DAY …
#define DS1390_REG_DATE …
#define DS1390_REG_MONTH_CENT …
#define DS1390_REG_YEAR …
#define DS1390_REG_ALARM_100THS …
#define DS1390_REG_ALARM_SECONDS …
#define DS1390_REG_ALARM_MINUTES …
#define DS1390_REG_ALARM_HOURS …
#define DS1390_REG_ALARM_DAY_DATE …
#define DS1390_REG_CONTROL …
#define DS1390_REG_STATUS …
#define DS1390_REG_TRICKLE …
#define DS1390_TRICKLE_CHARGER_ENABLE …
#define DS1390_TRICKLE_CHARGER_250_OHM …
#define DS1390_TRICKLE_CHARGER_2K_OHM …
#define DS1390_TRICKLE_CHARGER_4K_OHM …
#define DS1390_TRICKLE_CHARGER_NO_DIODE …
#define DS1390_TRICKLE_CHARGER_DIODE …
struct ds1390 { … };
static void ds1390_set_reg(struct device *dev, unsigned char address,
unsigned char data)
{ … }
static int ds1390_get_reg(struct device *dev, unsigned char address,
unsigned char *data)
{ … }
static void ds1390_trickle_of_init(struct spi_device *spi)
{ … }
static int ds1390_read_time(struct device *dev, struct rtc_time *dt)
{ … }
static int ds1390_set_time(struct device *dev, struct rtc_time *dt)
{ … }
static const struct rtc_class_ops ds1390_rtc_ops = …;
static int ds1390_probe(struct spi_device *spi)
{ … }
static const struct of_device_id ds1390_of_match[] __maybe_unused = …;
MODULE_DEVICE_TABLE(of, ds1390_of_match);
static const struct spi_device_id ds1390_spi_ids[] = …;
MODULE_DEVICE_TABLE(spi, ds1390_spi_ids);
static struct spi_driver ds1390_driver = …;
module_spi_driver(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_AUTHOR(…) …;
MODULE_LICENSE(…) …;
MODULE_ALIAS(…) …;