dm: Use dm_scan_fdt_dev() directly where possible
[oweals/u-boot.git] / drivers / power / axp209.c
index 71aa000daab759b459a4215c71091bcc09b75f16..fc162a149eb37d4edf1aa1d4ee911c3afb904f86 100644 (file)
@@ -6,6 +6,7 @@
  */
 
 #include <common.h>
+#include <command.h>
 #include <asm/arch/pmic_bus.h>
 #include <axp_pmic.h>
 
@@ -168,3 +169,14 @@ int axp_init(void)
 
        return 0;
 }
+
+int do_poweroff(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+{
+       pmic_bus_write(AXP209_SHUTDOWN, AXP209_POWEROFF);
+
+       /* infinite loop during shutdown */
+       while (1) {}
+
+       /* not reached */
+       return 0;
+}