#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>
static const unsigned short normal_i2c[] = …;
enum chips { … };
#define LM92_REG_CONFIG …
#define LM92_REG_TEMP …
#define LM92_REG_TEMP_HYST …
#define LM92_REG_TEMP_CRIT …
#define LM92_REG_TEMP_LOW …
#define LM92_REG_TEMP_HIGH …
#define LM92_REG_MAN_ID …
static inline int TEMP_FROM_REG(s16 reg)
{ … }
static inline s16 TEMP_TO_REG(long val)
{ … }
static inline u8 ALARMS_FROM_REG(s16 reg)
{ … }
enum temp_index { … };
static const u8 regs[t_num_regs] = …;
struct lm92_data { … };
static struct lm92_data *lm92_update_device(struct device *dev)
{ … }
static ssize_t temp_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_show(struct device *dev,
struct device_attribute *devattr, char *buf)
{ … }
static ssize_t temp1_min_hyst_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static ssize_t temp_hyst_store(struct device *dev,
struct device_attribute *devattr,
const char *buf, size_t count)
{ … }
static ssize_t alarms_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, t_input);
static SENSOR_DEVICE_ATTR_RW(temp1_crit, temp, t_crit);
static SENSOR_DEVICE_ATTR_RW(temp1_crit_hyst, temp_hyst, t_crit);
static SENSOR_DEVICE_ATTR_RW(temp1_min, temp, t_min);
static DEVICE_ATTR_RO(temp1_min_hyst);
static SENSOR_DEVICE_ATTR_RW(temp1_max, temp, t_max);
static SENSOR_DEVICE_ATTR_RO(temp1_max_hyst, temp_hyst, t_max);
static DEVICE_ATTR_RO(alarms);
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 void lm92_init_client(struct i2c_client *client)
{ … }
static struct attribute *lm92_attrs[] = …;
ATTRIBUTE_GROUPS(…);
static int lm92_detect(struct i2c_client *new_client,
struct i2c_board_info *info)
{ … }
static int lm92_probe(struct i2c_client *new_client)
{ … }
static const struct i2c_device_id lm92_id[] = …;
MODULE_DEVICE_TABLE(i2c, lm92_id);
static struct i2c_driver lm92_driver = …;
module_i2c_driver(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;