Release 4.12 include/linux/pm_wakeup.h
/*
* pm_wakeup.h - Power management wakeup interface
*
* Copyright (C) 2008 Alan Stern
* Copyright (C) 2010 Rafael J. Wysocki, Novell Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef _LINUX_PM_WAKEUP_H
#define _LINUX_PM_WAKEUP_H
#ifndef _DEVICE_H_
# error "please don't include this file directly"
#endif
#include <linux/types.h>
struct wake_irq;
/**
* struct wakeup_source - Representation of wakeup sources
*
* @name: Name of the wakeup source
* @entry: Wakeup source list entry
* @lock: Wakeup source lock
* @wakeirq: Optional device specific wakeirq
* @timer: Wakeup timer list
* @timer_expires: Wakeup timer expiration
* @total_time: Total time this wakeup source has been active.
* @max_time: Maximum time this wakeup source has been continuously active.
* @last_time: Monotonic clock when the wakeup source's was touched last time.
* @prevent_sleep_time: Total time this source has been preventing autosleep.
* @event_count: Number of signaled wakeup events.
* @active_count: Number of times the wakeup source was activated.
* @relax_count: Number of times the wakeup source was deactivated.
* @expire_count: Number of times the wakeup source's timeout has expired.
* @wakeup_count: Number of times the wakeup source might abort suspend.
* @active: Status of the wakeup source.
* @has_timeout: The wakeup source has been activated with a timeout.
*/
struct wakeup_source {
const char *name;
struct list_head entry;
spinlock_t lock;
struct wake_irq *wakeirq;
struct timer_list timer;
unsigned long timer_expires;
ktime_t total_time;
ktime_t max_time;
ktime_t last_time;
ktime_t start_prevent_time;
ktime_t prevent_sleep_time;
unsigned long event_count;
unsigned long active_count;
unsigned long relax_count;
unsigned long expire_count;
unsigned long wakeup_count;
bool active:1;
bool autosleep_enabled:1;
};
#ifdef CONFIG_PM_SLEEP
/*
* Changes to device_may_wakeup take effect on the next pm state change.
*/
static inline bool device_can_wakeup(struct device *dev)
{
return dev->power.can_wakeup;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Rafael J. Wysocki | 19 | 100.00% | 2 | 100.00% |
Total | 19 | 100.00% | 2 | 100.00% |
static inline bool device_may_wakeup(struct device *dev)
{
return dev->power.can_wakeup && !!dev->power.wakeup;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Alan Stern | 17 | 62.96% | 1 | 33.33% |
Rafael J. Wysocki | 9 | 33.33% | 1 | 33.33% |
Dmitry Torokhov | 1 | 3.70% | 1 | 33.33% |
Total | 27 | 100.00% | 3 | 100.00% |
/* drivers/base/power/wakeup.c */
extern void wakeup_source_prepare(struct wakeup_source *ws, const char *name);
extern struct wakeup_source *wakeup_source_create(const char *name);
extern void wakeup_source_drop(struct wakeup_source *ws);
extern void wakeup_source_destroy(struct wakeup_source *ws);
extern void wakeup_source_add(struct wakeup_source *ws);
extern void wakeup_source_remove(struct wakeup_source *ws);
extern struct wakeup_source *wakeup_source_register(const char *name);
extern void wakeup_source_unregister(struct wakeup_source *ws);
extern int device_wakeup_enable(struct device *dev);
extern int device_wakeup_disable(struct device *dev);
extern void device_set_wakeup_capable(struct device *dev, bool capable);
extern int device_init_wakeup(struct device *dev, bool val);
extern int device_set_wakeup_enable(struct device *dev, bool enable);
extern void __pm_stay_awake(struct wakeup_source *ws);
extern void pm_stay_awake(struct device *dev);
extern void __pm_relax(struct wakeup_source *ws);
extern void pm_relax(struct device *dev);
extern void pm_wakeup_ws_event(struct wakeup_source *ws, unsigned int msec, bool hard);
extern void pm_wakeup_dev_event(struct device *dev, unsigned int msec, bool hard);
#else /* !CONFIG_PM_SLEEP */
static inline void device_set_wakeup_capable(struct device *dev, bool capable)
{
dev->power.can_wakeup = capable;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Alan Stern | 18 | 78.26% | 1 | 33.33% |
Rafael J. Wysocki | 4 | 17.39% | 1 | 33.33% |
Dmitry Torokhov | 1 | 4.35% | 1 | 33.33% |
Total | 23 | 100.00% | 3 | 100.00% |
static inline bool device_can_wakeup(struct device *dev)
{
return dev->power.can_wakeup;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Alan Stern | 15 | 78.95% | 1 | 33.33% |
Rafael J. Wysocki | 3 | 15.79% | 1 | 33.33% |
Dmitry Torokhov | 1 | 5.26% | 1 | 33.33% |
Total | 19 | 100.00% | 3 | 100.00% |
static inline void wakeup_source_prepare(struct wakeup_source *ws,
const char *name) {}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Rafael J. Wysocki | 16 | 100.00% | 1 | 100.00% |
Total | 16 | 100.00% | 1 | 100.00% |
static inline struct wakeup_source *wakeup_source_create(const char *name)
{
return NULL;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Rafael J. Wysocki | 17 | 100.00% | 1 | 100.00% |
Total | 17 | 100.00% | 1 | 100.00% |
static inline void wakeup_source_drop(struct wakeup_source *ws) {}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Rafael J. Wysocki | 11 | 100.00% | 1 | 100.00% |
Total | 11 | 100.00% | 1 | 100.00% |
static inline void wakeup_source_destroy(struct wakeup_source *ws) {}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Rafael J. Wysocki | 11 | 100.00% | 1 | 100.00% |
Total | 11 | 100.00% | 1 | 100.00% |
static inline void wakeup_source_add(struct wakeup_source *ws) {}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Rafael J. Wysocki | 11 | 100.00% | 1 | 100.00% |
Total | 11 | 100.00% | 1 | 100.00% |
static inline void wakeup_source_remove(struct wakeup_source *ws) {}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Rafael J. Wysocki | 8 | 72.73% | 1 | 50.00% |
Alan Stern | 3 | 27.27% | 1 | 50.00% |
Total | 11 | 100.00% | 2 | 100.00% |
static inline struct wakeup_source *wakeup_source_register(const char *name)
{
return NULL;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Rafael J. Wysocki | 17 | 100.00% | 1 | 100.00% |
Total | 17 | 100.00% | 1 | 100.00% |
static inline void wakeup_source_unregister(struct wakeup_source *ws) {}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Rafael J. Wysocki | 11 | 100.00% | 1 | 100.00% |
Total | 11 | 100.00% | 1 | 100.00% |
static inline int device_wakeup_enable(struct device *dev)
{
dev->power.should_wakeup = true;
return 0;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Rafael J. Wysocki | 16 | 69.57% | 2 | 66.67% |
Alan Stern | 7 | 30.43% | 1 | 33.33% |
Total | 23 | 100.00% | 3 | 100.00% |
static inline int device_wakeup_disable(struct device *dev)
{
dev->power.should_wakeup = false;
return 0;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Rafael J. Wysocki | 21 | 91.30% | 2 | 66.67% |
Alan Stern | 2 | 8.70% | 1 | 33.33% |
Total | 23 | 100.00% | 3 | 100.00% |
static inline int device_set_wakeup_enable(struct device *dev, bool enable)
{
dev->power.should_wakeup = enable;
return 0;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Stephen Rothwell | 9 | 34.62% | 1 | 20.00% |
Alan Stern | 8 | 30.77% | 1 | 20.00% |
Rafael J. Wysocki | 8 | 30.77% | 2 | 40.00% |
Dmitry Torokhov | 1 | 3.85% | 1 | 20.00% |
Total | 26 | 100.00% | 5 | 100.00% |
static inline int device_init_wakeup(struct device *dev, bool val)
{
device_set_wakeup_capable(dev, val);
device_set_wakeup_enable(dev, val);
return 0;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Rafael J. Wysocki | 22 | 68.75% | 2 | 66.67% |
Alan Stern | 10 | 31.25% | 1 | 33.33% |
Total | 32 | 100.00% | 3 | 100.00% |
static inline bool device_may_wakeup(struct device *dev)
{
return dev->power.can_wakeup && dev->power.should_wakeup;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Rafael J. Wysocki | 23 | 92.00% | 1 | 50.00% |
Alan Stern | 2 | 8.00% | 1 | 50.00% |
Total | 25 | 100.00% | 2 | 100.00% |
static inline void __pm_stay_awake(struct wakeup_source *ws) {}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Rafael J. Wysocki | 8 | 72.73% | 1 | 50.00% |
Dmitry Torokhov | 3 | 27.27% | 1 | 50.00% |
Total | 11 | 100.00% | 2 | 100.00% |
static inline void pm_stay_awake(struct device *dev) {}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Rafael J. Wysocki | 11 | 100.00% | 1 | 100.00% |
Total | 11 | 100.00% | 1 | 100.00% |
static inline void __pm_relax(struct wakeup_source *ws) {}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Rafael J. Wysocki | 11 | 100.00% | 1 | 100.00% |
Total | 11 | 100.00% | 1 | 100.00% |
static inline void pm_relax(struct device *dev) {}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Rafael J. Wysocki | 6 | 54.55% | 1 | 33.33% |
Dmitry Torokhov | 3 | 27.27% | 1 | 33.33% |
Alan Stern | 2 | 18.18% | 1 | 33.33% |
Total | 11 | 100.00% | 3 | 100.00% |
static inline void pm_wakeup_ws_event(struct wakeup_source *ws,
unsigned int msec, bool hard) {}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Rafael J. Wysocki | 16 | 88.89% | 2 | 66.67% |
Alan Stern | 2 | 11.11% | 1 | 33.33% |
Total | 18 | 100.00% | 3 | 100.00% |
static inline void pm_wakeup_dev_event(struct device *dev, unsigned int msec,
bool hard) {}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Rafael J. Wysocki | 10 | 55.56% | 2 | 50.00% |
Dmitry Torokhov | 5 | 27.78% | 1 | 25.00% |
Alan Stern | 3 | 16.67% | 1 | 25.00% |
Total | 18 | 100.00% | 4 | 100.00% |
#endif /* !CONFIG_PM_SLEEP */
static inline void wakeup_source_init(struct wakeup_source *ws,
const char *name)
{
wakeup_source_prepare(ws, name);
wakeup_source_add(ws);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Rafael J. Wysocki | 29 | 100.00% | 1 | 100.00% |
Total | 29 | 100.00% | 1 | 100.00% |
static inline void wakeup_source_trash(struct wakeup_source *ws)
{
wakeup_source_remove(ws);
wakeup_source_drop(ws);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Rafael J. Wysocki | 22 | 100.00% | 1 | 100.00% |
Total | 22 | 100.00% | 1 | 100.00% |
static inline void __pm_wakeup_event(struct wakeup_source *ws, unsigned int msec)
{
return pm_wakeup_ws_event(ws, msec, false);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Rafael J. Wysocki | 26 | 100.00% | 1 | 100.00% |
Total | 26 | 100.00% | 1 | 100.00% |
static inline void pm_wakeup_event(struct device *dev, unsigned int msec)
{
return pm_wakeup_dev_event(dev, msec, false);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Rafael J. Wysocki | 26 | 100.00% | 1 | 100.00% |
Total | 26 | 100.00% | 1 | 100.00% |
static inline void pm_wakeup_hard_event(struct device *dev)
{
return pm_wakeup_dev_event(dev, 0, true);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Rafael J. Wysocki | 22 | 100.00% | 1 | 100.00% |
Total | 22 | 100.00% | 1 | 100.00% |
#endif /* _LINUX_PM_WAKEUP_H */
Overall Contributors
Person | Tokens | Prop | Commits | CommitProp |
Rafael J. Wysocki | 714 | 83.02% | 8 | 61.54% |
Alan Stern | 110 | 12.79% | 2 | 15.38% |
Dmitry Torokhov | 18 | 2.09% | 1 | 7.69% |
Tony Lindgren | 9 | 1.05% | 1 | 7.69% |
Stephen Rothwell | 9 | 1.05% | 1 | 7.69% |
Total | 860 | 100.00% | 13 | 100.00% |
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.