Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
Kernel
提交
eea2d481
K
Kernel
项目概览
openeuler
/
Kernel
1 年多 前同步成功
通知
8
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
K
Kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
eea2d481
编写于
4月 25, 2013
作者:
Z
Zhang Rui
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'thermal_core-doc-comments-update' of .git into next
上级
a502be18
a00e55f9
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
59 addition
and
25 deletion
+59
-25
Documentation/thermal/sysfs-api.txt
Documentation/thermal/sysfs-api.txt
+1
-1
drivers/thermal/thermal_core.c
drivers/thermal/thermal_core.c
+57
-23
include/linux/thermal.h
include/linux/thermal.h
+1
-1
未找到文件。
Documentation/thermal/sysfs-api.txt
浏览文件 @
eea2d481
...
...
@@ -367,7 +367,7 @@ This function returns the thermal_instance corresponding to a given
{thermal_zone, cooling_device, trip_point} combination. Returns NULL
if such an instance does not exist.
5.3:
notify_thermal
_framework:
5.3:
thermal_notify
_framework:
This function handles the trip events from sensor drivers. It starts
throttling the cooling devices according to the policy configured.
For CRITICAL and HOT trip points, this notifies the respective drivers,
...
...
drivers/thermal/thermal_core.c
浏览文件 @
eea2d481
...
...
@@ -40,7 +40,7 @@
MODULE_AUTHOR
(
"Zhang Rui"
);
MODULE_DESCRIPTION
(
"Generic thermal management sysfs support"
);
MODULE_LICENSE
(
"GPL"
);
MODULE_LICENSE
(
"GPL
v2
"
);
static
DEFINE_IDR
(
thermal_tz_idr
);
static
DEFINE_IDR
(
thermal_cdev_idr
);
...
...
@@ -446,7 +446,7 @@ void thermal_zone_device_update(struct thermal_zone_device *tz)
for
(
count
=
0
;
count
<
tz
->
trips
;
count
++
)
handle_thermal_trip
(
tz
,
count
);
}
EXPORT_SYMBOL
(
thermal_zone_device_update
);
EXPORT_SYMBOL
_GPL
(
thermal_zone_device_update
);
static
void
thermal_zone_device_check
(
struct
work_struct
*
work
)
{
...
...
@@ -1109,13 +1109,23 @@ thermal_remove_hwmon_sysfs(struct thermal_zone_device *tz)
#endif
/**
* thermal_zone_bind_cooling_device - bind a cooling device to a thermal zone
* @tz:
thermal zone
device
* thermal_zone_bind_cooling_device
()
- bind a cooling device to a thermal zone
* @tz:
pointer to struct thermal_zone_
device
* @trip: indicates which trip point the cooling devices is
* associated with in this thermal zone.
* @cdev: thermal cooling device
* @cdev: pointer to struct thermal_cooling_device
* @upper: the Maximum cooling state for this trip point.
* THERMAL_NO_LIMIT means no upper limit,
* and the cooling device can be in max_state.
* @lower: the Minimum cooling state can be used for this trip point.
* THERMAL_NO_LIMIT means no lower limit,
* and the cooling device can be in cooling state 0.
*
* This interface function bind a thermal cooling device to the certain trip
* point of a thermal zone device.
* This function is usually called in the thermal zone device .bind callback.
*
* Return: 0 on success, the proper error value otherwise.
*/
int
thermal_zone_bind_cooling_device
(
struct
thermal_zone_device
*
tz
,
int
trip
,
...
...
@@ -1209,16 +1219,21 @@ int thermal_zone_bind_cooling_device(struct thermal_zone_device *tz,
kfree
(
dev
);
return
result
;
}
EXPORT_SYMBOL
(
thermal_zone_bind_cooling_device
);
EXPORT_SYMBOL
_GPL
(
thermal_zone_bind_cooling_device
);
/**
* thermal_zone_unbind_cooling_device - unbind a cooling device from a thermal zone
* @tz: thermal zone device
* thermal_zone_unbind_cooling_device() - unbind a cooling device from a
* thermal zone.
* @tz: pointer to a struct thermal_zone_device.
* @trip: indicates which trip point the cooling devices is
* associated with in this thermal zone.
* @cdev:
thermal cooling device
* @cdev:
pointer to a struct thermal_cooling_device.
*
* This interface function unbind a thermal cooling device from the certain
* trip point of a thermal zone device.
* This function is usually called in the thermal zone device .unbind callback.
*
* Return: 0 on success, the proper error value otherwise.
*/
int
thermal_zone_unbind_cooling_device
(
struct
thermal_zone_device
*
tz
,
int
trip
,
...
...
@@ -1249,7 +1264,7 @@ int thermal_zone_unbind_cooling_device(struct thermal_zone_device *tz,
kfree
(
pos
);
return
0
;
}
EXPORT_SYMBOL
(
thermal_zone_unbind_cooling_device
);
EXPORT_SYMBOL
_GPL
(
thermal_zone_unbind_cooling_device
);
static
void
thermal_release
(
struct
device
*
dev
)
{
...
...
@@ -1272,10 +1287,17 @@ static struct class thermal_class = {
};
/**
* thermal_cooling_device_register - register a new thermal cooling device
* thermal_cooling_device_register
()
- register a new thermal cooling device
* @type: the thermal cooling device type.
* @devdata: device private data.
* @ops: standard thermal cooling devices callbacks.
*
* This interface function adds a new thermal cooling device (fan/processor/...)
* to /sys/class/thermal/ folder as cooling_device[0-*]. It tries to bind itself
* to all the thermal zone devices registered at the same time.
*
* Return: a pointer to the created struct thermal_cooling_device or an
* ERR_PTR. Caller must check return value with IS_ERR*() helpers.
*/
struct
thermal_cooling_device
*
thermal_cooling_device_register
(
char
*
type
,
void
*
devdata
,
...
...
@@ -1301,7 +1323,7 @@ thermal_cooling_device_register(char *type, void *devdata,
return
ERR_PTR
(
result
);
}
str
cpy
(
cdev
->
type
,
type
?
:
""
);
str
lcpy
(
cdev
->
type
,
type
?
:
""
,
sizeof
(
cdev
->
type
)
);
mutex_init
(
&
cdev
->
lock
);
INIT_LIST_HEAD
(
&
cdev
->
thermal_instances
);
cdev
->
ops
=
ops
;
...
...
@@ -1346,7 +1368,7 @@ thermal_cooling_device_register(char *type, void *devdata,
device_unregister
(
&
cdev
->
device
);
return
ERR_PTR
(
result
);
}
EXPORT_SYMBOL
(
thermal_cooling_device_register
);
EXPORT_SYMBOL
_GPL
(
thermal_cooling_device_register
);
/**
* thermal_cooling_device_unregister - removes the registered thermal cooling device
...
...
@@ -1406,7 +1428,7 @@ void thermal_cooling_device_unregister(struct thermal_cooling_device *cdev)
device_unregister
(
&
cdev
->
device
);
return
;
}
EXPORT_SYMBOL
(
thermal_cooling_device_unregister
);
EXPORT_SYMBOL
_GPL
(
thermal_cooling_device_unregister
);
void
thermal_cdev_update
(
struct
thermal_cooling_device
*
cdev
)
{
...
...
@@ -1432,7 +1454,7 @@ void thermal_cdev_update(struct thermal_cooling_device *cdev)
EXPORT_SYMBOL
(
thermal_cdev_update
);
/**
*
notify_thermal
_framework - Sensor drivers use this API to notify framework
*
thermal_notify
_framework - Sensor drivers use this API to notify framework
* @tz: thermal zone device
* @trip: indicates which trip point has been crossed
*
...
...
@@ -1443,16 +1465,21 @@ EXPORT_SYMBOL(thermal_cdev_update);
* The throttling policy is based on the configured platform data; if no
* platform data is provided, this uses the step_wise throttling policy.
*/
void
notify_thermal
_framework
(
struct
thermal_zone_device
*
tz
,
int
trip
)
void
thermal_notify
_framework
(
struct
thermal_zone_device
*
tz
,
int
trip
)
{
handle_thermal_trip
(
tz
,
trip
);
}
EXPORT_SYMBOL
(
notify_thermal
_framework
);
EXPORT_SYMBOL
_GPL
(
thermal_notify
_framework
);
/**
* create_trip_attrs - create attributes for trip points
* create_trip_attrs
()
- create attributes for trip points
* @tz: the thermal zone device
* @mask: Writeable trip point bitmap.
*
* helper function to instantiate sysfs entries for every trip
* point and its properties of a struct thermal_zone_device.
*
* Return: 0 on success, the proper error value otherwise.
*/
static
int
create_trip_attrs
(
struct
thermal_zone_device
*
tz
,
int
mask
)
{
...
...
@@ -1553,7 +1580,7 @@ static void remove_trip_attrs(struct thermal_zone_device *tz)
}
/**
* thermal_zone_device_register - register a new thermal zone device
* thermal_zone_device_register
()
- register a new thermal zone device
* @type: the thermal zone device type
* @trips: the number of trip points the thermal zone support
* @mask: a bit string indicating the writeablility of trip points
...
...
@@ -1566,8 +1593,15 @@ static void remove_trip_attrs(struct thermal_zone_device *tz)
* whether trip points have been crossed (0 for interrupt
* driven systems)
*
* This interface function adds a new thermal zone device (sensor) to
* /sys/class/thermal folder as thermal_zone[0-*]. It tries to bind all the
* thermal cooling devices registered at the same time.
* thermal_zone_device_unregister() must be called when the device is no
* longer needed. The passive cooling depends on the .get_trend() return value.
*
* Return: a pointer to the created struct thermal_zone_device or an
* in case of error, an ERR_PTR. Caller must check return value with
* IS_ERR*() helpers.
*/
struct
thermal_zone_device
*
thermal_zone_device_register
(
const
char
*
type
,
int
trips
,
int
mask
,
void
*
devdata
,
...
...
@@ -1606,7 +1640,7 @@ struct thermal_zone_device *thermal_zone_device_register(const char *type,
return
ERR_PTR
(
result
);
}
str
cpy
(
tz
->
type
,
type
?
:
""
);
str
lcpy
(
tz
->
type
,
type
?
:
""
,
sizeof
(
tz
->
type
)
);
tz
->
ops
=
ops
;
tz
->
tzp
=
tzp
;
tz
->
device
.
class
=
&
thermal_class
;
...
...
@@ -1699,7 +1733,7 @@ struct thermal_zone_device *thermal_zone_device_register(const char *type,
device_unregister
(
&
tz
->
device
);
return
ERR_PTR
(
result
);
}
EXPORT_SYMBOL
(
thermal_zone_device_register
);
EXPORT_SYMBOL
_GPL
(
thermal_zone_device_register
);
/**
* thermal_device_unregister - removes the registered thermal zone device
...
...
@@ -1766,7 +1800,7 @@ void thermal_zone_device_unregister(struct thermal_zone_device *tz)
device_unregister
(
&
tz
->
device
);
return
;
}
EXPORT_SYMBOL
(
thermal_zone_device_unregister
);
EXPORT_SYMBOL
_GPL
(
thermal_zone_device_unregister
);
/**
* thermal_zone_get_zone_by_name() - search for a zone and returns its ref
...
...
@@ -1882,7 +1916,7 @@ int thermal_generate_netlink_event(struct thermal_zone_device *tz,
return
result
;
}
EXPORT_SYMBOL
(
thermal_generate_netlink_event
);
EXPORT_SYMBOL
_GPL
(
thermal_generate_netlink_event
);
static
int
genetlink_init
(
void
)
{
...
...
include/linux/thermal.h
浏览文件 @
eea2d481
...
...
@@ -246,7 +246,7 @@ int get_tz_trend(struct thermal_zone_device *, int);
struct
thermal_instance
*
get_thermal_instance
(
struct
thermal_zone_device
*
,
struct
thermal_cooling_device
*
,
int
);
void
thermal_cdev_update
(
struct
thermal_cooling_device
*
);
void
notify_thermal
_framework
(
struct
thermal_zone_device
*
,
int
);
void
thermal_notify
_framework
(
struct
thermal_zone_device
*
,
int
);
#ifdef CONFIG_NET
extern
int
thermal_generate_netlink_event
(
struct
thermal_zone_device
*
tz
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录