Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f89735c4 authored by Evgeniy Polyakov's avatar Evgeniy Polyakov Committed by Linus Torvalds
Browse files

w1: added w1 reset command



Command which allows to reset the bus.

Signed-off-by: default avatarEvgeniy Polyakov <zbr@ioremap.net>
Cc: Paul Alfille <paul.alfille@gmail.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 325a06fb
Loading
Loading
Loading
Loading
+6 −0
Original line number Original line Diff line number Diff line
@@ -112,6 +112,12 @@ cn_msg->len = sizeof(struct w1_netlink_msg) +
	      sizeof(struct w1_netlink_cmd) +
	      sizeof(struct w1_netlink_cmd) +
	      N*8;
	      N*8;


W1 reset command.
[cn_msg]
  [w1_netlink_msg type = W1_MASTER_CMD
  	id is equal to the bus master id to use for searching]
  [w1_netlink_cmd cmd = W1_CMD_RESET]

Operation steps in w1 core when new command is received.
Operation steps in w1 core when new command is received.
=======================================================
=======================================================


+3 −0
Original line number Original line Diff line number Diff line
@@ -197,6 +197,9 @@ static int w1_process_command_master(struct w1_master *dev, struct cn_msg *req_m
	case W1_CMD_TOUCH:
	case W1_CMD_TOUCH:
		err = w1_process_command_io(dev, msg, hdr, cmd);
		err = w1_process_command_io(dev, msg, hdr, cmd);
		break;
		break;
	case W1_CMD_RESET:
		err = w1_reset_bus(dev);
		break;
	default:
	default:
		cmd->res = EINVAL;
		cmd->res = EINVAL;
		cn_netlink_send(msg, 0, GFP_KERNEL);
		cn_netlink_send(msg, 0, GFP_KERNEL);
+1 −0
Original line number Original line Diff line number Diff line
@@ -58,6 +58,7 @@ enum w1_commands {
	W1_CMD_SEARCH,
	W1_CMD_SEARCH,
	W1_CMD_ALARM_SEARCH,
	W1_CMD_ALARM_SEARCH,
	W1_CMD_TOUCH,
	W1_CMD_TOUCH,
	W1_CMD_RESET,
	W1_CMD_MAX,
	W1_CMD_MAX,
};
};