#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>
#include <linux/platform_data/ds620.h>
#define DS620_REG_CONFIG_DONE …
#define DS620_REG_CONFIG_NVB …
#define DS620_REG_CONFIG_THF …
#define DS620_REG_CONFIG_TLF …
#define DS620_REG_CONFIG_R1 …
#define DS620_REG_CONFIG_R0 …
#define DS620_REG_CONFIG_AUTOC …
#define DS620_REG_CONFIG_1SHOT …
#define DS620_REG_CONFIG_PO2 …
#define DS620_REG_CONFIG_PO1 …
#define DS620_REG_CONFIG_A2 …
#define DS620_REG_CONFIG_A1 …
#define DS620_REG_CONFIG_A0 …
static const u8 DS620_REG_TEMP[3] = …;
#define DS620_REG_CONF …
#define DS620_COM_START …
#define DS620_COM_STOP …
struct ds620_data { … };
static void ds620_init_client(struct i2c_client *client)
{ … }
static struct ds620_data *ds620_update_client(struct device *dev)
{ … }
static ssize_t temp_show(struct device *dev, struct device_attribute *da,
char *buf)
{ … }
static ssize_t temp_store(struct device *dev, struct device_attribute *da,
const char *buf, size_t count)
{ … }
static ssize_t alarm_show(struct device *dev, struct device_attribute *da,
char *buf)
{ … }
static SENSOR_DEVICE_ATTR_RO(temp1_input, temp, 0);
static SENSOR_DEVICE_ATTR_RW(temp1_min, temp, 1);
static SENSOR_DEVICE_ATTR_RW(temp1_max, temp, 2);
static SENSOR_DEVICE_ATTR_RO(temp1_min_alarm, alarm, DS620_REG_CONFIG_TLF);
static SENSOR_DEVICE_ATTR_RO(temp1_max_alarm, alarm, DS620_REG_CONFIG_THF);
static struct attribute *ds620_attrs[] = …;
ATTRIBUTE_GROUPS(…);
static int ds620_probe(struct i2c_client *client)
{ … }
static const struct i2c_device_id ds620_id[] = …;
MODULE_DEVICE_TABLE(i2c, ds620_id);
static struct i2c_driver ds620_driver = …;
module_i2c_driver(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;