]> git.baikalelectronics.ru Git - arm-tf.git/commitdiff
mediatek: mt8192: add power-off support
authorHsin-Hsiung Wang <hsin-hsiung.wang@mediatek.com>
Wed, 12 Aug 2020 08:32:10 +0000 (16:32 +0800)
committerManish Pandey <manish.pandey2@arm.com>
Mon, 7 Dec 2020 23:29:47 +0000 (23:29 +0000)
add power-off support

Signed-off-by: Hsin-Hsiung Wang <hsin-hsiung.wang@mediatek.com>
Change-Id: If19e99971515a8ae1ac9ae21046e4382adc18a69

plat/mediatek/mt8192/plat_pm.c

index 654a9a9f8fabfb27beda92d028697178e87a8665..ac6cb8085e5bdc1c88244f089a6b6608f6a679da 100644 (file)
@@ -19,6 +19,7 @@
 #include <plat_mtk_lpm.h>
 #include <plat_params.h>
 #include <plat_pm.h>
+#include <pmic.h>
 
 /*
  * Cluster state request:
@@ -334,6 +335,17 @@ static void plat_get_sys_suspend_power_state(psci_power_state_t *req_state)
                        sizeof(plat_power_state[cpu]));
 }
 
+static void __dead2 plat_mtk_system_off(void)
+{
+       INFO("MTK System Off\n");
+
+       pmic_power_off();
+
+       wfi();
+       ERROR("MTK System Off: operation not handled.\n");
+       panic();
+}
+
 static void __dead2 plat_mtk_system_reset(void)
 {
        struct bl_aux_gpio_info *gpio_reset = plat_get_mtk_gpio_reset();
@@ -355,6 +367,7 @@ static const plat_psci_ops_t plat_psci_ops = {
        .pwr_domain_off                 = plat_power_domain_off,
        .pwr_domain_suspend             = plat_power_domain_suspend,
        .pwr_domain_suspend_finish      = plat_power_domain_suspend_finish,
+       .system_off                     = plat_mtk_system_off,
        .validate_power_state           = plat_validate_power_state,
        .get_sys_suspend_power_state    = plat_get_sys_suspend_power_state
 };