Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 252067
b: refs/heads/master
c: 67dfd54
h: refs/heads/master
i:
  252065: f7c4117
  252063: 963ef04
v: v3
  • Loading branch information
Jean-François Dagenais authored and Linus Torvalds committed May 27, 2011
1 parent ecd5a2e commit 9105a2b
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 6f7bd76f05eb2bfbb48d58c0408a50a7e16b2423
refs/heads/master: 67dfd54c2d83a76a5756760f7fee0c8cfac52b1c
2 changes: 2 additions & 0 deletions trunk/drivers/w1/w1.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ struct w1_reg_num
#define W1_READ_ROM 0x33
#define W1_READ_PSUPPLY 0xB4
#define W1_MATCH_ROM 0x55
#define W1_RESUME_CMD 0xA5

#define W1_SLAVE_ACTIVE 0

Expand Down Expand Up @@ -213,6 +214,7 @@ void w1_write_block(struct w1_master *, const u8 *, int);
void w1_touch_block(struct w1_master *, u8 *, int);
u8 w1_read_block(struct w1_master *, u8 *, int);
int w1_reset_select_slave(struct w1_slave *sl);
int w1_reset_resume_command(struct w1_master *);
void w1_next_pullup(struct w1_master *, int);

static inline struct w1_slave* dev_to_w1_slave(struct device *dev)
Expand Down
26 changes: 26 additions & 0 deletions trunk/drivers/w1/w1_io.c
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,32 @@ int w1_reset_select_slave(struct w1_slave *sl)
}
EXPORT_SYMBOL_GPL(w1_reset_select_slave);

/**
* When the workflow with a slave amongst many requires several
* successive commands a reset between each, this function is similar
* to doing a reset then a match ROM for the last matched ROM. The
* advantage being that the matched ROM step is skipped in favor of the
* resume command. The slave must support the command of course.
*
* If the bus has only one slave, traditionnaly the match ROM is skipped
* and a "SKIP ROM" is done for efficiency. On multi-slave busses, this
* doesn't work of course, but the resume command is the next best thing.
*
* The w1 master lock must be held.
*
* @param dev the master device
*/
int w1_reset_resume_command(struct w1_master *dev)
{
if (w1_reset_bus(dev))
return -1;

/* This will make only the last matched slave perform a skip ROM. */
w1_write_8(dev, W1_RESUME_CMD);
return 0;
}
EXPORT_SYMBOL_GPL(w1_reset_resume_command);

/**
* Put out a strong pull-up of the specified duration after the next write
* operation. Not all hardware supports strong pullups. Hardware that
Expand Down

0 comments on commit 9105a2b

Please sign in to comment.