#define pr_fmt(fmt) …
#include <linux/module.h>
#include <linux/slab.h>
#include <linux/ioport.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/init.h>
#include <linux/mutex.h>
#include <linux/acpi.h>
#include <linux/io.h>
static unsigned short force_id;
module_param(force_id, ushort, 0);
MODULE_PARM_DESC(…) …;
static struct platform_device *pdev;
#define DRVNAME …
#define REG …
#define VAL …
static inline void superio_outb(int reg, int val)
{ … }
static inline int superio_inb(int reg)
{ … }
static inline void superio_select(int ld)
{ … }
static inline int superio_enter(void)
{ … }
static inline void superio_exit(void)
{ … }
#define SUPERIO_REG_DEVID …
#define SUPERIO_REG_DEVREV …
#define SUPERIO_REG_BASE_MSB …
#define SUPERIO_REG_BASE_LSB …
#define SUPERIO_REG_LD8 …
#define SMSC_EXTENT …
static u8 smsc47b397_reg_temp[] = …;
#define SMSC47B397_REG_TEMP(nr) …
#define SMSC47B397_REG_FAN_LSB(nr) …
#define SMSC47B397_REG_FAN_MSB(nr) …
struct smsc47b397_data { … };
static int smsc47b397_read_value(struct smsc47b397_data *data, u8 reg)
{ … }
static struct smsc47b397_data *smsc47b397_update_device(struct device *dev)
{ … }
static int temp_from_reg(u8 reg)
{ … }
static ssize_t temp_show(struct device *dev, struct device_attribute *devattr,
char *buf)
{ … }
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 int fan_from_reg(u16 reg)
{ … }
static ssize_t fan_show(struct device *dev, struct device_attribute *devattr,
char *buf)
{ … }
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 struct attribute *smsc47b397_attrs[] = …;
ATTRIBUTE_GROUPS(…);
static int smsc47b397_probe(struct platform_device *pdev);
static struct platform_driver smsc47b397_driver = …;
static int smsc47b397_probe(struct platform_device *pdev)
{ … }
static int __init smsc47b397_device_add(unsigned short address)
{ … }
static int __init smsc47b397_find(void)
{ … }
static int __init smsc47b397_init(void)
{ … }
static void __exit smsc47b397_exit(void)
{ … }
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;
module_init(…) …;
module_exit(smsc47b397_exit);