#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/sysfs.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 *smsc47m1_pdev;
#define DRVNAME …
enum chips { … };
#define REG …
#define VAL …
static inline void
superio_outb(int reg, int val)
{ … }
static inline int
superio_inb(int reg)
{ … }
#define superio_select() …
static inline int
superio_enter(void)
{ … }
static inline void
superio_exit(void)
{ … }
#define SUPERIO_REG_ACT …
#define SUPERIO_REG_BASE …
#define SUPERIO_REG_DEVID …
#define SUPERIO_REG_DEVREV …
#define SMSC_EXTENT …
#define SMSC47M1_REG_ALARM …
#define SMSC47M1_REG_TPIN(nr) …
#define SMSC47M1_REG_PPIN(nr) …
#define SMSC47M1_REG_FANDIV …
static const u8 SMSC47M1_REG_FAN[3] = …;
static const u8 SMSC47M1_REG_FAN_PRELOAD[3] = …;
static const u8 SMSC47M1_REG_PWM[3] = …;
#define SMSC47M2_REG_ALARM6 …
#define SMSC47M2_REG_TPIN1 …
#define SMSC47M2_REG_TPIN2 …
#define SMSC47M2_REG_TPIN3 …
#define SMSC47M2_REG_PPIN3 …
#define SMSC47M2_REG_FANDIV3 …
#define MIN_FROM_REG(reg, div) …
#define FAN_FROM_REG(reg, div, preload) …
#define DIV_FROM_REG(reg) …
#define PWM_FROM_REG(reg) …
#define PWM_EN_FROM_REG(reg) …
#define PWM_TO_REG(reg) …
struct smsc47m1_data { … };
struct smsc47m1_sio_data { … };
static inline int smsc47m1_read_value(struct smsc47m1_data *data, u8 reg)
{ … }
static inline void smsc47m1_write_value(struct smsc47m1_data *data, u8 reg,
u8 value)
{ … }
static struct smsc47m1_data *smsc47m1_update_device(struct device *dev,
int init)
{ … }
static ssize_t fan_show(struct device *dev, struct device_attribute *devattr,
char *buf)
{ … }
static ssize_t fan_min_show(struct device *dev,
struct device_attribute *devattr, char *buf)
{ … }
static ssize_t fan_div_show(struct device *dev,
struct device_attribute *devattr, char *buf)
{ … }
static ssize_t fan_alarm_show(struct device *dev,
struct device_attribute *devattr, char *buf)
{ … }
static ssize_t pwm_show(struct device *dev, struct device_attribute *devattr,
char *buf)
{ … }
static ssize_t pwm_en_show(struct device *dev,
struct device_attribute *devattr, char *buf)
{ … }
static ssize_t alarms_show(struct device *dev,
struct device_attribute *devattr, char *buf)
{ … }
static ssize_t fan_min_store(struct device *dev,
struct device_attribute *devattr,
const char *buf, size_t count)
{ … }
static ssize_t fan_div_store(struct device *dev,
struct device_attribute *devattr,
const char *buf, size_t count)
{ … }
static ssize_t pwm_store(struct device *dev, struct device_attribute *devattr,
const char *buf, size_t count)
{ … }
static ssize_t pwm_en_store(struct device *dev,
struct device_attribute *devattr, 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(fan1_alarm, fan_alarm, 0);
static SENSOR_DEVICE_ATTR_RW(pwm1, pwm, 0);
static SENSOR_DEVICE_ATTR_RW(pwm1_enable, pwm_en, 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 SENSOR_DEVICE_ATTR_RO(fan2_alarm, fan_alarm, 1);
static SENSOR_DEVICE_ATTR_RW(pwm2, pwm, 1);
static SENSOR_DEVICE_ATTR_RW(pwm2_enable, pwm_en, 1);
static SENSOR_DEVICE_ATTR_RO(fan3_input, fan, 2);
static SENSOR_DEVICE_ATTR_RW(fan3_min, fan_min, 2);
static SENSOR_DEVICE_ATTR_RW(fan3_div, fan_div, 2);
static SENSOR_DEVICE_ATTR_RO(fan3_alarm, fan_alarm, 2);
static SENSOR_DEVICE_ATTR_RW(pwm3, pwm, 2);
static SENSOR_DEVICE_ATTR_RW(pwm3_enable, pwm_en, 2);
static DEVICE_ATTR_RO(alarms);
static ssize_t name_show(struct device *dev, struct device_attribute
*devattr, char *buf)
{ … }
static DEVICE_ATTR_RO(name);
static struct attribute *smsc47m1_attributes_fan1[] = …;
static const struct attribute_group smsc47m1_group_fan1 = …;
static struct attribute *smsc47m1_attributes_fan2[] = …;
static const struct attribute_group smsc47m1_group_fan2 = …;
static struct attribute *smsc47m1_attributes_fan3[] = …;
static const struct attribute_group smsc47m1_group_fan3 = …;
static struct attribute *smsc47m1_attributes_pwm1[] = …;
static const struct attribute_group smsc47m1_group_pwm1 = …;
static struct attribute *smsc47m1_attributes_pwm2[] = …;
static const struct attribute_group smsc47m1_group_pwm2 = …;
static struct attribute *smsc47m1_attributes_pwm3[] = …;
static const struct attribute_group smsc47m1_group_pwm3 = …;
static struct attribute *smsc47m1_attributes[] = …;
static const struct attribute_group smsc47m1_group = …;
static int __init smsc47m1_find(struct smsc47m1_sio_data *sio_data)
{ … }
static void smsc47m1_restore(const struct smsc47m1_sio_data *sio_data)
{ … }
#define CHECK …
#define REQUEST …
static int __init smsc47m1_handle_resources(unsigned short address,
enum chips type, int action,
struct device *dev)
{ … }
static void smsc47m1_remove_files(struct device *dev)
{ … }
static int __init smsc47m1_probe(struct platform_device *pdev)
{ … }
static void __exit smsc47m1_remove(struct platform_device *pdev)
{ … }
static struct platform_driver smsc47m1_driver __refdata = …;
static int __init smsc47m1_device_add(unsigned short address,
const struct smsc47m1_sio_data *sio_data)
{ … }
static int __init sm_smsc47m1_init(void)
{ … }
static void __exit sm_smsc47m1_exit(void)
{ … }
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;
module_init(…) …;
module_exit(sm_smsc47m1_exit);