Commit 85509c00 authored by Kyle McMartin's avatar Kyle McMartin Committed by Kyle McMartin

[PARISC] Add chassis_power_off routine

Define a chassis_power_off routine that machines which have a way
to turn off the power supply can hook into. Formerly they were
using pm_power_off, which is now being used by generic code. Make
lasi.c use chassis_power_off instead of pm_power_off.

Note, all machines need to call machine_power_off so that the
switch can power off the machine, though halt -p may not necessarily
be able to work properly on the machine.
Signed-off-by: default avatarKyle McMartin <kyle@parisc-linux.org>
parent 526110f8
...@@ -54,12 +54,6 @@ ...@@ -54,12 +54,6 @@
#include <asm/uaccess.h> #include <asm/uaccess.h>
#include <asm/unwind.h> #include <asm/unwind.h>
/*
* Power off function, if any
*/
void (*pm_power_off)(void);
EXPORT_SYMBOL(pm_power_off);
void default_idle(void) void default_idle(void)
{ {
barrier(); barrier();
...@@ -142,6 +136,7 @@ void machine_halt(void) ...@@ -142,6 +136,7 @@ void machine_halt(void)
*/ */
} }
void (*chassis_power_off)(void);
/* /*
* This routine is called from sys_reboot to actually turn off the * This routine is called from sys_reboot to actually turn off the
...@@ -150,8 +145,8 @@ void machine_halt(void) ...@@ -150,8 +145,8 @@ void machine_halt(void)
void machine_power_off(void) void machine_power_off(void)
{ {
/* If there is a registered power off handler, call it. */ /* If there is a registered power off handler, call it. */
if(pm_power_off) if (chassis_power_off)
pm_power_off(); chassis_power_off();
/* Put the soft power button back under hardware control. /* Put the soft power button back under hardware control.
* If the user had already pressed the power button, the * If the user had already pressed the power button, the
...@@ -167,6 +162,8 @@ void machine_power_off(void) ...@@ -167,6 +162,8 @@ void machine_power_off(void)
KERN_EMERG "Please power this system off now."); KERN_EMERG "Please power this system off now.");
} }
void (*pm_power_off)(void) = machine_power_off;
EXPORT_SYMBOL(pm_power_off);
/* /*
* Create a kernel thread * Create a kernel thread
......
...@@ -166,6 +166,7 @@ static void lasi_power_off(void) ...@@ -166,6 +166,7 @@ static void lasi_power_off(void)
int __init int __init
lasi_init_chip(struct parisc_device *dev) lasi_init_chip(struct parisc_device *dev)
{ {
extern void (*chassis_power_off)(void);
struct gsc_asic *lasi; struct gsc_asic *lasi;
struct gsc_irq gsc_irq; struct gsc_irq gsc_irq;
int ret; int ret;
...@@ -222,7 +223,7 @@ lasi_init_chip(struct parisc_device *dev) ...@@ -222,7 +223,7 @@ lasi_init_chip(struct parisc_device *dev)
* ensure that only the first LASI (the one controlling the power off) * ensure that only the first LASI (the one controlling the power off)
* should set the HPA here */ * should set the HPA here */
lasi_power_off_hpa = lasi->hpa; lasi_power_off_hpa = lasi->hpa;
pm_power_off = lasi_power_off; chassis_power_off = lasi_power_off;
return ret; return ret;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment