#include <linux/bitops.h>
#include <linux/jiffies.h>
#include <linux/module.h>
#define DEVNAME "lm95241"
static const unsigned short normal_i2c[] = {
0x19, 0x2a, 0x2b, I2C_CLIENT_END };
#define LM95241_REG_R_MAN_ID 0xFE
#define LM95241_REG_R_CHIP_ID 0xFF
#define LM95241_REG_R_STATUS 0x02
#define LM95241_REG_RW_CONFIG 0x03
#define LM95241_REG_RW_REM_FILTER 0x06
#define LM95241_REG_RW_TRUTHERM 0x07
#define LM95241_REG_W_ONE_SHOT 0x0F
#define LM95241_REG_R_LOCAL_TEMPH 0x10
#define LM95241_REG_R_REMOTE1_TEMPH 0x11
#define LM95241_REG_R_REMOTE2_TEMPH 0x12
#define LM95241_REG_R_LOCAL_TEMPL 0x20
#define LM95241_REG_R_REMOTE1_TEMPL 0x21
#define LM95241_REG_R_REMOTE2_TEMPL 0x22
#define LM95241_REG_RW_REMOTE_MODEL 0x30
#define CFG_CR0182 BIT(4)
#define CFG_CR1000 BIT(5)
#define CFG_CR2700 (BIT(4) | BIT(5))
#define CFG_CRMASK (BIT(4) | BIT(5))
#define NATSEMI_MAN_ID 0x01
#define LM95231_CHIP_ID 0xA1
#define LM95241_CHIP_ID 0xA4
static const u8 lm95241_reg_address[] = {
LM95241_REG_R_LOCAL_TEMPH,
LM95241_REG_R_LOCAL_TEMPL,
LM95241_REG_R_REMOTE1_TEMPH,
LM95241_REG_R_REMOTE1_TEMPL,
LM95241_REG_R_REMOTE2_TEMPH,
LM95241_REG_R_REMOTE2_TEMPL
struct i2c_client *client;
struct mutex update_lock;
unsigned long last_updated;
u8 temp[ARRAY_SIZE(lm95241_reg_address)];