@@ -89,7 +89,8 @@ void __init board_setup(void)
{
printk(KERN_INFO "Trapeze ITS GPR board\n");
- pm_power_off = gpr_power_off;
+ register_power_off_handler_simple(gpr_power_off,
+ POWER_OFF_PRIORITY_FALLBACK);
_machine_halt = gpr_power_off;
_machine_restart = gpr_reset;
@@ -98,7 +98,8 @@ void __init board_setup(void)
alchemy_gpio_direction_output(211, 1); /* green on */
alchemy_gpio_direction_output(212, 0); /* red off */
- pm_power_off = mtx1_power_off;
+ register_power_off_handler_simple(mtx1_power_off,
+ POWER_OFF_PRIORITY_FALLBACK);
_machine_halt = mtx1_power_off;
_machine_restart = mtx1_reset;
@@ -79,7 +79,8 @@ void __init board_setup(void)
{
u32 pin_func;
- pm_power_off = xxs1500_power_off;
+ register_power_off_handler_simple(xxs1500_power_off,
+ POWER_OFF_PRIORITY_FALLBACK);
_machine_halt = xxs1500_power_off;
_machine_restart = xxs1500_reset;
@@ -64,10 +64,20 @@ static void db1x_reset(char *c)
bcsr_write(BCSR_SYSTEM, 0);
}
+static void db1x_power_off_handler(struct power_off_handler_block *this)
+{
+ db1x_power_off();
+}
+
+static struct power_off_handler_block db1x_power_off_hb = {
+ .handler = db1x_power_off_handler,
+ .priority = POWER_OFF_PRIORITY_LOW,
+};
+
static int __init db1x_late_setup(void)
{
- if (!pm_power_off)
- pm_power_off = db1x_power_off;
+ if (register_power_off_handler(&db1x_power_off_hb))
+ pr_warn("dbx1: Failed to register power-off handler\n");
if (!_machine_halt)
_machine_halt = db1x_power_off;
if (!_machine_restart)
@@ -91,7 +91,8 @@ void __init plat_mem_setup(void)
_machine_restart = ar7_machine_restart;
_machine_halt = ar7_machine_halt;
- pm_power_off = ar7_machine_power_off;
+ register_power_off_handler_simple(ar7_machine_power_off,
+ POWER_OFF_PRIORITY_DEFAULT);
io_base = (unsigned long)ioremap(AR7_REGS_BASE, 0x10000);
if (!io_base)
@@ -203,7 +203,8 @@ void __init plat_mem_setup(void)
_machine_restart = ath79_restart;
_machine_halt = ath79_halt;
- pm_power_off = ath79_halt;
+ register_power_off_handler_simple(ath79_halt,
+ POWER_OFF_PRIORITY_FALLBACK);
}
void __init plat_time_init(void)
@@ -246,7 +246,8 @@ void __init plat_mem_setup(void)
_machine_restart = bcm47xx_machine_restart;
_machine_halt = bcm47xx_machine_halt;
- pm_power_off = bcm47xx_machine_halt;
+ register_power_off_handler_simple(bcm47xx_machine_halt,
+ POWER_OFF_PRIORITY_FALLBACK);
bcm47xx_board_detect();
mips_set_machine_name(bcm47xx_board_get_name());
}
@@ -149,7 +149,8 @@ void __init plat_mem_setup(void)
_machine_halt = bcm63xx_machine_halt;
_machine_restart = __bcm63xx_machine_reboot;
- pm_power_off = bcm63xx_machine_halt;
+ register_power_off_handler_simple(bcm63xx_machine_halt,
+ POWER_OFF_PRIORITY_FALLBACK);
set_io_port_base(0);
ioport_resource.start = 0;
@@ -78,7 +78,8 @@ void __init plat_mem_setup(void)
_machine_restart = cobalt_machine_restart;
_machine_halt = cobalt_machine_halt;
- pm_power_off = cobalt_machine_halt;
+ register_power_off_handler_simple(cobalt_machine_halt,
+ POWER_OFF_PRIORITY_FALLBACK);
set_io_port_base(CKSEG1ADDR(GT_DEF_PCI0_IO_BASE));
@@ -158,7 +158,8 @@ void __init plat_mem_setup(void)
_machine_restart = dec_machine_restart;
_machine_halt = dec_machine_halt;
- pm_power_off = dec_machine_power_off;
+ register_power_off_handler_simple(dec_machine_power_off,
+ POWER_OFF_PRIORITY_DEFAULT);
ioport_resource.start = ~0UL;
ioport_resource.end = 0UL;
@@ -103,7 +103,8 @@ void __init plat_mem_setup(void)
_machine_restart = markeins_machine_restart;
_machine_halt = markeins_machine_halt;
- pm_power_off = markeins_machine_power_off;
+ register_power_off_handler_simple(markeins_machine_power_off,
+ POWER_OFF_PRIORITY_FALLBACK);
/* setup resource limits */
ioport_resource.start = EMMA2RH_PCI_IO_BASE;
@@ -114,5 +114,6 @@ void jz4740_reset_init(void)
{
_machine_restart = jz4740_restart;
_machine_halt = jz4740_halt;
- pm_power_off = jz4740_power_off;
+ register_power_off_handler_simple(jz4740_power_off,
+ POWER_OFF_PRIORITY_DEFAULT);
}
@@ -83,7 +83,8 @@ static int __init mips_reboot_setup(void)
{
_machine_restart = machine_restart;
_machine_halt = machine_halt;
- pm_power_off = machine_power_off;
+ register_power_off_handler_simple(machine_power_off,
+ POWER_OFF_PRIORITY_FALLBACK);
return 0;
}
@@ -157,7 +157,8 @@ static int __init mips_reboot_setup(void)
_machine_restart = ltq_machine_restart;
_machine_halt = ltq_machine_halt;
- pm_power_off = ltq_machine_power_off;
+ register_power_off_handler_simple(ltq_machine_power_off,
+ POWER_OFF_PRIORITY_FALLBACK);
return 0;
}
@@ -56,5 +56,6 @@ void lasat_reboot_setup(void)
{
_machine_restart = lasat_machine_restart;
_machine_halt = lasat_machine_halt;
- pm_power_off = lasat_machine_halt;
+ register_power_off_handler_simple(lasat_machine_halt,
+ POWER_OFF_PRIORITY_FALLBACK);
}
@@ -84,7 +84,8 @@ static int __init mips_reboot_setup(void)
{
_machine_restart = loongson_restart;
_machine_halt = loongson_halt;
- pm_power_off = loongson_poweroff;
+ register_power_off_handler_simple(loongson_poweroff,
+ POWER_OFF_PRIORITY_DEFAULT);
return 0;
}
@@ -38,7 +38,8 @@ static int __init ls1x_reboot_setup(void)
{
_machine_restart = ls1x_restart;
_machine_halt = ls1x_halt;
- pm_power_off = ls1x_power_off;
+ register_power_off_handler_simple(ls1x_power_off,
+ POWER_OFF_PRIORITY_FALLBACK);
return 0;
}
@@ -40,7 +40,8 @@ static int __init mips_reboot_setup(void)
{
_machine_restart = mips_machine_restart;
_machine_halt = mips_machine_halt;
- pm_power_off = mips_machine_power_off;
+ register_power_off_handler_simple(mips_machine_power_off,
+ POWER_OFF_PRIORITY_DEFAULT);
return 0;
}
@@ -33,7 +33,8 @@ static int __init mips_reboot_setup(void)
{
_machine_restart = mips_machine_restart;
_machine_halt = mips_machine_halt;
- pm_power_off = mips_machine_halt;
+ register_power_off_handler_simple(mips_machine_halt,
+ POWER_OFF_PRIORITY_FALLBACK);
return 0;
}
@@ -106,7 +106,8 @@ void __init plat_mem_setup(void)
#endif
_machine_restart = (void (*)(char *))nlm_linux_exit;
_machine_halt = nlm_linux_exit;
- pm_power_off = nlm_linux_exit;
+ register_power_off_handler_simple(nlm_linux_exit,
+ POWER_OFF_PRIORITY_FALLBACK);
/* memory and bootargs from DT */
xlp_early_init_devtree();
@@ -75,7 +75,8 @@ void __init plat_mem_setup(void)
{
_machine_restart = (void (*)(char *))nlm_linux_exit;
_machine_halt = nlm_linux_exit;
- pm_power_off = nlm_linux_exit;
+ register_power_off_handler_simple(nlm_linux_exit,
+ POWER_OFF_PRIORITY_FALLBACK);
}
const char *get_system_type(void)
@@ -144,7 +144,8 @@ void __init plat_mem_setup(void)
{
_machine_restart = msp_restart;
_machine_halt = msp_halt;
- pm_power_off = msp_power_off;
+ register_power_off_handler_simple(msp_power_off,
+ POWER_OFF_PRIORITY_FALLBACK);
}
void __init prom_init(void)
@@ -51,7 +51,8 @@ int __init plat_mem_setup(void)
_machine_restart = pnx833x_machine_restart;
_machine_halt = pnx833x_machine_halt;
- pm_power_off = pnx833x_machine_power_off;
+ register_power_off_handler_simple(pnx833x_machine_power_off,
+ POWER_OFF_PRIORITY_DEFAULT);
/* IO/MEM resources. */
set_io_port_base(KSEG1);
@@ -98,7 +98,8 @@ static int __init mips_reboot_setup(void)
{
_machine_restart = ralink_restart;
_machine_halt = ralink_halt;
- pm_power_off = ralink_halt;
+ register_power_off_handler_simple(ralink_halt,
+ POWER_OFF_PRIORITY_FALLBACK);
return 0;
}
@@ -44,7 +44,8 @@ void __init plat_mem_setup(void)
_machine_restart = rb_machine_restart;
_machine_halt = rb_machine_halt;
- pm_power_off = rb_machine_halt;
+ register_power_off_handler_simple(rb_machine_halt,
+ POWER_OFF_PRIORITY_FALLBACK);
set_io_port_base(KSEG1);
@@ -188,7 +188,8 @@ static int __init reboot_setup(void)
_machine_restart = sgi_machine_restart;
_machine_halt = sgi_machine_halt;
- pm_power_off = sgi_machine_power_off;
+ register_power_off_handler_simple(sgi_machine_power_off,
+ POWER_OFF_PRIORITY_DEFAULT);
res = request_irq(SGI_PANEL_IRQ, panel_int, 0, "Front Panel", NULL);
if (res) {
@@ -76,5 +76,6 @@ void ip27_reboot_setup(void)
{
_machine_restart = ip27_machine_restart;
_machine_halt = ip27_machine_halt;
- pm_power_off = ip27_machine_power_off;
+ register_power_off_handler_simple(ip27_machine_power_off,
+ POWER_OFF_PRIORITY_FALLBACK);
}
@@ -189,7 +189,8 @@ static __init int ip32_reboot_setup(void)
_machine_restart = ip32_machine_restart;
_machine_halt = ip32_machine_halt;
- pm_power_off = ip32_machine_power_off;
+ register_power_off_handler_simple(ip32_machine_power_off,
+ POWER_OFF_PRIORITY_FALLBACK);
init_timer(&blink_timer);
blink_timer.function = blink_timeout;
@@ -245,7 +245,8 @@ void __init prom_init(void)
_machine_restart = cfe_linux_restart;
_machine_halt = cfe_linux_halt;
- pm_power_off = cfe_linux_halt;
+ register_power_off_handler_simple(cfe_linux_halt,
+ POWER_OFF_PRIORITY_FALLBACK);
/*
* Check if a loader was used; if NOT, the 4 arguments are
@@ -225,7 +225,8 @@ void __init plat_mem_setup(void)
}
_machine_restart = sni_machine_restart;
- pm_power_off = sni_machine_power_off;
+ register_power_off_handler_simple(sni_machine_power_off,
+ POWER_OFF_PRIORITY_DEFAULT);
sni_display_setup();
sni_console_setup();
@@ -555,7 +555,8 @@ void __init plat_mem_setup(void)
/* fallback restart/halt routines */
_machine_restart = (void (*)(char *))txx9_machine_halt;
_machine_halt = txx9_machine_halt;
- pm_power_off = txx9_machine_halt;
+ register_power_off_handler_simple(txx9_machine_halt,
+ POWER_OFF_PRIORITY_FALLBACK);
#ifdef CONFIG_PCI
pcibios_plat_setup = txx9_pcibios_setup;
@@ -127,7 +127,8 @@ static int __init vr41xx_pmu_init(void)
cpu_wait = vr41xx_cpu_wait;
_machine_restart = vr41xx_restart;
_machine_halt = vr41xx_halt;
- pm_power_off = vr41xx_halt;
+ register_power_off_handler_simple(vr41xx_halt,
+ POWER_OFF_PRIORITY_FALLBACK);
return 0;
}