#include <linux/module.h>
#include <linux/init.h>
#include <linux/slab.h>
#include <linux/jiffies.h>
#include <linux/i2c.h>
#include <linux/hwmon.h>
#include <linux/hwmon-sysfs.h>
#include <linux/hwmon-vid.h>
#include <linux/err.h>
#include <linux/mutex.h>
static const unsigned short normal_i2c[] = …;
enum chips { … };
#define ADM1025_REG_MAN_ID …
#define ADM1025_REG_CHIP_ID …
#define ADM1025_REG_CONFIG …
#define ADM1025_REG_STATUS1 …
#define ADM1025_REG_STATUS2 …
#define ADM1025_REG_IN(nr) …
#define ADM1025_REG_IN_MAX(nr) …
#define ADM1025_REG_IN_MIN(nr) …
#define ADM1025_REG_TEMP(nr) …
#define ADM1025_REG_TEMP_HIGH(nr) …
#define ADM1025_REG_TEMP_LOW(nr) …
#define ADM1025_REG_VID …
#define ADM1025_REG_VID4 …
static const int in_scale[6] = …;
#define IN_FROM_REG(reg, scale) …
#define IN_TO_REG(val, scale) …
#define TEMP_FROM_REG(reg) …
#define TEMP_TO_REG(val) …
struct adm1025_data { … };
static struct adm1025_data *adm1025_update_device(struct device *dev)
{ … }
static ssize_t
in_show(struct device *dev, struct device_attribute *attr, char *buf)
{ … }
static ssize_t
in_min_show(struct device *dev, struct device_attribute *attr, char *buf)
{ … }
static ssize_t
in_max_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_max_show(struct device *dev, struct device_attribute *attr, char *buf)
{ … }
static ssize_t in_min_store(struct device *dev, struct device_attribute *attr,
const char *buf, size_t count)
{ … }
static ssize_t in_max_store(struct device *dev, struct device_attribute *attr,
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 SENSOR_DEVICE_ATTR_RO(in5_input, in, 5);
static SENSOR_DEVICE_ATTR_RW(in5_min, in_min, 5);
static SENSOR_DEVICE_ATTR_RW(in5_max, in_max, 5);
static ssize_t temp_min_store(struct device *dev,
struct device_attribute *attr, const char *buf,
size_t count)
{ … }
static ssize_t temp_max_store(struct device *dev,
struct device_attribute *attr, const char *buf,
size_t count)
{ … }
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(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 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 *attr, 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, 8);
static SENSOR_DEVICE_ATTR_RO(in5_alarm, alarm, 9);
static SENSOR_DEVICE_ATTR_RO(temp1_alarm, alarm, 5);
static SENSOR_DEVICE_ATTR_RO(temp2_alarm, alarm, 4);
static SENSOR_DEVICE_ATTR_RO(temp1_fault, alarm, 14);
static ssize_t
cpu0_vid_show(struct device *dev, struct device_attribute *attr, char *buf)
{ … }
static DEVICE_ATTR_RO(cpu0_vid);
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 DEVICE_ATTR_RW(vrm);
static struct attribute *adm1025_attributes[] = …;
static const struct attribute_group adm1025_group = …;
static struct attribute *adm1025_attributes_in4[] = …;
static const struct attribute_group adm1025_group_in4 = …;
static int adm1025_detect(struct i2c_client *client,
struct i2c_board_info *info)
{ … }
static void adm1025_init_client(struct i2c_client *client)
{ … }
static int adm1025_probe(struct i2c_client *client)
{ … }
static const struct i2c_device_id adm1025_id[] = …;
MODULE_DEVICE_TABLE(i2c, adm1025_id);
static struct i2c_driver adm1025_driver = …;
module_i2c_driver(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;