#include <linux/module.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/log2.h>
#include <linux/slab.h>
static const unsigned short normal_i2c[] = …;
#define ADT7462_REG_DEVICE …
#define ADT7462_REG_VENDOR …
#define ADT7462_REG_REVISION …
#define ADT7462_REG_MIN_TEMP_BASE_ADDR …
#define ADT7462_REG_MIN_TEMP_MAX_ADDR …
#define ADT7462_REG_MAX_TEMP_BASE_ADDR …
#define ADT7462_REG_MAX_TEMP_MAX_ADDR …
#define ADT7462_REG_TEMP_BASE_ADDR …
#define ADT7462_REG_TEMP_MAX_ADDR …
#define ADT7462_REG_FAN_BASE_ADDR …
#define ADT7462_REG_FAN_MAX_ADDR …
#define ADT7462_REG_FAN2_BASE_ADDR …
#define ADT7462_REG_FAN2_MAX_ADDR …
#define ADT7462_REG_FAN_ENABLE …
#define ADT7462_REG_FAN_MIN_BASE_ADDR …
#define ADT7462_REG_FAN_MIN_MAX_ADDR …
#define ADT7462_REG_CFG2 …
#define ADT7462_FSPD_MASK …
#define ADT7462_REG_PWM_BASE_ADDR …
#define ADT7462_REG_PWM_MAX_ADDR …
#define ADT7462_REG_PWM_MIN_BASE_ADDR …
#define ADT7462_REG_PWM_MIN_MAX_ADDR …
#define ADT7462_REG_PWM_MAX …
#define ADT7462_REG_PWM_TEMP_MIN_BASE_ADDR …
#define ADT7462_REG_PWM_TEMP_MIN_MAX_ADDR …
#define ADT7462_REG_PWM_TEMP_RANGE_BASE_ADDR …
#define ADT7462_REG_PWM_TEMP_RANGE_MAX_ADDR …
#define ADT7462_PWM_HYST_MASK …
#define ADT7462_PWM_RANGE_MASK …
#define ADT7462_PWM_RANGE_SHIFT …
#define ADT7462_REG_PWM_CFG_BASE_ADDR …
#define ADT7462_REG_PWM_CFG_MAX_ADDR …
#define ADT7462_PWM_CHANNEL_MASK …
#define ADT7462_PWM_CHANNEL_SHIFT …
#define ADT7462_REG_PIN_CFG_BASE_ADDR …
#define ADT7462_REG_PIN_CFG_MAX_ADDR …
#define ADT7462_PIN7_INPUT …
#define ADT7462_DIODE3_INPUT …
#define ADT7462_DIODE1_INPUT …
#define ADT7462_VID_INPUT …
#define ADT7462_PIN22_INPUT …
#define ADT7462_PIN21_INPUT …
#define ADT7462_PIN19_INPUT …
#define ADT7462_PIN15_INPUT …
#define ADT7462_PIN13_INPUT …
#define ADT7462_PIN8_INPUT …
#define ADT7462_PIN23_MASK …
#define ADT7462_PIN23_SHIFT …
#define ADT7462_PIN26_MASK …
#define ADT7462_PIN26_SHIFT …
#define ADT7462_PIN25_MASK …
#define ADT7462_PIN25_SHIFT …
#define ADT7462_PIN24_MASK …
#define ADT7462_PIN24_SHIFT …
#define ADT7462_PIN26_VOLT_INPUT …
#define ADT7462_PIN25_VOLT_INPUT …
#define ADT7462_PIN28_SHIFT …
#define ADT7462_PIN28_VOLT …
#define ADT7462_REG_ALARM1 …
#define ADT7462_LT_ALARM …
#define ADT7462_R1T_ALARM …
#define ADT7462_R2T_ALARM …
#define ADT7462_R3T_ALARM …
#define ADT7462_REG_ALARM2 …
#define ADT7462_V0_ALARM …
#define ADT7462_V1_ALARM …
#define ADT7462_V2_ALARM …
#define ADT7462_V3_ALARM …
#define ADT7462_V4_ALARM …
#define ADT7462_V5_ALARM …
#define ADT7462_V6_ALARM …
#define ADT7462_V7_ALARM …
#define ADT7462_REG_ALARM3 …
#define ADT7462_V8_ALARM …
#define ADT7462_V9_ALARM …
#define ADT7462_V10_ALARM …
#define ADT7462_V11_ALARM …
#define ADT7462_V12_ALARM …
#define ADT7462_REG_ALARM4 …
#define ADT7462_F0_ALARM …
#define ADT7462_F1_ALARM …
#define ADT7462_F2_ALARM …
#define ADT7462_F3_ALARM …
#define ADT7462_F4_ALARM …
#define ADT7462_F5_ALARM …
#define ADT7462_F6_ALARM …
#define ADT7462_F7_ALARM …
#define ADT7462_ALARM1 …
#define ADT7462_ALARM2 …
#define ADT7462_ALARM3 …
#define ADT7462_ALARM4 …
#define ADT7462_ALARM_REG_SHIFT …
#define ADT7462_ALARM_FLAG_MASK …
#define ADT7462_TEMP_COUNT …
#define ADT7462_TEMP_REG(x) …
#define ADT7462_TEMP_MIN_REG(x) …
#define ADT7462_TEMP_MAX_REG(x) …
#define TEMP_FRAC_OFFSET …
#define ADT7462_FAN_COUNT …
#define ADT7462_REG_FAN_MIN(x) …
#define ADT7462_PWM_COUNT …
#define ADT7462_REG_PWM(x) …
#define ADT7462_REG_PWM_MIN(x) …
#define ADT7462_REG_PWM_TMIN(x) …
#define ADT7462_REG_PWM_TRANGE(x) …
#define ADT7462_PIN_CFG_REG_COUNT …
#define ADT7462_REG_PIN_CFG(x) …
#define ADT7462_REG_PWM_CFG(x) …
#define ADT7462_ALARM_REG_COUNT …
#define ADT7462_VOLT_COUNT …
#define ADT7462_VENDOR …
#define ADT7462_DEVICE …
#define ADT7462_REVISION …
#define SENSOR_REFRESH_INTERVAL …
#define LIMIT_REFRESH_INTERVAL …
#define FAN_PERIOD_TO_RPM(x) …
#define FAN_RPM_TO_PERIOD …
#define FAN_PERIOD_INVALID …
#define FAN_DATA_VALID(x) …
#define MASK_AND_SHIFT(value, prefix) …
struct adt7462_data { … };
static inline int adt7462_read_word_data(struct i2c_client *client, u8 reg)
{ … }
static int ADT7462_REG_FAN(int fan)
{ … }
static int ADT7462_REG_VOLT_MAX(struct adt7462_data *data, int which)
{ … }
static int ADT7462_REG_VOLT_MIN(struct adt7462_data *data, int which)
{ … }
static int ADT7462_REG_VOLT(struct adt7462_data *data, int which)
{ … }
static const char *voltage_label(struct adt7462_data *data, int which)
{ … }
static int voltage_multiplier(struct adt7462_data *data, int which)
{ … }
static int temp_enabled(struct adt7462_data *data, int which)
{ … }
static const char *temp_label(struct adt7462_data *data, int which)
{ … }
#define NUM_TRANGE_VALUES …
static const int trange_values[NUM_TRANGE_VALUES] = …;
static int find_trange_value(int trange)
{ … }
static struct adt7462_data *adt7462_update_device(struct device *dev)
{ … }
static ssize_t temp_min_show(struct device *dev,
struct device_attribute *devattr, char *buf)
{ … }
static ssize_t temp_min_store(struct device *dev,
struct device_attribute *devattr,
const char *buf, size_t count)
{ … }
static ssize_t temp_max_show(struct device *dev,
struct device_attribute *devattr, char *buf)
{ … }
static ssize_t temp_max_store(struct device *dev,
struct device_attribute *devattr,
const char *buf, size_t count)
{ … }
static ssize_t temp_show(struct device *dev, struct device_attribute *devattr,
char *buf)
{ … }
static ssize_t temp_label_show(struct device *dev,
struct device_attribute *devattr, char *buf)
{ … }
static ssize_t volt_max_show(struct device *dev,
struct device_attribute *devattr, char *buf)
{ … }
static ssize_t volt_max_store(struct device *dev,
struct device_attribute *devattr,
const char *buf, size_t count)
{ … }
static ssize_t volt_min_show(struct device *dev,
struct device_attribute *devattr, char *buf)
{ … }
static ssize_t volt_min_store(struct device *dev,
struct device_attribute *devattr,
const char *buf, size_t count)
{ … }
static ssize_t voltage_show(struct device *dev,
struct device_attribute *devattr, char *buf)
{ … }
static ssize_t voltage_label_show(struct device *dev,
struct device_attribute *devattr, char *buf)
{ … }
static ssize_t alarm_show(struct device *dev,
struct device_attribute *devattr, char *buf)
{ … }
static int fan_enabled(struct adt7462_data *data, int fan)
{ … }
static ssize_t fan_min_show(struct device *dev,
struct device_attribute *devattr, char *buf)
{ … }
static ssize_t fan_min_store(struct device *dev,
struct device_attribute *devattr,
const char *buf, size_t count)
{ … }
static ssize_t fan_show(struct device *dev, struct device_attribute *devattr,
char *buf)
{ … }
static ssize_t force_pwm_max_show(struct device *dev,
struct device_attribute *devattr, char *buf)
{ … }
static ssize_t force_pwm_max_store(struct device *dev,
struct device_attribute *devattr,
const char *buf, size_t count)
{ … }
static ssize_t pwm_show(struct device *dev, struct device_attribute *devattr,
char *buf)
{ … }
static ssize_t pwm_store(struct device *dev, struct device_attribute *devattr,
const char *buf, size_t count)
{ … }
static ssize_t pwm_max_show(struct device *dev,
struct device_attribute *devattr, char *buf)
{ … }
static ssize_t pwm_max_store(struct device *dev,
struct device_attribute *devattr,
const char *buf, size_t count)
{ … }
static ssize_t pwm_min_show(struct device *dev,
struct device_attribute *devattr, char *buf)
{ … }
static ssize_t pwm_min_store(struct device *dev,
struct device_attribute *devattr,
const char *buf, size_t count)
{ … }
static ssize_t pwm_hyst_show(struct device *dev,
struct device_attribute *devattr, char *buf)
{ … }
static ssize_t pwm_hyst_store(struct device *dev,
struct device_attribute *devattr,
const char *buf, size_t count)
{ … }
static ssize_t pwm_tmax_show(struct device *dev,
struct device_attribute *devattr, char *buf)
{ … }
static ssize_t pwm_tmax_store(struct device *dev,
struct device_attribute *devattr,
const char *buf, size_t count)
{ … }
static ssize_t pwm_tmin_show(struct device *dev,
struct device_attribute *devattr, char *buf)
{ … }
static ssize_t pwm_tmin_store(struct device *dev,
struct device_attribute *devattr,
const char *buf, size_t count)
{ … }
static ssize_t pwm_auto_show(struct device *dev,
struct device_attribute *devattr, char *buf)
{ … }
static void set_pwm_channel(struct i2c_client *client,
struct adt7462_data *data,
int which,
int value)
{ … }
static ssize_t pwm_auto_store(struct device *dev,
struct device_attribute *devattr,
const char *buf, size_t count)
{ … }
static ssize_t pwm_auto_temp_show(struct device *dev,
struct device_attribute *devattr, char *buf)
{ … }
static int cvt_auto_temp(int input)
{ … }
static ssize_t pwm_auto_temp_store(struct device *dev,
struct device_attribute *devattr,
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 SENSOR_DEVICE_ATTR_RW(temp4_max, temp_max, 3);
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 SENSOR_DEVICE_ATTR_RW(temp4_min, temp_min, 3);
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 SENSOR_DEVICE_ATTR_RO(temp4_input, temp, 3);
static SENSOR_DEVICE_ATTR_RO(temp1_label, temp_label, 0);
static SENSOR_DEVICE_ATTR_RO(temp2_label, temp_label, 1);
static SENSOR_DEVICE_ATTR_RO(temp3_label, temp_label, 2);
static SENSOR_DEVICE_ATTR_RO(temp4_label, temp_label, 3);
static SENSOR_DEVICE_ATTR_RO(temp1_alarm, alarm,
ADT7462_ALARM1 | ADT7462_LT_ALARM);
static SENSOR_DEVICE_ATTR_RO(temp2_alarm, alarm,
ADT7462_ALARM1 | ADT7462_R1T_ALARM);
static SENSOR_DEVICE_ATTR_RO(temp3_alarm, alarm,
ADT7462_ALARM1 | ADT7462_R2T_ALARM);
static SENSOR_DEVICE_ATTR_RO(temp4_alarm, alarm,
ADT7462_ALARM1 | ADT7462_R3T_ALARM);
static SENSOR_DEVICE_ATTR_RW(in1_max, volt_max, 0);
static SENSOR_DEVICE_ATTR_RW(in2_max, volt_max, 1);
static SENSOR_DEVICE_ATTR_RW(in3_max, volt_max, 2);
static SENSOR_DEVICE_ATTR_RW(in4_max, volt_max, 3);
static SENSOR_DEVICE_ATTR_RW(in5_max, volt_max, 4);
static SENSOR_DEVICE_ATTR_RW(in6_max, volt_max, 5);
static SENSOR_DEVICE_ATTR_RW(in7_max, volt_max, 6);
static SENSOR_DEVICE_ATTR_RW(in8_max, volt_max, 7);
static SENSOR_DEVICE_ATTR_RW(in9_max, volt_max, 8);
static SENSOR_DEVICE_ATTR_RW(in10_max, volt_max, 9);
static SENSOR_DEVICE_ATTR_RW(in11_max, volt_max, 10);
static SENSOR_DEVICE_ATTR_RW(in12_max, volt_max, 11);
static SENSOR_DEVICE_ATTR_RW(in13_max, volt_max, 12);
static SENSOR_DEVICE_ATTR_RW(in1_min, volt_min, 0);
static SENSOR_DEVICE_ATTR_RW(in2_min, volt_min, 1);
static SENSOR_DEVICE_ATTR_RW(in3_min, volt_min, 2);
static SENSOR_DEVICE_ATTR_RW(in4_min, volt_min, 3);
static SENSOR_DEVICE_ATTR_RW(in5_min, volt_min, 4);
static SENSOR_DEVICE_ATTR_RW(in6_min, volt_min, 5);
static SENSOR_DEVICE_ATTR_RW(in7_min, volt_min, 6);
static SENSOR_DEVICE_ATTR_RW(in8_min, volt_min, 7);
static SENSOR_DEVICE_ATTR_RW(in9_min, volt_min, 8);
static SENSOR_DEVICE_ATTR_RW(in10_min, volt_min, 9);
static SENSOR_DEVICE_ATTR_RW(in11_min, volt_min, 10);
static SENSOR_DEVICE_ATTR_RW(in12_min, volt_min, 11);
static SENSOR_DEVICE_ATTR_RW(in13_min, volt_min, 12);
static SENSOR_DEVICE_ATTR_RO(in1_input, voltage, 0);
static SENSOR_DEVICE_ATTR_RO(in2_input, voltage, 1);
static SENSOR_DEVICE_ATTR_RO(in3_input, voltage, 2);
static SENSOR_DEVICE_ATTR_RO(in4_input, voltage, 3);
static SENSOR_DEVICE_ATTR_RO(in5_input, voltage, 4);
static SENSOR_DEVICE_ATTR_RO(in6_input, voltage, 5);
static SENSOR_DEVICE_ATTR_RO(in7_input, voltage, 6);
static SENSOR_DEVICE_ATTR_RO(in8_input, voltage, 7);
static SENSOR_DEVICE_ATTR_RO(in9_input, voltage, 8);
static SENSOR_DEVICE_ATTR_RO(in10_input, voltage, 9);
static SENSOR_DEVICE_ATTR_RO(in11_input, voltage, 10);
static SENSOR_DEVICE_ATTR_RO(in12_input, voltage, 11);
static SENSOR_DEVICE_ATTR_RO(in13_input, voltage, 12);
static SENSOR_DEVICE_ATTR_RO(in1_label, voltage_label, 0);
static SENSOR_DEVICE_ATTR_RO(in2_label, voltage_label, 1);
static SENSOR_DEVICE_ATTR_RO(in3_label, voltage_label, 2);
static SENSOR_DEVICE_ATTR_RO(in4_label, voltage_label, 3);
static SENSOR_DEVICE_ATTR_RO(in5_label, voltage_label, 4);
static SENSOR_DEVICE_ATTR_RO(in6_label, voltage_label, 5);
static SENSOR_DEVICE_ATTR_RO(in7_label, voltage_label, 6);
static SENSOR_DEVICE_ATTR_RO(in8_label, voltage_label, 7);
static SENSOR_DEVICE_ATTR_RO(in9_label, voltage_label, 8);
static SENSOR_DEVICE_ATTR_RO(in10_label, voltage_label, 9);
static SENSOR_DEVICE_ATTR_RO(in11_label, voltage_label, 10);
static SENSOR_DEVICE_ATTR_RO(in12_label, voltage_label, 11);
static SENSOR_DEVICE_ATTR_RO(in13_label, voltage_label, 12);
static SENSOR_DEVICE_ATTR_RO(in1_alarm, alarm,
ADT7462_ALARM2 | ADT7462_V0_ALARM);
static SENSOR_DEVICE_ATTR_RO(in2_alarm, alarm,
ADT7462_ALARM2 | ADT7462_V7_ALARM);
static SENSOR_DEVICE_ATTR_RO(in3_alarm, alarm,
ADT7462_ALARM2 | ADT7462_V2_ALARM);
static SENSOR_DEVICE_ATTR_RO(in4_alarm, alarm,
ADT7462_ALARM2 | ADT7462_V6_ALARM);
static SENSOR_DEVICE_ATTR_RO(in5_alarm, alarm,
ADT7462_ALARM2 | ADT7462_V5_ALARM);
static SENSOR_DEVICE_ATTR_RO(in6_alarm, alarm,
ADT7462_ALARM2 | ADT7462_V4_ALARM);
static SENSOR_DEVICE_ATTR_RO(in7_alarm, alarm,
ADT7462_ALARM2 | ADT7462_V3_ALARM);
static SENSOR_DEVICE_ATTR_RO(in8_alarm, alarm,
ADT7462_ALARM2 | ADT7462_V1_ALARM);
static SENSOR_DEVICE_ATTR_RO(in9_alarm, alarm,
ADT7462_ALARM3 | ADT7462_V10_ALARM);
static SENSOR_DEVICE_ATTR_RO(in10_alarm, alarm,
ADT7462_ALARM3 | ADT7462_V9_ALARM);
static SENSOR_DEVICE_ATTR_RO(in11_alarm, alarm,
ADT7462_ALARM3 | ADT7462_V8_ALARM);
static SENSOR_DEVICE_ATTR_RO(in12_alarm, alarm,
ADT7462_ALARM3 | ADT7462_V11_ALARM);
static SENSOR_DEVICE_ATTR_RO(in13_alarm, alarm,
ADT7462_ALARM3 | ADT7462_V12_ALARM);
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 SENSOR_DEVICE_ATTR_RW(fan5_min, fan_min, 4);
static SENSOR_DEVICE_ATTR_RW(fan6_min, fan_min, 5);
static SENSOR_DEVICE_ATTR_RW(fan7_min, fan_min, 6);
static SENSOR_DEVICE_ATTR_RW(fan8_min, fan_min, 7);
static SENSOR_DEVICE_ATTR_RO(fan1_input, fan, 0);
static SENSOR_DEVICE_ATTR_RO(fan2_input, fan, 1);
static SENSOR_DEVICE_ATTR_RO(fan3_input, fan, 2);
static SENSOR_DEVICE_ATTR_RO(fan4_input, fan, 3);
static SENSOR_DEVICE_ATTR_RO(fan5_input, fan, 4);
static SENSOR_DEVICE_ATTR_RO(fan6_input, fan, 5);
static SENSOR_DEVICE_ATTR_RO(fan7_input, fan, 6);
static SENSOR_DEVICE_ATTR_RO(fan8_input, fan, 7);
static SENSOR_DEVICE_ATTR_RO(fan1_alarm, alarm,
ADT7462_ALARM4 | ADT7462_F0_ALARM);
static SENSOR_DEVICE_ATTR_RO(fan2_alarm, alarm,
ADT7462_ALARM4 | ADT7462_F1_ALARM);
static SENSOR_DEVICE_ATTR_RO(fan3_alarm, alarm,
ADT7462_ALARM4 | ADT7462_F2_ALARM);
static SENSOR_DEVICE_ATTR_RO(fan4_alarm, alarm,
ADT7462_ALARM4 | ADT7462_F3_ALARM);
static SENSOR_DEVICE_ATTR_RO(fan5_alarm, alarm,
ADT7462_ALARM4 | ADT7462_F4_ALARM);
static SENSOR_DEVICE_ATTR_RO(fan6_alarm, alarm,
ADT7462_ALARM4 | ADT7462_F5_ALARM);
static SENSOR_DEVICE_ATTR_RO(fan7_alarm, alarm,
ADT7462_ALARM4 | ADT7462_F6_ALARM);
static SENSOR_DEVICE_ATTR_RO(fan8_alarm, alarm,
ADT7462_ALARM4 | ADT7462_F7_ALARM);
static SENSOR_DEVICE_ATTR_RW(force_pwm_max, force_pwm_max, 0);
static SENSOR_DEVICE_ATTR_RW(pwm1, pwm, 0);
static SENSOR_DEVICE_ATTR_RW(pwm2, pwm, 1);
static SENSOR_DEVICE_ATTR_RW(pwm3, pwm, 2);
static SENSOR_DEVICE_ATTR_RW(pwm4, pwm, 3);
static SENSOR_DEVICE_ATTR_RW(pwm1_auto_point1_pwm, pwm_min, 0);
static SENSOR_DEVICE_ATTR_RW(pwm2_auto_point1_pwm, pwm_min, 1);
static SENSOR_DEVICE_ATTR_RW(pwm3_auto_point1_pwm, pwm_min, 2);
static SENSOR_DEVICE_ATTR_RW(pwm4_auto_point1_pwm, pwm_min, 3);
static SENSOR_DEVICE_ATTR_RW(pwm1_auto_point2_pwm, pwm_max, 0);
static SENSOR_DEVICE_ATTR_RW(pwm2_auto_point2_pwm, pwm_max, 1);
static SENSOR_DEVICE_ATTR_RW(pwm3_auto_point2_pwm, pwm_max, 2);
static SENSOR_DEVICE_ATTR_RW(pwm4_auto_point2_pwm, pwm_max, 3);
static SENSOR_DEVICE_ATTR_RW(temp1_auto_point1_hyst, pwm_hyst, 0);
static SENSOR_DEVICE_ATTR_RW(temp2_auto_point1_hyst, pwm_hyst, 1);
static SENSOR_DEVICE_ATTR_RW(temp3_auto_point1_hyst, pwm_hyst, 2);
static SENSOR_DEVICE_ATTR_RW(temp4_auto_point1_hyst, pwm_hyst, 3);
static SENSOR_DEVICE_ATTR_RW(temp1_auto_point2_hyst, pwm_hyst, 0);
static SENSOR_DEVICE_ATTR_RW(temp2_auto_point2_hyst, pwm_hyst, 1);
static SENSOR_DEVICE_ATTR_RW(temp3_auto_point2_hyst, pwm_hyst, 2);
static SENSOR_DEVICE_ATTR_RW(temp4_auto_point2_hyst, pwm_hyst, 3);
static SENSOR_DEVICE_ATTR_RW(temp1_auto_point1_temp, pwm_tmin, 0);
static SENSOR_DEVICE_ATTR_RW(temp2_auto_point1_temp, pwm_tmin, 1);
static SENSOR_DEVICE_ATTR_RW(temp3_auto_point1_temp, pwm_tmin, 2);
static SENSOR_DEVICE_ATTR_RW(temp4_auto_point1_temp, pwm_tmin, 3);
static SENSOR_DEVICE_ATTR_RW(temp1_auto_point2_temp, pwm_tmax, 0);
static SENSOR_DEVICE_ATTR_RW(temp2_auto_point2_temp, pwm_tmax, 1);
static SENSOR_DEVICE_ATTR_RW(temp3_auto_point2_temp, pwm_tmax, 2);
static SENSOR_DEVICE_ATTR_RW(temp4_auto_point2_temp, pwm_tmax, 3);
static SENSOR_DEVICE_ATTR_RW(pwm1_enable, pwm_auto, 0);
static SENSOR_DEVICE_ATTR_RW(pwm2_enable, pwm_auto, 1);
static SENSOR_DEVICE_ATTR_RW(pwm3_enable, pwm_auto, 2);
static SENSOR_DEVICE_ATTR_RW(pwm4_enable, pwm_auto, 3);
static SENSOR_DEVICE_ATTR_RW(pwm1_auto_channels_temp, pwm_auto_temp, 0);
static SENSOR_DEVICE_ATTR_RW(pwm2_auto_channels_temp, pwm_auto_temp, 1);
static SENSOR_DEVICE_ATTR_RW(pwm3_auto_channels_temp, pwm_auto_temp, 2);
static SENSOR_DEVICE_ATTR_RW(pwm4_auto_channels_temp, pwm_auto_temp, 3);
static struct attribute *adt7462_attrs[] = …;
ATTRIBUTE_GROUPS(…);
static int adt7462_detect(struct i2c_client *client,
struct i2c_board_info *info)
{ … }
static int adt7462_probe(struct i2c_client *client)
{ … }
static const struct i2c_device_id adt7462_id[] = …;
MODULE_DEVICE_TABLE(i2c, adt7462_id);
static struct i2c_driver adt7462_driver = …;
module_i2c_driver(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;