diff options
Diffstat (limited to 'commands/wd.c')
-rw-r--r-- | commands/wd.c | 22 |
1 files changed, 7 insertions, 15 deletions
diff --git a/commands/wd.c b/commands/wd.c index 8029bab1ce..11f888133a 100644 --- a/commands/wd.c +++ b/commands/wd.c @@ -1,16 +1,5 @@ -/* - * (c) 2012 Juergen Beisert <kernel@pengutronix.de> - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - */ +// SPDX-License-Identifier: GPL-2.0-or-later +// SPDX-FileCopyrightText: © 2012 Juergen Beisert <kernel@pengutronix.de> #include <common.h> #include <command.h> @@ -29,11 +18,13 @@ static int do_wd(int argc, char *argv[]) int opt; int rc; - while ((opt = getopt(argc, argv, "d:")) > 0) { + while ((opt = getopt(argc, argv, "d:x")) > 0) { switch (opt) { case 'd': wd = watchdog_get_by_name(optarg); break; + case 'x': + return watchdog_inhibit_all(); default: return COMMAND_ERROR_USAGE; } @@ -77,12 +68,13 @@ BAREBOX_CMD_HELP_TEXT("When TIME is 0, the watchdog gets disabled,") BAREBOX_CMD_HELP_TEXT("Without a parameter the watchdog will be re-triggered.") BAREBOX_CMD_HELP_TEXT("Options:") BAREBOX_CMD_HELP_OPT("-d DEVICE\t", "watchdog name (default is highest priority watchdog)") +BAREBOX_CMD_HELP_OPT("-x\t", "inhibit all watchdogs (i.e. disable or autopoll if possible)") BAREBOX_CMD_HELP_END BAREBOX_CMD_START(wd) .cmd = do_wd, BAREBOX_CMD_DESC("enable/disable/trigger the watchdog") - BAREBOX_CMD_OPTS("[-d DEVICE] [TIME]") + BAREBOX_CMD_OPTS("[-d DEVICE] [-x] [TIME]") BAREBOX_CMD_GROUP(CMD_GRP_HWMANIP) BAREBOX_CMD_HELP(cmd_wd_help) BAREBOX_CMD_COMPLETE(device_complete) |