#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>
#include <linux/sysfs.h>
static const unsigned short normal_i2c[] = …;
#define MAX1619_REG_R_MAN_ID …
#define MAX1619_REG_R_CHIP_ID …
#define MAX1619_REG_R_CONFIG …
#define MAX1619_REG_W_CONFIG …
#define MAX1619_REG_R_CONVRATE …
#define MAX1619_REG_W_CONVRATE …
#define MAX1619_REG_R_STATUS …
#define MAX1619_REG_R_LOCAL_TEMP …
#define MAX1619_REG_R_REMOTE_TEMP …
#define MAX1619_REG_R_REMOTE_HIGH …
#define MAX1619_REG_W_REMOTE_HIGH …
#define MAX1619_REG_R_REMOTE_LOW …
#define MAX1619_REG_W_REMOTE_LOW …
#define MAX1619_REG_R_REMOTE_CRIT …
#define MAX1619_REG_W_REMOTE_CRIT …
#define MAX1619_REG_R_TCRIT_HYST …
#define MAX1619_REG_W_TCRIT_HYST …
static int temp_from_reg(int val)
{ … }
static int temp_to_reg(int val)
{ … }
enum temp_index { … };
struct max1619_data { … };
static const u8 regs_read[t_num_regs] = …;
static const u8 regs_write[t_num_regs] = …;
static struct max1619_data *max1619_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 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_input1);
static SENSOR_DEVICE_ATTR_RO(temp2_input, temp, t_input2);
static SENSOR_DEVICE_ATTR_RW(temp2_min, temp, t_low2);
static SENSOR_DEVICE_ATTR_RW(temp2_max, temp, t_high2);
static SENSOR_DEVICE_ATTR_RW(temp2_crit, temp, t_crit2);
static SENSOR_DEVICE_ATTR_RW(temp2_crit_hyst, temp, t_hyst2);
static DEVICE_ATTR_RO(alarms);
static SENSOR_DEVICE_ATTR_RO(temp2_crit_alarm, alarm, 1);
static SENSOR_DEVICE_ATTR_RO(temp2_fault, alarm, 2);
static SENSOR_DEVICE_ATTR_RO(temp2_min_alarm, alarm, 3);
static SENSOR_DEVICE_ATTR_RO(temp2_max_alarm, alarm, 4);
static struct attribute *max1619_attrs[] = …;
ATTRIBUTE_GROUPS(…);
static int max1619_detect(struct i2c_client *client,
struct i2c_board_info *info)
{ … }
static void max1619_init_client(struct i2c_client *client)
{ … }
static int max1619_probe(struct i2c_client *new_client)
{ … }
static const struct i2c_device_id max1619_id[] = …;
MODULE_DEVICE_TABLE(i2c, max1619_id);
#ifdef CONFIG_OF
static const struct of_device_id max1619_of_match[] = …;
MODULE_DEVICE_TABLE(of, max1619_of_match);
#endif
static struct i2c_driver max1619_driver = …;
module_i2c_driver(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;