#include <linux/module.h>
#include <linux/init.h>
#include <linux/slab.h>
#include <linux/jiffies.h>
#include <linux/i2c.h>
#include <linux/hwmon-sysfs.h>
#include <linux/hwmon.h>
#include <linux/err.h>
#include <linux/mutex.h>
static const unsigned short normal_i2c[] = …;
#define ADM1029_REG_MAN_ID …
#define ADM1029_REG_CHIP_ID …
#define ADM1029_REG_CONFIG …
#define ADM1029_REG_NB_FAN_SUPPORT …
#define ADM1029_REG_TEMP_DEVICES_INSTALLED …
#define ADM1029_REG_LOCAL_TEMP …
#define ADM1029_REG_REMOTE1_TEMP …
#define ADM1029_REG_REMOTE2_TEMP …
#define ADM1029_REG_LOCAL_TEMP_HIGH …
#define ADM1029_REG_REMOTE1_TEMP_HIGH …
#define ADM1029_REG_REMOTE2_TEMP_HIGH …
#define ADM1029_REG_LOCAL_TEMP_LOW …
#define ADM1029_REG_REMOTE1_TEMP_LOW …
#define ADM1029_REG_REMOTE2_TEMP_LOW …
#define ADM1029_REG_FAN1 …
#define ADM1029_REG_FAN2 …
#define ADM1029_REG_FAN1_MIN …
#define ADM1029_REG_FAN2_MIN …
#define ADM1029_REG_FAN1_CONFIG …
#define ADM1029_REG_FAN2_CONFIG …
#define TEMP_FROM_REG(val) …
#define DIV_FROM_REG(val) …
static const u8 ADM1029_REG_TEMP[] = …;
static const u8 ADM1029_REG_FAN[] = …;
static const u8 ADM1029_REG_FAN_DIV[] = …;
struct adm1029_data { … };
static struct adm1029_data *adm1029_update_device(struct device *dev)
{ … }
static ssize_t
temp_show(struct device *dev, struct device_attribute *devattr, char *buf)
{ … }
static ssize_t
fan_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_div_store(struct device *dev,
struct device_attribute *devattr,
const char *buf, size_t count)
{ … }
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(temp1_max, temp, 3);
static SENSOR_DEVICE_ATTR_RO(temp2_max, temp, 4);
static SENSOR_DEVICE_ATTR_RO(temp3_max, temp, 5);
static SENSOR_DEVICE_ATTR_RO(temp1_min, temp, 6);
static SENSOR_DEVICE_ATTR_RO(temp2_min, temp, 7);
static SENSOR_DEVICE_ATTR_RO(temp3_min, temp, 8);
static SENSOR_DEVICE_ATTR_RO(fan1_input, fan, 0);
static SENSOR_DEVICE_ATTR_RO(fan2_input, fan, 1);
static SENSOR_DEVICE_ATTR_RO(fan1_min, fan, 2);
static SENSOR_DEVICE_ATTR_RO(fan2_min, fan, 3);
static SENSOR_DEVICE_ATTR_RW(fan1_div, fan_div, 0);
static SENSOR_DEVICE_ATTR_RW(fan2_div, fan_div, 1);
static struct attribute *adm1029_attrs[] = …;
ATTRIBUTE_GROUPS(…);
static int adm1029_detect(struct i2c_client *client,
struct i2c_board_info *info)
{ … }
static int adm1029_init_client(struct i2c_client *client)
{ … }
static int adm1029_probe(struct i2c_client *client)
{ … }
static const struct i2c_device_id adm1029_id[] = …;
MODULE_DEVICE_TABLE(i2c, adm1029_id);
static struct i2c_driver adm1029_driver = …;
module_i2c_driver(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;