#include <linux/bcd.h>
#include <linux/bitfield.h>
#include <linux/clk.h>
#include <linux/completion.h>
#include <linux/interrupt.h>
#include <linux/ioctl.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/spinlock.h>
#include <linux/suspend.h>
#include <linux/time.h>
#include <linux/uaccess.h>
#define AT91_RTC_CR …
#define AT91_RTC_UPDTIM …
#define AT91_RTC_UPDCAL …
#define AT91_RTC_MR …
#define AT91_RTC_HRMOD …
#define AT91_RTC_NEGPPM …
#define AT91_RTC_CORRECTION …
#define AT91_RTC_HIGHPPM …
#define AT91_RTC_TIMR …
#define AT91_RTC_SEC …
#define AT91_RTC_MIN …
#define AT91_RTC_HOUR …
#define AT91_RTC_AMPM …
#define AT91_RTC_CALR …
#define AT91_RTC_CENT …
#define AT91_RTC_YEAR …
#define AT91_RTC_MONTH …
#define AT91_RTC_DAY …
#define AT91_RTC_DATE …
#define AT91_RTC_TIMALR …
#define AT91_RTC_SECEN …
#define AT91_RTC_MINEN …
#define AT91_RTC_HOUREN …
#define AT91_RTC_CALALR …
#define AT91_RTC_MTHEN …
#define AT91_RTC_DATEEN …
#define AT91_RTC_SR …
#define AT91_RTC_ACKUPD …
#define AT91_RTC_ALARM …
#define AT91_RTC_SECEV …
#define AT91_RTC_TIMEV …
#define AT91_RTC_CALEV …
#define AT91_RTC_SCCR …
#define AT91_RTC_IER …
#define AT91_RTC_IDR …
#define AT91_RTC_IMR …
#define AT91_RTC_VER …
#define AT91_RTC_NVTIM …
#define AT91_RTC_NVCAL …
#define AT91_RTC_NVTIMALR …
#define AT91_RTC_NVCALALR …
#define AT91_RTC_CORR_DIVIDEND …
#define AT91_RTC_CORR_LOW_RATIO …
#define at91_rtc_read(field) …
#define at91_rtc_write(field, val) …
struct at91_rtc_config { … };
static const struct at91_rtc_config *at91_rtc_config;
static DECLARE_COMPLETION(at91_rtc_updated);
static DECLARE_COMPLETION(at91_rtc_upd_rdy);
static void __iomem *at91_rtc_regs;
static int irq;
static DEFINE_SPINLOCK(at91_rtc_lock);
static u32 at91_rtc_shadow_imr;
static bool suspended;
static DEFINE_SPINLOCK(suspended_lock);
static unsigned long cached_events;
static u32 at91_rtc_imr;
static struct clk *sclk;
static void at91_rtc_write_ier(u32 mask)
{ … }
static void at91_rtc_write_idr(u32 mask)
{ … }
static u32 at91_rtc_read_imr(void)
{ … }
static void at91_rtc_decodetime(unsigned int timereg, unsigned int calreg,
struct rtc_time *tm)
{ … }
static int at91_rtc_readtime(struct device *dev, struct rtc_time *tm)
{ … }
static int at91_rtc_settime(struct device *dev, struct rtc_time *tm)
{ … }
static int at91_rtc_readalarm(struct device *dev, struct rtc_wkalrm *alrm)
{ … }
static int at91_rtc_setalarm(struct device *dev, struct rtc_wkalrm *alrm)
{ … }
static int at91_rtc_alarm_irq_enable(struct device *dev, unsigned int enabled)
{ … }
static int at91_rtc_readoffset(struct device *dev, long *offset)
{ … }
static int at91_rtc_setoffset(struct device *dev, long offset)
{ … }
static irqreturn_t at91_rtc_interrupt(int irq, void *dev_id)
{ … }
static const struct at91_rtc_config at91rm9200_config = …;
static const struct at91_rtc_config at91sam9x5_config = …;
static const struct at91_rtc_config sama5d4_config = …;
static const struct of_device_id at91_rtc_dt_ids[] = …;
MODULE_DEVICE_TABLE(of, at91_rtc_dt_ids);
static const struct rtc_class_ops at91_rtc_ops = …;
static const struct rtc_class_ops sama5d4_rtc_ops = …;
static int __init at91_rtc_probe(struct platform_device *pdev)
{ … }
static void __exit at91_rtc_remove(struct platform_device *pdev)
{ … }
static void at91_rtc_shutdown(struct platform_device *pdev)
{ … }
#ifdef CONFIG_PM_SLEEP
static int at91_rtc_suspend(struct device *dev)
{ … }
static int at91_rtc_resume(struct device *dev)
{ … }
#endif
static SIMPLE_DEV_PM_OPS(at91_rtc_pm_ops, at91_rtc_suspend, at91_rtc_resume);
static struct platform_driver at91_rtc_driver __refdata = …;
module_platform_driver_probe(…);
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;
MODULE_ALIAS(…) …;