linux/drivers/rtc/rtc-mt2712.c

// SPDX-License-Identifier: GPL-2.0
/*
 * Copyright (c) 2019 MediaTek Inc.
 * Author: Ran Bi <[email protected]>
 */

#include <linux/delay.h>
#include <linux/init.h>
#include <linux/io.h>
#include <linux/irqdomain.h>
#include <linux/module.h>
#include <linux/of_address.h>
#include <linux/of_irq.h>
#include <linux/platform_device.h>
#include <linux/rtc.h>

#define MT2712_BBPU
#define MT2712_BBPU_CLRPKY
#define MT2712_BBPU_RELOAD
#define MT2712_BBPU_CBUSY
#define MT2712_BBPU_KEY

#define MT2712_IRQ_STA
#define MT2712_IRQ_STA_AL
#define MT2712_IRQ_STA_TC

#define MT2712_IRQ_EN
#define MT2712_IRQ_EN_AL
#define MT2712_IRQ_EN_TC
#define MT2712_IRQ_EN_ONESHOT

#define MT2712_CII_EN

#define MT2712_AL_MASK
#define MT2712_AL_MASK_DOW

#define MT2712_TC_SEC
#define MT2712_TC_MIN
#define MT2712_TC_HOU
#define MT2712_TC_DOM
#define MT2712_TC_DOW
#define MT2712_TC_MTH
#define MT2712_TC_YEA

#define MT2712_AL_SEC
#define MT2712_AL_MIN
#define MT2712_AL_HOU
#define MT2712_AL_DOM
#define MT2712_AL_DOW
#define MT2712_AL_MTH
#define MT2712_AL_YEA

#define MT2712_SEC_MASK
#define MT2712_MIN_MASK
#define MT2712_HOU_MASK
#define MT2712_DOM_MASK
#define MT2712_DOW_MASK
#define MT2712_MTH_MASK
#define MT2712_YEA_MASK

#define MT2712_POWERKEY1
#define MT2712_POWERKEY2
#define MT2712_POWERKEY1_KEY
#define MT2712_POWERKEY2_KEY

#define MT2712_CON0
#define MT2712_CON1

#define MT2712_PROT
#define MT2712_PROT_UNLOCK1
#define MT2712_PROT_UNLOCK2

#define MT2712_WRTGR

#define MT2712_RTC_TIMESTAMP_END_2127

struct mt2712_rtc {};

static inline u32 mt2712_readl(struct mt2712_rtc *mt2712_rtc, u32 reg)
{}

static inline void mt2712_writel(struct mt2712_rtc *mt2712_rtc,
				 u32 reg, u32 val)
{}

static void mt2712_rtc_write_trigger(struct mt2712_rtc *mt2712_rtc)
{}

static void mt2712_rtc_writeif_unlock(struct mt2712_rtc *mt2712_rtc)
{}

static irqreturn_t rtc_irq_handler_thread(int irq, void *data)
{}

static void __mt2712_rtc_read_time(struct mt2712_rtc *mt2712_rtc,
				   struct rtc_time *tm, int *sec)
{}

static int mt2712_rtc_read_time(struct device *dev, struct rtc_time *tm)
{}

static int mt2712_rtc_set_time(struct device *dev, struct rtc_time *tm)
{}

static int mt2712_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alm)
{}

static int mt2712_rtc_alarm_irq_enable(struct device *dev,
				       unsigned int enabled)
{}

static int mt2712_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alm)
{}

/* Init RTC register */
static void mt2712_rtc_hw_init(struct mt2712_rtc *mt2712_rtc)
{}

static const struct rtc_class_ops mt2712_rtc_ops =;

static int mt2712_rtc_probe(struct platform_device *pdev)
{}

#ifdef CONFIG_PM_SLEEP
static int mt2712_rtc_suspend(struct device *dev)
{}

static int mt2712_rtc_resume(struct device *dev)
{}

static SIMPLE_DEV_PM_OPS(mt2712_pm_ops, mt2712_rtc_suspend,
			 mt2712_rtc_resume);
#endif

static const struct of_device_id mt2712_rtc_of_match[] =;

MODULE_DEVICE_TABLE(of, mt2712_rtc_of_match);

static struct platform_driver mt2712_rtc_driver =;

module_platform_driver();

MODULE_DESCRIPTION();
MODULE_AUTHOR();
MODULE_LICENSE();