Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
c5738ddd
cloud-kernel
项目概览
openanolis
/
cloud-kernel
1 年多 前同步成功
通知
161
Star
36
Fork
7
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
10
列表
看板
标记
里程碑
合并请求
2
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
cloud-kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
10
Issue
10
列表
看板
标记
里程碑
合并请求
2
合并请求
2
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
c5738ddd
编写于
3月 23, 2014
作者:
Z
Zhang Rui
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Thermal: int3400 thermal: add capability to detect supporting UUIDs
Signed-off-by:
N
Zhang Rui
<
rui.zhang@intel.com
>
上级
816cab93
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
69 addition
and
0 deletion
+69
-0
drivers/thermal/int340x_thermal/int3400_thermal.c
drivers/thermal/int340x_thermal/int3400_thermal.c
+69
-0
未找到文件。
drivers/thermal/int340x_thermal/int3400_thermal.c
浏览文件 @
c5738ddd
...
...
@@ -41,14 +41,79 @@ struct trt {
u64
reverved4
;
};
enum
int3400_thermal_uuid
{
INT3400_THERMAL_PASSIVE_1
,
INT3400_THERMAL_PASSIVE_2
,
INT3400_THERMAL_ACTIVE
,
INT3400_THERMAL_CRITICAL
,
INT3400_THERMAL_COOLING_MODE
,
INT3400_THERMAL_MAXIMUM_UUID
,
};
static
u8
*
int3400_thermal_uuids
[
INT3400_THERMAL_MAXIMUM_UUID
]
=
{
"42A441D6-AE6A-462b-A84B-4A8CE79027D3"
,
"9E04115A-AE87-4D1C-9500-0F3E340BFE75"
,
"3A95C389-E4B8-4629-A526-C52C88626BAE"
,
"97C68AE7-15FA-499c-B8C9-5DA81D606E0A"
,
"16CAF1B7-DD38-40ed-B1C1-1B8A1913D531"
,
};
struct
int3400_thermal_priv
{
struct
acpi_device
*
adev
;
int
art_count
;
struct
art
*
arts
;
int
trt_count
;
struct
trt
*
trts
;
u8
uuid_bitmap
;
};
static
int
int3400_thermal_get_uuids
(
struct
int3400_thermal_priv
*
priv
)
{
struct
acpi_buffer
buf
=
{
ACPI_ALLOCATE_BUFFER
,
NULL
};
union
acpi_object
*
obja
,
*
objb
;
int
i
,
j
;
int
result
=
0
;
acpi_status
status
;
status
=
acpi_evaluate_object
(
priv
->
adev
->
handle
,
"IDSP"
,
NULL
,
&
buf
);
if
(
ACPI_FAILURE
(
status
))
return
-
ENODEV
;
obja
=
(
union
acpi_object
*
)
buf
.
pointer
;
if
(
obja
->
type
!=
ACPI_TYPE_PACKAGE
)
{
result
=
-
EINVAL
;
goto
end
;
}
for
(
i
=
0
;
i
<
obja
->
package
.
count
;
i
++
)
{
objb
=
&
obja
->
package
.
elements
[
i
];
if
(
objb
->
type
!=
ACPI_TYPE_BUFFER
)
{
result
=
-
EINVAL
;
goto
end
;
}
/* UUID must be 16 bytes */
if
(
objb
->
buffer
.
length
!=
16
)
{
result
=
-
EINVAL
;
goto
end
;
}
for
(
j
=
0
;
j
<
INT3400_THERMAL_MAXIMUM_UUID
;
j
++
)
{
u8
uuid
[
16
];
acpi_str_to_uuid
(
int3400_thermal_uuids
[
j
],
uuid
);
if
(
!
strncmp
(
uuid
,
objb
->
buffer
.
pointer
,
16
))
{
priv
->
uuid_bitmap
|=
(
1
<<
j
);
break
;
}
}
}
end:
kfree
(
buf
.
pointer
);
return
result
;
}
static
int
parse_art
(
struct
int3400_thermal_priv
*
priv
)
{
acpi_handle
handle
=
priv
->
adev
->
handle
;
...
...
@@ -193,6 +258,10 @@ static int int3400_thermal_probe(struct platform_device *pdev)
priv
->
adev
=
adev
;
result
=
int3400_thermal_get_uuids
(
priv
);
if
(
result
)
goto
free_priv
;
result
=
parse_art
(
priv
);
if
(
result
)
goto
free_priv
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录