#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>
#define LM93_REG_MFR_ID …
#define LM93_REG_VER …
#define LM93_REG_STATUS_CONTROL …
#define LM93_REG_CONFIG …
#define LM93_REG_SLEEP_CONTROL …
#define LM93_REG_HOST_ERROR_1 …
#define LM93_REG_IN(nr) …
#define LM93_REG_IN_MIN(nr) …
#define LM93_REG_IN_MAX(nr) …
#define LM93_REG_TEMP(nr) …
#define LM93_REG_TEMP_MIN(nr) …
#define LM93_REG_TEMP_MAX(nr) …
#define LM93_REG_BOOST(nr) …
#define LM93_REG_PROCHOT_CUR(nr) …
#define LM93_REG_PROCHOT_AVG(nr) …
#define LM93_REG_PROCHOT_MAX(nr) …
#define LM93_REG_FAN(nr) …
#define LM93_REG_FAN_MIN(nr) …
#define LM93_REG_PWM_CTL(nr, reg) …
#define LM93_PWM_CTL1 …
#define LM93_PWM_CTL2 …
#define LM93_PWM_CTL3 …
#define LM93_PWM_CTL4 …
#define LM93_REG_GPI …
#define LM93_REG_VID(nr) …
#define LM93_REG_VCCP_LIMIT_OFF(nr) …
#define LM93_REG_BOOST_HYST_12 …
#define LM93_REG_BOOST_HYST_34 …
#define LM93_REG_BOOST_HYST(nr) …
#define LM93_REG_PWM_MIN_HYST_12 …
#define LM93_REG_PWM_MIN_HYST_34 …
#define LM93_REG_PWM_MIN_HYST(nr) …
#define LM93_REG_PROCHOT_OVERRIDE …
#define LM93_REG_PROCHOT_INTERVAL …
#define LM93_REG_TEMP_BASE(nr) …
#define LM93_REG_TEMP_OFFSET(step) …
#define LM93_REG_PWM_RAMP_CTL …
#define LM93_REG_SFC1 …
#define LM93_REG_SFC2 …
#define LM93_REG_GPI_VID_CTL …
#define LM93_REG_SF_TACH_TO_PWM …
#define LM93_REG_GPI_ERR_MASK …
#define LM93_REG_MISC_ERR_MASK …
#define LM93_MFR_ID …
#define LM93_MFR_ID_PROTOTYPE …
#define LM94_MFR_ID_2 …
#define LM94_MFR_ID …
#define LM94_MFR_ID_PROTOTYPE …
#define LM93_SMBUS_FUNC_FULL …
#define LM93_SMBUS_FUNC_MIN …
static const unsigned short normal_i2c[] = …;
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(…) …;
static struct i2c_driver lm93_driver;
static const struct { … } lm93_block_read_cmds[12] = …;
struct block1_t { … };
struct lm93_data { … };
static int LM93_VID_FROM_REG(u8 reg)
{ … }
static const u8 lm93_vin_reg_min[16] = …;
static const u8 lm93_vin_reg_max[16] = …;
static const unsigned long lm93_vin_val_min[16] = …;
static const unsigned long lm93_vin_val_max[16] = …;
static unsigned LM93_IN_FROM_REG(int nr, u8 reg)
{ … }
static u8 LM93_IN_TO_REG(int nr, unsigned val)
{ … }
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) …
static u8 LM93_IN_REL_TO_REG(unsigned val, int upper, int vid)
{ … }
static int LM93_TEMP_FROM_REG(u8 reg)
{ … }
#define LM93_TEMP_MIN …
#define LM93_TEMP_MAX …
static u8 LM93_TEMP_TO_REG(long temp)
{ … }
static int LM93_TEMP_OFFSET_MODE_FROM_REG(u8 sfc2, int nr)
{ … }
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 …
static u8 LM93_TEMP_OFFSET_TO_REG(int off, int mode)
{ … }
static int LM93_TEMP_AUTO_OFFSET_FROM_REG(u8 reg, int nr, int mode)
{ … }
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)
{ … }
enum pwm_freq { … };
static int lm93_pwm_map[2][16] = …;
static int LM93_PWM_FROM_REG(u8 reg, enum pwm_freq freq)
{ … }
static u8 LM93_PWM_TO_REG(int pwm, enum pwm_freq freq)
{ … }
static int LM93_FAN_FROM_REG(u16 regs)
{ … }
static u16 LM93_FAN_TO_REG(long rpm)
{ … }
static int lm93_pwm_freq_map[8] = …;
static int LM93_PWM_FREQ_FROM_REG(u8 reg)
{ … }
static u8 LM93_PWM_FREQ_TO_REG(int freq)
{ … }
static int lm93_spinup_time_map[8] = …;
static int LM93_SPINUP_TIME_FROM_REG(u8 reg)
{ … }
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)
{ … }
static u8 LM93_RAMP_TO_REG(int ramp)
{ … }
static u8 LM93_PROCHOT_TO_REG(long prochot)
{ … }
static int lm93_interval_map[10] = …;
static int LM93_INTERVAL_FROM_REG(u8 reg)
{ … }
static u8 LM93_INTERVAL_TO_REG(long interval)
{ … }
static unsigned LM93_GPI_FROM_REG(u8 reg)
{ … }
#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];
static void lm93_read_block(struct i2c_client *client, u8 fbn, u8 *values)
{ … }
static struct lm93_data *lm93_update_device(struct device *dev)
{ … }
static void lm93_update_client_common(struct lm93_data *data,
struct i2c_client *client)
{ … }
static void lm93_update_client_full(struct lm93_data *data,
struct i2c_client *client)
{ … }
static void lm93_update_client_min(struct lm93_data *data,
struct i2c_client *client)
{ … }
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);
static ssize_t fan_smart_tach_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
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)
{ … }
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)
{ … }
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(…) …;