#include <linux/device.h>
#include <linux/kobject.h>
#include <linux/string.h>
#include <linux/export.h>
#include <linux/pm_qos.h>
#include <linux/pm_runtime.h>
#include <linux/pm_wakeup.h>
#include <linux/atomic.h>
#include <linux/jiffies.h>
#include "power.h"
const char power_group_name[] = …;
EXPORT_SYMBOL_GPL(…);
static const char ctrl_auto[] = …;
static const char ctrl_on[] = …;
static ssize_t control_show(struct device *dev, struct device_attribute *attr,
char *buf)
{ … }
static ssize_t control_store(struct device * dev, struct device_attribute *attr,
const char * buf, size_t n)
{ … }
static DEVICE_ATTR_RW(control);
static ssize_t runtime_active_time_show(struct device *dev,
struct device_attribute *attr,
char *buf)
{ … }
static DEVICE_ATTR_RO(runtime_active_time);
static ssize_t runtime_suspended_time_show(struct device *dev,
struct device_attribute *attr,
char *buf)
{ … }
static DEVICE_ATTR_RO(runtime_suspended_time);
static ssize_t runtime_status_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static DEVICE_ATTR_RO(runtime_status);
static ssize_t autosuspend_delay_ms_show(struct device *dev,
struct device_attribute *attr,
char *buf)
{ … }
static ssize_t autosuspend_delay_ms_store(struct device *dev,
struct device_attribute *attr, const char *buf, size_t n)
{ … }
static DEVICE_ATTR_RW(autosuspend_delay_ms);
static ssize_t pm_qos_resume_latency_us_show(struct device *dev,
struct device_attribute *attr,
char *buf)
{ … }
static ssize_t pm_qos_resume_latency_us_store(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t n)
{ … }
static DEVICE_ATTR_RW(pm_qos_resume_latency_us);
static ssize_t pm_qos_latency_tolerance_us_show(struct device *dev,
struct device_attribute *attr,
char *buf)
{ … }
static ssize_t pm_qos_latency_tolerance_us_store(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t n)
{ … }
static DEVICE_ATTR_RW(pm_qos_latency_tolerance_us);
static ssize_t pm_qos_no_power_off_show(struct device *dev,
struct device_attribute *attr,
char *buf)
{ … }
static ssize_t pm_qos_no_power_off_store(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t n)
{ … }
static DEVICE_ATTR_RW(pm_qos_no_power_off);
#ifdef CONFIG_PM_SLEEP
static const char _enabled[] = …;
static const char _disabled[] = …;
static ssize_t wakeup_show(struct device *dev, struct device_attribute *attr,
char *buf)
{ … }
static ssize_t wakeup_store(struct device *dev, struct device_attribute *attr,
const char *buf, size_t n)
{ … }
static DEVICE_ATTR_RW(wakeup);
static ssize_t wakeup_count_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static DEVICE_ATTR_RO(wakeup_count);
static ssize_t wakeup_active_count_show(struct device *dev,
struct device_attribute *attr,
char *buf)
{ … }
static DEVICE_ATTR_RO(wakeup_active_count);
static ssize_t wakeup_abort_count_show(struct device *dev,
struct device_attribute *attr,
char *buf)
{ … }
static DEVICE_ATTR_RO(wakeup_abort_count);
static ssize_t wakeup_expire_count_show(struct device *dev,
struct device_attribute *attr,
char *buf)
{ … }
static DEVICE_ATTR_RO(wakeup_expire_count);
static ssize_t wakeup_active_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static DEVICE_ATTR_RO(wakeup_active);
static ssize_t wakeup_total_time_ms_show(struct device *dev,
struct device_attribute *attr,
char *buf)
{ … }
static DEVICE_ATTR_RO(wakeup_total_time_ms);
static ssize_t wakeup_max_time_ms_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static DEVICE_ATTR_RO(wakeup_max_time_ms);
static ssize_t wakeup_last_time_ms_show(struct device *dev,
struct device_attribute *attr,
char *buf)
{ … }
static inline int dpm_sysfs_wakeup_change_owner(struct device *dev, kuid_t kuid,
kgid_t kgid)
{ … }
static DEVICE_ATTR_RO(wakeup_last_time_ms);
#ifdef CONFIG_PM_AUTOSLEEP
static ssize_t wakeup_prevent_sleep_time_ms_show(struct device *dev,
struct device_attribute *attr,
char *buf)
{ … }
static DEVICE_ATTR_RO(wakeup_prevent_sleep_time_ms);
#endif
#else
static inline int dpm_sysfs_wakeup_change_owner(struct device *dev, kuid_t kuid,
kgid_t kgid)
{
return 0;
}
#endif
#ifdef CONFIG_PM_ADVANCED_DEBUG
static ssize_t runtime_usage_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static DEVICE_ATTR_RO(runtime_usage);
static ssize_t runtime_active_kids_show(struct device *dev,
struct device_attribute *attr,
char *buf)
{ … }
static DEVICE_ATTR_RO(runtime_active_kids);
static ssize_t runtime_enabled_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static DEVICE_ATTR_RO(runtime_enabled);
#ifdef CONFIG_PM_SLEEP
static ssize_t async_show(struct device *dev, struct device_attribute *attr,
char *buf)
{ … }
static ssize_t async_store(struct device *dev, struct device_attribute *attr,
const char *buf, size_t n)
{ … }
static DEVICE_ATTR_RW(async);
#endif
#endif
static struct attribute *power_attrs[] = …;
static const struct attribute_group pm_attr_group = …;
static struct attribute *wakeup_attrs[] = …;
static const struct attribute_group pm_wakeup_attr_group = …;
static struct attribute *runtime_attrs[] = …;
static const struct attribute_group pm_runtime_attr_group = …;
static struct attribute *pm_qos_resume_latency_attrs[] = …;
static const struct attribute_group pm_qos_resume_latency_attr_group = …;
static struct attribute *pm_qos_latency_tolerance_attrs[] = …;
static const struct attribute_group pm_qos_latency_tolerance_attr_group = …;
static struct attribute *pm_qos_flags_attrs[] = …;
static const struct attribute_group pm_qos_flags_attr_group = …;
int dpm_sysfs_add(struct device *dev)
{ … }
int dpm_sysfs_change_owner(struct device *dev, kuid_t kuid, kgid_t kgid)
{ … }
int wakeup_sysfs_add(struct device *dev)
{ … }
void wakeup_sysfs_remove(struct device *dev)
{ … }
int pm_qos_sysfs_add_resume_latency(struct device *dev)
{ … }
void pm_qos_sysfs_remove_resume_latency(struct device *dev)
{ … }
int pm_qos_sysfs_add_flags(struct device *dev)
{ … }
void pm_qos_sysfs_remove_flags(struct device *dev)
{ … }
int pm_qos_sysfs_add_latency_tolerance(struct device *dev)
{ … }
void pm_qos_sysfs_remove_latency_tolerance(struct device *dev)
{ … }
void rpm_sysfs_remove(struct device *dev)
{ … }
void dpm_sysfs_remove(struct device *dev)
{ … }