#include <linux/io.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/platform_device.h>
#include <linux/rtc.h>
#include <linux/slab.h>
enum { … };
#define RP5C01_12_24_SELECT_12 …
#define RP5C01_12_24_SELECT_24 …
#define RP5C01_10_HOUR_AM …
#define RP5C01_10_HOUR_PM …
#define RP5C01_MODE_TIMER_EN …
#define RP5C01_MODE_ALARM_EN …
#define RP5C01_MODE_MODE_MASK …
#define RP5C01_MODE_MODE00 …
#define RP5C01_MODE_MODE01 …
#define RP5C01_MODE_RAM_BLOCK10 …
#define RP5C01_MODE_RAM_BLOCK11 …
#define RP5C01_RESET_1HZ_PULSE …
#define RP5C01_RESET_16HZ_PULSE …
#define RP5C01_RESET_SECOND …
#define RP5C01_RESET_ALARM …
struct rp5c01_priv { … };
static inline unsigned int rp5c01_read(struct rp5c01_priv *priv,
unsigned int reg)
{ … }
static inline void rp5c01_write(struct rp5c01_priv *priv, unsigned int val,
unsigned int reg)
{ … }
static void rp5c01_lock(struct rp5c01_priv *priv)
{ … }
static void rp5c01_unlock(struct rp5c01_priv *priv)
{ … }
static int rp5c01_read_time(struct device *dev, struct rtc_time *tm)
{ … }
static int rp5c01_set_time(struct device *dev, struct rtc_time *tm)
{ … }
static const struct rtc_class_ops rp5c01_rtc_ops = …;
static int rp5c01_nvram_read(void *_priv, unsigned int pos, void *val,
size_t bytes)
{ … }
static int rp5c01_nvram_write(void *_priv, unsigned int pos, void *val,
size_t bytes)
{ … }
static int __init rp5c01_rtc_probe(struct platform_device *dev)
{ … }
static struct platform_driver rp5c01_rtc_driver = …;
module_platform_driver_probe(…);
MODULE_AUTHOR(…) …;
MODULE_LICENSE(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_ALIAS(…) …;