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
nexedi
linux
Commits
3d48b9e4
Commit
3d48b9e4
authored
Jul 09, 2003
by
Dave Jones
Committed by
Dave Jones
Jul 09, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[CPUFREQ] move cpufreq_restore(), and don't make it dependent on CONFIG_PM
From Dominik.
parent
1c576b19
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
35 deletions
+23
-35
kernel/cpufreq.c
kernel/cpufreq.c
+23
-35
No files found.
kernel/cpufreq.c
View file @
3d48b9e4
...
@@ -422,7 +422,29 @@ static int cpufreq_remove_dev (struct sys_device * sys_dev)
...
@@ -422,7 +422,29 @@ static int cpufreq_remove_dev (struct sys_device * sys_dev)
return
0
;
return
0
;
}
}
static
int
cpufreq_restore
(
struct
sys_device
*
);
/**
* cpufreq_restore - restore the CPU clock frequency after resume
*
* Restore the CPU clock frequency so that our idea of the current
* frequency reflects the actual hardware.
*/
static
int
cpufreq_restore
(
struct
sys_device
*
sysdev
)
{
int
cpu
=
sysdev
->
id
;
unsigned
int
ret
=
0
;
struct
cpufreq_policy
policy
;
if
(
cpu_online
(
cpu
)
&&
cpufreq_cpu_get
(
cpu
))
{
down
(
&
cpufreq_driver_sem
);
memcpy
(
&
policy
,
&
cpufreq_driver
->
policy
[
cpu
],
sizeof
(
struct
cpufreq_policy
));
up
(
&
cpufreq_driver_sem
);
ret
=
cpufreq_set_policy
(
&
policy
);
cpufreq_cpu_put
(
cpu
);
}
return
ret
;
}
static
struct
sysdev_driver
cpufreq_sysdev_driver
=
{
static
struct
sysdev_driver
cpufreq_sysdev_driver
=
{
.
add
=
cpufreq_add_dev
,
.
add
=
cpufreq_add_dev
,
...
@@ -877,37 +899,3 @@ int cpufreq_unregister_driver(struct cpufreq_driver *driver)
...
@@ -877,37 +899,3 @@ int cpufreq_unregister_driver(struct cpufreq_driver *driver)
return
0
;
return
0
;
}
}
EXPORT_SYMBOL_GPL
(
cpufreq_unregister_driver
);
EXPORT_SYMBOL_GPL
(
cpufreq_unregister_driver
);
#ifdef CONFIG_PM
/**
* cpufreq_restore - restore the CPU clock frequency after resume
*
* Restore the CPU clock frequency so that our idea of the current
* frequency reflects the actual hardware.
*/
static
int
cpufreq_restore
(
struct
sys_device
*
sysdev
)
{
int
cpu
=
sysdev
->
id
;
unsigned
int
ret
=
0
;
struct
cpufreq_policy
policy
;
if
(
cpu_online
(
cpu
)
&&
cpufreq_cpu_get
(
cpu
))
{
down
(
&
cpufreq_driver_sem
);
memcpy
(
&
policy
,
&
cpufreq_driver
->
policy
[
cpu
],
sizeof
(
struct
cpufreq_policy
));
up
(
&
cpufreq_driver_sem
);
ret
=
cpufreq_set_policy
(
&
policy
);
cpufreq_cpu_put
(
cpu
);
}
return
ret
;
}
#else
static
int
cpufreq_restore
(
struct
sys_device
*
sysdev
)
{
return
0
;
}
#endif
/* CONFIG_PM */
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