#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/rtc.h>
#include <linux/bcd.h>
#include <linux/mfd/rk808.h>
#include <linux/platform_device.h>
#define BIT_RTC_CTRL_REG_STOP_RTC_M …
#define BIT_RTC_CTRL_REG_RTC_GET_TIME …
#define BIT_RTC_CTRL_REG_RTC_READSEL_M …
#define BIT_RTC_INTERRUPTS_REG_IT_ALARM_M …
#define RTC_STATUS_MASK …
#define SECONDS_REG_MSK …
#define MINUTES_REG_MAK …
#define HOURS_REG_MSK …
#define DAYS_REG_MSK …
#define MONTHS_REG_MSK …
#define YEARS_REG_MSK …
#define WEEKS_REG_MSK …
#define NUM_TIME_REGS …
#define NUM_ALARM_REGS …
struct rk_rtc_compat_reg { … };
struct rk808_rtc { … };
static time64_t nov2dec_transitions(struct rtc_time *tm)
{ … }
static void rockchip_to_gregorian(struct rtc_time *tm)
{ … }
static void gregorian_to_rockchip(struct rtc_time *tm)
{ … }
static int rk808_rtc_readtime(struct device *dev, struct rtc_time *tm)
{ … }
static int rk808_rtc_set_time(struct device *dev, struct rtc_time *tm)
{ … }
static int rk808_rtc_readalarm(struct device *dev, struct rtc_wkalrm *alrm)
{ … }
static int rk808_rtc_stop_alarm(struct rk808_rtc *rk808_rtc)
{ … }
static int rk808_rtc_start_alarm(struct rk808_rtc *rk808_rtc)
{ … }
static int rk808_rtc_setalarm(struct device *dev, struct rtc_wkalrm *alrm)
{ … }
static int rk808_rtc_alarm_irq_enable(struct device *dev,
unsigned int enabled)
{ … }
static irqreturn_t rk808_alarm_irq(int irq, void *data)
{ … }
static const struct rtc_class_ops rk808_rtc_ops = …;
#ifdef CONFIG_PM_SLEEP
static int rk808_rtc_suspend(struct device *dev)
{ … }
static int rk808_rtc_resume(struct device *dev)
{ … }
#endif
static SIMPLE_DEV_PM_OPS(rk808_rtc_pm_ops,
rk808_rtc_suspend, rk808_rtc_resume);
static struct rk_rtc_compat_reg rk808_creg = …;
static struct rk_rtc_compat_reg rk817_creg = …;
static int rk808_rtc_probe(struct platform_device *pdev)
{ … }
static struct platform_driver rk808_rtc_driver = …;
module_platform_driver(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_AUTHOR(…) …;
MODULE_AUTHOR(…) …;
MODULE_LICENSE(…) …;
MODULE_ALIAS(…) …;