Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
Kernel
提交
e08f84e8
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看板
提交
e08f84e8
编写于
6月 16, 2015
作者:
R
Rafael J. Wysocki
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'acpi-scan' into acpi-video
上级
4a4f01a6
0519ade7
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
51 addition
and
38 deletion
+51
-38
drivers/acpi/internal.h
drivers/acpi/internal.h
+2
-0
drivers/acpi/property.c
drivers/acpi/property.c
+31
-23
drivers/acpi/scan.c
drivers/acpi/scan.c
+16
-14
include/acpi/acpi_bus.h
include/acpi/acpi_bus.h
+2
-1
未找到文件。
drivers/acpi/internal.h
浏览文件 @
e08f84e8
...
...
@@ -191,6 +191,8 @@ bool acpi_osi_is_win8(void);
/*--------------------------------------------------------------------------
Device properties
-------------------------------------------------------------------------- */
#define ACPI_DT_NAMESPACE_HID "PRP0001"
void
acpi_init_properties
(
struct
acpi_device
*
adev
);
void
acpi_free_properties
(
struct
acpi_device
*
adev
);
...
...
drivers/acpi/property.c
浏览文件 @
e08f84e8
...
...
@@ -79,50 +79,51 @@ static bool acpi_properties_format_valid(const union acpi_object *properties)
static
void
acpi_init_of_compatible
(
struct
acpi_device
*
adev
)
{
const
union
acpi_object
*
of_compatible
;
struct
acpi_hardware_id
*
hwid
;
bool
acpi_of
=
false
;
int
ret
;
/*
* Check if the special PRP0001 ACPI ID is present and in that
* case we fill in Device Tree compatible properties for this
* device.
*/
list_for_each_entry
(
hwid
,
&
adev
->
pnp
.
ids
,
list
)
{
if
(
!
strcmp
(
hwid
->
id
,
"PRP0001"
))
{
acpi_of
=
true
;
break
;
}
}
if
(
!
acpi_of
)
return
;
ret
=
acpi_dev_get_property_array
(
adev
,
"compatible"
,
ACPI_TYPE_STRING
,
&
of_compatible
);
if
(
ret
)
{
ret
=
acpi_dev_get_property
(
adev
,
"compatible"
,
ACPI_TYPE_STRING
,
&
of_compatible
);
if
(
ret
)
{
acpi_handle_warn
(
adev
->
handle
,
"PRP0001 requires compatible property
\n
"
);
if
(
adev
->
parent
&&
adev
->
parent
->
flags
.
of_compatible_ok
)
goto
out
;
return
;
}
}
adev
->
data
.
of_compatible
=
of_compatible
;
out:
adev
->
flags
.
of_compatible_ok
=
1
;
}
void
acpi_init_properties
(
struct
acpi_device
*
adev
)
{
struct
acpi_buffer
buf
=
{
ACPI_ALLOCATE_BUFFER
};
bool
acpi_of
=
false
;
struct
acpi_hardware_id
*
hwid
;
const
union
acpi_object
*
desc
;
acpi_status
status
;
int
i
;
/*
* Check if ACPI_DT_NAMESPACE_HID is present and inthat case we fill in
* Device Tree compatible properties for this device.
*/
list_for_each_entry
(
hwid
,
&
adev
->
pnp
.
ids
,
list
)
{
if
(
!
strcmp
(
hwid
->
id
,
ACPI_DT_NAMESPACE_HID
))
{
acpi_of
=
true
;
break
;
}
}
status
=
acpi_evaluate_object_typed
(
adev
->
handle
,
"_DSD"
,
NULL
,
&
buf
,
ACPI_TYPE_PACKAGE
);
if
(
ACPI_FAILURE
(
status
))
return
;
goto
out
;
desc
=
buf
.
pointer
;
if
(
desc
->
package
.
count
%
2
)
...
...
@@ -156,13 +157,20 @@ void acpi_init_properties(struct acpi_device *adev)
adev
->
data
.
pointer
=
buf
.
pointer
;
adev
->
data
.
properties
=
properties
;
acpi_init_of_compatible
(
adev
);
return
;
if
(
acpi_of
)
acpi_init_of_compatible
(
adev
);
goto
out
;
}
fail:
dev_
warn
(
&
adev
->
dev
,
"Returned _DSD data is not valid, skipping
\n
"
);
dev_
dbg
(
&
adev
->
dev
,
"Returned _DSD data is not valid, skipping
\n
"
);
ACPI_FREE
(
buf
.
pointer
);
out:
if
(
acpi_of
&&
!
adev
->
flags
.
of_compatible_ok
)
acpi_handle_info
(
adev
->
handle
,
ACPI_DT_NAMESPACE_HID
" requires 'compatible' property
\n
"
);
}
void
acpi_free_properties
(
struct
acpi_device
*
adev
)
...
...
drivers/acpi/scan.c
浏览文件 @
e08f84e8
...
...
@@ -135,12 +135,13 @@ static int create_pnp_modalias(struct acpi_device *acpi_dev, char *modalias,
struct
acpi_hardware_id
*
id
;
/*
* Since we skip PRP0001 from the modalias below, 0 should be returned
* if PRP0001 is the only ACPI/PNP ID in the device's list.
* Since we skip ACPI_DT_NAMESPACE_HID from the modalias below, 0 should
* be returned if ACPI_DT_NAMESPACE_HID is the only ACPI/PNP ID in the
* device's list.
*/
count
=
0
;
list_for_each_entry
(
id
,
&
acpi_dev
->
pnp
.
ids
,
list
)
if
(
strcmp
(
id
->
id
,
"PRP0001"
))
if
(
strcmp
(
id
->
id
,
ACPI_DT_NAMESPACE_HID
))
count
++
;
if
(
!
count
)
...
...
@@ -153,7 +154,7 @@ static int create_pnp_modalias(struct acpi_device *acpi_dev, char *modalias,
size
-=
len
;
list_for_each_entry
(
id
,
&
acpi_dev
->
pnp
.
ids
,
list
)
{
if
(
!
strcmp
(
id
->
id
,
"PRP0001"
))
if
(
!
strcmp
(
id
->
id
,
ACPI_DT_NAMESPACE_HID
))
continue
;
count
=
snprintf
(
&
modalias
[
len
],
size
,
"%s:"
,
id
->
id
);
...
...
@@ -177,7 +178,8 @@ static int create_pnp_modalias(struct acpi_device *acpi_dev, char *modalias,
* @size: Size of the buffer.
*
* Expose DT compatible modalias as of:NnameTCcompatible. This function should
* only be called for devices having PRP0001 in their list of ACPI/PNP IDs.
* only be called for devices having ACPI_DT_NAMESPACE_HID in their list of
* ACPI/PNP IDs.
*/
static
int
create_of_modalias
(
struct
acpi_device
*
acpi_dev
,
char
*
modalias
,
int
size
)
...
...
@@ -980,9 +982,9 @@ static void acpi_device_remove_files(struct acpi_device *dev)
* @adev: ACPI device object to match.
* @of_match_table: List of device IDs to match against.
*
* If @dev has an ACPI companion which has
the special PRP0001 device ID in its
*
list of identifiers and a _DSD object with the "compatible" property, use
*
that
property to match against the given list of identifiers.
* If @dev has an ACPI companion which has
ACPI_DT_NAMESPACE_HID in its list of
*
identifiers and a _DSD object with the "compatible" property, use that
* property to match against the given list of identifiers.
*/
static
bool
acpi_of_match_device
(
struct
acpi_device
*
adev
,
const
struct
of_device_id
*
of_match_table
)
...
...
@@ -1038,14 +1040,14 @@ static const struct acpi_device_id *__acpi_match_device(
return
id
;
/*
* Next, check
the special "PRP0001"
ID and try to match the
* Next, check
ACPI_DT_NAMESPACE_H
ID and try to match the
* "compatible" property if found.
*
* The id returned by the below is not valid, but the only
* caller passing non-NULL of_ids here is only interested in
* whether or not the return value is NULL.
*/
if
(
!
strcmp
(
"PRP0001"
,
hwid
->
id
)
if
(
!
strcmp
(
ACPI_DT_NAMESPACE_HID
,
hwid
->
id
)
&&
acpi_of_match_device
(
device
,
of_ids
))
return
id
;
}
...
...
@@ -1671,7 +1673,7 @@ static int acpi_bus_extract_wakeup_device_power_package(acpi_handle handle,
static
void
acpi_wakeup_gpe_init
(
struct
acpi_device
*
device
)
{
struct
acpi_device_id
button_device_ids
[]
=
{
st
atic
const
st
ruct
acpi_device_id
button_device_ids
[]
=
{
{
"PNP0C0C"
,
0
},
{
"PNP0C0D"
,
0
},
{
"PNP0C0E"
,
0
},
...
...
@@ -2405,7 +2407,7 @@ static void acpi_default_enumeration(struct acpi_device *device)
}
static
const
struct
acpi_device_id
generic_device_ids
[]
=
{
{
"PRP0001"
,
},
{
ACPI_DT_NAMESPACE_HID
,
},
{
""
,
},
};
...
...
@@ -2413,8 +2415,8 @@ static int acpi_generic_device_attach(struct acpi_device *adev,
const
struct
acpi_device_id
*
not_used
)
{
/*
* Since
PRP0001 is the only ID handled here, the test below can be
* unconditional.
* Since
ACPI_DT_NAMESPACE_HID is the only ID handled here, the test
*
below can be
unconditional.
*/
if
(
adev
->
data
.
of_compatible
)
acpi_default_enumeration
(
adev
);
...
...
include/acpi/acpi_bus.h
浏览文件 @
e08f84e8
...
...
@@ -208,7 +208,8 @@ struct acpi_device_flags {
u32
visited
:
1
;
u32
hotplug_notify
:
1
;
u32
is_dock_station
:
1
;
u32
reserved
:
23
;
u32
of_compatible_ok
:
1
;
u32
reserved
:
22
;
};
/* File System */
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录