static irqreturn_t panel_int(int irq, void *dev_id) { unsigned int buttons; buttons = sgioc->panel; sgioc->panel = SGIOC_PANEL_POWERON | SGIOC_PANEL_POWERINTR; if (sgint->istat1 & SGINT_ISTAT1_PWR) { /* Wait until interrupt goes away */ disable_irq(SGI_PANEL_IRQ); init_timer(&debounce_timer); debounce_timer.function = debounce; debounce_timer.expires = jiffies + 5; add_timer(&debounce_timer); } /* Power button was pressed * ioc.ps page 22: "The Panel Register is called Power Control by Full * House. Only lowest 2 bits are used. Guiness uses upper four bits * for volume control". This is not true, all bits are pulled high * on fullhouse */ if (!(buttons & SGIOC_PANEL_POWERINTR)) power_button(); return IRQ_HANDLED; }
static void panel_int(int irq, void *dev_id, struct pt_regs *regs) { unsigned int buttons; buttons = hpc3mregs->panel; hpc3mregs->panel = 3; /* power_interrupt | power_supply_on */ if (ioc_icontrol->istat1 & 2) { /* Wait until interrupt goes away */ disable_irq(9); init_timer(&debounce_timer); debounce_timer.function = debounce; debounce_timer.expires = jiffies + 5; add_timer(&debounce_timer); } if (!(buttons & 2)) /* Power button was pressed */ power_button(); if (!(buttons & 0x40)) { /* Volume up button was pressed */ init_timer(&volume_timer); volume_timer.function = volume_up_button; volume_timer.expires = jiffies + 1; add_timer(&volume_timer); } if (!(buttons & 0x10)) { /* Volume down button was pressed */ init_timer(&volume_timer); volume_timer.function = volume_down_button; volume_timer.expires = jiffies + 1; add_timer(&volume_timer); } }