Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
af261127
Commit
af261127
authored
Nov 27, 2014
by
Rafael J. Wysocki
Browse files
Options
Browse Files
Download
Plain Diff
Merge back earlier 'pm-runtime' material for 3.19-rc1.
parents
5d01410f
b2b49ccb
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
35 additions
and
37 deletions
+35
-37
arch/ia64/Kconfig
arch/ia64/Kconfig
+1
-0
drivers/base/power/runtime.c
drivers/base/power/runtime.c
+33
-36
kernel/power/Kconfig
kernel/power/Kconfig
+1
-1
No files found.
arch/ia64/Kconfig
View file @
af261127
...
...
@@ -233,6 +233,7 @@ config IA64_SGI_UV
config IA64_HP_SIM
bool "Ski-simulator"
select SWIOTLB
depends on !PM_RUNTIME
endchoice
...
...
drivers/base/power/runtime.c
View file @
af261127
...
...
@@ -13,42 +13,39 @@
#include <trace/events/rpm.h>
#include "power.h"
#define RPM_GET_CALLBACK(dev, cb) \
({ \
int (*__rpm_cb)(struct device *__d); \
\
if (dev->pm_domain) \
__rpm_cb = dev->pm_domain->ops.cb; \
else if (dev->type && dev->type->pm) \
__rpm_cb = dev->type->pm->cb; \
else if (dev->class && dev->class->pm) \
__rpm_cb = dev->class->pm->cb; \
else if (dev->bus && dev->bus->pm) \
__rpm_cb = dev->bus->pm->cb; \
else \
__rpm_cb = NULL; \
\
if (!__rpm_cb && dev->driver && dev->driver->pm) \
__rpm_cb = dev->driver->pm->cb; \
\
__rpm_cb; \
})
static
int
(
*
rpm_get_suspend_cb
(
struct
device
*
dev
))(
struct
device
*
)
{
return
RPM_GET_CALLBACK
(
dev
,
runtime_suspend
);
}
typedef
int
(
*
pm_callback_t
)(
struct
device
*
);
static
int
(
*
rpm_get_resume_cb
(
struct
device
*
dev
))(
struct
device
*
)
static
pm_callback_t
__rpm_get_callback
(
struct
device
*
dev
,
size_t
cb_offset
)
{
return
RPM_GET_CALLBACK
(
dev
,
runtime_resume
);
pm_callback_t
cb
;
const
struct
dev_pm_ops
*
ops
;
if
(
dev
->
pm_domain
)
ops
=
&
dev
->
pm_domain
->
ops
;
else
if
(
dev
->
type
&&
dev
->
type
->
pm
)
ops
=
dev
->
type
->
pm
;
else
if
(
dev
->
class
&&
dev
->
class
->
pm
)
ops
=
dev
->
class
->
pm
;
else
if
(
dev
->
bus
&&
dev
->
bus
->
pm
)
ops
=
dev
->
bus
->
pm
;
else
ops
=
NULL
;
if
(
ops
)
cb
=
*
(
pm_callback_t
*
)((
void
*
)
ops
+
cb_offset
);
else
cb
=
NULL
;
if
(
!
cb
&&
dev
->
driver
&&
dev
->
driver
->
pm
)
cb
=
*
(
pm_callback_t
*
)((
void
*
)
dev
->
driver
->
pm
+
cb_offset
);
return
cb
;
}
#define RPM_GET_CALLBACK(dev, callback) \
__rpm_get_callback(dev, offsetof(struct dev_pm_ops, callback))
#ifdef CONFIG_PM_RUNTIME
static
int
(
*
rpm_get_idle_cb
(
struct
device
*
dev
))(
struct
device
*
)
{
return
RPM_GET_CALLBACK
(
dev
,
runtime_idle
);
}
static
int
rpm_resume
(
struct
device
*
dev
,
int
rpmflags
);
static
int
rpm_suspend
(
struct
device
*
dev
,
int
rpmflags
);
...
...
@@ -347,7 +344,7 @@ static int rpm_idle(struct device *dev, int rpmflags)
dev
->
power
.
idle_notification
=
true
;
callback
=
rpm_get_idle_cb
(
dev
);
callback
=
RPM_GET_CALLBACK
(
dev
,
runtime_idle
);
if
(
callback
)
retval
=
__rpm_callback
(
callback
,
dev
);
...
...
@@ -517,7 +514,7 @@ static int rpm_suspend(struct device *dev, int rpmflags)
__update_runtime_status
(
dev
,
RPM_SUSPENDING
);
callback
=
rpm_get_suspend_cb
(
dev
);
callback
=
RPM_GET_CALLBACK
(
dev
,
runtime_suspend
);
retval
=
rpm_callback
(
callback
,
dev
);
if
(
retval
)
...
...
@@ -737,7 +734,7 @@ static int rpm_resume(struct device *dev, int rpmflags)
__update_runtime_status
(
dev
,
RPM_RESUMING
);
callback
=
rpm_get_resume_cb
(
dev
);
callback
=
RPM_GET_CALLBACK
(
dev
,
runtime_resume
);
retval
=
rpm_callback
(
callback
,
dev
);
if
(
retval
)
{
...
...
@@ -1431,7 +1428,7 @@ int pm_runtime_force_suspend(struct device *dev)
if
(
pm_runtime_status_suspended
(
dev
))
return
0
;
callback
=
rpm_get_suspend_cb
(
dev
);
callback
=
RPM_GET_CALLBACK
(
dev
,
runtime_suspend
);
if
(
!
callback
)
{
ret
=
-
ENOSYS
;
...
...
@@ -1467,7 +1464,7 @@ int pm_runtime_force_resume(struct device *dev)
int
(
*
callback
)(
struct
device
*
);
int
ret
=
0
;
callback
=
rpm_get_resume_cb
(
dev
);
callback
=
RPM_GET_CALLBACK
(
dev
,
runtime_resume
);
if
(
!
callback
)
{
ret
=
-
ENOSYS
;
...
...
kernel/power/Kconfig
View file @
af261127
...
...
@@ -94,6 +94,7 @@ config PM_STD_PARTITION
config PM_SLEEP
def_bool y
depends on SUSPEND || HIBERNATE_CALLBACKS
select PM_RUNTIME
config PM_SLEEP_SMP
def_bool y
...
...
@@ -131,7 +132,6 @@ config PM_WAKELOCKS_GC
config PM_RUNTIME
bool "Run-time PM core functionality"
depends on !IA64_HP_SIM
---help---
Enable functionality allowing I/O devices to be put into energy-saving
(low power) states at run time (or autosuspended) after a specified
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment