#define pr_fmt(fmt) …
#include <linux/module.h>
#include <linux/init.h>
#include <linux/slab.h>
#include <linux/jiffies.h>
#include <linux/platform_device.h>
#include <linux/hwmon.h>
#include <linux/hwmon-sysfs.h>
#include <linux/hwmon-vid.h>
#include <linux/err.h>
#include <linux/mutex.h>
#include <linux/ioport.h>
#include <linux/acpi.h>
#include <linux/io.h>
static int uch_config = …;
module_param(uch_config, int, 0);
MODULE_PARM_DESC(…) …;
static int int_mode = …;
module_param(int_mode, int, 0);
MODULE_PARM_DESC(…) …;
static unsigned short force_id;
module_param(force_id, ushort, 0);
MODULE_PARM_DESC(…) …;
static struct platform_device *pdev;
#define DRVNAME …
#define VT1211_REG_IN(ix) …
#define VT1211_REG_IN_MIN(ix) …
#define VT1211_REG_IN_MAX(ix) …
static u8 regtemp[] = …;
static u8 regtempmax[] = …;
static u8 regtemphyst[] = …;
#define VT1211_REG_FAN(ix) …
#define VT1211_REG_FAN_MIN(ix) …
#define VT1211_REG_FAN_DIV …
#define VT1211_REG_PWM(ix) …
#define VT1211_REG_PWM_CLK …
#define VT1211_REG_PWM_CTL …
#define VT1211_REG_PWM_AUTO_TEMP(ap) …
#define VT1211_REG_PWM_AUTO_PWM(ix, ap) …
#define VT1211_REG_CONFIG …
#define VT1211_REG_ALARM1 …
#define VT1211_REG_ALARM2 …
#define VT1211_REG_VID …
#define VT1211_REG_UCH_CONFIG …
#define VT1211_REG_TEMP1_CONFIG …
#define VT1211_REG_TEMP2_CONFIG …
static const u8 bitalarmin[] = …;
static const u8 bitalarmtemp[] = …;
static const u8 bitalarmfan[] = …;
struct vt1211_data { … };
#define ISVOLT(ix, uch_config) …
#define ISTEMP(ix, uch_config) …
#define IN_FROM_REG(ix, reg) …
#define IN_TO_REG(ix, val) …
#define TEMP_FROM_REG(ix, reg) …
#define TEMP_TO_REG(ix, val) …
#define DIV_FROM_REG(reg) …
#define RPM_FROM_REG(reg, div) …
#define RPM_TO_REG(val, div) …
#define SIO_REG_CIP1 …
#define SIO_REG_CIP2 …
#define SIO_VT1211_LDN …
#define SIO_VT1211_DEVID …
#define SIO_VT1211_DEVREV …
#define SIO_VT1211_ACTIVE …
#define SIO_VT1211_BADDR …
#define SIO_VT1211_ID …
#define SIO_VT1211_LDN_HWMON …
static inline int superio_inb(int sio_cip, int reg)
{ … }
static inline void superio_select(int sio_cip, int ldn)
{ … }
static inline int superio_enter(int sio_cip)
{ … }
static inline void superio_exit(int sio_cip)
{ … }
static inline u8 vt1211_read8(struct vt1211_data *data, u8 reg)
{ … }
static inline void vt1211_write8(struct vt1211_data *data, u8 reg, u8 val)
{ … }
static struct vt1211_data *vt1211_update_device(struct device *dev)
{ … }
#define SHOW_IN_INPUT …
#define SHOW_SET_IN_MIN …
#define SHOW_SET_IN_MAX …
#define SHOW_IN_ALARM …
static ssize_t show_in(struct device *dev, struct device_attribute *attr,
char *buf)
{ … }
static ssize_t set_in(struct device *dev, struct device_attribute *attr,
const char *buf, size_t count)
{ … }
#define SHOW_TEMP_INPUT …
#define SHOW_SET_TEMP_MAX …
#define SHOW_SET_TEMP_MAX_HYST …
#define SHOW_TEMP_ALARM …
static ssize_t show_temp(struct device *dev, struct device_attribute *attr,
char *buf)
{ … }
static ssize_t set_temp(struct device *dev, struct device_attribute *attr,
const char *buf, size_t count)
{ … }
#define SHOW_FAN_INPUT …
#define SHOW_SET_FAN_MIN …
#define SHOW_SET_FAN_DIV …
#define SHOW_FAN_ALARM …
static ssize_t show_fan(struct device *dev, struct device_attribute *attr,
char *buf)
{ … }
static ssize_t set_fan(struct device *dev, struct device_attribute *attr,
const char *buf, size_t count)
{ … }
#define SHOW_PWM …
#define SHOW_SET_PWM_ENABLE …
#define SHOW_SET_PWM_FREQ …
#define SHOW_SET_PWM_AUTO_CHANNELS_TEMP …
static ssize_t show_pwm(struct device *dev, struct device_attribute *attr,
char *buf)
{ … }
static ssize_t set_pwm(struct device *dev, struct device_attribute *attr,
const char *buf, size_t count)
{ … }
static ssize_t show_pwm_auto_point_temp(struct device *dev,
struct device_attribute *attr,
char *buf)
{ … }
static ssize_t set_pwm_auto_point_temp(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t count)
{ … }
static ssize_t show_pwm_auto_point_pwm(struct device *dev,
struct device_attribute *attr,
char *buf)
{ … }
static ssize_t set_pwm_auto_point_pwm(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t count)
{ … }
static ssize_t show_vrm(struct device *dev, struct device_attribute *attr,
char *buf)
{ … }
static ssize_t set_vrm(struct device *dev, struct device_attribute *attr,
const char *buf, size_t count)
{ … }
static ssize_t show_vid(struct device *dev, struct device_attribute *attr,
char *buf)
{ … }
static ssize_t show_name(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static ssize_t show_alarms(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
#define SENSOR_ATTR_IN(ix) …
static struct sensor_device_attribute_2 vt1211_sysfs_in[][4] = …;
#define IN_UNIT_ATTRS(X) …
static struct attribute *vt1211_in_attr[][5] = …;
static const struct attribute_group vt1211_in_attr_group[] = …;
#define SENSOR_ATTR_TEMP(ix) …
static struct sensor_device_attribute_2 vt1211_sysfs_temp[][4] = …;
#define TEMP_UNIT_ATTRS(X) …
static struct attribute *vt1211_temp_attr[][5] = …;
static const struct attribute_group vt1211_temp_attr_group[] = …;
#define SENSOR_ATTR_FAN(ix) …
#define SENSOR_ATTR_PWM(ix) …
#define SENSOR_ATTR_PWM_FREQ(ix) …
#define SENSOR_ATTR_PWM_FREQ_RO(ix) …
#define SENSOR_ATTR_PWM_AUTO_POINT_TEMP(ix, ap) …
#define SENSOR_ATTR_PWM_AUTO_POINT_TEMP_RO(ix, ap) …
#define SENSOR_ATTR_PWM_AUTO_POINT_PWM(ix, ap) …
#define SENSOR_ATTR_PWM_AUTO_POINT_PWM_RO(ix, ap) …
static struct sensor_device_attribute_2 vt1211_sysfs_fan_pwm[] = …;
static struct device_attribute vt1211_sysfs_misc[] = …;
static void vt1211_init_device(struct vt1211_data *data)
{ … }
static void vt1211_remove_sysfs(struct platform_device *pdev)
{ … }
static int vt1211_probe(struct platform_device *pdev)
{ … }
static void vt1211_remove(struct platform_device *pdev)
{ … }
static struct platform_driver vt1211_driver = …;
static int __init vt1211_device_add(unsigned short address)
{ … }
static int __init vt1211_find(int sio_cip, unsigned short *address)
{ … }
static int __init vt1211_init(void)
{ … }
static void __exit vt1211_exit(void)
{ … }
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;
module_init(…) …;
module_exit(vt1211_exit);