]> git.sur5r.net Git - u-boot/commitdiff
power: twl4030: Add CONFIG_CMD_POWEROFF support
authorAdam Ford <aford173@gmail.com>
Mon, 24 Apr 2017 18:34:43 +0000 (13:34 -0500)
committerTom Rini <trini@konsulko.com>
Wed, 10 May 2017 00:35:38 +0000 (20:35 -0400)
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>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
drivers/power/twl4030.c

index 8866bf1b19edb4ae4731eabacf434c501435a3d2..ab98d68dfb7e92737833c4ead058991d6dc97ec5 100644 (file)
@@ -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