All of lore.kernel.org
 help / color / mirror / Atom feed
From: Adam Ford <aford173@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] power: twl4030: Add CONFIG_CMD_POWEROFF support
Date: Mon, 24 Apr 2017 13:34:43 -0500	[thread overview]
Message-ID: <1493058883-23031-1-git-send-email-aford173@gmail.com> (raw)

With the addition of twl4030_power_off(), let's allow the 'poweroff' command
to run this function when CONFIG_CMD_POWEROFF is enabled.

Tested on a DM3730 with twl4030 PMIC.

Signed-off-by: Adam Ford <aford173@gmail.com>

diff --git a/drivers/power/twl4030.c b/drivers/power/twl4030.c
index 8866bf1..ab98d68 100644
--- a/drivers/power/twl4030.c
+++ b/drivers/power/twl4030.c
@@ -171,3 +171,12 @@ void twl4030_power_mmc_init(int dev_index)
 		mdelay(100);	/* ramp-up delay from Linux code */
 	}
 }
+
+#ifdef CONFIG_CMD_POWEROFF
+int do_poweroff(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+{
+	twl4030_power_off();
+
+	return 0;
+}
+#endif
-- 
2.7.4

             reply	other threads:[~2017-04-24 18:34 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20170424183452epcas2p2f44649cbfb461f0b4b77b1ef1d4658c1@epcas2p2.samsung.com>
2017-04-24 18:34 ` Adam Ford [this message]
2017-04-25 20:10   ` [U-Boot] [PATCH] power: twl4030: Add CONFIG_CMD_POWEROFF support Tom Rini
2017-04-26  0:51     ` Adam Ford
2017-04-26 18:43       ` Adam Ford
2017-04-27  4:14   ` Jaehoon Chung
2017-05-10 17:53   ` [U-Boot] " Tom Rini

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=1493058883-23031-1-git-send-email-aford173@gmail.com \
    --to=aford173@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.