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
500c09c7
Commit
500c09c7
authored
Jan 15, 2004
by
Len Brown
Browse files
Options
Browse Files
Download
Plain Diff
Merge intel.com:/home/lenb/src/linux-acpi-test-2.6.0
into intel.com:/home/lenb/src/linux-acpi-test-2.6.1
parents
74c84715
3136d340
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
63 additions
and
10 deletions
+63
-10
arch/i386/kernel/cpu/cpufreq/acpi.c
arch/i386/kernel/cpu/cpufreq/acpi.c
+61
-10
include/acpi/processor.h
include/acpi/processor.h
+2
-0
No files found.
arch/i386/kernel/cpu/cpufreq/acpi.c
View file @
500c09c7
...
...
@@ -108,7 +108,7 @@ acpi_processor_get_performance_control (
}
perf
->
control_register
=
(
u16
)
reg
->
address
;
perf
->
control_register_bit_width
=
reg
->
bit_width
;
/*
* status_register
*/
...
...
@@ -135,6 +135,7 @@ acpi_processor_get_performance_control (
}
perf
->
status_register
=
(
u16
)
reg
->
address
;
perf
->
status_register_bit_width
=
reg
->
bit_width
;
ACPI_DEBUG_PRINT
((
ACPI_DB_INFO
,
"control_register[0x%04x] status_register[0x%04x]
\n
"
,
...
...
@@ -224,6 +225,42 @@ acpi_processor_get_performance_states (
return_VALUE
(
result
);
}
static
int
acpi_processor_write_port
(
u16
port
,
u8
bit_width
,
u32
value
)
{
if
(
bit_width
<=
8
)
{
outb
(
value
,
port
);
}
else
if
(
bit_width
<=
16
)
{
outw
(
value
,
port
);
}
else
if
(
bit_width
<=
32
)
{
outl
(
value
,
port
);
}
else
{
return
-
ENODEV
;
}
return
0
;
}
static
int
acpi_processor_read_port
(
u16
port
,
u8
bit_width
,
u32
*
ret
)
{
*
ret
=
0
;
if
(
bit_width
<=
8
)
{
*
ret
=
inb
(
port
);
}
else
if
(
bit_width
<=
16
)
{
*
ret
=
inw
(
port
);
}
else
if
(
bit_width
<=
32
)
{
*
ret
=
inl
(
port
);
}
else
{
return
-
ENODEV
;
}
return
0
;
}
static
int
acpi_processor_set_performance
(
...
...
@@ -231,7 +268,9 @@ acpi_processor_set_performance (
int
state
)
{
u16
port
=
0
;
u16
value
=
0
;
u8
bit_width
=
0
;
int
ret
=
0
;
u32
value
=
0
;
int
i
=
0
;
struct
cpufreq_freqs
cpufreq_freqs
;
...
...
@@ -279,12 +318,18 @@ acpi_processor_set_performance (
*/
port
=
perf
->
control_register
;
value
=
(
u16
)
perf
->
states
[
state
].
control
;
bit_width
=
perf
->
control_register_bit_width
;
value
=
(
u32
)
perf
->
states
[
state
].
control
;
ACPI_DEBUG_PRINT
((
ACPI_DB_INFO
,
"Writing 0x%0
4
x to port 0x%04x
\n
"
,
value
,
port
));
"Writing 0x%0
8
x to port 0x%04x
\n
"
,
value
,
port
));
outw
(
value
,
port
);
ret
=
acpi_processor_write_port
(
port
,
bit_width
,
value
);
if
(
ret
)
{
ACPI_DEBUG_PRINT
((
ACPI_DB_WARN
,
"Invalid port width 0x%04x
\n
"
,
bit_width
));
return_VALUE
(
ret
);
}
/*
* Then we read the 'status_register' and compare the value with the
...
...
@@ -294,14 +339,20 @@ acpi_processor_set_performance (
*/
port
=
perf
->
status_register
;
bit_width
=
perf
->
status_register_bit_width
;
ACPI_DEBUG_PRINT
((
ACPI_DB_INFO
,
"Looking for 0x%0
4
x from port 0x%04x
\n
"
,
(
u
16
)
perf
->
states
[
state
].
status
,
port
));
"Looking for 0x%0
8
x from port 0x%04x
\n
"
,
(
u
32
)
perf
->
states
[
state
].
status
,
port
));
for
(
i
=
0
;
i
<
100
;
i
++
)
{
value
=
inw
(
port
);
if
(
value
==
(
u16
)
perf
->
states
[
state
].
status
)
ret
=
acpi_processor_read_port
(
port
,
bit_width
,
&
value
);
if
(
ret
)
{
ACPI_DEBUG_PRINT
((
ACPI_DB_WARN
,
"Invalid port width 0x%04x
\n
"
,
bit_width
));
return_VALUE
(
ret
);
}
if
(
value
==
(
u32
)
perf
->
states
[
state
].
status
)
break
;
udelay
(
10
);
}
...
...
@@ -309,7 +360,7 @@ acpi_processor_set_performance (
/* notify cpufreq */
cpufreq_notify_transition
(
&
cpufreq_freqs
,
CPUFREQ_POSTCHANGE
);
if
(
value
!=
(
u
16
)
perf
->
states
[
state
].
status
)
{
if
(
value
!=
(
u
32
)
perf
->
states
[
state
].
status
)
{
unsigned
int
tmp
=
cpufreq_freqs
.
new
;
cpufreq_freqs
.
new
=
cpufreq_freqs
.
old
;
cpufreq_freqs
.
old
=
tmp
;
...
...
include/acpi/processor.h
View file @
500c09c7
...
...
@@ -72,6 +72,8 @@ struct acpi_processor_performance {
int
platform_limit
;
u16
control_register
;
u16
status_register
;
u8
control_register_bit_width
;
u8
status_register_bit_width
;
int
state_count
;
struct
acpi_processor_px
states
[
ACPI_PROCESSOR_MAX_PERFORMANCE
];
struct
cpufreq_frequency_table
freq_table
[
ACPI_PROCESSOR_MAX_PERFORMANCE
];
...
...
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