diff options
author | Max Filippov <jcmvbkbc@gmail.com> | 2023-06-07 18:59:38 +0300 |
---|---|---|
committer | Max Filippov <jcmvbkbc@gmail.com> | 2023-06-13 05:48:56 +0300 |
commit | 7561dfbf3b3451957c5d3fc52f53c78e78ed3034 (patch) | |
tree | 9888ce0b5feae5969c04ebc2aaba66dda600bc82 /arch/xtensa/platforms | |
parent | 11976fe2a47aa952b8fec54bc2bd54d57642f650 (diff) | |
download | linux-7561dfbf3b3451957c5d3fc52f53c78e78ed3034.tar.xz |
xtensa: drop platform_halt and platform_power_off
Instead of using xtensa-specific platform_halt and platform_power_off
callbacks use do_kernel_power_off in the machine_halt and
machine_power_off and reimplement existing platform_halt and
platform_power_off users with register_sys_off_handler.
Drop platform_halt and platform_power_off declarations and default
implementations.
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Diffstat (limited to 'arch/xtensa/platforms')
-rw-r--r-- | arch/xtensa/platforms/iss/setup.c | 12 | ||||
-rw-r--r-- | arch/xtensa/platforms/xt2000/setup.c | 13 | ||||
-rw-r--r-- | arch/xtensa/platforms/xtfpga/setup.c | 14 |
3 files changed, 15 insertions, 24 deletions
diff --git a/arch/xtensa/platforms/iss/setup.c b/arch/xtensa/platforms/iss/setup.c index a7009f223ef2..0f1fe132691e 100644 --- a/arch/xtensa/platforms/iss/setup.c +++ b/arch/xtensa/platforms/iss/setup.c @@ -25,16 +25,11 @@ #include <platform/simcall.h> -void platform_halt(void) -{ - pr_info(" ** Called platform_halt() **\n"); - simc_exit(0); -} - -void platform_power_off(void) +static int iss_power_off(struct sys_off_data *unused) { pr_info(" ** Called platform_power_off() **\n"); simc_exit(0); + return NOTIFY_DONE; } static int iss_restart(struct notifier_block *this, @@ -90,4 +85,7 @@ void __init platform_setup(char **p_cmdline) atomic_notifier_chain_register(&panic_notifier_list, &iss_panic_block); register_restart_handler(&iss_restart_block); + register_sys_off_handler(SYS_OFF_MODE_POWER_OFF, + SYS_OFF_PRIO_PLATFORM, + iss_power_off, NULL); } diff --git a/arch/xtensa/platforms/xt2000/setup.c b/arch/xtensa/platforms/xt2000/setup.c index 71b57ab50599..258e01a51fd8 100644 --- a/arch/xtensa/platforms/xt2000/setup.c +++ b/arch/xtensa/platforms/xt2000/setup.c @@ -42,18 +42,12 @@ static void led_print (int f, char *s) break; } -void platform_halt(void) -{ - led_print (0, " HALT "); - local_irq_disable(); - while (1); -} - -void platform_power_off(void) +static int xt2000_power_off(struct sys_off_data *unused) { led_print (0, "POWEROFF"); local_irq_disable(); while (1); + return NOTIFY_DONE; } static int xt2000_restart(struct notifier_block *this, @@ -147,6 +141,9 @@ static int __init xt2000_setup_devinit(void) platform_device_register(&xt2000_sonic_device); mod_timer(&heartbeat_timer, jiffies + HZ / 2); register_restart_handler(&xt2000_restart_block); + register_sys_off_handler(SYS_OFF_MODE_POWER_OFF, + SYS_OFF_PRIO_DEFAULT, + xt2000_power_off, NULL); return 0; } diff --git a/arch/xtensa/platforms/xtfpga/setup.c b/arch/xtensa/platforms/xtfpga/setup.c index 1690232c003e..a2432f081710 100644 --- a/arch/xtensa/platforms/xtfpga/setup.c +++ b/arch/xtensa/platforms/xtfpga/setup.c @@ -33,20 +33,13 @@ #include <platform/lcd.h> #include <platform/hardware.h> -void platform_halt(void) -{ - lcd_disp_at_pos(" HALT ", 0); - local_irq_disable(); - while (1) - cpu_relax(); -} - -void platform_power_off(void) +static int xtfpga_power_off(struct sys_off_data *unused) { lcd_disp_at_pos("POWEROFF", 0); local_irq_disable(); while (1) cpu_relax(); + return NOTIFY_DONE; } static int xtfpga_restart(struct notifier_block *this, @@ -79,6 +72,9 @@ void __init platform_calibrate_ccount(void) static void __init xtfpga_register_handlers(void) { register_restart_handler(&xtfpga_restart_block); + register_sys_off_handler(SYS_OFF_MODE_POWER_OFF, + SYS_OFF_PRIO_DEFAULT, + xtfpga_power_off, NULL); } #ifdef CONFIG_USE_OF |