git://git.onelab.eu
/
linux-2.6.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
vserver 1.9.5.x5
[linux-2.6.git]
/
drivers
/
i2c
/
chips
/
ds1621.c
diff --git
a/drivers/i2c/chips/ds1621.c
b/drivers/i2c/chips/ds1621.c
index
3aa7298
..
753bfc6
100644
(file)
--- a/
drivers/i2c/chips/ds1621.c
+++ b/
drivers/i2c/chips/ds1621.c
@@
-29,10
+29,9
@@
#include "lm75.h"
/* Addresses to scan */
#include "lm75.h"
/* Addresses to scan */
-static unsigned short normal_i2c[] = {
I2C_CLIENT_END };
-
static unsigned short normal_i2c_range[] = { 0x48
, 0x4f, I2C_CLIENT_END };
+static unsigned short normal_i2c[] = {
0x48, 0x49, 0x4a, 0x4b, 0x4c,
+
0x4d, 0x4e
, 0x4f, I2C_CLIENT_END };
static unsigned int normal_isa[] = { I2C_CLIENT_ISA_END };
static unsigned int normal_isa[] = { I2C_CLIENT_ISA_END };
-static unsigned int normal_isa_range[] = { I2C_CLIENT_ISA_END };
/* Insmod parameters */
SENSORS_INSMOD_1(ds1621);
/* Insmod parameters */
SENSORS_INSMOD_1(ds1621);
@@
-43,9
+42,8
@@
MODULE_PARM_DESC(polarity, "Output's polarity: 0 = active high, 1 = active low")
/* Many DS1621 constants specified below */
/* Config register used for detection */
/* 7 6 5 4 3 2 1 0 */
/* Many DS1621 constants specified below */
/* Config register used for detection */
/* 7 6 5 4 3 2 1 0 */
-/* |Done|THF |TLF |NVB | 1 | 0 |POL |1SHOT| */
-#define DS1621_REG_CONFIG_MASK 0x0C
-#define DS1621_REG_CONFIG_VAL 0x08
+/* |Done|THF |TLF |NVB | X | X |POL |1SHOT| */
+#define DS1621_REG_CONFIG_NVB 0x10
#define DS1621_REG_CONFIG_POLARITY 0x02
#define DS1621_REG_CONFIG_1SHOT 0x01
#define DS1621_REG_CONFIG_DONE 0x80
#define DS1621_REG_CONFIG_POLARITY 0x02
#define DS1621_REG_CONFIG_1SHOT 0x01
#define DS1621_REG_CONFIG_DONE 0x80
@@
-56,6
+54,7
@@
MODULE_PARM_DESC(polarity, "Output's polarity: 0 = active high, 1 = active low")
#define DS1621_REG_TEMP_MAX 0xA2 /* word, RW */
#define DS1621_REG_CONF 0xAC /* byte, RW */
#define DS1621_COM_START 0xEE /* no data */
#define DS1621_REG_TEMP_MAX 0xA2 /* word, RW */
#define DS1621_REG_CONF 0xAC /* byte, RW */
#define DS1621_COM_START 0xEE /* no data */
+#define DS1621_COM_STOP 0x22 /* no data */
/* The DS1621 configuration register */
#define DS1621_ALARM_TEMP_HIGH 0x40
/* The DS1621 configuration register */
#define DS1621_ALARM_TEMP_HIGH 0x40
@@
-96,7
+95,7
@@
static struct i2c_driver ds1621_driver = {
.detach_client = ds1621_detach_client,
};
.detach_client = ds1621_detach_client,
};
-static int ds1621_id
= 0
;
+static int ds1621_id;
/* All registers are word-sized, except for the configuration register.
DS1621 uses a high-byte first convention, which is exactly opposite to
/* All registers are word-sized, except for the configuration register.
DS1621 uses a high-byte first convention, which is exactly opposite to
@@
-213,9
+212,13
@@
int ds1621_detect(struct i2c_adapter *adapter, int address,
/* Now, we do the remaining detection. It is lousy. */
if (kind < 0) {
/* Now, we do the remaining detection. It is lousy. */
if (kind < 0) {
+ /* The NVB bit should be low if no EEPROM write has been
+ requested during the latest 10ms, which is highly
+ improbable in our case. */
conf = ds1621_read_value(new_client, DS1621_REG_CONF);
conf = ds1621_read_value(new_client, DS1621_REG_CONF);
- if (
(conf & DS1621_REG_CONFIG_MASK) != DS1621_REG_CONFIG_VAL
)
+ if (
conf & DS1621_REG_CONFIG_NVB
)
goto exit_free;
goto exit_free;
+ /* The 7 lowest bits of a temperature should always be 0. */
temp = ds1621_read_value(new_client, DS1621_REG_TEMP);
if (temp & 0x007f)
goto exit_free;
temp = ds1621_read_value(new_client, DS1621_REG_TEMP);
if (temp & 0x007f)
goto exit_free;