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
a2883dfa
Commit
a2883dfa
authored
Oct 10, 2007
by
Len Brown
Browse files
Options
Browse Files
Download
Plain Diff
Pull thermal into release branch
parents
73a855f7
6e215785
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
10 deletions
+18
-10
drivers/acpi/thermal.c
drivers/acpi/thermal.c
+18
-10
No files found.
drivers/acpi/thermal.c
View file @
a2883dfa
...
...
@@ -195,6 +195,7 @@ struct acpi_thermal {
struct
acpi_thermal_trips
trips
;
struct
acpi_handle_list
devices
;
struct
timer_list
timer
;
struct
mutex
lock
;
};
static
const
struct
file_operations
acpi_thermal_state_fops
=
{
...
...
@@ -711,6 +712,7 @@ static void acpi_thermal_check(void *data)
int
result
=
0
;
struct
acpi_thermal
*
tz
=
data
;
unsigned
long
sleep_time
=
0
;
unsigned
long
timeout_jiffies
=
0
;
int
i
=
0
;
struct
acpi_thermal_state
state
;
...
...
@@ -720,11 +722,15 @@ static void acpi_thermal_check(void *data)
return
;
}
/* Check if someone else is already running */
if
(
!
mutex_trylock
(
&
tz
->
lock
))
return
;
state
=
tz
->
state
;
result
=
acpi_thermal_get_temperature
(
tz
);
if
(
result
)
return
;
goto
unlock
;
memset
(
&
tz
->
state
,
0
,
sizeof
(
tz
->
state
));
...
...
@@ -787,10 +793,13 @@ static void acpi_thermal_check(void *data)
* a thermal event occurs). Note that _TSP and _TZD values are
* given in 1/10th seconds (we must covert to milliseconds).
*/
if
(
tz
->
state
.
passive
)
if
(
tz
->
state
.
passive
)
{
sleep_time
=
tz
->
trips
.
passive
.
tsp
*
100
;
else
if
(
tz
->
polling_frequency
>
0
)
timeout_jiffies
=
jiffies
+
(
HZ
*
sleep_time
)
/
1000
;
}
else
if
(
tz
->
polling_frequency
>
0
)
{
sleep_time
=
tz
->
polling_frequency
*
100
;
timeout_jiffies
=
round_jiffies
(
jiffies
+
(
HZ
*
sleep_time
)
/
1000
);
}
ACPI_DEBUG_PRINT
((
ACPI_DB_INFO
,
"%s: temperature[%lu] sleep[%lu]
\n
"
,
tz
->
name
,
tz
->
temperature
,
sleep_time
));
...
...
@@ -804,17 +813,16 @@ static void acpi_thermal_check(void *data)
del_timer
(
&
(
tz
->
timer
));
}
else
{
if
(
timer_pending
(
&
(
tz
->
timer
)))
mod_timer
(
&
(
tz
->
timer
),
jiffies
+
(
HZ
*
sleep_time
)
/
1000
);
mod_timer
(
&
(
tz
->
timer
),
timeout_jiffies
);
else
{
tz
->
timer
.
data
=
(
unsigned
long
)
tz
;
tz
->
timer
.
function
=
acpi_thermal_run
;
tz
->
timer
.
expires
=
jiffies
+
(
HZ
*
sleep_time
)
/
1000
;
tz
->
timer
.
expires
=
timeout_jiffies
;
add_timer
(
&
(
tz
->
timer
));
}
}
return
;
unlock:
mutex_unlock
(
&
tz
->
lock
)
;
}
/* --------------------------------------------------------------------------
...
...
@@ -1251,7 +1259,7 @@ static int acpi_thermal_add(struct acpi_device *device)
strcpy
(
acpi_device_name
(
device
),
ACPI_THERMAL_DEVICE_NAME
);
strcpy
(
acpi_device_class
(
device
),
ACPI_THERMAL_CLASS
);
acpi_driver_data
(
device
)
=
tz
;
mutex_init
(
&
tz
->
lock
);
result
=
acpi_thermal_get_info
(
tz
);
if
(
result
)
goto
end
;
...
...
@@ -1321,7 +1329,7 @@ static int acpi_thermal_remove(struct acpi_device *device, int type)
}
acpi_thermal_remove_fs
(
device
);
mutex_destroy
(
&
tz
->
lock
);
kfree
(
tz
);
return
0
;
}
...
...
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