#include <linux/module.h>
#include <linux/hwmon-sysfs.h>
#include <linux/device.h>
#include <linux/jiffies.h>
#include <linux/regmap.h>
#define TMP103_TEMP_REG 0x00
#define TMP103_CONF_REG 0x01
#define TMP103_TLOW_REG 0x02
#define TMP103_THIGH_REG 0x03
#define TMP103_CONF_M0 0x01
#define TMP103_CONF_M1 0x02
#define TMP103_CONF_LC 0x04
#define TMP103_CONF_FL 0x08
#define TMP103_CONF_FH 0x10
#define TMP103_CONF_CR0 0x20
#define TMP103_CONF_CR1 0x40
#define TMP103_CONF_ID 0x80
#define TMP103_CONF_SD (TMP103_CONF_M1)
#define TMP103_CONF_SD_MASK (TMP103_CONF_M0 | TMP103_CONF_M1)
#define TMP103_CONFIG (TMP103_CONF_CR1 | TMP103_CONF_M1)
#define TMP103_CONFIG_MASK (TMP103_CONF_CR0 | TMP103_CONF_CR1 | \
TMP103_CONF_M0 | TMP103_CONF_M1)
static inline int tmp103_reg_to_mc(s8 val)
static inline u8 tmp103_mc_to_reg(int val)
return DIV_ROUND_CLOSEST(val, 1000);