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
f61d5b4d
Commit
f61d5b4d
authored
Aug 15, 2013
by
Zhang Rui
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'fixes' of .git into next
parents
036e8a13
ca56caa0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
11 deletions
+21
-11
drivers/thermal/step_wise.c
drivers/thermal/step_wise.c
+21
-11
No files found.
drivers/thermal/step_wise.c
View file @
f61d5b4d
...
...
@@ -51,44 +51,51 @@ static unsigned long get_target_state(struct thermal_instance *instance,
{
struct
thermal_cooling_device
*
cdev
=
instance
->
cdev
;
unsigned
long
cur_state
;
unsigned
long
next_target
;
/*
* We keep this instance the way it is by default.
* Otherwise, we use the current state of the
* cdev in use to determine the next_target.
*/
cdev
->
ops
->
get_cur_state
(
cdev
,
&
cur_state
);
next_target
=
instance
->
target
;
switch
(
trend
)
{
case
THERMAL_TREND_RAISING
:
if
(
throttle
)
{
cur_state
=
cur_state
<
instance
->
upper
?
next_target
=
cur_state
<
instance
->
upper
?
(
cur_state
+
1
)
:
instance
->
upper
;
if
(
cur_state
<
instance
->
lower
)
cur_state
=
instance
->
lower
;
if
(
next_target
<
instance
->
lower
)
next_target
=
instance
->
lower
;
}
break
;
case
THERMAL_TREND_RAISE_FULL
:
if
(
throttle
)
cur_state
=
instance
->
upper
;
next_target
=
instance
->
upper
;
break
;
case
THERMAL_TREND_DROPPING
:
if
(
cur_state
==
instance
->
lower
)
{
if
(
!
throttle
)
cur_state
=
-
1
;
next_target
=
THERMAL_NO_TARGET
;
}
else
{
cur_state
-=
1
;
if
(
cur_state
>
instance
->
upper
)
cur_state
=
instance
->
upper
;
next_target
=
cur_state
-
1
;
if
(
next_target
>
instance
->
upper
)
next_target
=
instance
->
upper
;
}
break
;
case
THERMAL_TREND_DROP_FULL
:
if
(
cur_state
==
instance
->
lower
)
{
if
(
!
throttle
)
cur_state
=
-
1
;
next_target
=
THERMAL_NO_TARGET
;
}
else
cur_state
=
instance
->
lower
;
next_target
=
instance
->
lower
;
break
;
default:
break
;
}
return
cur_state
;
return
next_target
;
}
static
void
update_passive_instance
(
struct
thermal_zone_device
*
tz
,
...
...
@@ -133,6 +140,9 @@ static void thermal_zone_trip_update(struct thermal_zone_device *tz, int trip)
old_target
=
instance
->
target
;
instance
->
target
=
get_target_state
(
instance
,
trend
,
throttle
);
if
(
old_target
==
instance
->
target
)
continue
;
/* Activate a passive thermal instance */
if
(
old_target
==
THERMAL_NO_TARGET
&&
instance
->
target
!=
THERMAL_NO_TARGET
)
...
...
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