linux/drivers/hwmon/max6620.c

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 * Hardware monitoring driver for Maxim MAX6620
 *
 * Originally from L. Grunenberg.
 * (C) 2012 by L. Grunenberg <[email protected]>
 *
 * Copyright (c) 2021 Dell Inc. or its subsidiaries. All Rights Reserved.
 *
 * based on code written by :
 * 2007 by Hans J. Koch <[email protected]>
 * John Morris <[email protected]>
 * Copyright (c) 2003 Spirent Communications
 * and Claus Gindhart <[email protected]>
 *
 * This module has only been tested with the MAX6620 chip.
 *
 * The datasheet was last seen at:
 *
 *        http://pdfserv.maxim-ic.com/en/ds/MAX6620.pdf
 *
 */

#include <linux/bits.h>
#include <linux/err.h>
#include <linux/hwmon.h>
#include <linux/i2c.h>
#include <linux/init.h>
#include <linux/jiffies.h>
#include <linux/module.h>
#include <linux/slab.h>

/*
 * MAX 6620 registers
 */

#define MAX6620_REG_CONFIG
#define MAX6620_REG_FAULT
#define MAX6620_REG_CONF_FAN0
#define MAX6620_REG_CONF_FAN1
#define MAX6620_REG_CONF_FAN2
#define MAX6620_REG_CONF_FAN3
#define MAX6620_REG_DYN_FAN0
#define MAX6620_REG_DYN_FAN1
#define MAX6620_REG_DYN_FAN2
#define MAX6620_REG_DYN_FAN3
#define MAX6620_REG_TACH0
#define MAX6620_REG_TACH1
#define MAX6620_REG_TACH2
#define MAX6620_REG_TACH3
#define MAX6620_REG_VOLT0
#define MAX6620_REG_VOLT1
#define MAX6620_REG_VOLT2
#define MAX6620_REG_VOLT3
#define MAX6620_REG_TAR0
#define MAX6620_REG_TAR1
#define MAX6620_REG_TAR2
#define MAX6620_REG_TAR3
#define MAX6620_REG_DAC0
#define MAX6620_REG_DAC1
#define MAX6620_REG_DAC2
#define MAX6620_REG_DAC3

/*
 * Config register bits
 */

#define MAX6620_CFG_RUN
#define MAX6620_CFG_POR
#define MAX6620_CFG_TIMEOUT
#define MAX6620_CFG_FULLFAN
#define MAX6620_CFG_OSC
#define MAX6620_CFG_WD_MASK
#define MAX6620_CFG_WD_2
#define MAX6620_CFG_WD_6
#define MAX6620_CFG_WD10
#define MAX6620_CFG_WD

/*
 * Failure status register bits
 */

#define MAX6620_FAIL_TACH0
#define MAX6620_FAIL_TACH1
#define MAX6620_FAIL_TACH2
#define MAX6620_FAIL_TACH3
#define MAX6620_FAIL_MASK0
#define MAX6620_FAIL_MASK1
#define MAX6620_FAIL_MASK2
#define MAX6620_FAIL_MASK3

#define MAX6620_CLOCK_FREQ
#define MAX6620_PULSE_PER_REV

/* Minimum and maximum values of the FAN-RPM */
#define FAN_RPM_MIN
#define FAN_RPM_MAX

static const u8 config_reg[] =;

static const u8 dyn_reg[] =;

static const u8 tach_reg[] =;

static const u8 target_reg[] =;

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

struct max6620_data {};

static u8 max6620_fan_div_from_reg(u8 val)
{}

static u16 max6620_fan_rpm_to_tach(u8 div, int rpm)
{}

static int max6620_fan_tach_to_rpm(u8 div, u16 tach)
{}

static int max6620_update_device(struct device *dev)
{}

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

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

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

static const struct hwmon_channel_info * const max6620_info[] =;

static const struct hwmon_ops max6620_hwmon_ops =;

static const struct hwmon_chip_info max6620_chip_info =;

static int max6620_init_client(struct max6620_data *data)
{}

static int max6620_probe(struct i2c_client *client)
{}

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

static struct i2c_driver max6620_driver =;

module_i2c_driver();

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