#define pr_fmt(fmt) …
#include <linux/dmi.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/init.h>
#include <linux/types.h>
#include <linux/slab.h>
#include <linux/pm_runtime.h>
#include <linux/sysfs.h>
#include <linux/acpi.h>
#include "sleep.h"
#include "internal.h"
#define ACPI_POWER_CLASS …
#define ACPI_POWER_DEVICE_NAME …
#define ACPI_POWER_RESOURCE_STATE_OFF …
#define ACPI_POWER_RESOURCE_STATE_ON …
#define ACPI_POWER_RESOURCE_STATE_UNKNOWN …
struct acpi_power_dependent_device { … };
struct acpi_power_resource { … };
struct acpi_power_resource_entry { … };
static LIST_HEAD(acpi_power_resource_list);
static DEFINE_MUTEX(power_resource_list_lock);
static inline const char *resource_dev_name(struct acpi_power_resource *pr)
{ … }
static inline
struct acpi_power_resource *to_power_resource(struct acpi_device *device)
{ … }
static struct acpi_power_resource *acpi_power_get_context(acpi_handle handle)
{ … }
static int acpi_power_resources_list_add(acpi_handle handle,
struct list_head *list)
{ … }
void acpi_power_resources_list_free(struct list_head *list)
{ … }
static bool acpi_power_resource_is_dup(union acpi_object *package,
unsigned int start, unsigned int i)
{ … }
int acpi_extract_power_resources(union acpi_object *package, unsigned int start,
struct list_head *list)
{ … }
static int __get_state(acpi_handle handle, u8 *state)
{ … }
static int acpi_power_get_state(struct acpi_power_resource *resource, u8 *state)
{ … }
static int acpi_power_get_list_state(struct list_head *list, u8 *state)
{ … }
static int
acpi_power_resource_add_dependent(struct acpi_power_resource *resource,
struct device *dev)
{ … }
static void
acpi_power_resource_remove_dependent(struct acpi_power_resource *resource,
struct device *dev)
{ … }
int acpi_device_power_add_dependent(struct acpi_device *adev,
struct device *dev)
{ … }
void acpi_device_power_remove_dependent(struct acpi_device *adev,
struct device *dev)
{ … }
static int __acpi_power_on(struct acpi_power_resource *resource)
{ … }
static int acpi_power_on_unlocked(struct acpi_power_resource *resource)
{ … }
static int acpi_power_on(struct acpi_power_resource *resource)
{ … }
static int __acpi_power_off(struct acpi_power_resource *resource)
{ … }
static int acpi_power_off_unlocked(struct acpi_power_resource *resource)
{ … }
static int acpi_power_off(struct acpi_power_resource *resource)
{ … }
static int acpi_power_off_list(struct list_head *list)
{ … }
static int acpi_power_on_list(struct list_head *list)
{ … }
static struct attribute *attrs[] = …;
static const struct attribute_group attr_groups[] = …;
static const struct attribute_group wakeup_attr_group = …;
static void acpi_power_hide_list(struct acpi_device *adev,
struct list_head *resources,
const struct attribute_group *attr_group)
{ … }
static void acpi_power_expose_list(struct acpi_device *adev,
struct list_head *resources,
const struct attribute_group *attr_group)
{ … }
static void acpi_power_expose_hide(struct acpi_device *adev,
struct list_head *resources,
const struct attribute_group *attr_group,
bool expose)
{ … }
void acpi_power_add_remove_device(struct acpi_device *adev, bool add)
{ … }
int acpi_power_wakeup_list_init(struct list_head *list, int *system_level_p)
{ … }
int acpi_device_sleep_wake(struct acpi_device *dev,
int enable, int sleep_state, int dev_state)
{ … }
int acpi_enable_wakeup_device_power(struct acpi_device *dev, int sleep_state)
{ … }
int acpi_disable_wakeup_device_power(struct acpi_device *dev)
{ … }
int acpi_power_get_inferred_state(struct acpi_device *device, int *state)
{ … }
int acpi_power_on_resources(struct acpi_device *device, int state)
{ … }
int acpi_power_transition(struct acpi_device *device, int state)
{ … }
static void acpi_release_power_resource(struct device *dev)
{ … }
static ssize_t resource_in_use_show(struct device *dev,
struct device_attribute *attr,
char *buf)
{ … }
static DEVICE_ATTR_RO(resource_in_use);
static void acpi_power_sysfs_remove(struct acpi_device *device)
{ … }
static void acpi_power_add_resource_to_list(struct acpi_power_resource *resource)
{ … }
struct acpi_device *acpi_add_power_resource(acpi_handle handle)
{ … }
#ifdef CONFIG_ACPI_SLEEP
void acpi_resume_power_resources(void)
{ … }
#endif
static const struct dmi_system_id dmi_leave_unused_power_resources_on[] = …;
void acpi_turn_off_unused_power_resources(void)
{ … }