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
8c59ecb5
Commit
8c59ecb5
authored
Jan 03, 2014
by
Zhang Rui
Browse files
Options
Browse Files
Download
Plain Diff
Merge branches 'misc' and 'soc' of .git into next
parents
201531c2
800744bf
329fe7b1
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
37 additions
and
1 deletion
+37
-1
Documentation/devicetree/bindings/thermal/imx-thermal.txt
Documentation/devicetree/bindings/thermal/imx-thermal.txt
+4
-0
drivers/thermal/imx_thermal.c
drivers/thermal/imx_thermal.c
+20
-0
drivers/thermal/intel_powerclamp.c
drivers/thermal/intel_powerclamp.c
+10
-1
drivers/thermal/thermal_core.c
drivers/thermal/thermal_core.c
+3
-0
No files found.
Documentation/devicetree/bindings/thermal/imx-thermal.txt
View file @
8c59ecb5
...
...
@@ -8,10 +8,14 @@ Required properties:
calibration data, e.g. OCOTP on imx6q. The details about calibration data
can be found in SoC Reference Manual.
Optional properties:
- clocks : thermal sensor's clock source.
Example:
tempmon {
compatible = "fsl,imx6q-tempmon";
fsl,tempmon = <&anatop>;
fsl,tempmon-data = <&ocotp>;
clocks = <&clks 172>;
};
drivers/thermal/imx_thermal.c
View file @
8c59ecb5
...
...
@@ -7,6 +7,7 @@
*
*/
#include <linux/clk.h>
#include <linux/cpu_cooling.h>
#include <linux/cpufreq.h>
#include <linux/delay.h>
...
...
@@ -73,6 +74,7 @@ struct imx_thermal_data {
unsigned
long
last_temp
;
bool
irq_enabled
;
int
irq
;
struct
clk
*
thermal_clk
;
};
static
void
imx_set_alarm_temp
(
struct
imx_thermal_data
*
data
,
...
...
@@ -457,6 +459,22 @@ static int imx_thermal_probe(struct platform_device *pdev)
return
ret
;
}
data
->
thermal_clk
=
devm_clk_get
(
&
pdev
->
dev
,
NULL
);
if
(
IS_ERR
(
data
->
thermal_clk
))
{
dev_warn
(
&
pdev
->
dev
,
"failed to get thermal clk!
\n
"
);
}
else
{
/*
* Thermal sensor needs clk on to get correct value, normally
* we should enable its clk before taking measurement and disable
* clk after measurement is done, but if alarm function is enabled,
* hardware will auto measure the temperature periodically, so we
* need to keep the clk always on for alarm function.
*/
ret
=
clk_prepare_enable
(
data
->
thermal_clk
);
if
(
ret
)
dev_warn
(
&
pdev
->
dev
,
"failed to enable thermal clk: %d
\n
"
,
ret
);
}
/* Enable measurements at ~ 10 Hz */
regmap_write
(
map
,
TEMPSENSE1
+
REG_CLR
,
TEMPSENSE1_MEASURE_FREQ
);
measure_freq
=
DIV_ROUND_UP
(
32768
,
10
);
/* 10 Hz */
...
...
@@ -478,6 +496,8 @@ static int imx_thermal_remove(struct platform_device *pdev)
/* Disable measurements */
regmap_write
(
map
,
TEMPSENSE0
+
REG_SET
,
TEMPSENSE0_POWER_DOWN
);
if
(
!
IS_ERR
(
data
->
thermal_clk
))
clk_disable_unprepare
(
data
->
thermal_clk
);
thermal_zone_device_unregister
(
data
->
tz
);
cpufreq_cooling_unregister
(
data
->
cdev
);
...
...
drivers/thermal/intel_powerclamp.c
View file @
8c59ecb5
...
...
@@ -206,6 +206,15 @@ static void find_target_mwait(void)
}
static
bool
has_pkg_state_counter
(
void
)
{
u64
tmp
;
return
!
rdmsrl_safe
(
MSR_PKG_C2_RESIDENCY
,
&
tmp
)
||
!
rdmsrl_safe
(
MSR_PKG_C3_RESIDENCY
,
&
tmp
)
||
!
rdmsrl_safe
(
MSR_PKG_C6_RESIDENCY
,
&
tmp
)
||
!
rdmsrl_safe
(
MSR_PKG_C7_RESIDENCY
,
&
tmp
);
}
static
u64
pkg_state_counter
(
void
)
{
u64
val
;
...
...
@@ -500,7 +509,7 @@ static int start_power_clamp(void)
struct
task_struct
*
thread
;
/* check if pkg cstate counter is completely 0, abort in this case */
if
(
!
pkg_state_counter
())
{
if
(
!
has_
pkg_state_counter
())
{
pr_err
(
"pkg cstate counter not functional, abort
\n
"
);
return
-
EINVAL
;
}
...
...
drivers/thermal/thermal_core.c
View file @
8c59ecb5
...
...
@@ -781,6 +781,9 @@ emul_temp_store(struct device *dev, struct device_attribute *attr,
ret
=
tz
->
ops
->
set_emul_temp
(
tz
,
temperature
);
}
if
(
!
ret
)
thermal_zone_device_update
(
tz
);
return
ret
?
ret
:
count
;
}
static
DEVICE_ATTR
(
emul_temp
,
S_IWUSR
,
NULL
,
emul_temp_store
);
...
...
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