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
e1297b96
Commit
e1297b96
authored
Mar 15, 2004
by
Andrew Morton
Committed by
Linus Torvalds
Mar 15, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] Added rtas_set_power_level()
From: John Rose <johnrose@austin.ibm.com> Added rtas_set_power_level()
parent
323a26b1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
0 deletions
+29
-0
arch/ppc64/kernel/rtas.c
arch/ppc64/kernel/rtas.c
+28
-0
include/asm-ppc64/rtas.h
include/asm-ppc64/rtas.h
+1
-0
No files found.
arch/ppc64/kernel/rtas.c
View file @
e1297b96
...
...
@@ -258,6 +258,33 @@ rtas_get_power_level(int powerdomain, int *level)
return
rc
;
}
int
rtas_set_power_level
(
int
powerdomain
,
int
level
,
int
*
setlevel
)
{
int
token
=
rtas_token
(
"set-power-level"
);
unsigned
int
wait_time
;
long
returned_level
;
int
rc
;
if
(
token
==
RTAS_UNKNOWN_SERVICE
)
return
RTAS_UNKNOWN_OP
;
while
(
1
)
{
rc
=
(
int
)
rtas_call
(
token
,
2
,
2
,
&
returned_level
,
powerdomain
,
level
);
if
(
rc
==
RTAS_BUSY
)
udelay
(
1
);
else
if
(
rtas_is_extended_busy
(
rc
))
{
wait_time
=
rtas_extended_busy_delay_time
(
rc
);
udelay
(
wait_time
*
1000
);
}
else
break
;
}
*
setlevel
=
(
int
)
returned_level
;
return
rc
;
}
int
rtas_get_sensor
(
int
sensor
,
int
index
,
int
*
state
)
{
...
...
@@ -472,4 +499,5 @@ EXPORT_SYMBOL(rtas_data_buf_lock);
EXPORT_SYMBOL
(
rtas_extended_busy_delay_time
);
EXPORT_SYMBOL
(
rtas_get_sensor
);
EXPORT_SYMBOL
(
rtas_get_power_level
);
EXPORT_SYMBOL
(
rtas_set_power_level
);
EXPORT_SYMBOL
(
rtas_set_indicator
);
include/asm-ppc64/rtas.h
View file @
e1297b96
...
...
@@ -177,6 +177,7 @@ extern void rtas_power_off(void);
extern
void
rtas_halt
(
void
);
extern
int
rtas_get_sensor
(
int
sensor
,
int
index
,
int
*
state
);
extern
int
rtas_get_power_level
(
int
powerdomain
,
int
*
level
);
extern
int
rtas_set_power_level
(
int
powerdomain
,
int
level
,
int
*
setlevel
);
extern
int
rtas_set_indicator
(
int
indicator
,
int
index
,
int
new_value
);
/* Given an RTAS status code of 9900..9905 compute the hinted delay */
...
...
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