2008-03-28 12:51:44

by David Fries

[permalink] [raw]
Subject: [PATCH 26/35] W1: ds2490.c ds_write_bit disable readback

ds2490.c 1.11
ds_write_bit doesn't read the input buffer, so add COMM_ICP and a
comment that it will no longer generate a read back data byte. If
there is an extra data byte later on then it will cause an error and
discard what data was there.

Signed-off-by: David Fries <[email protected]>
---
drivers/w1/masters/ds2490.c | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/drivers/w1/masters/ds2490.c b/drivers/w1/masters/ds2490.c
index 6778bd3..e0e9325 100644
--- a/drivers/w1/masters/ds2490.c
+++ b/drivers/w1/masters/ds2490.c
@@ -525,7 +525,12 @@ static int ds_write_bit(struct ds_device *dev, u8 bit)
int err;
struct ds_status st;

- err = ds_send_control(dev, COMM_BIT_IO | COMM_IM | (bit ? COMM_D : 0), 0);
+ /* Set COMM_ICP to write without a readback. Note, this will
+ * produce one time slot, a down followed by an up with COMM_D
+ * only determing the timing.
+ */
+ err = ds_send_control(dev, COMM_BIT_IO | COMM_IM | COMM_ICP |
+ (bit ? COMM_D : 0), 0);
if (err)
return err;

--
1.4.4.4


Attachments:
(No filename) (1.02 kB)
(No filename) (189.00 B)
Download all attachments