linux/drivers/rtc/rtc-wm831x.c

// SPDX-License-Identifier: GPL-2.0+
/*
 *	Real Time Clock driver for Wolfson Microelectronics WM831x
 *
 *	Copyright (C) 2009 Wolfson Microelectronics PLC.
 *
 *  Author: Mark Brown <[email protected]>
 *
 */

#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/time.h>
#include <linux/rtc.h>
#include <linux/slab.h>
#include <linux/bcd.h>
#include <linux/interrupt.h>
#include <linux/ioctl.h>
#include <linux/completion.h>
#include <linux/mfd/wm831x/core.h>
#include <linux/delay.h>
#include <linux/platform_device.h>
#include <linux/random.h>

/*
 * R16416 (0x4020) - RTC Write Counter
 */
#define WM831X_RTC_WR_CNT_MASK
#define WM831X_RTC_WR_CNT_SHIFT
#define WM831X_RTC_WR_CNT_WIDTH

/*
 * R16417 (0x4021) - RTC Time 1
 */
#define WM831X_RTC_TIME_MASK
#define WM831X_RTC_TIME_SHIFT
#define WM831X_RTC_TIME_WIDTH

/*
 * R16418 (0x4022) - RTC Time 2
 */
#define WM831X_RTC_TIME_MASK
#define WM831X_RTC_TIME_SHIFT
#define WM831X_RTC_TIME_WIDTH

/*
 * R16419 (0x4023) - RTC Alarm 1
 */
#define WM831X_RTC_ALM_MASK
#define WM831X_RTC_ALM_SHIFT
#define WM831X_RTC_ALM_WIDTH

/*
 * R16420 (0x4024) - RTC Alarm 2
 */
#define WM831X_RTC_ALM_MASK
#define WM831X_RTC_ALM_SHIFT
#define WM831X_RTC_ALM_WIDTH

/*
 * R16421 (0x4025) - RTC Control
 */
#define WM831X_RTC_VALID
#define WM831X_RTC_VALID_MASK
#define WM831X_RTC_VALID_SHIFT
#define WM831X_RTC_VALID_WIDTH
#define WM831X_RTC_SYNC_BUSY
#define WM831X_RTC_SYNC_BUSY_MASK
#define WM831X_RTC_SYNC_BUSY_SHIFT
#define WM831X_RTC_SYNC_BUSY_WIDTH
#define WM831X_RTC_ALM_ENA
#define WM831X_RTC_ALM_ENA_MASK
#define WM831X_RTC_ALM_ENA_SHIFT
#define WM831X_RTC_ALM_ENA_WIDTH
#define WM831X_RTC_PINT_FREQ_MASK
#define WM831X_RTC_PINT_FREQ_SHIFT
#define WM831X_RTC_PINT_FREQ_WIDTH

/*
 * R16422 (0x4026) - RTC Trim
 */
#define WM831X_RTC_TRIM_MASK
#define WM831X_RTC_TRIM_SHIFT
#define WM831X_RTC_TRIM_WIDTH

#define WM831X_SET_TIME_RETRIES
#define WM831X_GET_TIME_RETRIES

struct wm831x_rtc {};

static void wm831x_rtc_add_randomness(struct wm831x *wm831x)
{}

/*
 * Read current time and date in RTC
 */
static int wm831x_rtc_readtime(struct device *dev, struct rtc_time *tm)
{}

/*
 * Set current time and date in RTC
 */
static int wm831x_rtc_settime(struct device *dev, struct rtc_time *tm)
{}

/*
 * Read alarm time and date in RTC
 */
static int wm831x_rtc_readalarm(struct device *dev, struct rtc_wkalrm *alrm)
{}

static int wm831x_rtc_stop_alarm(struct wm831x_rtc *wm831x_rtc)
{}

static int wm831x_rtc_start_alarm(struct wm831x_rtc *wm831x_rtc)
{}

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

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

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

static const struct rtc_class_ops wm831x_rtc_ops =;

#ifdef CONFIG_PM
/* Turn off the alarm if it should not be a wake source. */
static int wm831x_rtc_suspend(struct device *dev)
{}

/* Enable the alarm if it should be enabled (in case it was disabled to
 * prevent use as a wake source).
 */
static int wm831x_rtc_resume(struct device *dev)
{}

/* Unconditionally disable the alarm */
static int wm831x_rtc_freeze(struct device *dev)
{}
#else
#define wm831x_rtc_suspend
#define wm831x_rtc_resume
#define wm831x_rtc_freeze
#endif

static int wm831x_rtc_probe(struct platform_device *pdev)
{}

static const struct dev_pm_ops wm831x_rtc_pm_ops =;

static struct platform_driver wm831x_rtc_driver =;

module_platform_driver();

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