linux/drivers/rtc/rtc-ma35d1.c

// SPDX-License-Identifier: GPL-2.0
/*
 * RTC driver for Nuvoton MA35D1
 *
 * Copyright (C) 2023 Nuvoton Technology Corp.
 */

#include <linux/bcd.h>
#include <linux/clk.h>
#include <linux/delay.h>
#include <linux/init.h>
#include <linux/io.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/platform_device.h>
#include <linux/rtc.h>

/* MA35D1 RTC Control Registers */
#define MA35_REG_RTC_INIT
#define MA35_REG_RTC_SINFASTS
#define MA35_REG_RTC_FREQADJ
#define MA35_REG_RTC_TIME
#define MA35_REG_RTC_CAL
#define MA35_REG_RTC_CLKFMT
#define MA35_REG_RTC_WEEKDAY
#define MA35_REG_RTC_TALM
#define MA35_REG_RTC_CALM
#define MA35_REG_RTC_LEAPYEAR
#define MA35_REG_RTC_INTEN
#define MA35_REG_RTC_INTSTS

/* register MA35_REG_RTC_INIT */
#define RTC_INIT_ACTIVE
#define RTC_INIT_MAGIC_CODE

/* register MA35_REG_RTC_CLKFMT */
#define RTC_CLKFMT_24HEN
#define RTC_CLKFMT_DCOMPEN

/* register MA35_REG_RTC_INTEN */
#define RTC_INTEN_ALMIEN
#define RTC_INTEN_UIEN
#define RTC_INTEN_CLKFIEN
#define RTC_INTEN_CLKSTIEN

/* register MA35_REG_RTC_INTSTS */
#define RTC_INTSTS_ALMIF
#define RTC_INTSTS_UIF
#define RTC_INTSTS_CLKFIF
#define RTC_INTSTS_CLKSTIF

#define RTC_INIT_TIMEOUT

struct ma35_rtc {};

static u32 rtc_reg_read(struct ma35_rtc *p, u32 offset)
{}

static inline void rtc_reg_write(struct ma35_rtc *p, u32 offset, u32 value)
{}

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

static int ma35d1_rtc_init(struct ma35_rtc *rtc, u32 ms_timeout)
{}

static int ma35d1_alarm_irq_enable(struct device *dev, u32 enabled)
{}

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

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

static int ma35d1_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alrm)
{}

static int ma35d1_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alrm)
{}

static const struct rtc_class_ops ma35d1_rtc_ops =;

static int ma35d1_rtc_probe(struct platform_device *pdev)
{}

static int ma35d1_rtc_suspend(struct platform_device *pdev, pm_message_t state)
{}

static int ma35d1_rtc_resume(struct platform_device *pdev)
{}

static const struct of_device_id ma35d1_rtc_of_match[] =;
MODULE_DEVICE_TABLE(of, ma35d1_rtc_of_match);

static struct platform_driver ma35d1_rtc_driver =;

module_platform_driver();

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