#define pr_fmt(fmt) …
#include <linux/module.h>
#include <linux/init.h>
#include <linux/slab.h>
#include <linux/pci.h>
#include <linux/jiffies.h>
#include <linux/platform_device.h>
#include <linux/hwmon.h>
#include <linux/hwmon-sysfs.h>
#include <linux/err.h>
#include <linux/mutex.h>
#include <linux/acpi.h>
#include <linux/io.h>
static int force_addr;
module_param(force_addr, int, 0);
MODULE_PARM_DESC(…) …;
static struct platform_device *pdev;
#define VT8231_EXTENT …
#define VT8231_BASE_REG …
#define VT8231_ENABLE_REG …
#define DRIVER_NAME …
#define VT8231_REG_FAN_MIN(nr) …
#define VT8231_REG_FAN(nr) …
static const u8 regvolt[] = …;
static const u8 regvoltmax[] = …;
static const u8 regvoltmin[] = …;
#define VT8231_REG_TEMP_LOW01 …
#define VT8231_REG_TEMP_LOW25 …
static const u8 regtemp[] = …;
static const u8 regtempmax[] = …;
static const u8 regtempmin[] = …;
#define TEMP_FROM_REG(reg) …
#define TEMP_MAXMIN_FROM_REG(reg) …
#define TEMP_MAXMIN_TO_REG(val) …
#define VT8231_REG_CONFIG …
#define VT8231_REG_ALARM1 …
#define VT8231_REG_ALARM2 …
#define VT8231_REG_FANDIV …
#define VT8231_REG_UCH_CONFIG …
#define VT8231_REG_TEMP1_CONFIG …
#define VT8231_REG_TEMP2_CONFIG …
#define ISTEMP(i, ch_config) …
#define ISVOLT(i, ch_config) …
#define DIV_FROM_REG(val) …
static inline u8 FAN_TO_REG(long rpm, int div)
{ … }
#define FAN_FROM_REG(val, div) …
struct vt8231_data { … };
static struct pci_dev *s_bridge;
static inline int vt8231_read_value(struct vt8231_data *data, u8 reg)
{ … }
static inline void vt8231_write_value(struct vt8231_data *data, u8 reg,
u8 value)
{ … }
static struct vt8231_data *vt8231_update_device(struct device *dev)
{ … }
static ssize_t in_show(struct device *dev, struct device_attribute *attr,
char *buf)
{ … }
static ssize_t in_min_show(struct device *dev, struct device_attribute *attr,
char *buf)
{ … }
static ssize_t in_max_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 ssize_t in_max_store(struct device *dev, struct device_attribute *attr,
const char *buf, size_t count)
{ … }
static ssize_t in5_input_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static ssize_t in5_min_show(struct device *dev, struct device_attribute *attr,
char *buf)
{ … }
static ssize_t in5_max_show(struct device *dev, struct device_attribute *attr,
char *buf)
{ … }
static ssize_t in5_min_store(struct device *dev,
struct device_attribute *attr, const char *buf,
size_t count)
{ … }
static ssize_t in5_max_store(struct device *dev,
struct device_attribute *attr, const char *buf,
size_t count)
{ … }
static SENSOR_DEVICE_ATTR_RO(in0_input, in, 0);
static SENSOR_DEVICE_ATTR_RW(in0_min, in_min, 0);
static SENSOR_DEVICE_ATTR_RW(in0_max, in_max, 0);
static SENSOR_DEVICE_ATTR_RO(in1_input, in, 1);
static SENSOR_DEVICE_ATTR_RW(in1_min, in_min, 1);
static SENSOR_DEVICE_ATTR_RW(in1_max, in_max, 1);
static SENSOR_DEVICE_ATTR_RO(in2_input, in, 2);
static SENSOR_DEVICE_ATTR_RW(in2_min, in_min, 2);
static SENSOR_DEVICE_ATTR_RW(in2_max, in_max, 2);
static SENSOR_DEVICE_ATTR_RO(in3_input, in, 3);
static SENSOR_DEVICE_ATTR_RW(in3_min, in_min, 3);
static SENSOR_DEVICE_ATTR_RW(in3_max, in_max, 3);
static SENSOR_DEVICE_ATTR_RO(in4_input, in, 4);
static SENSOR_DEVICE_ATTR_RW(in4_min, in_min, 4);
static SENSOR_DEVICE_ATTR_RW(in4_max, in_max, 4);
static DEVICE_ATTR_RO(in5_input);
static DEVICE_ATTR_RW(in5_min);
static DEVICE_ATTR_RW(in5_max);
static ssize_t temp1_input_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static ssize_t temp1_max_show(struct device *dev, struct device_attribute *attr,
char *buf)
{ … }
static ssize_t temp1_max_hyst_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static ssize_t temp1_max_store(struct device *dev,
struct device_attribute *attr, const char *buf,
size_t count)
{ … }
static ssize_t temp1_max_hyst_store(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t count)
{ … }
static ssize_t temp_show(struct device *dev, struct device_attribute *attr,
char *buf)
{ … }
static ssize_t temp_max_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static ssize_t temp_min_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 ssize_t temp_min_store(struct device *dev,
struct device_attribute *attr, const char *buf,
size_t count)
{ … }
static DEVICE_ATTR_RO(temp1_input);
static DEVICE_ATTR_RW(temp1_max);
static DEVICE_ATTR_RW(temp1_max_hyst);
static SENSOR_DEVICE_ATTR_RO(temp2_input, temp, 1);
static SENSOR_DEVICE_ATTR_RW(temp2_max, temp_max, 1);
static SENSOR_DEVICE_ATTR_RW(temp2_max_hyst, temp_min, 1);
static SENSOR_DEVICE_ATTR_RO(temp3_input, temp, 2);
static SENSOR_DEVICE_ATTR_RW(temp3_max, temp_max, 2);
static SENSOR_DEVICE_ATTR_RW(temp3_max_hyst, temp_min, 2);
static SENSOR_DEVICE_ATTR_RO(temp4_input, temp, 3);
static SENSOR_DEVICE_ATTR_RW(temp4_max, temp_max, 3);
static SENSOR_DEVICE_ATTR_RW(temp4_max_hyst, temp_min, 3);
static SENSOR_DEVICE_ATTR_RO(temp5_input, temp, 4);
static SENSOR_DEVICE_ATTR_RW(temp5_max, temp_max, 4);
static SENSOR_DEVICE_ATTR_RW(temp5_max_hyst, temp_min, 4);
static SENSOR_DEVICE_ATTR_RO(temp6_input, temp, 5);
static SENSOR_DEVICE_ATTR_RW(temp6_max, temp_max, 5);
static SENSOR_DEVICE_ATTR_RW(temp6_max_hyst, temp_min, 5);
static ssize_t fan_show(struct device *dev, struct device_attribute *attr,
char *buf)
{ … }
static ssize_t fan_min_show(struct device *dev, struct device_attribute *attr,
char *buf)
{ … }
static ssize_t fan_div_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 ssize_t fan_div_store(struct device *dev,
struct device_attribute *attr, const char *buf,
size_t count)
{ … }
static SENSOR_DEVICE_ATTR_RO(fan1_input, fan, 0);
static SENSOR_DEVICE_ATTR_RW(fan1_min, fan_min, 0);
static SENSOR_DEVICE_ATTR_RW(fan1_div, fan_div, 0);
static SENSOR_DEVICE_ATTR_RO(fan2_input, fan, 1);
static SENSOR_DEVICE_ATTR_RW(fan2_min, fan_min, 1);
static SENSOR_DEVICE_ATTR_RW(fan2_div, fan_div, 1);
static ssize_t alarms_show(struct device *dev, struct device_attribute *attr,
char *buf)
{ … }
static DEVICE_ATTR_RO(alarms);
static ssize_t alarm_show(struct device *dev, struct device_attribute *attr,
char *buf)
{ … }
static SENSOR_DEVICE_ATTR_RO(temp1_alarm, alarm, 4);
static SENSOR_DEVICE_ATTR_RO(temp2_alarm, alarm, 11);
static SENSOR_DEVICE_ATTR_RO(temp3_alarm, alarm, 0);
static SENSOR_DEVICE_ATTR_RO(temp4_alarm, alarm, 1);
static SENSOR_DEVICE_ATTR_RO(temp5_alarm, alarm, 3);
static SENSOR_DEVICE_ATTR_RO(temp6_alarm, alarm, 8);
static SENSOR_DEVICE_ATTR_RO(in0_alarm, alarm, 11);
static SENSOR_DEVICE_ATTR_RO(in1_alarm, alarm, 0);
static SENSOR_DEVICE_ATTR_RO(in2_alarm, alarm, 1);
static SENSOR_DEVICE_ATTR_RO(in3_alarm, alarm, 3);
static SENSOR_DEVICE_ATTR_RO(in4_alarm, alarm, 8);
static SENSOR_DEVICE_ATTR_RO(in5_alarm, alarm, 2);
static SENSOR_DEVICE_ATTR_RO(fan1_alarm, alarm, 6);
static SENSOR_DEVICE_ATTR_RO(fan2_alarm, alarm, 7);
static ssize_t name_show(struct device *dev, struct device_attribute
*devattr, char *buf)
{ … }
static DEVICE_ATTR_RO(name);
static struct attribute *vt8231_attributes_temps[6][5] = …;
static const struct attribute_group vt8231_group_temps[6] = …;
static struct attribute *vt8231_attributes_volts[6][5] = …;
static const struct attribute_group vt8231_group_volts[6] = …;
static struct attribute *vt8231_attributes[] = …;
static const struct attribute_group vt8231_group = …;
static void vt8231_init_device(struct vt8231_data *data)
{ … }
static int vt8231_probe(struct platform_device *pdev)
{ … }
static void vt8231_remove(struct platform_device *pdev)
{ … }
static struct platform_driver vt8231_driver = …;
static const struct pci_device_id vt8231_pci_ids[] = …;
MODULE_DEVICE_TABLE(pci, vt8231_pci_ids);
static int vt8231_device_add(unsigned short address)
{ … }
static int vt8231_pci_probe(struct pci_dev *dev,
const struct pci_device_id *id)
{ … }
static struct pci_driver vt8231_pci_driver = …;
static int __init sm_vt8231_init(void)
{ … }
static void __exit sm_vt8231_exit(void)
{ … }
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;
module_init(…) …;
module_exit(sm_vt8231_exit);