#include <linux/module.h>
#include <linux/jiffies.h>
#include <linux/hwmon-sysfs.h>
#define DRVNAME "lm95234"
enum chips { lm95233, lm95234 };
static const unsigned short normal_i2c[] = {
0x18, 0x2a, 0x2b, 0x4d, 0x4e, I2C_CLIENT_END };
#define LM95234_REG_MAN_ID 0xFE
#define LM95234_REG_CHIP_ID 0xFF
#define LM95234_REG_STATUS 0x02
#define LM95234_REG_CONFIG 0x03
#define LM95234_REG_CONVRATE 0x04
#define LM95234_REG_STS_FAULT 0x07
#define LM95234_REG_STS_TCRIT1 0x08
#define LM95234_REG_STS_TCRIT2 0x09
#define LM95234_REG_TEMPH(x) ((x) + 0x10)
#define LM95234_REG_TEMPL(x) ((x) + 0x20)
#define LM95234_REG_UTEMPH(x) ((x) + 0x19)
#define LM95234_REG_UTEMPL(x) ((x) + 0x29)
#define LM95234_REG_REM_MODEL 0x30
#define LM95234_REG_REM_MODEL_STS 0x38
#define LM95234_REG_OFFSET(x) ((x) + 0x31)
#define LM95234_REG_TCRIT1(x) ((x) + 0x40)
#define LM95234_REG_TCRIT2(x) ((x) + 0x49)
#define LM95234_REG_TCRIT_HYST 0x5a
#define NATSEMI_MAN_ID 0x01
#define LM95233_CHIP_ID 0x89
#define LM95234_CHIP_ID 0x79
struct i2c_client *client;
const struct attribute_group *groups[3];
struct mutex update_lock;
unsigned long last_updated, interval;
static int lm95234_read_temp(struct i2c_client *client, int index, int *t)
val = i2c_smbus_read_byte_data(client,
LM95234_REG_UTEMPH(index - 1));
val = i2c_smbus_read_byte_data(client,
LM95234_REG_UTEMPL(index - 1));