aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/w1/w1_therm.c
diff options
context:
space:
mode:
authorEvgeniy Polyakov <johnpol@2ka.mipt.ru>2005-08-11 09:27:49 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2005-09-08 17:41:26 -0400
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
176 crc = 0; 176 crc = 0;
177 177
178 while (max_trying--) { 178 while (max_trying--) {
179 if (!w1_reset_bus (dev)) { 179 if (!w1_reset_select_slave(sl)) {
180 int count = 0; 180 int count = 0;
181 u8 match[9] = {W1_MATCH_ROM, };
182 unsigned int tm = 750; 181 unsigned int tm = 750;
183 182
184 memcpy(&match[1], (u64 *) & sl->reg_num, 8);
185
186 w1_write_block(dev, match, 9);
187
188 w1_write_8(dev, W1_CONVERT_TEMP); 183 w1_write_8(dev, W1_CONVERT_TEMP);
189 184
190 while (tm) { 185 while (tm) {
@@ -193,8 +188,7 @@ static ssize_t w1_therm_read_bin(struct kobject *kobj, char *buf, loff_t off, si
193 flush_signals(current); 188 flush_signals(current);
194 } 189 }
195 190
196 if (!w1_reset_bus (dev)) { 191 if (!w1_reset_select_slave(sl)) {
197 w1_write_block(dev, match, 9);
198 192
199 w1_write_8(dev, W1_READ_SCRATCHPAD); 193 w1_write_8(dev, W1_READ_SCRATCHPAD);
200 if ((count = w1_read_block(dev, rom, 9)) != 9) { 194 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
205 199
206 if (rom[8] == crc && rom[0]) 200 if (rom[8] == crc && rom[0])
207 verdict = 1; 201 verdict = 1;
208
209 } 202 }
210 } 203 }
211 204