diff options
author | PixelBot AutoMerger <android-nexus-securitybot@system.gserviceaccount.com> | 2022-06-12 19:57:24 -0700 |
---|---|---|
committer | SecurityBot <android-nexus-securitybot@system.gserviceaccount.com> | 2022-06-12 19:57:24 -0700 |
commit | a39df56effa52998d291697bfe849bc6f47cea4f (patch) | |
tree | efe9aa91c49b91bc6068e574682769b9b48664c2 | |
parent | 9ee263862113c1073446976fd35c13c0e5e8bb67 (diff) | |
parent | 4cc727a5900bc7473b8c0f3b075c6ae63d91e0f9 (diff) | |
download | reset-a39df56effa52998d291697bfe849bc6f47cea4f.tar.gz |
Merge android13-gs-pixel-5.10-tm-d1 into android13-gs-pixel-5.10-tm-qpr1
SBMerger: 442815275
Change-Id: I2dcdef5be48d1225a2fa5af1eccab121a75ebdd9
Signed-off-by: SecurityBot <android-nexus-securitybot@system.gserviceaccount.com>
-rw-r--r-- | exynos-gs201-reboot.c | 43 |
1 files changed, 21 insertions, 22 deletions
diff --git a/exynos-gs201-reboot.c b/exynos-gs201-reboot.c index 0e6b2b9..4917058 100644 --- a/exynos-gs201-reboot.c +++ b/exynos-gs201-reboot.c @@ -117,6 +117,27 @@ static int exynos_reboot_handler(struct notifier_block *nb, unsigned long mode, { exynos_reboot_parse(cmd); + if (mode != SYS_POWER_OFF) + return NOTIFY_DONE; + + while (1) { + /* wait for power button release */ + if (!pmic_read_pwrkey_status()) { +#if IS_ENABLED(CONFIG_GS_ACPM) + acpm_prepare_reboot(); +#endif + pr_info("ready to do power off.\n"); + break; + } else { + /* + * if power button is not released, + * wait and check TA again + */ + pr_info("PWR Key is not released.\n"); + } + mdelay(1000); + } + return NOTIFY_DONE; } @@ -141,27 +162,6 @@ static struct notifier_block exynos_restart_nb = { .priority = 130, }; -static void exynos_power_off(struct platform_device *pdev) -{ - while (1) { - /* wait for power button release */ - if (!pmic_read_pwrkey_status()) { -#if IS_ENABLED(CONFIG_GS_ACPM) - acpm_prepare_reboot(); -#endif - pr_info("ready to do power off.\n"); - break; - } else { - /* - * if power button is not released, - * wait and check TA again - */ - pr_info("PWR Key is not released.\n"); - } - mdelay(1000); - } -} - static int exynos_reboot_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; @@ -223,7 +223,6 @@ static const struct of_device_id exynos_reboot_of_match[] = { static struct platform_driver exynos_reboot_driver = { .probe = exynos_reboot_probe, - .shutdown = exynos_power_off, .driver = { .name = "exynos-reboot", .of_match_table = exynos_reboot_of_match, |