mirror of
https://github.com/raspberrypi/linux.git
synced 2025-12-06 10:00:17 +00:00
riscv: sbi: Switch to new sys-off handler API
Kernel now supports chained power-off handlers. Use register_platform_power_off() that registers a platform level power-off handler. Legacy pm_power_off() will be removed once all drivers and archs are converted to the new sys-off API. Signed-off-by: Andrew Davis <afd@ti.com> Tested-by: Alexandre Ghiti <alexghiti@rivosinc.com> Reviewed-by: Alexandre Ghiti <alexghiti@rivosinc.com> Link: https://lore.kernel.org/r/20250813151855.105237-1-afd@ti.com Signed-off-by: Paul Walmsley <pjw@kernel.org>
This commit is contained in:
committed by
Paul Walmsley
parent
16d18e3eaf
commit
70ddf86d76
@@ -148,7 +148,7 @@ static int __sbi_rfence_v01(int fid, const struct cpumask *cpu_mask,
|
|||||||
|
|
||||||
static void sbi_set_power_off(void)
|
static void sbi_set_power_off(void)
|
||||||
{
|
{
|
||||||
pm_power_off = sbi_shutdown;
|
register_platform_power_off(sbi_shutdown);
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
static void __sbi_set_timer_v01(uint64_t stime_value)
|
static void __sbi_set_timer_v01(uint64_t stime_value)
|
||||||
@@ -682,7 +682,7 @@ void __init sbi_init(void)
|
|||||||
if (sbi_spec_version >= sbi_mk_version(0, 3) &&
|
if (sbi_spec_version >= sbi_mk_version(0, 3) &&
|
||||||
sbi_probe_extension(SBI_EXT_SRST)) {
|
sbi_probe_extension(SBI_EXT_SRST)) {
|
||||||
pr_info("SBI SRST extension detected\n");
|
pr_info("SBI SRST extension detected\n");
|
||||||
pm_power_off = sbi_srst_power_off;
|
register_platform_power_off(sbi_srst_power_off);
|
||||||
sbi_srst_reboot_nb.notifier_call = sbi_srst_reboot;
|
sbi_srst_reboot_nb.notifier_call = sbi_srst_reboot;
|
||||||
sbi_srst_reboot_nb.priority = 192;
|
sbi_srst_reboot_nb.priority = 192;
|
||||||
register_restart_handler(&sbi_srst_reboot_nb);
|
register_restart_handler(&sbi_srst_reboot_nb);
|
||||||
|
|||||||
Reference in New Issue
Block a user