linux/drivers/rtc/rtc-rx8025.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * Driver for Epson's RTC module RX-8025 SA/NB
 *
 * Copyright (C) 2009 Wolfgang Grandegger <[email protected]>
 *
 * Copyright (C) 2005 by Digi International Inc.
 * All rights reserved.
 *
 * Modified by fengjh at rising.com.cn
 * <[email protected]>
 * 2006.11
 *
 * Code cleanup by Sergei Poselenov, <[email protected]>
 * Converted to new style by Wolfgang Grandegger <[email protected]>
 * Alarm and periodic interrupt added by Dmitry Rakhchev <[email protected]>
 */
#include <linux/bcd.h>
#include <linux/bitops.h>
#include <linux/i2c.h>
#include <linux/kernel.h>
#include <linux/kstrtox.h>
#include <linux/module.h>
#include <linux/rtc.h>

/* Register definitions */
#define RX8025_REG_SEC
#define RX8025_REG_MIN
#define RX8025_REG_HOUR
#define RX8025_REG_WDAY
#define RX8025_REG_MDAY
#define RX8025_REG_MONTH
#define RX8025_REG_YEAR
#define RX8025_REG_DIGOFF
#define RX8025_REG_ALWMIN
#define RX8025_REG_ALWHOUR
#define RX8025_REG_ALWWDAY
#define RX8025_REG_ALDMIN
#define RX8025_REG_ALDHOUR
/* 0x0d is reserved */
#define RX8025_REG_CTRL1
#define RX8025_REG_CTRL2

#define RX8025_BIT_CTRL1_CT
/* 1 Hz periodic level irq */
#define RX8025_BIT_CTRL1_CT_1HZ
#define RX8025_BIT_CTRL1_TEST
#define RX8025_BIT_CTRL1_1224
#define RX8025_BIT_CTRL1_DALE
#define RX8025_BIT_CTRL1_WALE

#define RX8025_BIT_CTRL2_DAFG
#define RX8025_BIT_CTRL2_WAFG
#define RX8025_BIT_CTRL2_CTFG
#define RX8025_BIT_CTRL2_PON
#define RX8025_BIT_CTRL2_XST
#define RX8025_BIT_CTRL2_VDET

#define RX8035_BIT_HOUR_1224

/* Clock precision adjustment */
#define RX8025_ADJ_RESOLUTION
#define RX8025_ADJ_DATA_MAX
#define RX8025_ADJ_DATA_MIN

enum rx_model {};

static const struct i2c_device_id rx8025_id[] =;
MODULE_DEVICE_TABLE(i2c, rx8025_id);

struct rx8025_data {};

static s32 rx8025_read_reg(const struct i2c_client *client, u8 number)
{}

static int rx8025_read_regs(const struct i2c_client *client,
			    u8 number, u8 length, u8 *values)
{}

static s32 rx8025_write_reg(const struct i2c_client *client, u8 number,
			    u8 value)
{}

static s32 rx8025_write_regs(const struct i2c_client *client,
			     u8 number, u8 length, const u8 *values)
{}

static int rx8025_is_osc_stopped(enum rx_model model, int ctrl2)
{}

static int rx8025_check_validity(struct device *dev)
{}

static int rx8025_reset_validity(struct i2c_client *client)
{}

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

static int rx8025_get_time(struct device *dev, struct rtc_time *dt)
{}

static int rx8025_set_time(struct device *dev, struct rtc_time *dt)
{}

static int rx8025_init_client(struct i2c_client *client)
{}

/* Alarm support */
static int rx8025_read_alarm(struct device *dev, struct rtc_wkalrm *t)
{}

static int rx8025_set_alarm(struct device *dev, struct rtc_wkalrm *t)
{}

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

/*
 * According to the RX8025 SA/NB application manual the frequency and
 * temperature characteristics can be approximated using the following
 * equation:
 *
 *   df = a * (ut - t)**2
 *
 *   df: Frequency deviation in any temperature
 *   a : Coefficient = (-35 +-5) * 10**-9
 *   ut: Ultimate temperature in degree = +25 +-5 degree
 *   t : Any temperature in degree
 */
static int rx8025_read_offset(struct device *dev, long *offset)
{}

static int rx8025_set_offset(struct device *dev, long offset)
{}

static const struct rtc_class_ops rx8025_rtc_ops =;

static ssize_t rx8025_sysfs_show_clock_adjust(struct device *dev,
					      struct device_attribute *attr,
					      char *buf)
{}

static ssize_t rx8025_sysfs_store_clock_adjust(struct device *dev,
					       struct device_attribute *attr,
					       const char *buf, size_t count)
{}

static DEVICE_ATTR(clock_adjust_ppb, S_IRUGO | S_IWUSR,
		   rx8025_sysfs_show_clock_adjust,
		   rx8025_sysfs_store_clock_adjust);

static struct attribute *rx8025_attrs[] =;

static const struct attribute_group rx8025_attr_group =;

static int rx8025_probe(struct i2c_client *client)
{}

static struct i2c_driver rx8025_driver =;

module_i2c_driver();

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