I note that powermgmt.c contains the following code
/*
* We shut off in the following cases:
* 1) The unit is idle, not playing music
* 2) The unit is playing music, but is paused
* 3) The battery level has reached shutdown limit
*
* We do not shut off in the following cases:
* 1) The USB is connected
* 2) The charger is connected
* 3) We are recording, or recording with pause
* 4) The radio is playing
*/
static void handle_auto_poweroff(void)
{
long timeout = poweroff_timeout*60*HZ;
int audio_stat = audio_status();
#if CONFIG_CHARGING
/*
* Inhibit shutdown as long as the charger is plugged in. If it is
* unplugged, wait for a timeout period and then shut down.
*/
if(charger_input_state == CHARGER || audio_stat == AUDIO_STATUS_PLAY) {
last_event_tick = current_tick;
}
#endif
Since the correct behaviour is apparently already coded in, I assume the problem is that charger_input_state is not being set properly by the wall charger. Any idea why that might be?
EDIT 2215 11/08/08: Does anyone know where CONFIG_CHARGING is defined? It doesn't seem to be in either power.h or powermgmt.h.