Shutdown after resume using power button

Marcelo Tosatti marcelo at kvack.org
Sat Jul 7 16:04:18 EDT 2007


On Sat, Jul 07, 2007 at 03:35:01PM -0400, Marcelo Tosatti wrote:
> Hi folks,
> 
> I was reading olpc-pm.c while I stumbled across this code
> 
> 
> static int olpc_pm_interrupt(int irq, void *id)
> {
>         uint32_t sts, gpe = 0;
> 
>         sts = inl(acpi_base + PM1_STS);
>         outl(sts | 0xFFFF, acpi_base + PM1_STS);
> 
>         if (olpc_get_rev() >= OLPC_REV_B2) {
>                 gpe = inl(acpi_base + PM_GPE0_STS);
>                 outl(0xFFFFFFFF, acpi_base + PM_GPE0_STS);
>         }
> 
>         if (sts & CS5536_PM_PWRBTN) {
>                 input_report_key(pm_inputdev, KEY_POWER, 1);
>                 input_sync(pm_inputdev);
>                 /* Do we need to delay this (and hence schedule_work)? */
>                 input_report_key(pm_inputdev, KEY_POWER, 0);
>                 input_sync(pm_inputdev);
>         }
> 
> So we report the KEY_POWER event down to userspace, which is probably
> the reason why we're seeing the powerdown sequence being started.
> 
> Now I wonder why exactly is this piece of code here? Shouldnt we export
> the "reason for wakeup" information via another means?

Doh, I was reading the function was "olpc_fixup_wakeup"... But I'm still
uncertain why the SCI is reported after we wakeup.




More information about the Devel mailing list