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
da8029f3
Commit
da8029f3
authored
Sep 30, 2002
by
Andy Grover
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ACPI: Fix thermal management and make trip points R/W (Pavel Machek)
parent
1b4fe850
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
47 additions
and
2 deletions
+47
-2
drivers/acpi/processor.c
drivers/acpi/processor.c
+3
-0
drivers/acpi/thermal.c
drivers/acpi/thermal.c
+44
-2
No files found.
drivers/acpi/processor.c
View file @
da8029f3
...
...
@@ -1478,6 +1478,9 @@ acpi_processor_set_thermal_limit (
* performance state.
*/
px
=
pr
->
limit
.
thermal
.
px
;
tx
=
pr
->
limit
.
thermal
.
tx
;
switch
(
type
)
{
case
ACPI_PROCESSOR_LIMIT_NONE
:
...
...
drivers/acpi/thermal.c
View file @
da8029f3
...
...
@@ -63,6 +63,7 @@
#define ACPI_THERMAL_MAX_ACTIVE 10
#define KELVIN_TO_CELSIUS(t) ((t-2732+5)/10)
#define CELSIUS_TO_KELVIN(t) ((t+273)*10)
#define _COMPONENT ACPI_THERMAL_COMPONENT
ACPI_MODULE_NAME
(
"acpi_thermal"
)
...
...
@@ -868,6 +869,46 @@ acpi_thermal_read_trip_points (
}
static
int
acpi_thermal_write_trip_points
(
struct
file
*
file
,
const
char
*
buffer
,
unsigned
long
count
,
void
*
data
)
{
struct
acpi_thermal
*
tz
=
(
struct
acpi_thermal
*
)
data
;
char
limit_string
[
25
]
=
{
'\0'
};
int
critical
,
hot
,
passive
,
active0
,
active1
;
ACPI_FUNCTION_TRACE
(
"acpi_thermal_write_trip_points"
);
if
(
!
tz
||
(
count
>
sizeof
(
limit_string
)
-
1
))
{
ACPI_DEBUG_PRINT
((
ACPI_DB_ERROR
,
"Invalid argument
\n
"
));
return_VALUE
(
-
EINVAL
);
}
if
(
copy_from_user
(
limit_string
,
buffer
,
count
))
{
ACPI_DEBUG_PRINT
((
ACPI_DB_ERROR
,
"Invalid data
\n
"
));
return_VALUE
(
-
EFAULT
);
}
limit_string
[
count
]
=
'\0'
;
if
(
sscanf
(
limit_string
,
"%d:%d:%d:%d:%d"
,
&
critical
,
&
hot
,
&
passive
,
&
active0
,
&
active1
)
!=
5
)
{
ACPI_DEBUG_PRINT
((
ACPI_DB_ERROR
,
"Invalid data format
\n
"
));
return_VALUE
(
-
EINVAL
);
}
tz
->
trips
.
critical
.
temperature
=
CELSIUS_TO_KELVIN
(
critical
);
tz
->
trips
.
hot
.
temperature
=
CELSIUS_TO_KELVIN
(
hot
);
tz
->
trips
.
passive
.
temperature
=
CELSIUS_TO_KELVIN
(
passive
);
tz
->
trips
.
active
[
0
].
temperature
=
CELSIUS_TO_KELVIN
(
active0
);
tz
->
trips
.
active
[
1
].
temperature
=
CELSIUS_TO_KELVIN
(
active1
);
return_VALUE
(
count
);
}
static
int
acpi_thermal_read_cooling_mode
(
char
*
page
,
...
...
@@ -1057,15 +1098,16 @@ acpi_thermal_add_fs (
entry
->
data
=
acpi_driver_data
(
device
);
}
/* 'trip_points' [R] */
/* 'trip_points' [R
/W
] */
entry
=
create_proc_entry
(
ACPI_THERMAL_FILE_TRIP_POINTS
,
S_I
RUGO
,
acpi_device_dir
(
device
));
S_I
FREG
|
S_IRUGO
|
S_IWUSR
,
acpi_device_dir
(
device
));
if
(
!
entry
)
ACPI_DEBUG_PRINT
((
ACPI_DB_ERROR
,
"Unable to create '%s' fs entry
\n
"
,
ACPI_THERMAL_FILE_POLLING_FREQ
));
else
{
entry
->
read_proc
=
acpi_thermal_read_trip_points
;
entry
->
write_proc
=
acpi_thermal_write_trip_points
;
entry
->
data
=
acpi_driver_data
(
device
);
}
...
...
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