Looking at the pm.c supplied with wm8650 source, it appears that the
wakeup event fires when you press the power button, and it can thus be
captured.
#ifdef KEYPAD_POWER_SUPPORT
if((status & BIT14) && kpadPower_dev) {
spin_lock_irq(&kpadPower_lock);
if(!powerKey_is_pressed) {
powerKey_is_pressed = 1;
input_report_key(kpadPower_dev, KEY_END, 1); //power key is
pressed
input_sync(kpadPower_dev);
pressed_jiffies = jiffies;
wmt_pwrbtn_debounce_value(power_up_debounce_value);
DPRINTK("\n[%s]power key pressed -->\n",__func__);
} else {
input_event(kpadPower_dev, EV_KEY, KEY_END, 2); // power key
repeat
input_sync(kpadPower_dev);
DPRINTK("\n[%s]power key repeat\n",__func__);
}
//disable_irq(IRQ_PMC_WAKEUP);
spin_unlock_irq(&kpadPower_lock);
mod_timer(&kpadPower_timer, jiffies + power_button_timeout);
}
#endif
I guess part of the keypad driver should be able to capture the power
button as well, and trigger a shutdown event. Guessing it definately
needs to be in soft-power mode for this to work.
Regards
Tony P