#include <linux/module.h>
#include <linux/init.h>
#include <linux/slab.h>
#include <linux/i2c.h>
#include <linux/hwmon.h>
#include <linux/hwmon-sysfs.h>
#include <linux/err.h>
#include <linux/mutex.h>
#include <linux/jiffies.h>
MODULE_LICENSE(…) …;
static const unsigned short normal_i2c[] = …;
enum chips { … };
static unsigned short adm1022_temp3[16];
static unsigned int adm1022_temp3_num;
module_param_array(…);
MODULE_PARM_DESC(…) …;
#define THMC50_REG_CONF …
#define THMC50_REG_COMPANY_ID …
#define THMC50_REG_DIE_CODE …
#define THMC50_REG_ANALOG_OUT …
#define THMC50_REG_INTR …
static const u8 THMC50_REG_TEMP[] = …;
static const u8 THMC50_REG_TEMP_MIN[] = …;
static const u8 THMC50_REG_TEMP_MAX[] = …;
static const u8 THMC50_REG_TEMP_CRITICAL[] = …;
static const u8 THMC50_REG_TEMP_DEFAULT[] = …;
#define THMC50_REG_CONF_nFANOFF …
#define THMC50_REG_CONF_PROGRAMMED …
struct thmc50_data { … };
static struct thmc50_data *thmc50_update_device(struct device *dev)
{ … }
static ssize_t analog_out_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static ssize_t analog_out_store(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t count)
{ … }
static ssize_t pwm_mode_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static ssize_t temp_show(struct device *dev, struct device_attribute *attr,
char *buf)
{ … }
static ssize_t temp_min_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static ssize_t temp_min_store(struct device *dev,
struct device_attribute *attr, const char *buf,
size_t count)
{ … }
static ssize_t temp_max_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static ssize_t temp_max_store(struct device *dev,
struct device_attribute *attr, const char *buf,
size_t count)
{ … }
static ssize_t temp_critical_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static ssize_t alarm_show(struct device *dev, struct device_attribute *attr,
char *buf)
{ … }
static SENSOR_DEVICE_ATTR_RO(temp1_input, temp, 0);
static SENSOR_DEVICE_ATTR_RW(temp1_min, temp_min, 0);
static SENSOR_DEVICE_ATTR_RW(temp1_max, temp_max, 0);
static SENSOR_DEVICE_ATTR_RO(temp1_crit, temp_critical, 0);
static SENSOR_DEVICE_ATTR_RO(temp2_input, temp, 1);
static SENSOR_DEVICE_ATTR_RW(temp2_min, temp_min, 1);
static SENSOR_DEVICE_ATTR_RW(temp2_max, temp_max, 1);
static SENSOR_DEVICE_ATTR_RO(temp2_crit, temp_critical, 1);
static SENSOR_DEVICE_ATTR_RO(temp3_input, temp, 2);
static SENSOR_DEVICE_ATTR_RW(temp3_min, temp_min, 2);
static SENSOR_DEVICE_ATTR_RW(temp3_max, temp_max, 2);
static SENSOR_DEVICE_ATTR_RO(temp3_crit, temp_critical, 2);
static SENSOR_DEVICE_ATTR_RO(temp1_alarm, alarm, 0);
static SENSOR_DEVICE_ATTR_RO(temp2_alarm, alarm, 5);
static SENSOR_DEVICE_ATTR_RO(temp3_alarm, alarm, 1);
static SENSOR_DEVICE_ATTR_RO(temp2_fault, alarm, 7);
static SENSOR_DEVICE_ATTR_RO(temp3_fault, alarm, 2);
static SENSOR_DEVICE_ATTR_RW(pwm1, analog_out, 0);
static SENSOR_DEVICE_ATTR_RO(pwm1_mode, pwm_mode, 0);
static struct attribute *thmc50_attributes[] = …;
static const struct attribute_group thmc50_group = …;
static struct attribute *temp3_attributes[] = …;
static const struct attribute_group temp3_group = …;
static int thmc50_detect(struct i2c_client *client,
struct i2c_board_info *info)
{ … }
static void thmc50_init_client(struct thmc50_data *data)
{ … }
static int thmc50_probe(struct i2c_client *client)
{ … }
static const struct i2c_device_id thmc50_id[] = …;
MODULE_DEVICE_TABLE(i2c, thmc50_id);
static struct i2c_driver thmc50_driver = …;
module_i2c_driver(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;