linux/drivers/rtc/rtc-ab-eoz9.c

// SPDX-License-Identifier: GPL-2.0
/*
 * Real Time Clock driver for AB-RTCMC-32.768kHz-EOZ9 chip.
 * Copyright (C) 2019 Orolia
 *
 */

#include <linux/module.h>
#include <linux/rtc.h>
#include <linux/i2c.h>
#include <linux/bcd.h>
#include <linux/of.h>
#include <linux/regmap.h>
#include <linux/bitfield.h>
#include <linux/hwmon.h>
#include <linux/hwmon-sysfs.h>

#define ABEOZ9_REG_CTRL1
#define ABEOZ9_REG_CTRL1_MASK
#define ABEOZ9_REG_CTRL1_WE
#define ABEOZ9_REG_CTRL1_TE
#define ABEOZ9_REG_CTRL1_TAR
#define ABEOZ9_REG_CTRL1_EERE
#define ABEOZ9_REG_CTRL1_SRON
#define ABEOZ9_REG_CTRL1_TD0
#define ABEOZ9_REG_CTRL1_TD1
#define ABEOZ9_REG_CTRL1_CLKINT

#define ABEOZ9_REG_CTRL_INT
#define ABEOZ9_REG_CTRL_INT_AIE
#define ABEOZ9_REG_CTRL_INT_TIE
#define ABEOZ9_REG_CTRL_INT_V1IE
#define ABEOZ9_REG_CTRL_INT_V2IE
#define ABEOZ9_REG_CTRL_INT_SRIE

#define ABEOZ9_REG_CTRL_INT_FLAG
#define ABEOZ9_REG_CTRL_INT_FLAG_AF
#define ABEOZ9_REG_CTRL_INT_FLAG_TF
#define ABEOZ9_REG_CTRL_INT_FLAG_V1IF
#define ABEOZ9_REG_CTRL_INT_FLAG_V2IF
#define ABEOZ9_REG_CTRL_INT_FLAG_SRF

#define ABEOZ9_REG_CTRL_STATUS
#define ABEOZ9_REG_CTRL_STATUS_V1F
#define ABEOZ9_REG_CTRL_STATUS_V2F
#define ABEOZ9_REG_CTRL_STATUS_SR
#define ABEOZ9_REG_CTRL_STATUS_PON
#define ABEOZ9_REG_CTRL_STATUS_EEBUSY

#define ABEOZ9_REG_SEC
#define ABEOZ9_REG_MIN
#define ABEOZ9_REG_HOURS
#define ABEOZ9_HOURS_PM
#define ABEOZ9_REG_DAYS
#define ABEOZ9_REG_WEEKDAYS
#define ABEOZ9_REG_MONTHS
#define ABEOZ9_REG_YEARS

#define ABEOZ9_SEC_LEN

#define ABEOZ9_REG_ALARM_SEC
#define ABEOZ9_BIT_ALARM_SEC
#define ABEOZ9_REG_ALARM_MIN
#define ABEOZ9_BIT_ALARM_MIN
#define ABEOZ9_REG_ALARM_HOURS
#define ABEOZ9_BIT_ALARM_HOURS_PM
#define ABEOZ9_BIT_ALARM_HOURS
#define ABEOZ9_REG_ALARM_DAYS
#define ABEOZ9_BIT_ALARM_DAYS
#define ABEOZ9_REG_ALARM_WEEKDAYS
#define ABEOZ9_BIT_ALARM_WEEKDAYS
#define ABEOZ9_REG_ALARM_MONTHS
#define ABEOZ9_BIT_ALARM_MONTHS
#define ABEOZ9_REG_ALARM_YEARS

#define ABEOZ9_ALARM_LEN
#define ABEOZ9_BIT_ALARM_AE

#define ABEOZ9_REG_REG_TEMP
#define ABEOZ953_TEMP_MAX
#define ABEOZ953_TEMP_MIN

#define ABEOZ9_REG_EEPROM
#define ABEOZ9_REG_EEPROM_MASK
#define ABEOZ9_REG_EEPROM_THP
#define ABEOZ9_REG_EEPROM_THE
#define ABEOZ9_REG_EEPROM_FD0
#define ABEOZ9_REG_EEPROM_FD1
#define ABEOZ9_REG_EEPROM_R1K
#define ABEOZ9_REG_EEPROM_R5K
#define ABEOZ9_REG_EEPROM_R20K
#define ABEOZ9_REG_EEPROM_R80K

struct abeoz9_rtc_data {};

static int abeoz9_check_validity(struct device *dev)
{}

static int abeoz9_reset_validity(struct regmap *regmap)
{}

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

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

static int abeoz9_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alarm)
{}

static int abeoz9_rtc_alarm_irq_enable(struct device *dev, u32 enable)
{}

static int abeoz9_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alarm)
{}

static irqreturn_t abeoz9_rtc_irq(int irq, void *dev)
{}

static int abeoz9_trickle_parse_dt(struct device_node *node)
{}

static int abeoz9_rtc_setup(struct device *dev, struct device_node *node)
{}

static const struct rtc_class_ops rtc_ops =;

static const struct regmap_config abeoz9_rtc_regmap_config =;

#if IS_REACHABLE(CONFIG_HWMON)

static int abeoz9z3_temp_read(struct device *dev,
			      enum hwmon_sensor_types type,
			      u32 attr, int channel, long *temp)
{}

static umode_t abeoz9_is_visible(const void *data,
				 enum hwmon_sensor_types type,
				 u32 attr, int channel)
{}

static const u32 abeoz9_chip_config[] =;

static const struct hwmon_channel_info abeoz9_chip =;

static const u32 abeoz9_temp_config[] =;

static const struct hwmon_channel_info abeoz9_temp =;

static const struct hwmon_channel_info * const abeoz9_info[] =;

static const struct hwmon_ops abeoz9_hwmon_ops =;

static const struct hwmon_chip_info abeoz9_chip_info =;

static void abeoz9_hwmon_register(struct device *dev,
				  struct abeoz9_rtc_data *data)
{}

#else

static void abeoz9_hwmon_register(struct device *dev,
				  struct abeoz9_rtc_data *data)
{
}

#endif

static int abeoz9_probe(struct i2c_client *client)
{}

#ifdef CONFIG_OF
static const struct of_device_id abeoz9_dt_match[] =;
MODULE_DEVICE_TABLE(of, abeoz9_dt_match);
#endif

static const struct i2c_device_id abeoz9_id[] =;

static struct i2c_driver abeoz9_driver =;

module_i2c_driver();

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