linux/drivers/rtc/rtc-s5m.c

// SPDX-License-Identifier: GPL-2.0+
//
// Copyright (c) 2013-2014 Samsung Electronics Co., Ltd
//	http://www.samsung.com
//
//  Copyright (C) 2013 Google, Inc

#define pr_fmt(fmt)

#include <linux/module.h>
#include <linux/i2c.h>
#include <linux/bcd.h>
#include <linux/regmap.h>
#include <linux/rtc.h>
#include <linux/platform_device.h>
#include <linux/mfd/samsung/core.h>
#include <linux/mfd/samsung/irq.h>
#include <linux/mfd/samsung/rtc.h>
#include <linux/mfd/samsung/s2mps14.h>

/*
 * Maximum number of retries for checking changes in UDR field
 * of S5M_RTC_UDR_CON register (to limit possible endless loop).
 *
 * After writing to RTC registers (setting time or alarm) read the UDR field
 * in S5M_RTC_UDR_CON register. UDR is auto-cleared when data have
 * been transferred.
 */
#define UDR_READ_RETRY_CNT

enum {};

/*
 * Registers used by the driver which are different between chipsets.
 *
 * Operations like read time and write alarm/time require updating
 * specific fields in UDR register. These fields usually are auto-cleared
 * (with some exceptions).
 *
 * Table of operations per device:
 *
 * Device     | Write time | Read time | Write alarm
 * =================================================
 * S5M8767    | UDR + TIME |           | UDR
 * S2MPS11/14 | WUDR       | RUDR      | WUDR + RUDR
 * S2MPS13    | WUDR       | RUDR      | WUDR + AUDR
 * S2MPS15    | WUDR       | RUDR      | AUDR
 */
struct s5m_rtc_reg_config {};

/* Register map for S5M8767 */
static const struct s5m_rtc_reg_config s5m_rtc_regs =;

/* Register map for S2MPS13 */
static const struct s5m_rtc_reg_config s2mps13_rtc_regs =;

/* Register map for S2MPS11/14 */
static const struct s5m_rtc_reg_config s2mps14_rtc_regs =;

/*
 * Register map for S2MPS15 - in comparison to S2MPS14 the WUDR and AUDR bits
 * are swapped.
 */
static const struct s5m_rtc_reg_config s2mps15_rtc_regs =;

struct s5m_rtc_info {};

static const struct regmap_config s5m_rtc_regmap_config =;

static const struct regmap_config s2mps14_rtc_regmap_config =;

static void s5m8767_data_to_tm(u8 *data, struct rtc_time *tm,
			       int rtc_24hr_mode)
{}

static int s5m8767_tm_to_data(struct rtc_time *tm, u8 *data)
{}

/*
 * Read RTC_UDR_CON register and wait till UDR field is cleared.
 * This indicates that time/alarm update ended.
 */
static int s5m8767_wait_for_udr_update(struct s5m_rtc_info *info)
{}

static int s5m_check_peding_alarm_interrupt(struct s5m_rtc_info *info,
		struct rtc_wkalrm *alarm)
{}

static int s5m8767_rtc_set_time_reg(struct s5m_rtc_info *info)
{}

static int s5m8767_rtc_set_alarm_reg(struct s5m_rtc_info *info)
{}

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

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

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

static int s5m_rtc_stop_alarm(struct s5m_rtc_info *info)
{}

static int s5m_rtc_start_alarm(struct s5m_rtc_info *info)
{}

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

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

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

static const struct rtc_class_ops s5m_rtc_ops =;

static int s5m8767_rtc_init_reg(struct s5m_rtc_info *info)
{}

static int s5m_rtc_probe(struct platform_device *pdev)
{}

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

static int s5m_rtc_suspend(struct device *dev)
{}
#endif /* CONFIG_PM_SLEEP */

static SIMPLE_DEV_PM_OPS(s5m_rtc_pm_ops, s5m_rtc_suspend, s5m_rtc_resume);

static const struct platform_device_id s5m_rtc_id[] =;
MODULE_DEVICE_TABLE(platform, s5m_rtc_id);

static struct platform_driver s5m_rtc_driver =;

module_platform_driver();

/* Module information */
MODULE_AUTHOR();
MODULE_DESCRIPTION();
MODULE_LICENSE();