Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
raspberrypi-kernel
提交
d8dd3cbc
R
raspberrypi-kernel
项目概览
openeuler
/
raspberrypi-kernel
通知
13
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
raspberrypi-kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
d8dd3cbc
编写于
8月 12, 2007
作者:
L
Len Brown
浏览文件
操作
浏览文件
下载
差异文件
Pull bugzilla-8842 into release branch
上级
fc0dc4d3
0b5bfa1c
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
149 addition
and
14 deletion
+149
-14
Documentation/kernel-parameters.txt
Documentation/kernel-parameters.txt
+20
-0
drivers/acpi/thermal.c
drivers/acpi/thermal.c
+129
-14
未找到文件。
Documentation/kernel-parameters.txt
浏览文件 @
d8dd3cbc
...
...
@@ -1822,6 +1822,26 @@ and is between 256 and 4096 characters. It is defined in the file
thash_entries= [KNL,NET]
Set number of hash buckets for TCP connection
thermal.act= [HW,ACPI]
-1: disable all active trip points in all thermal zones
<degrees C>: override all lowest active trip points
thermal.nocrt= [HW,ACPI]
Set to disable actions on ACPI thermal zone
critical and hot trip points.
thermal.off= [HW,ACPI]
1: disable ACPI thermal control
thermal.psv= [HW,ACPI]
-1: disable all passive trip points
<degrees C>: override all passive trip points to this value
thermal.tzp= [HW,ACPI]
Specify global default ACPI thermal zone polling rate
<deci-seconds>: poll all this frequency
0: no polling (default)
time Show timing data prefixed to each printk message line
[deprecated, see 'printk.time']
...
...
drivers/acpi/thermal.c
浏览文件 @
d8dd3cbc
...
...
@@ -33,6 +33,7 @@
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/dmi.h>
#include <linux/init.h>
#include <linux/types.h>
#include <linux/proc_fs.h>
...
...
@@ -74,10 +75,26 @@ MODULE_AUTHOR("Paul Diefenbaugh");
MODULE_DESCRIPTION
(
"ACPI Thermal Zone Driver"
);
MODULE_LICENSE
(
"GPL"
);
static
int
act
;
module_param
(
act
,
int
,
0644
);
MODULE_PARM_DESC
(
act
,
"Disable or override all lowest active trip points.
\n
"
);
static
int
tzp
;
module_param
(
tzp
,
int
,
0
);
module_param
(
tzp
,
int
,
0
444
);
MODULE_PARM_DESC
(
tzp
,
"Thermal zone polling frequency, in 1/10 seconds.
\n
"
);
static
int
nocrt
;
module_param
(
nocrt
,
int
,
0
);
MODULE_PARM_DESC
(
nocrt
,
"Set to disable action on ACPI thermal zone critical and hot trips.
\n
"
);
static
int
off
;
module_param
(
off
,
int
,
0
);
MODULE_PARM_DESC
(
off
,
"Set to disable ACPI thermal support.
\n
"
);
static
int
psv
;
module_param
(
psv
,
int
,
0644
);
MODULE_PARM_DESC
(
psv
,
"Disable or override all passive trip points.
\n
"
);
static
int
acpi_thermal_add
(
struct
acpi_device
*
device
);
static
int
acpi_thermal_remove
(
struct
acpi_device
*
device
,
int
type
);
static
int
acpi_thermal_resume
(
struct
acpi_device
*
device
);
...
...
@@ -339,9 +356,16 @@ static int acpi_thermal_get_trip_points(struct acpi_thermal *tz)
/* Passive: Processors (optional) */
status
=
acpi_evaluate_integer
(
tz
->
device
->
handle
,
"_PSV"
,
NULL
,
&
tz
->
trips
.
passive
.
temperature
);
if
(
psv
==
-
1
)
{
status
=
AE_SUPPORT
;
}
else
if
(
psv
>
0
)
{
tz
->
trips
.
passive
.
temperature
=
CELSIUS_TO_KELVIN
(
psv
);
status
=
AE_OK
;
}
else
{
status
=
acpi_evaluate_integer
(
tz
->
device
->
handle
,
"_PSV"
,
NULL
,
&
tz
->
trips
.
passive
.
temperature
);
}
if
(
ACPI_FAILURE
(
status
))
{
tz
->
trips
.
passive
.
flags
.
valid
=
0
;
ACPI_DEBUG_PRINT
((
ACPI_DB_INFO
,
"No passive threshold
\n
"
));
...
...
@@ -386,11 +410,33 @@ static int acpi_thermal_get_trip_points(struct acpi_thermal *tz)
char
name
[
5
]
=
{
'_'
,
'A'
,
'C'
,
(
'0'
+
i
),
'\0'
};
status
=
acpi_evaluate_integer
(
tz
->
device
->
handle
,
name
,
NULL
,
&
tz
->
trips
.
active
[
i
].
temperature
);
if
(
ACPI_FAILURE
(
status
))
if
(
act
==
-
1
)
break
;
/* disable all active trip points */
status
=
acpi_evaluate_integer
(
tz
->
device
->
handle
,
name
,
NULL
,
&
tz
->
trips
.
active
[
i
].
temperature
);
if
(
ACPI_FAILURE
(
status
))
{
if
(
i
==
0
)
/* no active trip points */
break
;
if
(
act
<=
0
)
/* no override requested */
break
;
if
(
i
==
1
)
{
/* 1 trip point */
tz
->
trips
.
active
[
0
].
temperature
=
CELSIUS_TO_KELVIN
(
act
);
}
else
{
/* multiple trips */
/*
* Don't allow override higher than
* the next higher trip point
*/
tz
->
trips
.
active
[
i
-
1
].
temperature
=
(
tz
->
trips
.
active
[
i
-
2
].
temperature
<
CELSIUS_TO_KELVIN
(
act
)
?
tz
->
trips
.
active
[
i
-
2
].
temperature
:
CELSIUS_TO_KELVIN
(
act
));
}
break
;
}
name
[
2
]
=
'L'
;
status
=
...
...
@@ -427,7 +473,7 @@ static int acpi_thermal_get_devices(struct acpi_thermal *tz)
static
int
acpi_thermal_critical
(
struct
acpi_thermal
*
tz
)
{
if
(
!
tz
||
!
tz
->
trips
.
critical
.
flags
.
valid
)
if
(
!
tz
||
!
tz
->
trips
.
critical
.
flags
.
valid
||
nocrt
)
return
-
EINVAL
;
if
(
tz
->
temperature
>=
tz
->
trips
.
critical
.
temperature
)
{
...
...
@@ -449,7 +495,7 @@ static int acpi_thermal_critical(struct acpi_thermal *tz)
static
int
acpi_thermal_hot
(
struct
acpi_thermal
*
tz
)
{
if
(
!
tz
||
!
tz
->
trips
.
hot
.
flags
.
valid
)
if
(
!
tz
||
!
tz
->
trips
.
hot
.
flags
.
valid
||
nocrt
)
return
-
EINVAL
;
if
(
tz
->
temperature
>=
tz
->
trips
.
hot
.
temperature
)
{
...
...
@@ -824,12 +870,14 @@ static int acpi_thermal_trip_seq_show(struct seq_file *seq, void *offset)
goto
end
;
if
(
tz
->
trips
.
critical
.
flags
.
valid
)
seq_printf
(
seq
,
"critical (S5): %ld C
\n
"
,
KELVIN_TO_CELSIUS
(
tz
->
trips
.
critical
.
temperature
));
seq_printf
(
seq
,
"critical (S5): %ld C%s"
,
KELVIN_TO_CELSIUS
(
tz
->
trips
.
critical
.
temperature
),
nocrt
?
" <disabled>
\n
"
:
"
\n
"
);
if
(
tz
->
trips
.
hot
.
flags
.
valid
)
seq_printf
(
seq
,
"hot (S4): %ld C
\n
"
,
KELVIN_TO_CELSIUS
(
tz
->
trips
.
hot
.
temperature
));
seq_printf
(
seq
,
"hot (S4): %ld C%s"
,
KELVIN_TO_CELSIUS
(
tz
->
trips
.
hot
.
temperature
),
nocrt
?
" <disabled>
\n
"
:
"
\n
"
);
if
(
tz
->
trips
.
passive
.
flags
.
valid
)
{
seq_printf
(
seq
,
...
...
@@ -1281,11 +1329,78 @@ static int acpi_thermal_resume(struct acpi_device *device)
return
AE_OK
;
}
#ifdef CONFIG_DMI
static
int
thermal_act
(
struct
dmi_system_id
*
d
)
{
if
(
act
==
0
)
{
printk
(
KERN_NOTICE
"ACPI: %s detected: "
"disabling all active thermal trip points
\n
"
,
d
->
ident
);
act
=
-
1
;
}
return
0
;
}
static
int
thermal_tzp
(
struct
dmi_system_id
*
d
)
{
if
(
tzp
==
0
)
{
printk
(
KERN_NOTICE
"ACPI: %s detected: "
"enabling thermal zone polling
\n
"
,
d
->
ident
);
tzp
=
300
;
/* 300 dS = 30 Seconds */
}
return
0
;
}
static
int
thermal_psv
(
struct
dmi_system_id
*
d
)
{
if
(
psv
==
0
)
{
printk
(
KERN_NOTICE
"ACPI: %s detected: "
"disabling all passive thermal trip points
\n
"
,
d
->
ident
);
psv
=
-
1
;
}
return
0
;
}
static
struct
dmi_system_id
thermal_dmi_table
[]
__initdata
=
{
/*
* Award BIOS on this AOpen makes thermal control almost worthless.
* http://bugzilla.kernel.org/show_bug.cgi?id=8842
*/
{
.
callback
=
thermal_act
,
.
ident
=
"AOpen i915GMm-HFS"
,
.
matches
=
{
DMI_MATCH
(
DMI_BOARD_VENDOR
,
"AOpen"
),
DMI_MATCH
(
DMI_BOARD_NAME
,
"i915GMm-HFS"
),
},
},
{
.
callback
=
thermal_psv
,
.
ident
=
"AOpen i915GMm-HFS"
,
.
matches
=
{
DMI_MATCH
(
DMI_BOARD_VENDOR
,
"AOpen"
),
DMI_MATCH
(
DMI_BOARD_NAME
,
"i915GMm-HFS"
),
},
},
{
.
callback
=
thermal_tzp
,
.
ident
=
"AOpen i915GMm-HFS"
,
.
matches
=
{
DMI_MATCH
(
DMI_BOARD_VENDOR
,
"AOpen"
),
DMI_MATCH
(
DMI_BOARD_NAME
,
"i915GMm-HFS"
),
},
},
{}
};
#endif
/* CONFIG_DMI */
static
int
__init
acpi_thermal_init
(
void
)
{
int
result
=
0
;
dmi_check_system
(
thermal_dmi_table
);
if
(
off
)
{
printk
(
KERN_NOTICE
"ACPI: thermal control disabled
\n
"
);
return
-
ENODEV
;
}
acpi_thermal_dir
=
proc_mkdir
(
ACPI_THERMAL_CLASS
,
acpi_root_dir
);
if
(
!
acpi_thermal_dir
)
return
-
ENODEV
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录