From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 10E31C433F5 for ; Sun, 30 Jan 2022 23:40:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1357047AbiA3Xkl (ORCPT ); Sun, 30 Jan 2022 18:40:41 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34422 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1357394AbiA3XiF (ORCPT ); Sun, 30 Jan 2022 18:38:05 -0500 Received: from mail-lj1-x22e.google.com (mail-lj1-x22e.google.com [IPv6:2a00:1450:4864:20::22e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 81396C06175B; Sun, 30 Jan 2022 15:38:02 -0800 (PST) Received: by mail-lj1-x22e.google.com with SMTP id e17so17113900ljk.5; Sun, 30 Jan 2022 15:38:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Fjun7H7HFd6eJVLuHg+U86J15PDVhx/hGCMSiPgf2P0=; b=dd2fzDC5TDl8KpWUh0gU7+/JjGrL9a19MSGIOALm5z7fXs5VXHit+rqxXTBnz43EEy 6bAuu4TW+sayWblmW8KdfTygyhCSzYvoS93Z1gI42rqbvA3DwMo07+1y2fEK2Sdi+dYK sDP0y+AYT+lJyA1SE0LAK8MGBAbFccq0iNsI8MFwHrM4VDudz2gSr9hVrcXqatHOdkrN 1PfcjftqYULiK+vhkvAQxqJqQERFYAQADXPAeAOnfrVl+/hqqAaB3aFTvjRxQxWLKkrn UW62fbZN1kM7Fr/Abhtj4Byx5IJSmwGLhZ3+a2bcHkPKFWrQslOrFdx+rzve0FEyiDp5 +e8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Fjun7H7HFd6eJVLuHg+U86J15PDVhx/hGCMSiPgf2P0=; b=EY7fm7x2TZqegodT/S1qvPr9CR6IGiPkrsEn9LbHOT1KZCLez8+Ssh5RVugJE7G1YV KOutulLwumIZZnq4rK/KdsxmrfHxAaT7FdefLG+2Ew4rK144R/YmULtSZztzwlRq434u BwBQNnu8EGnqC7UlAVv6HB3mjeDN2ksksQf7GGI7E+1w18Wzu2IGkbVgbA9eIQARza9t ppJThI93JOBg0r144hHiGm9jQroVgVTFjQzebayQLftzcyIdeAEKKNx7xshKke7kO4aP rJS/a5MIZmSOlGu+GJP7iAaVFykjB0LN8cxIOtsdI+a+PCeyGITpLfNjZKnOAah8yTNB sYzA== X-Gm-Message-State: AOAM532tzXP+Vfs1zTutEHYwSSaoC1NQTXJLtH//OESkcKsrQl2x6MDS rwqzx4+fqdbgZNncH4HB0Wc= X-Google-Smtp-Source: ABdhPJztEpqDu7c0duU4BlEMnF97NCTUImWX4xTUQenIAQJSUD2GpIv4OSVa9Xt8JSMsGNu6LN6TTQ== X-Received: by 2002:a2e:5858:: with SMTP id x24mr11923571ljd.519.1643585879834; Sun, 30 Jan 2022 15:37:59 -0800 (PST) Received: from localhost.localdomain (109-252-138-126.dynamic.spd-mgts.ru. [109.252.138.126]) by smtp.gmail.com with ESMTPSA id a24sm1262950ljp.112.2022.01.30.15.37.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 30 Jan 2022 15:37:59 -0800 (PST) From: Dmitry Osipenko To: Thierry Reding , Jonathan Hunter , Russell King , Catalin Marinas , Will Deacon , Guo Ren , Geert Uytterhoeven , Greg Ungerer , Joshua Thompson , Thomas Bogendoerfer , Sebastian Reichel , Linus Walleij , Philipp Zabel , Greentime Hu , Vincent Chen , "James E.J. Bottomley" , Helge Deller , Michael Ellerman , Benjamin Herrenschmidt , Paul Mackerras , Paul Walmsley , Palmer Dabbelt , Albert Ou , Yoshinori Sato , Rich Felker , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , Boris Ostrovsky , Juergen Gross , Stefano Stabellini , "Rafael J. Wysocki" , Len Brown , Santosh Shilimkar , Krzysztof Kozlowski , Liam Girdwood , Mark Brown , Pavel Machek , Lee Jones , Andrew Morton , Guenter Roeck , Daniel Lezcano , Andy Shevchenko , Ulf Hansson , alankao@andestech.com, "K . C . Kuen-Chern Lin" , =?UTF-8?q?Micha=C5=82=20Miros=C5=82aw?= Cc: linux-kernel@vger.kernel.org, linux-csky@vger.kernel.org, linux-ia64@vger.kernel.org, linux-m68k@lists.linux-m68k.org, linux-mips@vger.kernel.org, linux-parisc@vger.kernel.org, linux-riscv@lists.infradead.org, linux-sh@vger.kernel.org, xen-devel@lists.xenproject.org, linux-acpi@vger.kernel.org, linux-pm@vger.kernel.org, linux-tegra@vger.kernel.org Subject: [PATCH v6 19/21] ACPI: power: Switch to sys-off handler API Date: Mon, 31 Jan 2022 02:37:16 +0300 Message-Id: <20220130233718.21544-20-digetx@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220130233718.21544-1-digetx@gmail.com> References: <20220130233718.21544-1-digetx@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org Switch to sys-off API that replaces legacy pm_power_off callbacks. Signed-off-by: Dmitry Osipenko --- drivers/acpi/sleep.c | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/drivers/acpi/sleep.c b/drivers/acpi/sleep.c index a60ff5dfed3a..e27ac5b4645b 100644 --- a/drivers/acpi/sleep.c +++ b/drivers/acpi/sleep.c @@ -47,19 +47,11 @@ static void acpi_sleep_tts_switch(u32 acpi_state) } } -static int tts_notify_reboot(struct notifier_block *this, - unsigned long code, void *x) +static void tts_reboot_prepare(struct reboot_prep_data *data) { acpi_sleep_tts_switch(ACPI_STATE_S5); - return NOTIFY_DONE; } -static struct notifier_block tts_notifier = { - .notifier_call = tts_notify_reboot, - .next = NULL, - .priority = 0, -}; - static int acpi_sleep_prepare(u32 acpi_state) { #ifdef CONFIG_ACPI_SLEEP @@ -1031,7 +1023,7 @@ static void acpi_sleep_hibernate_setup(void) static inline void acpi_sleep_hibernate_setup(void) {} #endif /* !CONFIG_HIBERNATION */ -static void acpi_power_off_prepare(void) +static void acpi_power_off_prepare(struct power_off_prep_data *data) { /* Prepare to power off the system */ acpi_sleep_prepare(ACPI_STATE_S5); @@ -1039,7 +1031,7 @@ static void acpi_power_off_prepare(void) acpi_os_wait_events_complete(); } -static void acpi_power_off(void) +static void acpi_power_off(struct power_off_data *data) { /* acpi_sleep_prepare(ACPI_STATE_S5) should have already been called */ pr_debug("%s called\n", __func__); @@ -1047,6 +1039,11 @@ static void acpi_power_off(void) acpi_enter_sleep_state(ACPI_STATE_S5); } +static struct sys_off_handler acpi_sys_off_handler = { + .power_off_priority = POWEROFF_PRIO_FIRMWARE, + .reboot_prepare_cb = tts_reboot_prepare, +}; + int __init acpi_sleep_init(void) { char supported[ACPI_S_STATE_COUNT * 3 + 1]; @@ -1063,8 +1060,8 @@ int __init acpi_sleep_init(void) if (acpi_sleep_state_supported(ACPI_STATE_S5)) { sleep_states[ACPI_STATE_S5] = 1; - pm_power_off_prepare = acpi_power_off_prepare; - pm_power_off = acpi_power_off; + acpi_sys_off_handler.power_off_cb = acpi_power_off; + acpi_sys_off_handler.power_off_prepare_cb = acpi_power_off_prepare; } else { acpi_no_s5 = true; } @@ -1080,6 +1077,6 @@ int __init acpi_sleep_init(void) * Register the tts_notifier to reboot notifier list so that the _TTS * object can also be evaluated when the system enters S5. */ - register_reboot_notifier(&tts_notifier); + register_sys_off_handler(&acpi_sys_off_handler); return 0; } -- 2.34.1 From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dmitry Osipenko Date: Sun, 30 Jan 2022 23:37:16 +0000 Subject: [PATCH v6 19/21] ACPI: power: Switch to sys-off handler API Message-Id: <20220130233718.21544-20-digetx@gmail.com> List-Id: References: <20220130233718.21544-1-digetx@gmail.com> In-Reply-To: <20220130233718.21544-1-digetx@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Thierry Reding , Jonathan Hunter , Russell King , Catalin Marinas , Will Deacon , Guo Ren , Geert Uytterhoeven , Greg Ungerer , Joshua Thompson , Thomas Bogendoerfer , Sebastian Reichel , Linus Walleij , Philipp Zabel , Greentime Hu , Vincent Chen , "James E.J. Bottomley" , Helge Deller , Michael Ellerman , Benjamin Herrenschmidt , Paul Mackerras , Paul Walmsley , Palmer Dabbelt , Albert Ou , Yoshinori Sato , Rich Felker , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , Boris Ostrovsky , Juergen Gross , Stefano Stabellini , "Rafael J. Wysocki" , Len Brown , Santosh Shilimkar , Krzysztof Kozlowski , Liam Girdwood , Mark Brown , Pavel Machek , Lee Jones , Andrew Morton , Guenter Roeck , Daniel Lezcano , Andy Shevchenko , Ulf Hansson , alankao@andestech.com, "K . C . Kuen-Chern Lin" , =?UTF-8?q?Micha=C5=82=20Miros=C5=82aw?= Cc: linux-kernel@vger.kernel.org, linux-csky@vger.kernel.org, linux-ia64@vger.kernel.org, linux-m68k@lists.linux-m68k.org, linux-mips@vger.kernel.org, linux-parisc@vger.kernel.org, linux-riscv@lists.infradead.org, linux-sh@vger.kernel.org, xen-devel@lists.xenproject.org, linux-acpi@vger.kernel.org, linux-pm@vger.kernel.org, linux-tegra@vger.kernel.org Switch to sys-off API that replaces legacy pm_power_off callbacks. Signed-off-by: Dmitry Osipenko --- drivers/acpi/sleep.c | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/drivers/acpi/sleep.c b/drivers/acpi/sleep.c index a60ff5dfed3a..e27ac5b4645b 100644 --- a/drivers/acpi/sleep.c +++ b/drivers/acpi/sleep.c @@ -47,19 +47,11 @@ static void acpi_sleep_tts_switch(u32 acpi_state) } } -static int tts_notify_reboot(struct notifier_block *this, - unsigned long code, void *x) +static void tts_reboot_prepare(struct reboot_prep_data *data) { acpi_sleep_tts_switch(ACPI_STATE_S5); - return NOTIFY_DONE; } -static struct notifier_block tts_notifier = { - .notifier_call = tts_notify_reboot, - .next = NULL, - .priority = 0, -}; - static int acpi_sleep_prepare(u32 acpi_state) { #ifdef CONFIG_ACPI_SLEEP @@ -1031,7 +1023,7 @@ static void acpi_sleep_hibernate_setup(void) static inline void acpi_sleep_hibernate_setup(void) {} #endif /* !CONFIG_HIBERNATION */ -static void acpi_power_off_prepare(void) +static void acpi_power_off_prepare(struct power_off_prep_data *data) { /* Prepare to power off the system */ acpi_sleep_prepare(ACPI_STATE_S5); @@ -1039,7 +1031,7 @@ static void acpi_power_off_prepare(void) acpi_os_wait_events_complete(); } -static void acpi_power_off(void) +static void acpi_power_off(struct power_off_data *data) { /* acpi_sleep_prepare(ACPI_STATE_S5) should have already been called */ pr_debug("%s called\n", __func__); @@ -1047,6 +1039,11 @@ static void acpi_power_off(void) acpi_enter_sleep_state(ACPI_STATE_S5); } +static struct sys_off_handler acpi_sys_off_handler = { + .power_off_priority = POWEROFF_PRIO_FIRMWARE, + .reboot_prepare_cb = tts_reboot_prepare, +}; + int __init acpi_sleep_init(void) { char supported[ACPI_S_STATE_COUNT * 3 + 1]; @@ -1063,8 +1060,8 @@ int __init acpi_sleep_init(void) if (acpi_sleep_state_supported(ACPI_STATE_S5)) { sleep_states[ACPI_STATE_S5] = 1; - pm_power_off_prepare = acpi_power_off_prepare; - pm_power_off = acpi_power_off; + acpi_sys_off_handler.power_off_cb = acpi_power_off; + acpi_sys_off_handler.power_off_prepare_cb = acpi_power_off_prepare; } else { acpi_no_s5 = true; } @@ -1080,6 +1077,6 @@ int __init acpi_sleep_init(void) * Register the tts_notifier to reboot notifier list so that the _TTS * object can also be evaluated when the system enters S5. */ - register_reboot_notifier(&tts_notifier); + register_sys_off_handler(&acpi_sys_off_handler); return 0; } -- 2.34.1 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A8D9FC433F5 for ; Sun, 30 Jan 2022 23:39:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=zfUIc/uqJ4p9ewOMDsJnbxviAkA7nvIbJLAAD57ZUDY=; b=rAXTnwSaPy4+Be YnGhWiNx6sT2qlBdIUlHlttxd8i1fMKd+RqFVogQt9t5R8QZeTitseUWvGw1y382ITtF/UXNCMU77 3sV2/ZXS7wn8ePKfCh7Pz5iqaAkHHtZ6tVe+DYN0BGbpxSjhT4bRD/E7N/1fD+DtM2USQmIafpPuE 7rxgYZhFfZvzPjMbIxubSkyvbyiM8ElElePO7iV/0Bm39Xz+Acbh+sUvwUG+huDI7b2owD6Q1n96f RvbeSIc8ck6JR7UQQQsDr72re9Sip0mSgmLncI05Ez0gj83dgKhu/YD1mJQ7+SPNthfOA9S9/OOw8 ya0k8hyJcC66yUjL5Pyg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nEJn3-007gs7-H9; Sun, 30 Jan 2022 23:39:25 +0000 Received: from mail-lj1-x235.google.com ([2a00:1450:4864:20::235]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nEJlh-007frT-9P for linux-riscv@lists.infradead.org; Sun, 30 Jan 2022 23:38:02 +0000 Received: by mail-lj1-x235.google.com with SMTP id z7so17118261ljj.4 for ; Sun, 30 Jan 2022 15:38:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Fjun7H7HFd6eJVLuHg+U86J15PDVhx/hGCMSiPgf2P0=; b=dd2fzDC5TDl8KpWUh0gU7+/JjGrL9a19MSGIOALm5z7fXs5VXHit+rqxXTBnz43EEy 6bAuu4TW+sayWblmW8KdfTygyhCSzYvoS93Z1gI42rqbvA3DwMo07+1y2fEK2Sdi+dYK sDP0y+AYT+lJyA1SE0LAK8MGBAbFccq0iNsI8MFwHrM4VDudz2gSr9hVrcXqatHOdkrN 1PfcjftqYULiK+vhkvAQxqJqQERFYAQADXPAeAOnfrVl+/hqqAaB3aFTvjRxQxWLKkrn UW62fbZN1kM7Fr/Abhtj4Byx5IJSmwGLhZ3+a2bcHkPKFWrQslOrFdx+rzve0FEyiDp5 +e8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Fjun7H7HFd6eJVLuHg+U86J15PDVhx/hGCMSiPgf2P0=; b=4txaQ3cYjqh7EnQLpn29aN+0Y3YEkvzRIUWwAgLGXGwD1Gmd2UiL5Zu6PfxwqpXy1B gUbTFdtDrd65lOAfUWbmUEqv5gVJvmmq9IwptOf2EOBgggJiJkj1LVHr8rWrLjcnrmyu TI7L1gt50E/wuB3PReUDCtpvskqErCTYhk3/2gAUBh3v949S4ls0I68srq/ECQ8tJUDw 3oH5zs55hIrXH2M3EkIEqe1QpSJO9GITye14Doap7oERMnQwWu9LnCCwtHaWh4QHYF41 QjF2BgM3qKXBwjyIRL7byBaSUNZ9S7pkhKtIz1xLCpRP2DlohtMQcVAhKlzxY00Nr+1u RgFg== X-Gm-Message-State: AOAM531w8rYxo6K0wm2F+LtI9PSDid+vM322C/eX1F3+TuIeftcrv3Qs dI1DEtr4hoW/7O/Y0/qLah0= X-Google-Smtp-Source: ABdhPJztEpqDu7c0duU4BlEMnF97NCTUImWX4xTUQenIAQJSUD2GpIv4OSVa9Xt8JSMsGNu6LN6TTQ== X-Received: by 2002:a2e:5858:: with SMTP id x24mr11923571ljd.519.1643585879834; Sun, 30 Jan 2022 15:37:59 -0800 (PST) Received: from localhost.localdomain (109-252-138-126.dynamic.spd-mgts.ru. [109.252.138.126]) by smtp.gmail.com with ESMTPSA id a24sm1262950ljp.112.2022.01.30.15.37.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 30 Jan 2022 15:37:59 -0800 (PST) From: Dmitry Osipenko To: Thierry Reding , Jonathan Hunter , Russell King , Catalin Marinas , Will Deacon , Guo Ren , Geert Uytterhoeven , Greg Ungerer , Joshua Thompson , Thomas Bogendoerfer , Sebastian Reichel , Linus Walleij , Philipp Zabel , Greentime Hu , Vincent Chen , "James E.J. Bottomley" , Helge Deller , Michael Ellerman , Benjamin Herrenschmidt , Paul Mackerras , Paul Walmsley , Palmer Dabbelt , Albert Ou , Yoshinori Sato , Rich Felker , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , Boris Ostrovsky , Juergen Gross , Stefano Stabellini , "Rafael J. Wysocki" , Len Brown , Santosh Shilimkar , Krzysztof Kozlowski , Liam Girdwood , Mark Brown , Pavel Machek , Lee Jones , Andrew Morton , Guenter Roeck , Daniel Lezcano , Andy Shevchenko , Ulf Hansson , alankao@andestech.com, "K . C . Kuen-Chern Lin" , =?UTF-8?q?Micha=C5=82=20Miros=C5=82aw?= Cc: linux-kernel@vger.kernel.org, linux-csky@vger.kernel.org, linux-ia64@vger.kernel.org, linux-m68k@lists.linux-m68k.org, linux-mips@vger.kernel.org, linux-parisc@vger.kernel.org, linux-riscv@lists.infradead.org, linux-sh@vger.kernel.org, xen-devel@lists.xenproject.org, linux-acpi@vger.kernel.org, linux-pm@vger.kernel.org, linux-tegra@vger.kernel.org Subject: [PATCH v6 19/21] ACPI: power: Switch to sys-off handler API Date: Mon, 31 Jan 2022 02:37:16 +0300 Message-Id: <20220130233718.21544-20-digetx@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220130233718.21544-1-digetx@gmail.com> References: <20220130233718.21544-1-digetx@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220130_153801_379977_D41073A3 X-CRM114-Status: GOOD ( 16.75 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org Switch to sys-off API that replaces legacy pm_power_off callbacks. Signed-off-by: Dmitry Osipenko --- drivers/acpi/sleep.c | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/drivers/acpi/sleep.c b/drivers/acpi/sleep.c index a60ff5dfed3a..e27ac5b4645b 100644 --- a/drivers/acpi/sleep.c +++ b/drivers/acpi/sleep.c @@ -47,19 +47,11 @@ static void acpi_sleep_tts_switch(u32 acpi_state) } } -static int tts_notify_reboot(struct notifier_block *this, - unsigned long code, void *x) +static void tts_reboot_prepare(struct reboot_prep_data *data) { acpi_sleep_tts_switch(ACPI_STATE_S5); - return NOTIFY_DONE; } -static struct notifier_block tts_notifier = { - .notifier_call = tts_notify_reboot, - .next = NULL, - .priority = 0, -}; - static int acpi_sleep_prepare(u32 acpi_state) { #ifdef CONFIG_ACPI_SLEEP @@ -1031,7 +1023,7 @@ static void acpi_sleep_hibernate_setup(void) static inline void acpi_sleep_hibernate_setup(void) {} #endif /* !CONFIG_HIBERNATION */ -static void acpi_power_off_prepare(void) +static void acpi_power_off_prepare(struct power_off_prep_data *data) { /* Prepare to power off the system */ acpi_sleep_prepare(ACPI_STATE_S5); @@ -1039,7 +1031,7 @@ static void acpi_power_off_prepare(void) acpi_os_wait_events_complete(); } -static void acpi_power_off(void) +static void acpi_power_off(struct power_off_data *data) { /* acpi_sleep_prepare(ACPI_STATE_S5) should have already been called */ pr_debug("%s called\n", __func__); @@ -1047,6 +1039,11 @@ static void acpi_power_off(void) acpi_enter_sleep_state(ACPI_STATE_S5); } +static struct sys_off_handler acpi_sys_off_handler = { + .power_off_priority = POWEROFF_PRIO_FIRMWARE, + .reboot_prepare_cb = tts_reboot_prepare, +}; + int __init acpi_sleep_init(void) { char supported[ACPI_S_STATE_COUNT * 3 + 1]; @@ -1063,8 +1060,8 @@ int __init acpi_sleep_init(void) if (acpi_sleep_state_supported(ACPI_STATE_S5)) { sleep_states[ACPI_STATE_S5] = 1; - pm_power_off_prepare = acpi_power_off_prepare; - pm_power_off = acpi_power_off; + acpi_sys_off_handler.power_off_cb = acpi_power_off; + acpi_sys_off_handler.power_off_prepare_cb = acpi_power_off_prepare; } else { acpi_no_s5 = true; } @@ -1080,6 +1077,6 @@ int __init acpi_sleep_init(void) * Register the tts_notifier to reboot notifier list so that the _TTS * object can also be evaluated when the system enters S5. */ - register_reboot_notifier(&tts_notifier); + register_sys_off_handler(&acpi_sys_off_handler); return 0; } -- 2.34.1 _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv