#define pr_fmt(fmt) …
#include <linux/module.h>
#include <linux/init.h>
#include <linux/slab.h>
#include <linux/jiffies.h>
#include <linux/i2c.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/acpi.h>
#include <linux/io.h>
static struct platform_device *pdev;
static bool force_start;
module_param(force_start, bool, 0);
MODULE_PARM_DESC(…) …;
static unsigned short force_id;
module_param(force_id, ushort, 0);
MODULE_PARM_DESC(…) …;
static bool probe_all_addr;
module_param(probe_all_addr, bool, 0);
MODULE_PARM_DESC(…) …;
static const unsigned short normal_i2c[] = …;
enum chips { … };
#define DO_REPORT …
#define DME1737_REG_IN(ix) …
#define DME1737_REG_IN_MIN(ix) …
#define DME1737_REG_IN_MAX(ix) …
#define DME1737_REG_TEMP(ix) …
#define DME1737_REG_TEMP_MIN(ix) …
#define DME1737_REG_TEMP_MAX(ix) …
#define DME1737_REG_TEMP_OFFSET(ix) …
#define DME1737_REG_IN_TEMP_LSB(ix) …
static const u8 DME1737_REG_IN_LSB[] = …;
static const u8 DME1737_REG_IN_LSB_SHL[] = …;
static const u8 DME1737_REG_TEMP_LSB[] = …;
static const u8 DME1737_REG_TEMP_LSB_SHL[] = …;
#define DME1737_REG_FAN(ix) …
#define DME1737_REG_FAN_MIN(ix) …
#define DME1737_REG_FAN_OPT(ix) …
#define DME1737_REG_FAN_MAX(ix) …
#define DME1737_REG_PWM(ix) …
#define DME1737_REG_PWM_CONFIG(ix) …
#define DME1737_REG_PWM_MIN(ix) …
#define DME1737_REG_PWM_FREQ(ix) …
#define DME1737_REG_PWM_RR(ix) …
#define DME1737_REG_ZONE_LOW(ix) …
#define DME1737_REG_ZONE_ABS(ix) …
#define DME1737_REG_ZONE_HYST(ix) …
#define DME1737_REG_ALARM1 …
#define DME1737_REG_ALARM2 …
#define DME1737_REG_ALARM3 …
static const u8 DME1737_BIT_ALARM_IN[] = …;
static const u8 DME1737_BIT_ALARM_TEMP[] = …;
static const u8 DME1737_BIT_ALARM_FAN[] = …;
#define DME1737_REG_DEVICE …
#define DME1737_REG_COMPANY …
#define DME1737_REG_VERSTEP …
#define DME1737_REG_CONFIG …
#define DME1737_REG_CONFIG2 …
#define DME1737_REG_VID …
#define DME1737_REG_TACH_PWM …
#define DME1737_COMPANY_SMSC …
#define DME1737_VERSTEP …
#define DME1737_VERSTEP_MASK …
#define SCH311X_DEVICE …
#define SCH5027_VERSTEP …
#define SCH5127_DEVICE …
#define DME1737_ID_1 …
#define DME1737_ID_2 …
#define SCH3112_ID …
#define SCH3114_ID …
#define SCH3116_ID …
#define SCH5027_ID …
#define SCH5127_ID …
#define DME1737_EXTENT …
#define HAS_TEMP_OFFSET …
#define HAS_VID …
#define HAS_ZONE3 …
#define HAS_ZONE_HYST …
#define HAS_PWM_MIN …
#define HAS_FAN(ix) …
#define HAS_PWM(ix) …
#define HAS_IN7 …
struct dme1737_data { … };
static const int IN_NOMINAL_DME1737[] = …;
static const int IN_NOMINAL_SCH311x[] = …;
static const int IN_NOMINAL_SCH5027[] = …;
static const int IN_NOMINAL_SCH5127[] = …;
#define IN_NOMINAL(type) …
static inline int IN_FROM_REG(int reg, int nominal, int res)
{ … }
static inline int IN_TO_REG(long val, int nominal)
{ … }
static inline int TEMP_FROM_REG(int reg, int res)
{ … }
static inline int TEMP_TO_REG(long val)
{ … }
static const int TEMP_RANGE[] = …;
static inline int TEMP_RANGE_FROM_REG(int reg)
{ … }
static int TEMP_RANGE_TO_REG(long val, int reg)
{ … }
static inline int TEMP_HYST_FROM_REG(int reg, int ix)
{ … }
static inline int TEMP_HYST_TO_REG(int temp, long hyst, int ix, int reg)
{ … }
static inline int FAN_FROM_REG(int reg, int tpc)
{ … }
static inline int FAN_TO_REG(long val, int tpc)
{ … }
static inline int FAN_TPC_FROM_REG(int reg)
{ … }
static inline int FAN_TYPE_FROM_REG(int reg)
{ … }
static inline int FAN_TYPE_TO_REG(long val, int reg)
{ … }
static const int FAN_MAX[] = …;
static int FAN_MAX_FROM_REG(int reg)
{ … }
static int FAN_MAX_TO_REG(long val)
{ … }
static inline int PWM_EN_FROM_REG(int reg)
{ … }
static inline int PWM_EN_TO_REG(int val, int reg)
{ … }
static inline int PWM_ACZ_FROM_REG(int reg)
{ … }
static inline int PWM_ACZ_TO_REG(long val, int reg)
{ … }
static const int PWM_FREQ[] = …;
static inline int PWM_FREQ_FROM_REG(int reg)
{ … }
static int PWM_FREQ_TO_REG(long val, int reg)
{ … }
static const u8 PWM_RR[] = …;
static inline int PWM_RR_FROM_REG(int reg, int ix)
{ … }
static int PWM_RR_TO_REG(long val, int ix, int reg)
{ … }
static inline int PWM_RR_EN_FROM_REG(int reg, int ix)
{ … }
static inline int PWM_RR_EN_TO_REG(long val, int ix, int reg)
{ … }
static inline int PWM_OFF_FROM_REG(int reg, int ix)
{ … }
static inline int PWM_OFF_TO_REG(int val, int ix, int reg)
{ … }
static u8 dme1737_read(const struct dme1737_data *data, u8 reg)
{ … }
static s32 dme1737_write(const struct dme1737_data *data, u8 reg, u8 val)
{ … }
static struct dme1737_data *dme1737_update_device(struct device *dev)
{ … }
#define SYS_IN_INPUT …
#define SYS_IN_MIN …
#define SYS_IN_MAX …
#define SYS_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 SYS_TEMP_INPUT …
#define SYS_TEMP_MIN …
#define SYS_TEMP_MAX …
#define SYS_TEMP_OFFSET …
#define SYS_TEMP_ALARM …
#define SYS_TEMP_FAULT …
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 SYS_ZONE_AUTO_CHANNELS_TEMP …
#define SYS_ZONE_AUTO_POINT1_TEMP_HYST …
#define SYS_ZONE_AUTO_POINT1_TEMP …
#define SYS_ZONE_AUTO_POINT2_TEMP …
#define SYS_ZONE_AUTO_POINT3_TEMP …
static ssize_t show_zone(struct device *dev, struct device_attribute *attr,
char *buf)
{ … }
static ssize_t set_zone(struct device *dev, struct device_attribute *attr,
const char *buf, size_t count)
{ … }
#define SYS_FAN_INPUT …
#define SYS_FAN_MIN …
#define SYS_FAN_MAX …
#define SYS_FAN_ALARM …
#define SYS_FAN_TYPE …
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 SYS_PWM …
#define SYS_PWM_FREQ …
#define SYS_PWM_ENABLE …
#define SYS_PWM_RAMP_RATE …
#define SYS_PWM_AUTO_CHANNELS_ZONE …
#define SYS_PWM_AUTO_PWM_MIN …
#define SYS_PWM_AUTO_POINT1_PWM …
#define SYS_PWM_AUTO_POINT2_PWM …
static ssize_t show_pwm(struct device *dev, struct device_attribute *attr,
char *buf)
{ … }
static struct attribute *dme1737_pwm_chmod_attr[];
static void dme1737_chmod_file(struct device*, struct attribute*, umode_t);
static ssize_t set_pwm(struct device *dev, struct device_attribute *attr,
const char *buf, size_t count)
{ … }
static ssize_t vrm_show(struct device *dev, struct device_attribute *attr,
char *buf)
{ … }
static ssize_t vrm_store(struct device *dev, struct device_attribute *attr,
const char *buf, size_t count)
{ … }
static ssize_t cpu0_vid_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static ssize_t name_show(struct device *dev, struct device_attribute *attr,
char *buf)
{ … }
#define SENSOR_DEVICE_ATTR_IN(ix) …
SENSOR_DEVICE_ATTR_IN(…);
SENSOR_DEVICE_ATTR_IN(…);
SENSOR_DEVICE_ATTR_IN(…);
SENSOR_DEVICE_ATTR_IN(…);
SENSOR_DEVICE_ATTR_IN(…);
SENSOR_DEVICE_ATTR_IN(…);
SENSOR_DEVICE_ATTR_IN(…);
SENSOR_DEVICE_ATTR_IN(…);
#define SENSOR_DEVICE_ATTR_TEMP(ix) …
SENSOR_DEVICE_ATTR_TEMP(…);
SENSOR_DEVICE_ATTR_TEMP(…);
SENSOR_DEVICE_ATTR_TEMP(…);
#define SENSOR_DEVICE_ATTR_ZONE(ix) …
SENSOR_DEVICE_ATTR_ZONE(…);
SENSOR_DEVICE_ATTR_ZONE(…);
SENSOR_DEVICE_ATTR_ZONE(…);
#define SENSOR_DEVICE_ATTR_FAN_1TO4(ix) …
SENSOR_DEVICE_ATTR_FAN_1TO4(…);
SENSOR_DEVICE_ATTR_FAN_1TO4(…);
SENSOR_DEVICE_ATTR_FAN_1TO4(…);
SENSOR_DEVICE_ATTR_FAN_1TO4(…);
#define SENSOR_DEVICE_ATTR_FAN_5TO6(ix) …
SENSOR_DEVICE_ATTR_FAN_5TO6(…);
SENSOR_DEVICE_ATTR_FAN_5TO6(…);
#define SENSOR_DEVICE_ATTR_PWM_1TO3(ix) …
SENSOR_DEVICE_ATTR_PWM_1TO3(…);
SENSOR_DEVICE_ATTR_PWM_1TO3(…);
SENSOR_DEVICE_ATTR_PWM_1TO3(…);
#define SENSOR_DEVICE_ATTR_PWM_5TO6(ix) …
SENSOR_DEVICE_ATTR_PWM_5TO6(…);
SENSOR_DEVICE_ATTR_PWM_5TO6(…);
static DEVICE_ATTR_RW(vrm);
static DEVICE_ATTR_RO(cpu0_vid);
static DEVICE_ATTR_RO(name);
static struct attribute *dme1737_attr[] = …;
static const struct attribute_group dme1737_group = …;
static struct attribute *dme1737_temp_offset_attr[] = …;
static const struct attribute_group dme1737_temp_offset_group = …;
static struct attribute *dme1737_vid_attr[] = …;
static const struct attribute_group dme1737_vid_group = …;
static struct attribute *dme1737_zone3_attr[] = …;
static const struct attribute_group dme1737_zone3_group = …;
static struct attribute *dme1737_zone_hyst_attr[] = …;
static const struct attribute_group dme1737_zone_hyst_group = …;
static struct attribute *dme1737_in7_attr[] = …;
static const struct attribute_group dme1737_in7_group = …;
static struct attribute *dme1737_pwm1_attr[] = …;
static struct attribute *dme1737_pwm2_attr[] = …;
static struct attribute *dme1737_pwm3_attr[] = …;
static struct attribute *dme1737_pwm5_attr[] = …;
static struct attribute *dme1737_pwm6_attr[] = …;
static const struct attribute_group dme1737_pwm_group[] = …;
static struct attribute *dme1737_auto_pwm_min_attr[] = …;
static struct attribute *dme1737_fan1_attr[] = …;
static struct attribute *dme1737_fan2_attr[] = …;
static struct attribute *dme1737_fan3_attr[] = …;
static struct attribute *dme1737_fan4_attr[] = …;
static struct attribute *dme1737_fan5_attr[] = …;
static struct attribute *dme1737_fan6_attr[] = …;
static const struct attribute_group dme1737_fan_group[] = …;
static struct attribute *dme1737_zone_chmod_attr[] = …;
static const struct attribute_group dme1737_zone_chmod_group = …;
static struct attribute *dme1737_zone3_chmod_attr[] = …;
static const struct attribute_group dme1737_zone3_chmod_group = …;
static struct attribute *dme1737_pwm1_chmod_attr[] = …;
static struct attribute *dme1737_pwm2_chmod_attr[] = …;
static struct attribute *dme1737_pwm3_chmod_attr[] = …;
static struct attribute *dme1737_pwm5_chmod_attr[] = …;
static struct attribute *dme1737_pwm6_chmod_attr[] = …;
static const struct attribute_group dme1737_pwm_chmod_group[] = …;
static struct attribute *dme1737_pwm_chmod_attr[] = …;
static inline void dme1737_sio_enter(int sio_cip)
{ … }
static inline void dme1737_sio_exit(int sio_cip)
{ … }
static inline int dme1737_sio_inb(int sio_cip, int reg)
{ … }
static inline void dme1737_sio_outb(int sio_cip, int reg, int val)
{ … }
static int dme1737_i2c_get_features(int, struct dme1737_data*);
static void dme1737_chmod_file(struct device *dev,
struct attribute *attr, umode_t mode)
{ … }
static void dme1737_chmod_group(struct device *dev,
const struct attribute_group *group,
umode_t mode)
{ … }
static void dme1737_remove_files(struct device *dev)
{ … }
static int dme1737_create_files(struct device *dev)
{ … }
static int dme1737_init_device(struct device *dev)
{ … }
static struct i2c_driver dme1737_i2c_driver;
static int dme1737_i2c_get_features(int sio_cip, struct dme1737_data *data)
{ … }
static int dme1737_i2c_detect(struct i2c_client *client,
struct i2c_board_info *info)
{ … }
static int dme1737_i2c_probe(struct i2c_client *client)
{ … }
static void dme1737_i2c_remove(struct i2c_client *client)
{ … }
static const struct i2c_device_id dme1737_id[] = …;
MODULE_DEVICE_TABLE(i2c, dme1737_id);
static struct i2c_driver dme1737_i2c_driver = …;
static int __init dme1737_isa_detect(int sio_cip, unsigned short *addr)
{ … }
static int __init dme1737_isa_device_add(unsigned short addr)
{ … }
static int dme1737_isa_probe(struct platform_device *pdev)
{ … }
static void dme1737_isa_remove(struct platform_device *pdev)
{ … }
static struct platform_driver dme1737_isa_driver = …;
static int __init dme1737_init(void)
{ … }
static void __exit dme1737_exit(void)
{ … }
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;
module_init(…) …;
module_exit(dme1737_exit);