#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/err.h>
#include <linux/mutex.h>
#include <linux/io.h>
#include <linux/acpi.h>
#define DRVNAME …
#define SIO_F71858FG_LD_HWM …
#define SIO_F71882FG_LD_HWM …
#define SIO_UNLOCK_KEY …
#define SIO_LOCK_KEY …
#define SIO_REG_LDSEL …
#define SIO_REG_DEVID …
#define SIO_REG_DEVREV …
#define SIO_REG_MANID …
#define SIO_REG_ENABLE …
#define SIO_REG_ADDR …
#define SIO_FINTEK_ID …
#define SIO_F71808E_ID …
#define SIO_F71808A_ID …
#define SIO_F71858_ID …
#define SIO_F71862_ID …
#define SIO_F71868_ID …
#define SIO_F71869_ID …
#define SIO_F71869A_ID …
#define SIO_F71882_ID …
#define SIO_F71889_ID …
#define SIO_F71889E_ID …
#define SIO_F71889A_ID …
#define SIO_F8000_ID …
#define SIO_F81768D_ID …
#define SIO_F81865_ID …
#define SIO_F81866_ID …
#define SIO_F71858AD_ID …
#define SIO_F81966_ID …
#define REGION_LENGTH …
#define ADDR_REG_OFFSET …
#define DATA_REG_OFFSET …
#define F71882FG_REG_IN_STATUS …
#define F71882FG_REG_IN_BEEP …
#define F71882FG_REG_IN(nr) …
#define F71882FG_REG_IN1_HIGH …
#define F81866_REG_IN_STATUS …
#define F81866_REG_IN_BEEP …
#define F81866_REG_IN1_HIGH …
#define F71882FG_REG_FAN(nr) …
#define F71882FG_REG_FAN_TARGET(nr) …
#define F71882FG_REG_FAN_FULL_SPEED(nr) …
#define F71882FG_REG_FAN_STATUS …
#define F71882FG_REG_FAN_BEEP …
#define F71882FG_REG_TEMP(nr) …
#define F71882FG_REG_TEMP_OVT(nr) …
#define F71882FG_REG_TEMP_HIGH(nr) …
#define F71882FG_REG_TEMP_STATUS …
#define F71882FG_REG_TEMP_BEEP …
#define F71882FG_REG_TEMP_CONFIG …
#define F71882FG_REG_TEMP_HYST(nr) …
#define F71882FG_REG_TEMP_TYPE …
#define F71882FG_REG_TEMP_DIODE_OPEN …
#define F71882FG_REG_PWM(nr) …
#define F71882FG_REG_PWM_TYPE …
#define F71882FG_REG_PWM_ENABLE …
#define F71882FG_REG_FAN_HYST(nr) …
#define F71882FG_REG_FAN_FAULT_T …
#define F71882FG_FAN_NEG_TEMP_EN …
#define F71882FG_FAN_PROG_SEL …
#define F71882FG_REG_POINT_PWM(pwm, point) …
#define F71882FG_REG_POINT_TEMP(pwm, point) …
#define F71882FG_REG_POINT_MAPPING(nr) …
#define F71882FG_REG_START …
#define F71882FG_MAX_INS …
#define FAN_MIN_DETECT …
static unsigned short force_id;
module_param(force_id, ushort, 0);
MODULE_PARM_DESC(…) …;
enum chips { … };
static const char *const f71882fg_names[] = …;
static const char f71882fg_has_in[][F71882FG_MAX_INS] = …;
static const char f71882fg_has_in1_alarm[] = …;
static const char f71882fg_fan_has_beep[] = …;
static const char f71882fg_nr_fans[] = …;
static const char f71882fg_temp_has_beep[] = …;
static const char f71882fg_nr_temps[] = …;
static struct platform_device *f71882fg_pdev;
struct f71882fg_sio_data { … };
struct f71882fg_data { … };
static u8 f71882fg_read8(struct f71882fg_data *data, u8 reg)
{ … }
static u16 f71882fg_read16(struct f71882fg_data *data, u8 reg)
{ … }
static inline int fan_from_reg(u16 reg)
{ … }
static inline u16 fan_to_reg(int fan)
{ … }
static void f71882fg_write8(struct f71882fg_data *data, u8 reg, u8 val)
{ … }
static void f71882fg_write16(struct f71882fg_data *data, u8 reg, u16 val)
{ … }
static u16 f71882fg_read_temp(struct f71882fg_data *data, int nr)
{ … }
static struct f71882fg_data *f71882fg_update_device(struct device *dev)
{ … }
static ssize_t name_show(struct device *dev, struct device_attribute *devattr,
char *buf)
{ … }
static DEVICE_ATTR_RO(name);
static ssize_t show_temp(struct device *dev, struct device_attribute *devattr,
char *buf)
{ … }
static ssize_t show_temp_max(struct device *dev, struct device_attribute
*devattr, char *buf)
{ … }
static ssize_t store_temp_max(struct device *dev, struct device_attribute
*devattr, const char *buf, size_t count)
{ … }
static ssize_t show_temp_max_hyst(struct device *dev, struct device_attribute
*devattr, char *buf)
{ … }
static ssize_t store_temp_max_hyst(struct device *dev, struct device_attribute
*devattr, const char *buf, size_t count)
{ … }
static ssize_t show_temp_alarm(struct device *dev, struct device_attribute
*devattr, char *buf)
{ … }
static ssize_t show_temp_crit(struct device *dev, struct device_attribute
*devattr, char *buf)
{ … }
static ssize_t store_temp_crit(struct device *dev, struct device_attribute
*devattr, const char *buf, size_t count)
{ … }
static ssize_t show_temp_crit_hyst(struct device *dev, struct device_attribute
*devattr, char *buf)
{ … }
static ssize_t show_temp_fault(struct device *dev, struct device_attribute
*devattr, char *buf)
{ … }
static struct sensor_device_attribute_2 f71858fg_temp_attr[] = …;
static ssize_t show_temp_type(struct device *dev, struct device_attribute
*devattr, char *buf)
{ … }
static struct sensor_device_attribute_2 fxxxx_temp_attr[3][9] = …;
static ssize_t show_temp_beep(struct device *dev, struct device_attribute
*devattr, char *buf)
{ … }
static ssize_t store_temp_beep(struct device *dev, struct device_attribute
*devattr, const char *buf, size_t count)
{ … }
static struct sensor_device_attribute_2 fxxxx_temp_beep_attr[3][2] = …;
static struct sensor_device_attribute_2 f81866_temp_beep_attr[3][2] = …;
static struct sensor_device_attribute_2 f8000_temp_attr[] = …;
static ssize_t show_in(struct device *dev, struct device_attribute *devattr,
char *buf)
{ … }
static struct sensor_device_attribute_2 fxxxx_in_attr[] = …;
static ssize_t show_in_max(struct device *dev, struct device_attribute
*devattr, char *buf)
{ … }
static ssize_t store_in_max(struct device *dev, struct device_attribute
*devattr, const char *buf, size_t count)
{ … }
static ssize_t show_in_beep(struct device *dev, struct device_attribute
*devattr, char *buf)
{ … }
static ssize_t store_in_beep(struct device *dev, struct device_attribute
*devattr, const char *buf, size_t count)
{ … }
static ssize_t show_in_alarm(struct device *dev, struct device_attribute
*devattr, char *buf)
{ … }
static struct sensor_device_attribute_2 fxxxx_in1_alarm_attr[] = …;
static ssize_t show_fan(struct device *dev, struct device_attribute *devattr,
char *buf)
{ … }
static ssize_t show_fan_full_speed(struct device *dev,
struct device_attribute *devattr, char *buf)
{ … }
static ssize_t store_fan_full_speed(struct device *dev,
struct device_attribute *devattr,
const char *buf, size_t count)
{ … }
static ssize_t show_fan_alarm(struct device *dev, struct device_attribute
*devattr, char *buf)
{ … }
static ssize_t show_pwm(struct device *dev,
struct device_attribute *devattr, char *buf)
{ … }
static ssize_t store_pwm(struct device *dev,
struct device_attribute *devattr, const char *buf,
size_t count)
{ … }
static ssize_t show_pwm_enable(struct device *dev,
struct device_attribute *devattr, char *buf)
{ … }
static ssize_t store_pwm_enable(struct device *dev, struct device_attribute
*devattr, const char *buf, size_t count)
{ … }
static ssize_t show_pwm_interpolate(struct device *dev,
struct device_attribute *devattr, char *buf)
{ … }
static ssize_t store_pwm_interpolate(struct device *dev,
struct device_attribute *devattr,
const char *buf, size_t count)
{ … }
static struct sensor_device_attribute_2 fxxxx_fan_attr[4][6] = …;
static ssize_t show_simple_pwm(struct device *dev,
struct device_attribute *devattr, char *buf)
{ … }
static ssize_t store_simple_pwm(struct device *dev,
struct device_attribute *devattr,
const char *buf, size_t count)
{ … }
static struct sensor_device_attribute_2 f71808a_fan3_attr[] = …;
static ssize_t show_fan_beep(struct device *dev, struct device_attribute
*devattr, char *buf)
{ … }
static ssize_t store_fan_beep(struct device *dev, struct device_attribute
*devattr, const char *buf, size_t count)
{ … }
static struct sensor_device_attribute_2 fxxxx_fan_beep_attr[] = …;
static ssize_t show_pwm_auto_point_channel(struct device *dev,
struct device_attribute *devattr,
char *buf)
{ … }
static ssize_t store_pwm_auto_point_channel(struct device *dev,
struct device_attribute *devattr,
const char *buf, size_t count)
{ … }
static ssize_t show_pwm_auto_point_pwm(struct device *dev,
struct device_attribute *devattr,
char *buf)
{ … }
static ssize_t store_pwm_auto_point_pwm(struct device *dev,
struct device_attribute *devattr,
const char *buf, size_t count)
{ … }
static ssize_t show_pwm_auto_point_temp(struct device *dev,
struct device_attribute *devattr,
char *buf)
{ … }
static ssize_t store_pwm_auto_point_temp(struct device *dev,
struct device_attribute *devattr,
const char *buf, size_t count)
{ … }
static ssize_t show_pwm_auto_point_temp_hyst(struct device *dev,
struct device_attribute *devattr,
char *buf)
{ … }
static ssize_t store_pwm_auto_point_temp_hyst(struct device *dev,
struct device_attribute *devattr,
const char *buf, size_t count)
{ … }
static struct sensor_device_attribute_2 f71862fg_auto_pwm_attr[3][7] = …;
static struct sensor_device_attribute_2 f71869_auto_pwm_attr[3][8] = …;
static struct sensor_device_attribute_2 fxxxx_auto_pwm_attr[4][14] = …;
static struct sensor_device_attribute_2 f8000_fan_attr[] = …;
static struct sensor_device_attribute_2 f8000_auto_pwm_attr[3][14] = …;
static inline int superio_inb(int base, int reg)
{ … }
static int superio_inw(int base, int reg)
{ … }
static inline int superio_enter(int base)
{ … }
static inline void superio_select(int base, int ld)
{ … }
static inline void superio_exit(int base)
{ … }
static int f71882fg_create_sysfs_files(struct platform_device *pdev,
struct sensor_device_attribute_2 *attr, int count)
{ … }
static void f71882fg_remove_sysfs_files(struct platform_device *pdev,
struct sensor_device_attribute_2 *attr, int count)
{ … }
static int f71882fg_create_fan_sysfs_files(
struct platform_device *pdev, int idx)
{ … }
static void f71882fg_remove(struct platform_device *pdev)
{ … }
static int f71882fg_probe(struct platform_device *pdev)
{ … }
static int __init f71882fg_find(int sioaddr, struct f71882fg_sio_data *sio_data)
{ … }
static int __init f71882fg_device_add(int address,
const struct f71882fg_sio_data *sio_data)
{ … }
static struct platform_driver f71882fg_driver = …;
static int __init f71882fg_init(void)
{ … }
static void __exit f71882fg_exit(void)
{ … }
MODULE_DESCRIPTION(…) …;
MODULE_AUTHOR(…) …;
MODULE_LICENSE(…) …;
module_init(…) …;
module_exit(f71882fg_exit);