Пример #1
0
static int autosuspend_init(void)
{
    if (autosuspend_inited) {
        return 0;
    }

    autosuspend_ops = autosuspend_earlysuspend_init();
    if (autosuspend_ops) {
        goto out;
    }

    autosuspend_ops = autosuspend_autosleep_init();
    if (autosuspend_ops) {
        goto out;
    }

    autosuspend_ops = autosuspend_wakeup_count_init();
    if (autosuspend_ops) {
        goto out;
    }

    if (!autosuspend_ops) {
        ALOGE("failed to initialize autosuspend\n");
        return -1;
    }

out:
    autosuspend_inited = true;

    ALOGV("autosuspend initialized\n");
    return 0;
}
Пример #2
0
static int autosuspend_init(void)
{
    if (autosuspend_inited) {
        return 0;
    }

    autosuspend_ops = autosuspend_earlysuspend_init();
    if (autosuspend_ops) {
        goto out;
    }

    /* Remove autosleep so userspace can manager suspend/resume and keep stats */
#if 0
    autosuspend_ops = autosuspend_autosleep_init();
    if (autosuspend_ops) {
        goto out;
    }
#endif

    autosuspend_ops = autosuspend_wakeup_count_init();
    if (autosuspend_ops) {
        goto out;
    }

    if (!autosuspend_ops) {
        ALOGE("failed to initialize autosuspend\n");
        return -1;
    }

out:
    autosuspend_inited = true;

    ALOGV("autosuspend initialized\n");
    return 0;
}