linux/drivers/hwmon/lm93.c

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 * lm93.c - Part of lm_sensors, Linux kernel modules for hardware monitoring
 *
 * Author/Maintainer: Mark M. Hoffman <[email protected]>
 *	Copyright (c) 2004 Utilitek Systems, Inc.
 *
 * derived in part from lm78.c:
 *	Copyright (c) 1998, 1999  Frodo Looijaard <[email protected]>
 *
 * derived in part from lm85.c:
 *	Copyright (c) 2002, 2003 Philip Pokorny <[email protected]>
 *	Copyright (c) 2003       Margit Schubert-While <[email protected]>
 *
 * derived in part from w83l785ts.c:
 *	Copyright (c) 2003-2004 Jean Delvare <[email protected]>
 *
 * Ported to Linux 2.6 by Eric J. Bowersox <[email protected]>
 *	Copyright (c) 2005 Aspen Systems, Inc.
 *
 * Adapted to 2.6.20 by Carsten Emde <[email protected]>
 *	Copyright (c) 2006 Carsten Emde, Open Source Automation Development Lab
 *
 * Modified for mainline integration by Hans J. Koch <[email protected]>
 *	Copyright (c) 2007 Hans J. Koch, Linutronix GmbH
 */

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

/* LM93 REGISTER ADDRESSES */

/* miscellaneous */
#define LM93_REG_MFR_ID
#define LM93_REG_VER
#define LM93_REG_STATUS_CONTROL
#define LM93_REG_CONFIG
#define LM93_REG_SLEEP_CONTROL

/* alarm values start here */
#define LM93_REG_HOST_ERROR_1

/* voltage inputs: in1-in16 (nr => 0-15) */
#define LM93_REG_IN(nr)
#define LM93_REG_IN_MIN(nr)
#define LM93_REG_IN_MAX(nr)

/* temperature inputs: temp1-temp4 (nr => 0-3) */
#define LM93_REG_TEMP(nr)
#define LM93_REG_TEMP_MIN(nr)
#define LM93_REG_TEMP_MAX(nr)

/* temp[1-4]_auto_boost (nr => 0-3) */
#define LM93_REG_BOOST(nr)

/* #PROCHOT inputs: prochot1-prochot2 (nr => 0-1) */
#define LM93_REG_PROCHOT_CUR(nr)
#define LM93_REG_PROCHOT_AVG(nr)
#define LM93_REG_PROCHOT_MAX(nr)

/* fan tach inputs: fan1-fan4 (nr => 0-3) */
#define LM93_REG_FAN(nr)
#define LM93_REG_FAN_MIN(nr)

/* pwm outputs: pwm1-pwm2 (nr => 0-1, reg => 0-3) */
#define LM93_REG_PWM_CTL(nr, reg)
#define LM93_PWM_CTL1
#define LM93_PWM_CTL2
#define LM93_PWM_CTL3
#define LM93_PWM_CTL4

/* GPIO input state */
#define LM93_REG_GPI

/* vid inputs: vid1-vid2 (nr => 0-1) */
#define LM93_REG_VID(nr)

/* vccp1 & vccp2: VID relative inputs (nr => 0-1) */
#define LM93_REG_VCCP_LIMIT_OFF(nr)

/* temp[1-4]_auto_boost_hyst */
#define LM93_REG_BOOST_HYST_12
#define LM93_REG_BOOST_HYST_34
#define LM93_REG_BOOST_HYST(nr)

/* temp[1-4]_auto_pwm_[min|hyst] */
#define LM93_REG_PWM_MIN_HYST_12
#define LM93_REG_PWM_MIN_HYST_34
#define LM93_REG_PWM_MIN_HYST(nr)

/* prochot_override & prochot_interval */
#define LM93_REG_PROCHOT_OVERRIDE
#define LM93_REG_PROCHOT_INTERVAL

/* temp[1-4]_auto_base (nr => 0-3) */
#define LM93_REG_TEMP_BASE(nr)

/* temp[1-4]_auto_offsets (step => 0-11) */
#define LM93_REG_TEMP_OFFSET(step)

/* #PROCHOT & #VRDHOT PWM ramp control */
#define LM93_REG_PWM_RAMP_CTL

/* miscellaneous */
#define LM93_REG_SFC1
#define LM93_REG_SFC2
#define LM93_REG_GPI_VID_CTL
#define LM93_REG_SF_TACH_TO_PWM

/* error masks */
#define LM93_REG_GPI_ERR_MASK
#define LM93_REG_MISC_ERR_MASK

/* LM93 REGISTER VALUES */
#define LM93_MFR_ID
#define LM93_MFR_ID_PROTOTYPE

/* LM94 REGISTER VALUES */
#define LM94_MFR_ID_2
#define LM94_MFR_ID
#define LM94_MFR_ID_PROTOTYPE

/* SMBus capabilities */
#define LM93_SMBUS_FUNC_FULL
#define LM93_SMBUS_FUNC_MIN

/* Addresses to scan */
static const unsigned short normal_i2c[] =;

/* Insmod parameters */

static bool disable_block;
module_param(disable_block, bool, 0);
MODULE_PARM_DESC();

static bool init;
module_param(init, bool, 0);
MODULE_PARM_DESC();

static int vccp_limit_type[2] =;
module_param_array();
MODULE_PARM_DESC();

static int vid_agtl;
module_param(vid_agtl, int, 0);
MODULE_PARM_DESC();

/* Driver data */
static struct i2c_driver lm93_driver;

/* LM93 BLOCK READ COMMANDS */
static const struct {} lm93_block_read_cmds[12] =;

/*
 * ALARMS: SYSCTL format described further below
 * REG: 64 bits in 8 registers, as immediately below
 */
struct block1_t {};

/*
 * Client-specific data
 */
struct lm93_data {};

/*
 * VID:	mV
 * REG: 6-bits, right justified, *always* using Intel VRM/VRD 10
 */
static int LM93_VID_FROM_REG(u8 reg)
{}

/* min, max, and nominal register values, per channel (u8) */
static const u8 lm93_vin_reg_min[16] =;
static const u8 lm93_vin_reg_max[16] =;
/*
 * Values from the datasheet. They're here for documentation only.
 * static const u8 lm93_vin_reg_nom[16] = {
 * 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0,
 * 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0x40, 0xc0,
 * };
 */

/* min, max, and nominal voltage readings, per channel (mV)*/
static const unsigned long lm93_vin_val_min[16] =;

static const unsigned long lm93_vin_val_max[16] =;
/*
 * Values from the datasheet. They're here for documentation only.
 * static const unsigned long lm93_vin_val_nom[16] = {
 * 927,  927,  927, 1200, 1500, 1500, 1200, 1200,
 * 3300, 5000, 2500, 1969,  984,  984,  309, 3300,
 * };
 */

static unsigned LM93_IN_FROM_REG(int nr, u8 reg)
{}

/*
 * IN: mV, limits determined by channel nr
 * REG: scaling determined by channel nr
 */
static u8 LM93_IN_TO_REG(int nr, unsigned val)
{}

/* vid in mV, upper == 0 indicates low limit, otherwise upper limit */
static unsigned LM93_IN_REL_FROM_REG(u8 reg, int upper, int vid)
{}

#define LM93_IN_MIN_FROM_REG(reg, vid)
#define LM93_IN_MAX_FROM_REG(reg, vid)

/*
 * vid in mV , upper == 0 indicates low limit, otherwise upper limit
 * upper also determines which nibble of the register is returned
 * (the other nibble will be 0x0)
 */
static u8 LM93_IN_REL_TO_REG(unsigned val, int upper, int vid)
{}

/*
 * TEMP: 1/1000 degrees C (-128C to +127C)
 * REG: 1C/bit, two's complement
 */
static int LM93_TEMP_FROM_REG(u8 reg)
{}

#define LM93_TEMP_MIN
#define LM93_TEMP_MAX

/*
 * TEMP: 1/1000 degrees C (-128C to +127C)
 * REG: 1C/bit, two's complement
 */
static u8 LM93_TEMP_TO_REG(long temp)
{}

/* Determine 4-bit temperature offset resolution */
static int LM93_TEMP_OFFSET_MODE_FROM_REG(u8 sfc2, int nr)
{}

/*
 * This function is common to all 4-bit temperature offsets
 * reg is 4 bits right justified
 * mode 0 => 1C/bit, mode !0 => 0.5C/bit
 */
static int LM93_TEMP_OFFSET_FROM_REG(u8 reg, int mode)
{}

#define LM93_TEMP_OFFSET_MIN
#define LM93_TEMP_OFFSET_MAX0
#define LM93_TEMP_OFFSET_MAX1

/*
 * This function is common to all 4-bit temperature offsets
 * returns 4 bits right justified
 * mode 0 => 1C/bit, mode !0 => 0.5C/bit
 */
static u8 LM93_TEMP_OFFSET_TO_REG(int off, int mode)
{}

/* 0 <= nr <= 3 */
static int LM93_TEMP_AUTO_OFFSET_FROM_REG(u8 reg, int nr, int mode)
{}

/*
 * TEMP: 1/10 degrees C (0C to +15C (mode 0) or +7.5C (mode non-zero))
 * REG: 1.0C/bit (mode 0) or 0.5C/bit (mode non-zero)
 * 0 <= nr <= 3
 */
static u8 LM93_TEMP_AUTO_OFFSET_TO_REG(u8 old, int off, int nr, int mode)
{}

static int LM93_AUTO_BOOST_HYST_FROM_REGS(struct lm93_data *data, int nr,
		int mode)
{}

static u8 LM93_AUTO_BOOST_HYST_TO_REG(struct lm93_data *data, long hyst,
		int nr, int mode)
{}

/*
 * PWM: 0-255 per sensors documentation
 * REG: 0-13 as mapped below... right justified
 */
enum pwm_freq {};

static int lm93_pwm_map[2][16] =;

static int LM93_PWM_FROM_REG(u8 reg, enum pwm_freq freq)
{}

/* round up to nearest match */
static u8 LM93_PWM_TO_REG(int pwm, enum pwm_freq freq)
{}

static int LM93_FAN_FROM_REG(u16 regs)
{}

/*
 * RPM: (82.5 to 1350000)
 * REG: 14-bits, LE, *left* justified
 */
static u16 LM93_FAN_TO_REG(long rpm)
{}

/*
 * PWM FREQ: HZ
 * REG: 0-7 as mapped below
 */
static int lm93_pwm_freq_map[8] =;

static int LM93_PWM_FREQ_FROM_REG(u8 reg)
{}

/* round up to nearest match */
static u8 LM93_PWM_FREQ_TO_REG(int freq)
{}

/*
 * TIME: 1/100 seconds
 * REG: 0-7 as mapped below
 */
static int lm93_spinup_time_map[8] =;

static int LM93_SPINUP_TIME_FROM_REG(u8 reg)
{}

/* round up to nearest match */
static u8 LM93_SPINUP_TIME_TO_REG(int time)
{}

#define LM93_RAMP_MIN
#define LM93_RAMP_MAX

static int LM93_RAMP_FROM_REG(u8 reg)
{}

/*
 * RAMP: 1/100 seconds
 * REG: 50mS/bit 4-bits right justified
 */
static u8 LM93_RAMP_TO_REG(int ramp)
{}

/*
 * PROCHOT: 0-255, 0 => 0%, 255 => > 96.6%
 * REG: (same)
 */
static u8 LM93_PROCHOT_TO_REG(long prochot)
{}

/*
 * PROCHOT-INTERVAL: 73 - 37200 (1/100 seconds)
 * REG: 0-9 as mapped below
 */
static int lm93_interval_map[10] =;

static int LM93_INTERVAL_FROM_REG(u8 reg)
{}

/* round up to nearest match */
static u8 LM93_INTERVAL_TO_REG(long interval)
{}

/*
 * GPIO: 0-255, GPIO0 is LSB
 * REG: inverted
 */
static unsigned LM93_GPI_FROM_REG(u8 reg)
{}

/*
 * alarm bitmask definitions
 * The LM93 has nearly 64 bits of error status... I've pared that down to
 * what I think is a useful subset in order to fit it into 32 bits.
 *
 * Especially note that the #VRD_HOT alarms are missing because we provide
 * that information as values in another sysfs file.
 *
 * If libsensors is extended to support 64 bit values, this could be revisited.
 */
#define LM93_ALARM_IN1
#define LM93_ALARM_IN2
#define LM93_ALARM_IN3
#define LM93_ALARM_IN4
#define LM93_ALARM_IN5
#define LM93_ALARM_IN6
#define LM93_ALARM_IN7
#define LM93_ALARM_IN8
#define LM93_ALARM_IN9
#define LM93_ALARM_IN10
#define LM93_ALARM_IN11
#define LM93_ALARM_IN12
#define LM93_ALARM_IN13
#define LM93_ALARM_IN14
#define LM93_ALARM_IN15
#define LM93_ALARM_IN16
#define LM93_ALARM_FAN1
#define LM93_ALARM_FAN2
#define LM93_ALARM_FAN3
#define LM93_ALARM_FAN4
#define LM93_ALARM_PH1_ERR
#define LM93_ALARM_PH2_ERR
#define LM93_ALARM_SCSI1_ERR
#define LM93_ALARM_SCSI2_ERR
#define LM93_ALARM_DVDDP1_ERR
#define LM93_ALARM_DVDDP2_ERR
#define LM93_ALARM_D1_ERR
#define LM93_ALARM_D2_ERR
#define LM93_ALARM_TEMP1
#define LM93_ALARM_TEMP2
#define LM93_ALARM_TEMP3

static unsigned LM93_ALARMS_FROM_REG(struct block1_t b1)
{}

#define MAX_RETRIES

static u8 lm93_read_byte(struct i2c_client *client, u8 reg)
{}

static int lm93_write_byte(struct i2c_client *client, u8 reg, u8 value)
{}

static u16 lm93_read_word(struct i2c_client *client, u8 reg)
{}

static int lm93_write_word(struct i2c_client *client, u8 reg, u16 value)
{}

static u8 lm93_block_buffer[I2C_SMBUS_BLOCK_MAX];

/*
 * read block data into values, retry if not expected length
 * fbn => index to lm93_block_read_cmds table
 * (Fixed Block Number - section 14.5.2 of LM93 datasheet)
 */
static void lm93_read_block(struct i2c_client *client, u8 fbn, u8 *values)
{}

static struct lm93_data *lm93_update_device(struct device *dev)
{}

/* update routine for data that has no corresponding SMBus block command */
static void lm93_update_client_common(struct lm93_data *data,
				      struct i2c_client *client)
{}

/* update routine which uses SMBus block data commands */
static void lm93_update_client_full(struct lm93_data *data,
				    struct i2c_client *client)
{}

/* update routine which uses SMBus byte/word data commands only */
static void lm93_update_client_min(struct lm93_data *data,
				   struct i2c_client *client)
{}

/* following are the sysfs callback functions */
static ssize_t in_show(struct device *dev, struct device_attribute *attr,
		       char *buf)
{}

static SENSOR_DEVICE_ATTR_RO(in1_input, in, 0);
static SENSOR_DEVICE_ATTR_RO(in2_input, in, 1);
static SENSOR_DEVICE_ATTR_RO(in3_input, in, 2);
static SENSOR_DEVICE_ATTR_RO(in4_input, in, 3);
static SENSOR_DEVICE_ATTR_RO(in5_input, in, 4);
static SENSOR_DEVICE_ATTR_RO(in6_input, in, 5);
static SENSOR_DEVICE_ATTR_RO(in7_input, in, 6);
static SENSOR_DEVICE_ATTR_RO(in8_input, in, 7);
static SENSOR_DEVICE_ATTR_RO(in9_input, in, 8);
static SENSOR_DEVICE_ATTR_RO(in10_input, in, 9);
static SENSOR_DEVICE_ATTR_RO(in11_input, in, 10);
static SENSOR_DEVICE_ATTR_RO(in12_input, in, 11);
static SENSOR_DEVICE_ATTR_RO(in13_input, in, 12);
static SENSOR_DEVICE_ATTR_RO(in14_input, in, 13);
static SENSOR_DEVICE_ATTR_RO(in15_input, in, 14);
static SENSOR_DEVICE_ATTR_RO(in16_input, in, 15);

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

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

static SENSOR_DEVICE_ATTR_RW(in1_min, in_min, 0);
static SENSOR_DEVICE_ATTR_RW(in2_min, in_min, 1);
static SENSOR_DEVICE_ATTR_RW(in3_min, in_min, 2);
static SENSOR_DEVICE_ATTR_RW(in4_min, in_min, 3);
static SENSOR_DEVICE_ATTR_RW(in5_min, in_min, 4);
static SENSOR_DEVICE_ATTR_RW(in6_min, in_min, 5);
static SENSOR_DEVICE_ATTR_RW(in7_min, in_min, 6);
static SENSOR_DEVICE_ATTR_RW(in8_min, in_min, 7);
static SENSOR_DEVICE_ATTR_RW(in9_min, in_min, 8);
static SENSOR_DEVICE_ATTR_RW(in10_min, in_min, 9);
static SENSOR_DEVICE_ATTR_RW(in11_min, in_min, 10);
static SENSOR_DEVICE_ATTR_RW(in12_min, in_min, 11);
static SENSOR_DEVICE_ATTR_RW(in13_min, in_min, 12);
static SENSOR_DEVICE_ATTR_RW(in14_min, in_min, 13);
static SENSOR_DEVICE_ATTR_RW(in15_min, in_min, 14);
static SENSOR_DEVICE_ATTR_RW(in16_min, in_min, 15);

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

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

static SENSOR_DEVICE_ATTR_RW(in1_max, in_max, 0);
static SENSOR_DEVICE_ATTR_RW(in2_max, in_max, 1);
static SENSOR_DEVICE_ATTR_RW(in3_max, in_max, 2);
static SENSOR_DEVICE_ATTR_RW(in4_max, in_max, 3);
static SENSOR_DEVICE_ATTR_RW(in5_max, in_max, 4);
static SENSOR_DEVICE_ATTR_RW(in6_max, in_max, 5);
static SENSOR_DEVICE_ATTR_RW(in7_max, in_max, 6);
static SENSOR_DEVICE_ATTR_RW(in8_max, in_max, 7);
static SENSOR_DEVICE_ATTR_RW(in9_max, in_max, 8);
static SENSOR_DEVICE_ATTR_RW(in10_max, in_max, 9);
static SENSOR_DEVICE_ATTR_RW(in11_max, in_max, 10);
static SENSOR_DEVICE_ATTR_RW(in12_max, in_max, 11);
static SENSOR_DEVICE_ATTR_RW(in13_max, in_max, 12);
static SENSOR_DEVICE_ATTR_RW(in14_max, in_max, 13);
static SENSOR_DEVICE_ATTR_RW(in15_max, in_max, 14);
static SENSOR_DEVICE_ATTR_RW(in16_max, in_max, 15);

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

static SENSOR_DEVICE_ATTR_RO(temp1_input, temp, 0);
static SENSOR_DEVICE_ATTR_RO(temp2_input, temp, 1);
static SENSOR_DEVICE_ATTR_RO(temp3_input, temp, 2);

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

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

static SENSOR_DEVICE_ATTR_RW(temp1_min, temp_min, 0);
static SENSOR_DEVICE_ATTR_RW(temp2_min, temp_min, 1);
static SENSOR_DEVICE_ATTR_RW(temp3_min, temp_min, 2);

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

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

static SENSOR_DEVICE_ATTR_RW(temp1_max, temp_max, 0);
static SENSOR_DEVICE_ATTR_RW(temp2_max, temp_max, 1);
static SENSOR_DEVICE_ATTR_RW(temp3_max, temp_max, 2);

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

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

static SENSOR_DEVICE_ATTR_RW(temp1_auto_base, temp_auto_base, 0);
static SENSOR_DEVICE_ATTR_RW(temp2_auto_base, temp_auto_base, 1);
static SENSOR_DEVICE_ATTR_RW(temp3_auto_base, temp_auto_base, 2);

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

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

static SENSOR_DEVICE_ATTR_RW(temp1_auto_boost, temp_auto_boost, 0);
static SENSOR_DEVICE_ATTR_RW(temp2_auto_boost, temp_auto_boost, 1);
static SENSOR_DEVICE_ATTR_RW(temp3_auto_boost, temp_auto_boost, 2);

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

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

static SENSOR_DEVICE_ATTR_RW(temp1_auto_boost_hyst, temp_auto_boost_hyst, 0);
static SENSOR_DEVICE_ATTR_RW(temp2_auto_boost_hyst, temp_auto_boost_hyst, 1);
static SENSOR_DEVICE_ATTR_RW(temp3_auto_boost_hyst, temp_auto_boost_hyst, 2);

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

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

static SENSOR_DEVICE_ATTR_2_RW(temp1_auto_offset1, temp_auto_offset, 0, 0);
static SENSOR_DEVICE_ATTR_2_RW(temp1_auto_offset2, temp_auto_offset, 1, 0);
static SENSOR_DEVICE_ATTR_2_RW(temp1_auto_offset3, temp_auto_offset, 2, 0);
static SENSOR_DEVICE_ATTR_2_RW(temp1_auto_offset4, temp_auto_offset, 3, 0);
static SENSOR_DEVICE_ATTR_2_RW(temp1_auto_offset5, temp_auto_offset, 4, 0);
static SENSOR_DEVICE_ATTR_2_RW(temp1_auto_offset6, temp_auto_offset, 5, 0);
static SENSOR_DEVICE_ATTR_2_RW(temp1_auto_offset7, temp_auto_offset, 6, 0);
static SENSOR_DEVICE_ATTR_2_RW(temp1_auto_offset8, temp_auto_offset, 7, 0);
static SENSOR_DEVICE_ATTR_2_RW(temp1_auto_offset9, temp_auto_offset, 8, 0);
static SENSOR_DEVICE_ATTR_2_RW(temp1_auto_offset10, temp_auto_offset, 9, 0);
static SENSOR_DEVICE_ATTR_2_RW(temp1_auto_offset11, temp_auto_offset, 10, 0);
static SENSOR_DEVICE_ATTR_2_RW(temp1_auto_offset12, temp_auto_offset, 11, 0);
static SENSOR_DEVICE_ATTR_2_RW(temp2_auto_offset1, temp_auto_offset, 0, 1);
static SENSOR_DEVICE_ATTR_2_RW(temp2_auto_offset2, temp_auto_offset, 1, 1);
static SENSOR_DEVICE_ATTR_2_RW(temp2_auto_offset3, temp_auto_offset, 2, 1);
static SENSOR_DEVICE_ATTR_2_RW(temp2_auto_offset4, temp_auto_offset, 3, 1);
static SENSOR_DEVICE_ATTR_2_RW(temp2_auto_offset5, temp_auto_offset, 4, 1);
static SENSOR_DEVICE_ATTR_2_RW(temp2_auto_offset6, temp_auto_offset, 5, 1);
static SENSOR_DEVICE_ATTR_2_RW(temp2_auto_offset7, temp_auto_offset, 6, 1);
static SENSOR_DEVICE_ATTR_2_RW(temp2_auto_offset8, temp_auto_offset, 7, 1);
static SENSOR_DEVICE_ATTR_2_RW(temp2_auto_offset9, temp_auto_offset, 8, 1);
static SENSOR_DEVICE_ATTR_2_RW(temp2_auto_offset10, temp_auto_offset, 9, 1);
static SENSOR_DEVICE_ATTR_2_RW(temp2_auto_offset11, temp_auto_offset, 10, 1);
static SENSOR_DEVICE_ATTR_2_RW(temp2_auto_offset12, temp_auto_offset, 11, 1);
static SENSOR_DEVICE_ATTR_2_RW(temp3_auto_offset1, temp_auto_offset, 0, 2);
static SENSOR_DEVICE_ATTR_2_RW(temp3_auto_offset2, temp_auto_offset, 1, 2);
static SENSOR_DEVICE_ATTR_2_RW(temp3_auto_offset3, temp_auto_offset, 2, 2);
static SENSOR_DEVICE_ATTR_2_RW(temp3_auto_offset4, temp_auto_offset, 3, 2);
static SENSOR_DEVICE_ATTR_2_RW(temp3_auto_offset5, temp_auto_offset, 4, 2);
static SENSOR_DEVICE_ATTR_2_RW(temp3_auto_offset6, temp_auto_offset, 5, 2);
static SENSOR_DEVICE_ATTR_2_RW(temp3_auto_offset7, temp_auto_offset, 6, 2);
static SENSOR_DEVICE_ATTR_2_RW(temp3_auto_offset8, temp_auto_offset, 7, 2);
static SENSOR_DEVICE_ATTR_2_RW(temp3_auto_offset9, temp_auto_offset, 8, 2);
static SENSOR_DEVICE_ATTR_2_RW(temp3_auto_offset10, temp_auto_offset, 9, 2);
static SENSOR_DEVICE_ATTR_2_RW(temp3_auto_offset11, temp_auto_offset, 10, 2);
static SENSOR_DEVICE_ATTR_2_RW(temp3_auto_offset12, temp_auto_offset, 11, 2);

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

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

static SENSOR_DEVICE_ATTR_RW(temp1_auto_pwm_min, temp_auto_pwm_min, 0);
static SENSOR_DEVICE_ATTR_RW(temp2_auto_pwm_min, temp_auto_pwm_min, 1);
static SENSOR_DEVICE_ATTR_RW(temp3_auto_pwm_min, temp_auto_pwm_min, 2);

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

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

static SENSOR_DEVICE_ATTR_RW(temp1_auto_offset_hyst, temp_auto_offset_hyst, 0);
static SENSOR_DEVICE_ATTR_RW(temp2_auto_offset_hyst, temp_auto_offset_hyst, 1);
static SENSOR_DEVICE_ATTR_RW(temp3_auto_offset_hyst, temp_auto_offset_hyst, 2);

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

static SENSOR_DEVICE_ATTR_RO(fan1_input, fan_input, 0);
static SENSOR_DEVICE_ATTR_RO(fan2_input, fan_input, 1);
static SENSOR_DEVICE_ATTR_RO(fan3_input, fan_input, 2);
static SENSOR_DEVICE_ATTR_RO(fan4_input, fan_input, 3);

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

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

static SENSOR_DEVICE_ATTR_RW(fan1_min, fan_min, 0);
static SENSOR_DEVICE_ATTR_RW(fan2_min, fan_min, 1);
static SENSOR_DEVICE_ATTR_RW(fan3_min, fan_min, 2);
static SENSOR_DEVICE_ATTR_RW(fan4_min, fan_min, 3);

/*
 * some tedious bit-twiddling here to deal with the register format:
 *
 *	data->sf_tach_to_pwm: (tach to pwm mapping bits)
 *
 *		bit |  7  |  6  |  5  |  4  |  3  |  2  |  1  |  0
 *		     T4:P2 T4:P1 T3:P2 T3:P1 T2:P2 T2:P1 T1:P2 T1:P1
 *
 *	data->sfc2: (enable bits)
 *
 *		bit |  3  |  2  |  1  |  0
 *		       T4    T3    T2    T1
 */

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

/*
 * helper function - must grab data->update_lock before calling
 * fan is 0-3, indicating fan1-fan4
 */
static void lm93_write_fan_smart_tach(struct i2c_client *client,
	struct lm93_data *data, int fan, long value)
{}

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

static SENSOR_DEVICE_ATTR_RW(fan1_smart_tach, fan_smart_tach, 0);
static SENSOR_DEVICE_ATTR_RW(fan2_smart_tach, fan_smart_tach, 1);
static SENSOR_DEVICE_ATTR_RW(fan3_smart_tach, fan_smart_tach, 2);
static SENSOR_DEVICE_ATTR_RW(fan4_smart_tach, fan_smart_tach, 3);

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

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

static SENSOR_DEVICE_ATTR_RW(pwm1, pwm, 0);
static SENSOR_DEVICE_ATTR_RW(pwm2, pwm, 1);

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

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

static SENSOR_DEVICE_ATTR_RW(pwm1_enable, pwm_enable, 0);
static SENSOR_DEVICE_ATTR_RW(pwm2_enable, pwm_enable, 1);

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

/*
 * helper function - must grab data->update_lock before calling
 * pwm is 0-1, indicating pwm1-pwm2
 * this disables smart tach for all tach channels bound to the given pwm
 */
static void lm93_disable_fan_smart_tach(struct i2c_client *client,
	struct lm93_data *data, int pwm)
{}

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

static SENSOR_DEVICE_ATTR_RW(pwm1_freq, pwm_freq, 0);
static SENSOR_DEVICE_ATTR_RW(pwm2_freq, pwm_freq, 1);

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

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

static SENSOR_DEVICE_ATTR_RW(pwm1_auto_channels, pwm_auto_channels, 0);
static SENSOR_DEVICE_ATTR_RW(pwm2_auto_channels, pwm_auto_channels, 1);

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

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

static SENSOR_DEVICE_ATTR_RW(pwm1_auto_spinup_min, pwm_auto_spinup_min, 0);
static SENSOR_DEVICE_ATTR_RW(pwm2_auto_spinup_min, pwm_auto_spinup_min, 1);

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

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

static SENSOR_DEVICE_ATTR_RW(pwm1_auto_spinup_time, pwm_auto_spinup_time, 0);
static SENSOR_DEVICE_ATTR_RW(pwm2_auto_spinup_time, pwm_auto_spinup_time, 1);

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

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

static DEVICE_ATTR_RW(pwm_auto_prochot_ramp);

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

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

static DEVICE_ATTR_RW(pwm_auto_vrdhot_ramp);

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

static SENSOR_DEVICE_ATTR_RO(cpu0_vid, vid, 0);
static SENSOR_DEVICE_ATTR_RO(cpu1_vid, vid, 1);

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

static SENSOR_DEVICE_ATTR_RO(prochot1, prochot, 0);
static SENSOR_DEVICE_ATTR_RO(prochot2, prochot, 1);

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

static SENSOR_DEVICE_ATTR_RO(prochot1_avg, prochot_avg, 0);
static SENSOR_DEVICE_ATTR_RO(prochot2_avg, prochot_avg, 1);

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

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

static SENSOR_DEVICE_ATTR_RW(prochot1_max, prochot_max, 0);
static SENSOR_DEVICE_ATTR_RW(prochot2_max, prochot_max, 1);

static const u8 prochot_override_mask[] =;

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

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

static SENSOR_DEVICE_ATTR_RW(prochot1_override, prochot_override, 0);
static SENSOR_DEVICE_ATTR_RW(prochot2_override, prochot_override, 1);

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

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

static SENSOR_DEVICE_ATTR_RW(prochot1_interval, prochot_interval, 0);
static SENSOR_DEVICE_ATTR_RW(prochot2_interval, prochot_interval, 1);

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

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

static DEVICE_ATTR_RW(prochot_override_duty_cycle);

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

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

static DEVICE_ATTR_RW(prochot_short);

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

static SENSOR_DEVICE_ATTR_RO(vrdhot1, vrdhot, 0);
static SENSOR_DEVICE_ATTR_RO(vrdhot2, vrdhot, 1);

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

static DEVICE_ATTR_RO(gpio);

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

static DEVICE_ATTR_RO(alarms);

static struct attribute *lm93_attrs[] =;

ATTRIBUTE_GROUPS();

static void lm93_init_client(struct i2c_client *client)
{}

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

static int lm93_probe(struct i2c_client *client)
{}

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

static struct i2c_driver lm93_driver =;

module_i2c_driver();

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