summaryrefslogtreecommitdiff
path: root/drivers/w1/w1_therm.c
diff options
context:
space:
mode:
authorEvgeniy Polyakov <johnpol@2ka.mipt.ru>2005-08-11 17:27:49 +0400
committerGreg Kroah-Hartman <gregkh@suse.de>2005-09-08 14:41:26 -0700
commitea7d8f65c865ebfa1d7cd67c360a87333ff013c1 (patch)
tree1e687c32d53a92c10a61fb23ab14763459ff5779 /drivers/w1/w1_therm.c
parentdb2d0008de519c5db6baec45f7831e08790301cf (diff)
[PATCH] w1: Added w1_reset_select_slave() - Resets the bus and then selects the slave by
sending either a skip rom or a rom match. Patch from Ben Gardner <bgardner@wabtec.com> Signed-off-by: Evgeniy Polyakov <johnpol@2ka.mipt.ru> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/w1/w1_therm.c')
-rw-r--r--drivers/w1/w1_therm.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/drivers/w1/w1_therm.c b/drivers/w1/w1_therm.c
index 2259f3d851ff..2ed0e0f48268 100644
--- a/drivers/w1/w1_therm.c
+++ b/drivers/w1/w1_therm.c
@@ -176,15 +176,10 @@ static ssize_t w1_therm_read_bin(struct kobject *kobj, char *buf, loff_t off, si
crc = 0;
while (max_trying--) {
- if (!w1_reset_bus (dev)) {
+ if (!w1_reset_select_slave(sl)) {
int count = 0;
- u8 match[9] = {W1_MATCH_ROM, };
unsigned int tm = 750;
- memcpy(&match[1], (u64 *) & sl->reg_num, 8);
-
- w1_write_block(dev, match, 9);
-
w1_write_8(dev, W1_CONVERT_TEMP);
while (tm) {
@@ -193,8 +188,7 @@ static ssize_t w1_therm_read_bin(struct kobject *kobj, char *buf, loff_t off, si
flush_signals(current);
}
- if (!w1_reset_bus (dev)) {
- w1_write_block(dev, match, 9);
+ if (!w1_reset_select_slave(sl)) {
w1_write_8(dev, W1_READ_SCRATCHPAD);
if ((count = w1_read_block(dev, rom, 9)) != 9) {
@@ -205,7 +199,6 @@ static ssize_t w1_therm_read_bin(struct kobject *kobj, char *buf, loff_t off, si
if (rom[8] == crc && rom[0])
verdict = 1;
-
}
}