linux/drivers/rtc/rtc-spear.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * drivers/rtc/rtc-spear.c
 *
 * Copyright (C) 2010 ST Microelectronics
 * Rajeev Kumar<[email protected]>
 */

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

/* RTC registers */
#define TIME_REG
#define DATE_REG
#define ALARM_TIME_REG
#define ALARM_DATE_REG
#define CTRL_REG
#define STATUS_REG

/* TIME_REG & ALARM_TIME_REG */
#define SECONDS_UNITS
#define SECONDS_TENS
#define MINUTES_UNITS
#define MINUTES_TENS
#define HOURS_UNITS
#define HOURS_TENS

/* DATE_REG & ALARM_DATE_REG */
#define DAYS_UNITS
#define DAYS_TENS
#define MONTHS_UNITS
#define MONTHS_TENS
#define YEARS_UNITS
#define YEARS_TENS
#define YEARS_HUNDREDS
#define YEARS_MILLENIUMS

/* MASK SHIFT TIME_REG & ALARM_TIME_REG*/
#define SECOND_SHIFT
#define MINUTE_SHIFT
#define HOUR_SHIFT
#define MDAY_SHIFT
#define MONTH_SHIFT
#define YEAR_SHIFT

#define SECOND_MASK
#define MIN_MASK
#define HOUR_MASK
#define DAY_MASK
#define MONTH_MASK
#define YEAR_MASK

/* date reg equal to time reg, for debug only */
#define TIME_BYP
#define INT_ENABLE

/* STATUS_REG */
#define CLK_UNCONNECTED
#define PEND_WR_TIME
#define PEND_WR_DATE
#define LOST_WR_TIME
#define LOST_WR_DATE
#define RTC_INT_MASK
#define STATUS_BUSY
#define STATUS_FAIL

struct spear_rtc_config {};

static inline void spear_rtc_clear_interrupt(struct spear_rtc_config *config)
{}

static inline void spear_rtc_enable_interrupt(struct spear_rtc_config *config)
{}

static inline void spear_rtc_disable_interrupt(struct spear_rtc_config *config)
{}

static inline int is_write_complete(struct spear_rtc_config *config)
{}

static void rtc_wait_not_busy(struct spear_rtc_config *config)
{}

static irqreturn_t spear_rtc_irq(int irq, void *dev_id)
{}

static void tm2bcd(struct rtc_time *tm)
{}

static void bcd2tm(struct rtc_time *tm)
{}

/*
 * spear_rtc_read_time - set the time
 * @dev: rtc device in use
 * @tm: holds date and time
 *
 * This function read time and date. On success it will return 0
 * otherwise -ve error is returned.
 */
static int spear_rtc_read_time(struct device *dev, struct rtc_time *tm)
{}

/*
 * spear_rtc_set_time - set the time
 * @dev: rtc device in use
 * @tm: holds date and time
 *
 * This function set time and date. On success it will return 0
 * otherwise -ve error is returned.
 */
static int spear_rtc_set_time(struct device *dev, struct rtc_time *tm)
{}

/*
 * spear_rtc_read_alarm - read the alarm time
 * @dev: rtc device in use
 * @alm: holds alarm date and time
 *
 * This function read alarm time and date. On success it will return 0
 * otherwise -ve error is returned.
 */
static int spear_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alm)
{}

/*
 * spear_rtc_set_alarm - set the alarm time
 * @dev: rtc device in use
 * @alm: holds alarm date and time
 *
 * This function set alarm time and date. On success it will return 0
 * otherwise -ve error is returned.
 */
static int spear_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alm)
{}

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

static const struct rtc_class_ops spear_rtc_ops =;

static int spear_rtc_probe(struct platform_device *pdev)
{}

static void spear_rtc_remove(struct platform_device *pdev)
{}

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

static int spear_rtc_resume(struct device *dev)
{}
#endif

static SIMPLE_DEV_PM_OPS(spear_rtc_pm_ops, spear_rtc_suspend, spear_rtc_resume);

static void spear_rtc_shutdown(struct platform_device *pdev)
{}

#ifdef CONFIG_OF
static const struct of_device_id spear_rtc_id_table[] =;
MODULE_DEVICE_TABLE(of, spear_rtc_id_table);
#endif

static struct platform_driver spear_rtc_driver =;

module_platform_driver();

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