#include <linux/clk.h>
#include <linux/interrupt.h>
#include <linux/io.h>
#include <linux/mod_devicetable.h>
#include <linux/module.h>
#include <linux/platform_device.h>
#include <linux/rtc.h>
#define MTK_RTC_DEV …
#define MTK_RTC_PWRCHK1 …
#define RTC_PWRCHK1_MAGIC …
#define MTK_RTC_PWRCHK2 …
#define RTC_PWRCHK2_MAGIC …
#define MTK_RTC_KEY …
#define RTC_KEY_MAGIC …
#define MTK_RTC_PROT1 …
#define RTC_PROT1_MAGIC …
#define MTK_RTC_PROT2 …
#define RTC_PROT2_MAGIC …
#define MTK_RTC_PROT3 …
#define RTC_PROT3_MAGIC …
#define MTK_RTC_PROT4 …
#define RTC_PROT4_MAGIC …
#define MTK_RTC_CTL …
#define RTC_RC_STOP …
#define MTK_RTC_DEBNCE …
#define RTC_DEBNCE_MASK …
#define MTK_RTC_INT …
#define RTC_INT_AL_STA …
#define MTK_RTC_TREG(_t, _f) …
#define MTK_RTC_AL_CTL …
#define RTC_AL_EN …
#define RTC_AL_ALL …
#define MTK_RTC_TM_YR_OFFSET …
#define MTK_RTC_TM_YR_L …
#define MTK_RTC_HW_YR_LIMIT …
#define MTK_RTC_TM_YR_H …
#define MTK_RTC_TM_YR_VALID(_y) …
enum { … };
enum { … };
struct mtk_rtc { … };
static void mtk_w32(struct mtk_rtc *rtc, u32 reg, u32 val)
{ … }
static u32 mtk_r32(struct mtk_rtc *rtc, u32 reg)
{ … }
static void mtk_rmw(struct mtk_rtc *rtc, u32 reg, u32 mask, u32 set)
{ … }
static void mtk_set(struct mtk_rtc *rtc, u32 reg, u32 val)
{ … }
static void mtk_clr(struct mtk_rtc *rtc, u32 reg, u32 val)
{ … }
static void mtk_rtc_hw_init(struct mtk_rtc *hw)
{ … }
static void mtk_rtc_get_alarm_or_time(struct mtk_rtc *hw, struct rtc_time *tm,
int time_alarm)
{ … }
static void mtk_rtc_set_alarm_or_time(struct mtk_rtc *hw, struct rtc_time *tm,
int time_alarm)
{ … }
static irqreturn_t mtk_rtc_alarmirq(int irq, void *id)
{ … }
static int mtk_rtc_gettime(struct device *dev, struct rtc_time *tm)
{ … }
static int mtk_rtc_settime(struct device *dev, struct rtc_time *tm)
{ … }
static int mtk_rtc_getalarm(struct device *dev, struct rtc_wkalrm *wkalrm)
{ … }
static int mtk_rtc_setalarm(struct device *dev, struct rtc_wkalrm *wkalrm)
{ … }
static const struct rtc_class_ops mtk_rtc_ops = …;
static const struct of_device_id mtk_rtc_match[] = …;
MODULE_DEVICE_TABLE(of, mtk_rtc_match);
static int mtk_rtc_probe(struct platform_device *pdev)
{ … }
static void mtk_rtc_remove(struct platform_device *pdev)
{ … }
#ifdef CONFIG_PM_SLEEP
static int mtk_rtc_suspend(struct device *dev)
{ … }
static int mtk_rtc_resume(struct device *dev)
{ … }
static SIMPLE_DEV_PM_OPS(mtk_rtc_pm_ops, mtk_rtc_suspend, mtk_rtc_resume);
#define MTK_RTC_PM_OPS …
#else
#define MTK_RTC_PM_OPS …
#endif
static struct platform_driver mtk_rtc_driver = …;
module_platform_driver(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_AUTHOR(…) …;
MODULE_LICENSE(…) …;