Esempio n. 1
0
static u32 spm_get_wake_period(wake_reason_t last_wr)
{
    int period;
 
    /* battery decreases 1% */
    period = get_dynamic_period(!!(last_wr != WR_PCM_TIMER), 600, 1);
    if (period <= 1) 
    {
        spm_error("!!! CANNOT GET PERIOD FROM FUEL GAUGE !!!\n");
        period = 600;
    }
    else if (period > 36 * 3600)
    {    /* max period is 36.4 hours */
        period = 36 * 3600;
    }

    return period;
}
Esempio n. 2
0
static u32 sc_get_wake_period(bool first)
{
	int period;

#ifdef PLATFORM_EVB
	period = 300;
#else
	period = get_dynamic_period(first, 300, 1);	/* battery decreases 1% */
	if (period <= 1) {
		sc_xerror("!!! CANNOT GET PERIOD FROM FUEL GAUGE !!!\n");
		period = 300;
	} else if (period > 36 * 3600) {	/* max period is 36.4 hours */
		period = 36 * 3600;
	}
#endif

	return period;
}
static u32 spm_get_wake_period(int pwake_time, wake_reason_t last_wr)
{
    int period = SPM_WAKE_PERIOD;

    if (pwake_time < 0) {
        /* use FG to get the period of 1% battery decrease */
        period = get_dynamic_period(last_wr != WR_PCM_TIMER ? 1 : 0, SPM_WAKE_PERIOD, 1);
        if (period <= 0) {
            spm_warn("CANNOT GET PERIOD FROM FUEL GAUGE\n");
            period = SPM_WAKE_PERIOD;
        }
    } else {
        period = pwake_time;
        spm_crit2("pwake = %d\n", pwake_time);
    }

    if (period > 36 * 3600)     /* max period is 36.4 hours */
        period = 36 * 3600;

    return period;
}