#include <linux/bcd.h>
#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/regmap.h>
#include <linux/rtc.h>
#include <linux/of.h>
#include <linux/spi/spi.h>
#include <linux/i2c.h>
#define RX6110_REG_SEC …
#define RX6110_REG_MIN …
#define RX6110_REG_HOUR …
#define RX6110_REG_WDAY …
#define RX6110_REG_MDAY …
#define RX6110_REG_MONTH …
#define RX6110_REG_YEAR …
#define RX6110_REG_RES1 …
#define RX6110_REG_ALMIN …
#define RX6110_REG_ALHOUR …
#define RX6110_REG_ALWDAY …
#define RX6110_REG_TCOUNT0 …
#define RX6110_REG_TCOUNT1 …
#define RX6110_REG_EXT …
#define RX6110_REG_FLAG …
#define RX6110_REG_CTRL …
#define RX6110_REG_USER0 …
#define RX6110_REG_USER1 …
#define RX6110_REG_USER2 …
#define RX6110_REG_USER3 …
#define RX6110_REG_USER4 …
#define RX6110_REG_USER5 …
#define RX6110_REG_USER6 …
#define RX6110_REG_USER7 …
#define RX6110_REG_USER8 …
#define RX6110_REG_USER9 …
#define RX6110_REG_USERA …
#define RX6110_REG_USERB …
#define RX6110_REG_USERC …
#define RX6110_REG_USERD …
#define RX6110_REG_USERE …
#define RX6110_REG_USERF …
#define RX6110_REG_RES2 …
#define RX6110_REG_RES3 …
#define RX6110_REG_IRQ …
#define RX6110_BIT_ALARM_EN …
#define RX6110_BIT_EXT_TSEL0 …
#define RX6110_BIT_EXT_TSEL1 …
#define RX6110_BIT_EXT_TSEL2 …
#define RX6110_BIT_EXT_WADA …
#define RX6110_BIT_EXT_TE …
#define RX6110_BIT_EXT_USEL …
#define RX6110_BIT_EXT_FSEL0 …
#define RX6110_BIT_EXT_FSEL1 …
#define RX6110_BIT_FLAG_VLF …
#define RX6110_BIT_FLAG_AF …
#define RX6110_BIT_FLAG_TF …
#define RX6110_BIT_FLAG_UF …
#define RX6110_BIT_CTRL_TBKE …
#define RX6110_BIT_CTRL_TBKON …
#define RX6110_BIT_CTRL_TSTP …
#define RX6110_BIT_CTRL_AIE …
#define RX6110_BIT_CTRL_TIE …
#define RX6110_BIT_CTRL_UIE …
#define RX6110_BIT_CTRL_STOP …
#define RX6110_BIT_CTRL_TEST …
enum { … };
#define RX6110_DRIVER_NAME …
struct rx6110_data { … };
static int rx6110_rtc_tm_to_data(struct rtc_time *tm, u8 *data)
{ … }
static int rx6110_data_to_rtc_tm(u8 *data, struct rtc_time *tm)
{ … }
static int rx6110_set_time(struct device *dev, struct rtc_time *tm)
{ … }
static int rx6110_get_time(struct device *dev, struct rtc_time *tm)
{ … }
static const struct reg_sequence rx6110_default_regs[] = …;
static int rx6110_init(struct rx6110_data *rx6110)
{ … }
static const struct rtc_class_ops rx6110_rtc_ops = …;
static int rx6110_probe(struct rx6110_data *rx6110, struct device *dev)
{ … }
#if IS_ENABLED(CONFIG_SPI_MASTER)
static const struct regmap_config regmap_spi_config = …;
static int rx6110_spi_probe(struct spi_device *spi)
{ … }
static const struct spi_device_id rx6110_spi_id[] = …;
MODULE_DEVICE_TABLE(spi, rx6110_spi_id);
static const __maybe_unused struct of_device_id rx6110_spi_of_match[] = …;
MODULE_DEVICE_TABLE(of, rx6110_spi_of_match);
static struct spi_driver rx6110_spi_driver = …;
static int rx6110_spi_register(void)
{ … }
static void rx6110_spi_unregister(void)
{ … }
#else
static int rx6110_spi_register(void)
{
return 0;
}
static void rx6110_spi_unregister(void)
{
}
#endif
#if IS_ENABLED(CONFIG_I2C)
static const struct regmap_config regmap_i2c_config = …;
static int rx6110_i2c_probe(struct i2c_client *client)
{ … }
static const struct acpi_device_id rx6110_i2c_acpi_match[] = …;
MODULE_DEVICE_TABLE(acpi, rx6110_i2c_acpi_match);
static const struct i2c_device_id rx6110_i2c_id[] = …;
MODULE_DEVICE_TABLE(i2c, rx6110_i2c_id);
static struct i2c_driver rx6110_i2c_driver = …;
static int rx6110_i2c_register(void)
{ … }
static void rx6110_i2c_unregister(void)
{ … }
#else
static int rx6110_i2c_register(void)
{
return 0;
}
static void rx6110_i2c_unregister(void)
{
}
#endif
static int __init rx6110_module_init(void)
{ … }
module_init(…) …;
static void __exit rx6110_module_exit(void)
{ … }
module_exit(rx6110_module_exit);
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;