linux/drivers/rtc/rtc-msc313.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * Real time clocks driver for MStar/SigmaStar ARMv7 SoCs.
 * Based on "Real Time Clock driver for msb252x." that was contained
 * in various MStar kernels.
 *
 * (C) 2019 Daniel Palmer
 * (C) 2021 Romain Perier
 */

#include <linux/clk.h>
#include <linux/delay.h>
#include <linux/io.h>
#include <linux/module.h>
#include <linux/mod_devicetable.h>
#include <linux/platform_device.h>
#include <linux/rtc.h>

/* Registers */
#define REG_RTC_CTRL
#define REG_RTC_FREQ_CW_L
#define REG_RTC_FREQ_CW_H
#define REG_RTC_LOAD_VAL_L
#define REG_RTC_LOAD_VAL_H
#define REG_RTC_MATCH_VAL_L
#define REG_RTC_MATCH_VAL_H
#define REG_RTC_STATUS_INT
#define REG_RTC_CNT_VAL_L
#define REG_RTC_CNT_VAL_H

/* Control bits for REG_RTC_CTRL */
#define SOFT_RSTZ_BIT
#define CNT_EN_BIT
#define WRAP_EN_BIT
#define LOAD_EN_BIT
#define READ_EN_BIT
#define INT_MASK_BIT
#define INT_FORCE_BIT
#define INT_CLEAR_BIT

/* Control bits for REG_RTC_STATUS_INT */
#define RAW_INT_BIT
#define ALM_INT_BIT

struct msc313_rtc {};

static int msc313_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alarm)
{}

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

static int msc313_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alarm)
{}

static bool msc313_rtc_get_enabled(struct msc313_rtc *priv)
{}

static void msc313_rtc_set_enabled(struct msc313_rtc *priv)
{}

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

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

static const struct rtc_class_ops msc313_rtc_ops =;

static irqreturn_t msc313_rtc_interrupt(s32 irq, void *dev_id)
{}

static int msc313_rtc_probe(struct platform_device *pdev)
{}

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

static struct platform_driver msc313_rtc_driver =;

module_platform_driver();

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