Commit 7977cad2 authored by Len Brown's avatar Len Brown Committed by Len Brown
parent e00f6a84
...@@ -502,13 +502,27 @@ static struct { ...@@ -502,13 +502,27 @@ static struct {
unsigned int apic_thmr; unsigned int apic_thmr;
} apic_pm_state; } apic_pm_state;
static int lapic_suspend(struct sys_device *dev, u32 state) static int lapic_shutdown(struct sys_device *dev)
{ {
unsigned long flags; unsigned long flags;
if (!apic_pm_state.active) if (!apic_pm_state.active)
return 0; return 0;
local_irq_save(flags);
disable_local_APIC();
local_irq_restore(flags);
return 0;
}
static int lapic_suspend(struct sys_device *dev, u32 state)
{
if (!apic_pm_state.active)
return 0;
apic_pm_state.apic_id = apic_read(APIC_ID); apic_pm_state.apic_id = apic_read(APIC_ID);
apic_pm_state.apic_taskpri = apic_read(APIC_TASKPRI); apic_pm_state.apic_taskpri = apic_read(APIC_TASKPRI);
apic_pm_state.apic_ldr = apic_read(APIC_LDR); apic_pm_state.apic_ldr = apic_read(APIC_LDR);
...@@ -523,10 +537,7 @@ static int lapic_suspend(struct sys_device *dev, u32 state) ...@@ -523,10 +537,7 @@ static int lapic_suspend(struct sys_device *dev, u32 state)
apic_pm_state.apic_tdcr = apic_read(APIC_TDCR); apic_pm_state.apic_tdcr = apic_read(APIC_TDCR);
apic_pm_state.apic_thmr = apic_read(APIC_LVTTHMR); apic_pm_state.apic_thmr = apic_read(APIC_LVTTHMR);
local_irq_save(flags); return lapic_shutdown(dev);
disable_local_APIC();
local_irq_restore(flags);
return 0;
} }
static int lapic_resume(struct sys_device *dev) static int lapic_resume(struct sys_device *dev)
...@@ -575,6 +586,7 @@ static int lapic_resume(struct sys_device *dev) ...@@ -575,6 +586,7 @@ static int lapic_resume(struct sys_device *dev)
static struct sysdev_class lapic_sysclass = { static struct sysdev_class lapic_sysclass = {
set_kset_name("lapic"), set_kset_name("lapic"),
.shutdown = lapic_shutdown,
.resume = lapic_resume, .resume = lapic_resume,
.suspend = lapic_suspend, .suspend = lapic_suspend,
}; };
......
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