linux/kernel/power/autosleep.c

// SPDX-License-Identifier: GPL-2.0
/*
 * kernel/power/autosleep.c
 *
 * Opportunistic sleep support.
 *
 * Copyright (C) 2012 Rafael J. Wysocki <[email protected]>
 */

#include <linux/device.h>
#include <linux/mutex.h>
#include <linux/pm_wakeup.h>

#include "power.h"

static suspend_state_t autosleep_state;
static struct workqueue_struct *autosleep_wq;
/*
 * Note: it is only safe to mutex_lock(&autosleep_lock) if a wakeup_source
 * is active, otherwise a deadlock with try_to_suspend() is possible.
 * Alternatively mutex_lock_interruptible() can be used.  This will then fail
 * if an auto_sleep cycle tries to freeze processes.
 */
static DEFINE_MUTEX(autosleep_lock);
static struct wakeup_source *autosleep_ws;

static void try_to_suspend(struct work_struct *work)
{}

static DECLARE_WORK(suspend_work, try_to_suspend);

void queue_up_suspend_work(void)
{}

suspend_state_t pm_autosleep_state(void)
{}

int pm_autosleep_lock(void)
{}

void pm_autosleep_unlock(void)
{}

int pm_autosleep_set_state(suspend_state_t state)
{}

int __init pm_autosleep_init(void)
{}