w1: add touch block command
Writes and returns sampled data back to userspace. Signed-off-by: Evgeniy Polyakov <zbr@ioremap.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
committed by
Linus Torvalds
parent
610705e780
commit
9be62e0b2f
@@ -108,6 +108,10 @@ static int w1_process_command_slave(struct w1_slave *sl, struct cn_msg *msg,
|
||||
cmd->cmd, cmd->len);
|
||||
|
||||
switch (cmd->cmd) {
|
||||
case W1_CMD_TOUCH:
|
||||
w1_touch_block(sl->master, cmd->data, cmd->len);
|
||||
w1_send_read_reply(sl, msg, hdr, cmd);
|
||||
break;
|
||||
case W1_CMD_READ:
|
||||
w1_read_block(sl->master, cmd->data, cmd->len);
|
||||
w1_send_read_reply(sl, msg, hdr, cmd);
|
||||
@@ -208,9 +212,6 @@ static void w1_cn_callback(void *data)
|
||||
break;
|
||||
}
|
||||
|
||||
if (!mlen)
|
||||
goto out_cont;
|
||||
|
||||
if (m->type == W1_MASTER_CMD) {
|
||||
dev = w1_search_master_id(m->id.mst.id);
|
||||
} else if (m->type == W1_SLAVE_CMD) {
|
||||
@@ -227,6 +228,10 @@ static void w1_cn_callback(void *data)
|
||||
goto out_cont;
|
||||
}
|
||||
|
||||
err = 0;
|
||||
if (!mlen)
|
||||
goto out_cont;
|
||||
|
||||
mutex_lock(&dev->mutex);
|
||||
|
||||
if (sl && w1_reset_select_slave(sl)) {
|
||||
|
Reference in New Issue
Block a user