linux/drivers/rtc/rtc-sunxi.c

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 * An RTC driver for Allwinner A10/A20
 *
 * Copyright (c) 2013, Carlo Caione <[email protected]>
 */

#include <linux/delay.h>
#include <linux/err.h>
#include <linux/fs.h>
#include <linux/init.h>
#include <linux/interrupt.h>
#include <linux/io.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/platform_device.h>
#include <linux/rtc.h>
#include <linux/types.h>

#define SUNXI_LOSC_CTRL
#define SUNXI_LOSC_CTRL_RTC_HMS_ACC
#define SUNXI_LOSC_CTRL_RTC_YMD_ACC

#define SUNXI_RTC_YMD

#define SUNXI_RTC_HMS

#define SUNXI_ALRM_DHMS

#define SUNXI_ALRM_EN
#define SUNXI_ALRM_EN_CNT_EN

#define SUNXI_ALRM_IRQ_EN
#define SUNXI_ALRM_IRQ_EN_CNT_IRQ_EN

#define SUNXI_ALRM_IRQ_STA
#define SUNXI_ALRM_IRQ_STA_CNT_IRQ_PEND

#define SUNXI_MASK_DH
#define SUNXI_MASK_SM
#define SUNXI_MASK_M
#define SUNXI_MASK_LY
#define SUNXI_MASK_D
#define SUNXI_MASK_M

#define SUNXI_GET(x, mask, shift)

#define SUNXI_SET(x, mask, shift)

/*
 * Get date values
 */
#define SUNXI_DATE_GET_DAY_VALUE(x)
#define SUNXI_DATE_GET_MON_VALUE(x)
#define SUNXI_DATE_GET_YEAR_VALUE(x, mask)

/*
 * Get time values
 */
#define SUNXI_TIME_GET_SEC_VALUE(x)
#define SUNXI_TIME_GET_MIN_VALUE(x)
#define SUNXI_TIME_GET_HOUR_VALUE(x)

/*
 * Get alarm values
 */
#define SUNXI_ALRM_GET_SEC_VALUE(x)
#define SUNXI_ALRM_GET_MIN_VALUE(x)
#define SUNXI_ALRM_GET_HOUR_VALUE(x)

/*
 * Set date values
 */
#define SUNXI_DATE_SET_DAY_VALUE(x)
#define SUNXI_DATE_SET_MON_VALUE(x)
#define SUNXI_DATE_SET_YEAR_VALUE(x, mask)
#define SUNXI_LEAP_SET_VALUE(x, shift)

/*
 * Set time values
 */
#define SUNXI_TIME_SET_SEC_VALUE(x)
#define SUNXI_TIME_SET_MIN_VALUE(x)
#define SUNXI_TIME_SET_HOUR_VALUE(x)

/*
 * Set alarm values
 */
#define SUNXI_ALRM_SET_SEC_VALUE(x)
#define SUNXI_ALRM_SET_MIN_VALUE(x)
#define SUNXI_ALRM_SET_HOUR_VALUE(x)
#define SUNXI_ALRM_SET_DAY_VALUE(x)

/*
 * Time unit conversions
 */
#define SEC_IN_MIN
#define SEC_IN_HOUR
#define SEC_IN_DAY

/*
 * The year parameter passed to the driver is usually an offset relative to
 * the year 1900. This macro is used to convert this offset to another one
 * relative to the minimum year allowed by the hardware.
 */
#define SUNXI_YEAR_OFF(x)

/*
 * min and max year are arbitrary set considering the limited range of the
 * hardware register field
 */
struct sunxi_rtc_data_year {};

static const struct sunxi_rtc_data_year data_year_param[] =;

struct sunxi_rtc_dev {};

static irqreturn_t sunxi_rtc_alarmirq(int irq, void *id)
{}

static void sunxi_rtc_setaie(unsigned int to, struct sunxi_rtc_dev *chip)
{}

static int sunxi_rtc_getalarm(struct device *dev, struct rtc_wkalrm *wkalrm)
{}

static int sunxi_rtc_gettime(struct device *dev, struct rtc_time *rtc_tm)
{}

static int sunxi_rtc_setalarm(struct device *dev, struct rtc_wkalrm *wkalrm)
{}

static int sunxi_rtc_wait(struct sunxi_rtc_dev *chip, int offset,
			  unsigned int mask, unsigned int ms_timeout)
{}

static int sunxi_rtc_settime(struct device *dev, struct rtc_time *rtc_tm)
{}

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

static const struct rtc_class_ops sunxi_rtc_ops =;

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

static int sunxi_rtc_probe(struct platform_device *pdev)
{}

static struct platform_driver sunxi_rtc_driver =;

module_platform_driver();

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