#include <linux/device.h>
#include <linux/idr.h>
#include <linux/init.h>
#include <linux/kdev_t.h>
#include <linux/kernel.h>
#include <linux/kobject.h>
#include <linux/slab.h>
#include <linux/timekeeping.h>
#include "power.h"
static struct class *wakeup_class;
#define wakeup_attr(_name) …
wakeup_attr(…);
wakeup_attr(…);
wakeup_attr(…);
wakeup_attr(…);
static ssize_t active_time_ms_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static DEVICE_ATTR_RO(active_time_ms);
static ssize_t total_time_ms_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static DEVICE_ATTR_RO(total_time_ms);
static ssize_t max_time_ms_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static DEVICE_ATTR_RO(max_time_ms);
static ssize_t last_change_ms_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static DEVICE_ATTR_RO(last_change_ms);
static ssize_t name_show(struct device *dev, struct device_attribute *attr,
char *buf)
{ … }
static DEVICE_ATTR_RO(name);
static ssize_t prevent_suspend_time_ms_show(struct device *dev,
struct device_attribute *attr,
char *buf)
{ … }
static DEVICE_ATTR_RO(prevent_suspend_time_ms);
static struct attribute *wakeup_source_attrs[] = …;
ATTRIBUTE_GROUPS(…);
static void device_create_release(struct device *dev)
{ … }
static struct device *wakeup_source_device_create(struct device *parent,
struct wakeup_source *ws)
{ … }
int wakeup_source_sysfs_add(struct device *parent, struct wakeup_source *ws)
{ … }
int pm_wakeup_source_sysfs_add(struct device *parent)
{ … }
void wakeup_source_sysfs_remove(struct wakeup_source *ws)
{ … }
static int __init wakeup_sources_sysfs_init(void)
{ … }
postcore_initcall(wakeup_sources_sysfs_init);