From: Tom Rini <trini@konsulko.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 1/4] cmd_boot: Add a poweroff command
Date: Sun, 20 Dec 2015 10:58:27 -0500 [thread overview]
Message-ID: <20151220155827.GJ11783@bill-the-cat> (raw)
In-Reply-To: <1450626095-31948-2-git-send-email-hdegoede@redhat.com>
On Sun, Dec 20, 2015 at 04:41:32PM +0100, Hans de Goede wrote:
> From: Michael van Slingerland <michael@deviousops.nl>
>
> Add a 'poweroff' command to boot commands, this only gets enabled if the
> board Kconfig does a "select CMD_POWEROFF".
>
> Signed-off-by: Michael van Slingerland <michael@deviousops.nl>
> [hdegoede at redhat.com: Make the cmd conditional on a CMD_POWEROFF Kconfig]
> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
> ---
> common/Kconfig | 3 +++
> common/cmd_boot.c | 8 ++++++++
> include/command.h | 3 +++
> 3 files changed, 14 insertions(+)
>
> diff --git a/common/Kconfig b/common/Kconfig
> index ccf5475..9d446bf 100644
> --- a/common/Kconfig
> +++ b/common/Kconfig
> @@ -184,6 +184,9 @@ config CMD_XIMG
> help
> Extract a part of a multi-image.
>
> +config CMD_POWEROFF
> + bool
> +
> endmenu
>
> menu "Environment commands"
> diff --git a/common/cmd_boot.c b/common/cmd_boot.c
> index 8f2e070..5a8f912 100644
> --- a/common/cmd_boot.c
> +++ b/common/cmd_boot.c
> @@ -61,3 +61,11 @@ U_BOOT_CMD(
> "Perform RESET of the CPU",
> ""
> );
> +
> +#ifdef CONFIG_CMD_POWEROFF
> +U_BOOT_CMD(
> + poweroff, 1, 0, do_poweroff,
> + "Perform POWEROFF",
" of the device"
> + ""
> +);
> +#endif
> diff --git a/include/command.h b/include/command.h
> index 2ae9b6c..30bc327 100644
> --- a/include/command.h
> +++ b/include/command.h
> @@ -110,6 +110,9 @@ extern int common_diskboot(cmd_tbl_t *cmdtp, const char *intf, int argc,
> char *const argv[]);
>
> extern int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]);
> +#ifdef CONFIG_CMD_POWEROFF
> +extern int do_poweroff(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]);
> +#endif
No need for ifdef/endif (yes, there's others in the file like that but
that's something to fix sometime). Thanks!
--
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20151220/d735c0f1/attachment.sig>
next prev parent reply other threads:[~2015-12-20 15:58 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-20 15:41 [U-Boot] [PATCH 0/4] Add a new poweroff command and implement it for sunxi Hans de Goede
2015-12-20 15:41 ` [U-Boot] [PATCH 1/4] cmd_boot: Add a poweroff command Hans de Goede
2015-12-20 15:58 ` Tom Rini [this message]
2015-12-20 15:41 ` [U-Boot] [PATCH 2/4] sunxi: Implement poweroff support for axp152 pmic Hans de Goede
2015-12-20 15:41 ` [U-Boot] [PATCH 3/4] sunxi: Implement poweroff support for axp209 pmic Hans de Goede
2015-12-20 15:41 ` [U-Boot] [PATCH 4/4] sunxi: Implement poweroff support for axp221 pmic Hans de Goede
2015-12-20 20:14 ` [U-Boot] [PATCH 0/4] Add a new poweroff command and implement it for sunxi Ian Campbell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20151220155827.GJ11783@bill-the-cat \
--to=trini@konsulko.com \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox