#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/err.h>
#include <linux/mutex.h>
static const unsigned short normal_i2c[] = …;
#define LM77_REG_TEMP …
#define LM77_REG_CONF …
#define LM77_REG_TEMP_HYST …
#define LM77_REG_TEMP_CRIT …
#define LM77_REG_TEMP_MIN …
#define LM77_REG_TEMP_MAX …
enum temp_index { … };
static const u8 temp_regs[t_num_temp] = …;
struct lm77_data { … };
#define LM77_TEMP_MIN …
#define LM77_TEMP_MAX …
static inline s16 LM77_TEMP_TO_REG(int temp)
{ … }
static inline int LM77_TEMP_FROM_REG(s16 reg)
{ … }
static u16 lm77_read_value(struct i2c_client *client, u8 reg)
{ … }
static int lm77_write_value(struct i2c_client *client, u8 reg, u16 value)
{ … }
static struct lm77_data *lm77_update_device(struct device *dev)
{ … }
static ssize_t temp_show(struct device *dev, struct device_attribute *devattr,
char *buf)
{ … }
static ssize_t temp_hyst_show(struct device *dev,
struct device_attribute *devattr, char *buf)
{ … }
static ssize_t temp_store(struct device *dev,
struct device_attribute *devattr, const char *buf,
size_t count)
{ … }
static ssize_t temp_hyst_store(struct device *dev,
struct device_attribute *devattr,
const char *buf, size_t count)
{ … }
static ssize_t alarm_show(struct device *dev, struct device_attribute *attr,
char *buf)
{ … }
static SENSOR_DEVICE_ATTR_RO(temp1_input, temp, t_input);
static SENSOR_DEVICE_ATTR_RW(temp1_crit, temp, t_crit);
static SENSOR_DEVICE_ATTR_RW(temp1_min, temp, t_min);
static SENSOR_DEVICE_ATTR_RW(temp1_max, temp, t_max);
static SENSOR_DEVICE_ATTR_RW(temp1_crit_hyst, temp_hyst, t_crit);
static SENSOR_DEVICE_ATTR_RO(temp1_min_hyst, temp_hyst, t_min);
static SENSOR_DEVICE_ATTR_RO(temp1_max_hyst, temp_hyst, t_max);
static SENSOR_DEVICE_ATTR_RO(temp1_crit_alarm, alarm, 2);
static SENSOR_DEVICE_ATTR_RO(temp1_min_alarm, alarm, 0);
static SENSOR_DEVICE_ATTR_RO(temp1_max_alarm, alarm, 1);
static struct attribute *lm77_attrs[] = …;
ATTRIBUTE_GROUPS(…);
static int lm77_detect(struct i2c_client *client, struct i2c_board_info *info)
{ … }
static void lm77_init_client(struct i2c_client *client)
{ … }
static int lm77_probe(struct i2c_client *client)
{ … }
static const struct i2c_device_id lm77_id[] = …;
MODULE_DEVICE_TABLE(i2c, lm77_id);
static struct i2c_driver lm77_driver = …;
module_i2c_driver(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;