linux/drivers/rtc/rtc-isl12022.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * An I2C driver for the Intersil ISL 12022
 *
 * Author: Roman Fietze <[email protected]>
 *
 * Based on the Philips PCF8563 RTC
 * by Alessandro Zummo <[email protected]>.
 */

#include <linux/bcd.h>
#include <linux/bitfield.h>
#include <linux/clk-provider.h>
#include <linux/err.h>
#include <linux/hwmon.h>
#include <linux/i2c.h>
#include <linux/module.h>
#include <linux/regmap.h>
#include <linux/rtc.h>
#include <linux/slab.h>

#include <asm/byteorder.h>

/* ISL register offsets */
#define ISL12022_REG_SC
#define ISL12022_REG_MN
#define ISL12022_REG_HR
#define ISL12022_REG_DT
#define ISL12022_REG_MO
#define ISL12022_REG_YR
#define ISL12022_REG_DW

#define ISL12022_REG_SR
#define ISL12022_REG_INT

#define ISL12022_REG_PWR_VBAT

#define ISL12022_REG_BETA
#define ISL12022_REG_TEMP_L

/* ISL register bits */
#define ISL12022_HR_MIL

#define ISL12022_SR_LBAT85
#define ISL12022_SR_LBAT75

#define ISL12022_INT_WRTC
#define ISL12022_INT_FO_MASK
#define ISL12022_INT_FO_OFF
#define ISL12022_INT_FO_32K

#define ISL12022_REG_VB85_MASK
#define ISL12022_REG_VB75_MASK

#define ISL12022_BETA_TSE

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

/*
 * A user-initiated temperature conversion is not started by this function,
 * so the temperature is updated once every ~60 seconds.
 */
static int isl12022_hwmon_read_temp(struct device *dev, long *mC)
{}

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

static const struct hwmon_channel_info * const isl12022_hwmon_info[] =;

static const struct hwmon_ops isl12022_hwmon_ops =;

static const struct hwmon_chip_info isl12022_hwmon_chip_info =;

static void isl12022_hwmon_register(struct device *dev)
{}

/*
 * In the routines that deal directly with the isl12022 hardware, we use
 * rtc_time -- month 0-11, hour 0-23, yr = calendar year-epoch.
 */
static int isl12022_rtc_read_time(struct device *dev, struct rtc_time *tm)
{}

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

static int isl12022_rtc_ioctl(struct device *dev, unsigned int cmd, unsigned long arg)
{}

static const struct rtc_class_ops isl12022_rtc_ops =;

static const struct regmap_config regmap_config =;

static int isl12022_register_clock(struct device *dev)
{}

static const u32 trip_levels[2][7] =;

static void isl12022_set_trip_levels(struct device *dev)
{}

static int isl12022_probe(struct i2c_client *client)
{}

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

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

static struct i2c_driver isl12022_driver =;

module_i2c_driver();

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