#define DRIVER_NAME …
#define pr_fmt(fmt) …
#include <linux/module.h>
#include <linux/slab.h>
#include <linux/ioport.h>
#include <linux/pci.h>
#include <linux/platform_device.h>
#include <linux/hwmon.h>
#include <linux/hwmon-sysfs.h>
#include <linux/err.h>
#include <linux/init.h>
#include <linux/jiffies.h>
#include <linux/mutex.h>
#include <linux/sysfs.h>
#include <linux/acpi.h>
#include <linux/io.h>
static u16 force_addr;
module_param(force_addr, ushort, 0);
MODULE_PARM_DESC(…) …;
static struct platform_device *pdev;
#define SIS5595_EXTENT …
#define SIS5595_BASE_REG …
#define SIS5595_PIN_REG …
#define SIS5595_ENABLE_REG …
#define SIS5595_ADDR_REG_OFFSET …
#define SIS5595_DATA_REG_OFFSET …
#define SIS5595_REG_IN_MAX(nr) …
#define SIS5595_REG_IN_MIN(nr) …
#define SIS5595_REG_IN(nr) …
#define SIS5595_REG_FAN_MIN(nr) …
#define SIS5595_REG_FAN(nr) …
#define REV2MIN …
#define SIS5595_REG_TEMP …
#define SIS5595_REG_TEMP_OVER …
#define SIS5595_REG_TEMP_HYST …
#define SIS5595_REG_CONFIG …
#define SIS5595_REG_ALARM1 …
#define SIS5595_REG_ALARM2 …
#define SIS5595_REG_FANDIV …
static inline u8 IN_TO_REG(unsigned long val)
{ … }
#define IN_FROM_REG(val) …
static inline u8 FAN_TO_REG(long rpm, int div)
{ … }
static inline int FAN_FROM_REG(u8 val, int div)
{ … }
static inline int TEMP_FROM_REG(s8 val)
{ … }
static inline s8 TEMP_TO_REG(long val)
{ … }
#define DIV_FROM_REG(val) …
struct sis5595_data { … };
static struct pci_dev *s_bridge;
static int sis5595_read_value(struct sis5595_data *data, u8 reg)
{ … }
static void sis5595_write_value(struct sis5595_data *data, u8 reg, u8 value)
{ … }
static struct sis5595_data *sis5595_update_device(struct device *dev)
{ … }
static ssize_t in_show(struct device *dev, struct device_attribute *da,
char *buf)
{ … }
static ssize_t in_min_show(struct device *dev, struct device_attribute *da,
char *buf)
{ … }
static ssize_t in_max_show(struct device *dev, struct device_attribute *da,
char *buf)
{ … }
static ssize_t in_min_store(struct device *dev, struct device_attribute *da,
const char *buf, size_t count)
{ … }
static ssize_t in_max_store(struct device *dev, struct device_attribute *da,
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 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_store(struct device *dev,
struct device_attribute *attr, const char *buf,
size_t count)
{ … }
static ssize_t temp1_max_hyst_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static ssize_t temp1_max_hyst_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 ssize_t fan_show(struct device *dev, struct device_attribute *da,
char *buf)
{ … }
static ssize_t fan_min_show(struct device *dev, struct device_attribute *da,
char *buf)
{ … }
static ssize_t fan_min_store(struct device *dev, struct device_attribute *da,
const char *buf, size_t count)
{ … }
static ssize_t fan_div_show(struct device *dev, struct device_attribute *da,
char *buf)
{ … }
static ssize_t fan_div_store(struct device *dev, struct device_attribute *da,
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 *da,
char *buf)
{ … }
static SENSOR_DEVICE_ATTR_RO(in0_alarm, alarm, 0);
static SENSOR_DEVICE_ATTR_RO(in1_alarm, alarm, 1);
static SENSOR_DEVICE_ATTR_RO(in2_alarm, alarm, 2);
static SENSOR_DEVICE_ATTR_RO(in3_alarm, alarm, 3);
static SENSOR_DEVICE_ATTR_RO(in4_alarm, alarm, 15);
static SENSOR_DEVICE_ATTR_RO(fan1_alarm, alarm, 6);
static SENSOR_DEVICE_ATTR_RO(fan2_alarm, alarm, 7);
static SENSOR_DEVICE_ATTR_RO(temp1_alarm, alarm, 15);
static ssize_t name_show(struct device *dev, struct device_attribute *attr,
char *buf)
{ … }
static DEVICE_ATTR_RO(name);
static struct attribute *sis5595_attributes[] = …;
static const struct attribute_group sis5595_group = …;
static struct attribute *sis5595_attributes_in4[] = …;
static const struct attribute_group sis5595_group_in4 = …;
static struct attribute *sis5595_attributes_temp1[] = …;
static const struct attribute_group sis5595_group_temp1 = …;
static void sis5595_init_device(struct sis5595_data *data)
{ … }
static int sis5595_probe(struct platform_device *pdev)
{ … }
static void sis5595_remove(struct platform_device *pdev)
{ … }
static const struct pci_device_id sis5595_pci_ids[] = …;
MODULE_DEVICE_TABLE(pci, sis5595_pci_ids);
static int blacklist[] = …;
static int sis5595_device_add(unsigned short address)
{ … }
static struct platform_driver sis5595_driver = …;
static int sis5595_pci_probe(struct pci_dev *dev,
const struct pci_device_id *id)
{ … }
static struct pci_driver sis5595_pci_driver = …;
static int __init sm_sis5595_init(void)
{ … }
static void __exit sm_sis5595_exit(void)
{ … }
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;
module_init(…) …;
module_exit(sm_sis5595_exit);