linux/drivers/hwmon/max1619.c

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 * max1619.c - Part of lm_sensors, Linux kernel modules for hardware
 *             monitoring
 * Copyright (C) 2003-2004 Oleksij Rempel <[email protected]>
 *                         Jean Delvare <[email protected]>
 *
 * Based on the lm90 driver. The MAX1619 is a sensor chip made by Maxim.
 * It reports up to two temperatures (its own plus up to
 * one external one). Complete datasheet can be
 * obtained from Maxim's website at:
 *   http://pdfserv.maxim-ic.com/en/ds/MAX1619.pdf
 */

#include <linux/module.h>
#include <linux/init.h>
#include <linux/slab.h>
#include <linux/jiffies.h>
#include <linux/i2c.h>
#include <linux/hwmon.h>
#include <linux/hwmon-sysfs.h>
#include <linux/err.h>
#include <linux/mutex.h>
#include <linux/sysfs.h>

static const unsigned short normal_i2c[] =;

/*
 * The MAX1619 registers
 */

#define MAX1619_REG_R_MAN_ID
#define MAX1619_REG_R_CHIP_ID
#define MAX1619_REG_R_CONFIG
#define MAX1619_REG_W_CONFIG
#define MAX1619_REG_R_CONVRATE
#define MAX1619_REG_W_CONVRATE
#define MAX1619_REG_R_STATUS
#define MAX1619_REG_R_LOCAL_TEMP
#define MAX1619_REG_R_REMOTE_TEMP
#define MAX1619_REG_R_REMOTE_HIGH
#define MAX1619_REG_W_REMOTE_HIGH
#define MAX1619_REG_R_REMOTE_LOW
#define MAX1619_REG_W_REMOTE_LOW
#define MAX1619_REG_R_REMOTE_CRIT
#define MAX1619_REG_W_REMOTE_CRIT
#define MAX1619_REG_R_TCRIT_HYST
#define MAX1619_REG_W_TCRIT_HYST

/*
 * Conversions
 */

static int temp_from_reg(int val)
{}

static int temp_to_reg(int val)
{}

enum temp_index {};

/*
 * Client data (each client gets its own)
 */

struct max1619_data {};

static const u8 regs_read[t_num_regs] =;

static const u8 regs_write[t_num_regs] =;

static struct max1619_data *max1619_update_device(struct device *dev)
{}

/*
 * Sysfs stuff
 */

static ssize_t temp_show(struct device *dev, struct device_attribute *devattr,
			 char *buf)
{}

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

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

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

static SENSOR_DEVICE_ATTR_RO(temp1_input, temp, t_input1);
static SENSOR_DEVICE_ATTR_RO(temp2_input, temp, t_input2);
static SENSOR_DEVICE_ATTR_RW(temp2_min, temp, t_low2);
static SENSOR_DEVICE_ATTR_RW(temp2_max, temp, t_high2);
static SENSOR_DEVICE_ATTR_RW(temp2_crit, temp, t_crit2);
static SENSOR_DEVICE_ATTR_RW(temp2_crit_hyst, temp, t_hyst2);

static DEVICE_ATTR_RO(alarms);
static SENSOR_DEVICE_ATTR_RO(temp2_crit_alarm, alarm, 1);
static SENSOR_DEVICE_ATTR_RO(temp2_fault, alarm, 2);
static SENSOR_DEVICE_ATTR_RO(temp2_min_alarm, alarm, 3);
static SENSOR_DEVICE_ATTR_RO(temp2_max_alarm, alarm, 4);

static struct attribute *max1619_attrs[] =;
ATTRIBUTE_GROUPS();

/* Return 0 if detection is successful, -ENODEV otherwise */
static int max1619_detect(struct i2c_client *client,
			  struct i2c_board_info *info)
{}

static void max1619_init_client(struct i2c_client *client)
{}

static int max1619_probe(struct i2c_client *new_client)
{}

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

#ifdef CONFIG_OF
static const struct of_device_id max1619_of_match[] =;

MODULE_DEVICE_TABLE(of, max1619_of_match);
#endif

static struct i2c_driver max1619_driver =;

module_i2c_driver();

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