From: Adam Ford Date: Mon, 24 Apr 2017 18:34:43 +0000 (-0500) Subject: power: twl4030: Add CONFIG_CMD_POWEROFF support X-Git-Tag: v2017.07-rc1~360 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=4c2fb5fcc8159b1610dbb169f9acea2c043e7cc2;p=oweals%2Fu-boot.git power: twl4030: Add CONFIG_CMD_POWEROFF support 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 Reviewed-by: Tom Rini Reviewed-by: Jaehoon Chung --- diff --git a/drivers/power/twl4030.c b/drivers/power/twl4030.c index 8866bf1b19..ab98d68dfb 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