linux/drivers/rtc/rtc-twl.c

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 * rtc-twl.c -- TWL Real Time Clock interface
 *
 * Copyright (C) 2007 MontaVista Software, Inc
 * Author: Alexandre Rusev <[email protected]>
 *
 * Based on original TI driver twl4030-rtc.c
 *   Copyright (C) 2006 Texas Instruments, Inc.
 *
 * Based on rtc-omap.c
 *   Copyright (C) 2003 MontaVista Software, Inc.
 *   Author: George G. Davis <[email protected]> or <[email protected]>
 *   Copyright (C) 2006 David Brownell
 */

#define pr_fmt(fmt)

#include <linux/kernel.h>
#include <linux/errno.h>
#include <linux/init.h>
#include <linux/module.h>
#include <linux/types.h>
#include <linux/rtc.h>
#include <linux/bcd.h>
#include <linux/platform_device.h>
#include <linux/interrupt.h>
#include <linux/of.h>

#include <linux/mfd/twl.h>

enum twl_class {};

/*
 * RTC block register offsets (use TWL_MODULE_RTC)
 */
enum {};
static const u8 twl4030_rtc_reg_map[] =;
static const u8 twl6030_rtc_reg_map[] =;

/* RTC_CTRL_REG bitfields */
#define BIT_RTC_CTRL_REG_STOP_RTC_M
#define BIT_RTC_CTRL_REG_ROUND_30S_M
#define BIT_RTC_CTRL_REG_AUTO_COMP_M
#define BIT_RTC_CTRL_REG_MODE_12_24_M
#define BIT_RTC_CTRL_REG_TEST_MODE_M
#define BIT_RTC_CTRL_REG_SET_32_COUNTER_M
#define BIT_RTC_CTRL_REG_GET_TIME_M
#define BIT_RTC_CTRL_REG_RTC_V_OPT

/* RTC_STATUS_REG bitfields */
#define BIT_RTC_STATUS_REG_RUN_M
#define BIT_RTC_STATUS_REG_1S_EVENT_M
#define BIT_RTC_STATUS_REG_1M_EVENT_M
#define BIT_RTC_STATUS_REG_1H_EVENT_M
#define BIT_RTC_STATUS_REG_1D_EVENT_M
#define BIT_RTC_STATUS_REG_ALARM_M
#define BIT_RTC_STATUS_REG_POWER_UP_M

/* RTC_INTERRUPTS_REG bitfields */
#define BIT_RTC_INTERRUPTS_REG_EVERY_M
#define BIT_RTC_INTERRUPTS_REG_IT_TIMER_M
#define BIT_RTC_INTERRUPTS_REG_IT_ALARM_M


/* REG_SECONDS_REG through REG_YEARS_REG is how many registers? */
#define ALL_TIME_REGS

/*----------------------------------------------------------------------*/
struct twl_rtc {};

/*
 * Supports 1 byte read from TWL RTC register.
 */
static int twl_rtc_read_u8(struct twl_rtc *twl_rtc, u8 *data, u8 reg)
{}

/*
 * Supports 1 byte write to TWL RTC registers.
 */
static int twl_rtc_write_u8(struct twl_rtc *twl_rtc, u8 data, u8 reg)
{}

/*
 * Enable 1/second update and/or alarm interrupts.
 */
static int set_rtc_irq_bit(struct twl_rtc *twl_rtc, unsigned char bit)
{}

/*
 * Disable update and/or alarm interrupts.
 */
static int mask_rtc_irq_bit(struct twl_rtc *twl_rtc, unsigned char bit)
{}

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

/*
 * Gets current TWL RTC time and date parameters.
 *
 * The RTC's time/alarm representation is not what gmtime(3) requires
 * Linux to use:
 *
 *  - Months are 1..12 vs Linux 0-11
 *  - Years are 0..99 vs Linux 1900..N (we assume 21st century)
 */
static int twl_rtc_read_time(struct device *dev, struct rtc_time *tm)
{}

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

/*
 * Gets current TWL RTC alarm time.
 */
static int twl_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alm)
{}

static int twl_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alm)
{}

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

static const struct rtc_class_ops twl_rtc_ops =;

static int twl_nvram_read(void *priv, unsigned int offset, void *val,
			  size_t bytes)
{}

static int twl_nvram_write(void *priv, unsigned int offset, void *val,
			   size_t bytes)
{}

/*----------------------------------------------------------------------*/

static int twl_rtc_probe(struct platform_device *pdev)
{}

/*
 * Disable all TWL RTC module interrupts.
 * Sets status flag to free.
 */
static void twl_rtc_remove(struct platform_device *pdev)
{}

static void twl_rtc_shutdown(struct platform_device *pdev)
{}

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

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

static SIMPLE_DEV_PM_OPS(twl_rtc_pm_ops, twl_rtc_suspend, twl_rtc_resume);

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

static struct platform_driver twl4030rtc_driver =;

module_platform_driver();

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