aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorDavid Fries <david@fries.net>2008-10-16 01:05:08 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-10-16 14:21:51 -0400
commit19e7184f75354c50bc196d856ff903b2add5ff5a (patch)
tree803c74bdb9b81b0122afb3ffdc59262233349bc0 /drivers
parente464af24734c40853dd68ec694d83a82e3930d66 (diff)
W1: ds2490.c magic number work
This replaces some magic numbers with marcos and corrects one marco. Signed-off-by: David Fries <david@fries.net> Signed-off-by: Evgeniy Polyakov <johnpol@2ka.mipt.ru> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/w1/masters/ds2490.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/drivers/w1/masters/ds2490.c b/drivers/w1/masters/ds2490.c
index 0f356939b349..29df1d2998b2 100644
--- a/drivers/w1/masters/ds2490.c
+++ b/drivers/w1/masters/ds2490.c
@@ -88,7 +88,7 @@
88#define COMM_DT 0x2000 88#define COMM_DT 0x2000
89#define COMM_SPU 0x1000 89#define COMM_SPU 0x1000
90#define COMM_F 0x0800 90#define COMM_F 0x0800
91#define COMM_NTP 0x0400 91#define COMM_NTF 0x0400
92#define COMM_ICP 0x0200 92#define COMM_ICP 0x0200
93#define COMM_RST 0x0100 93#define COMM_RST 0x0100
94 94
@@ -440,7 +440,7 @@ static int ds_wait_status(struct ds_device *dev, struct ds_status *st)
440 printk("\n"); 440 printk("\n");
441 } 441 }
442#endif 442#endif
443 } while(!(buf[0x08] & 0x20) && !(err < 0) && ++count < 100); 443 } while (!(buf[0x08] & ST_IDLE) && !(err < 0) && ++count < 100);
444 444
445 if (err >= 16 && st->status & ST_EPOF) { 445 if (err >= 16 && st->status & ST_EPOF) {
446 printk(KERN_INFO "Resetting device after ST_EPOF.\n"); 446 printk(KERN_INFO "Resetting device after ST_EPOF.\n");
@@ -470,8 +470,16 @@ static int ds_reset(struct ds_device *dev)
470{ 470{
471 int err; 471 int err;
472 472
473 //err = ds_send_control(dev, COMM_1_WIRE_RESET | COMM_F | COMM_IM | COMM_SE, SPEED_FLEXIBLE); 473 /* Other potentionally interesting flags for reset.
474 err = ds_send_control(dev, 0x43, SPEED_NORMAL); 474 *
475 * COMM_NTF: Return result register feedback. This could be used to
476 * detect some conditions such as short, alarming presence, or
477 * detect if a new device was detected.
478 *
479 * COMM_SE which allows SPEED_NORMAL, SPEED_FLEXIBLE, SPEED_OVERDRIVE:
480 * Select the data transfer rate.
481 */
482 err = ds_send_control(dev, COMM_1_WIRE_RESET | COMM_IM, SPEED_NORMAL);
475 if (err) 483 if (err)
476 return err; 484 return err;
477 485