#include <linux/bcd.h>
#include <linux/mfd/max8907.h>
#include <linux/module.h>
#include <linux/platform_device.h>
#include <linux/regmap.h>
#include <linux/rtc.h>
#include <linux/slab.h>
enum { … };
#define TIME_NUM …
#define ALARM_1SEC …
#define HOUR_12 …
#define HOUR_AM_PM …
#define ALARM0_IRQ …
#define ALARM1_IRQ …
#define ALARM0_STATUS …
#define ALARM1_STATUS …
struct max8907_rtc { … };
static irqreturn_t max8907_irq_handler(int irq, void *data)
{ … }
static void regs_to_tm(u8 *regs, struct rtc_time *tm)
{ … }
static void tm_to_regs(struct rtc_time *tm, u8 *regs)
{ … }
static int max8907_rtc_read_time(struct device *dev, struct rtc_time *tm)
{ … }
static int max8907_rtc_set_time(struct device *dev, struct rtc_time *tm)
{ … }
static int max8907_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alrm)
{ … }
static int max8907_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alrm)
{ … }
static const struct rtc_class_ops max8907_rtc_ops = …;
static int max8907_rtc_probe(struct platform_device *pdev)
{ … }
static struct platform_driver max8907_rtc_driver = …;
module_platform_driver(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;