Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
Kernel
提交
b6c70268
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看板
提交
b6c70268
编写于
11月 30, 2017
作者:
R
Rafael J. Wysocki
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'acpi-ec' into acpi
* acpi-ec: ACPI / EC: Fix regression related to PM ops support in ECDT device
上级
10809bb9
a64a62ce
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
69 addition
and
24 deletion
+69
-24
drivers/acpi/ec.c
drivers/acpi/ec.c
+45
-24
drivers/acpi/internal.h
drivers/acpi/internal.h
+1
-0
drivers/acpi/scan.c
drivers/acpi/scan.c
+21
-0
include/acpi/acpi_bus.h
include/acpi/acpi_bus.h
+1
-0
include/acpi/acpi_drivers.h
include/acpi/acpi_drivers.h
+1
-0
未找到文件。
drivers/acpi/ec.c
浏览文件 @
b6c70268
...
...
@@ -1597,32 +1597,41 @@ static int acpi_ec_add(struct acpi_device *device)
{
struct
acpi_ec
*
ec
=
NULL
;
int
ret
;
bool
is_ecdt
=
false
;
acpi_status
status
;
strcpy
(
acpi_device_name
(
device
),
ACPI_EC_DEVICE_NAME
);
strcpy
(
acpi_device_class
(
device
),
ACPI_EC_CLASS
);
ec
=
acpi_ec_alloc
();
if
(
!
ec
)
return
-
ENOMEM
;
if
(
ec_parse_device
(
device
->
handle
,
0
,
ec
,
NULL
)
!=
AE_CTRL_TERMINATE
)
{
if
(
!
strcmp
(
acpi_device_hid
(
device
),
ACPI_ECDT_HID
))
{
is_ecdt
=
true
;
ec
=
boot_ec
;
}
else
{
ec
=
acpi_ec_alloc
();
if
(
!
ec
)
return
-
ENOMEM
;
status
=
ec_parse_device
(
device
->
handle
,
0
,
ec
,
NULL
);
if
(
status
!=
AE_CTRL_TERMINATE
)
{
ret
=
-
EINVAL
;
goto
err_alloc
;
}
}
if
(
acpi_is_boot_ec
(
ec
))
{
boot_ec_is_ecdt
=
false
;
/*
* Trust PNP0C09 namespace location rather than ECDT ID.
*
* But trust ECDT GPE rather than _GPE because of ASUS quirks,
* so do not change boot_ec->gpe to ec->gpe.
*/
boot_ec
->
handle
=
ec
->
handle
;
acpi_handle_debug
(
ec
->
handle
,
"duplicated.
\n
"
);
acpi_ec_free
(
ec
);
ec
=
boot_ec
;
ret
=
acpi_config_boot_ec
(
ec
,
ec
->
handle
,
true
,
false
);
boot_ec_is_ecdt
=
is_ecdt
;
if
(
!
is_ecdt
)
{
/*
* Trust PNP0C09 namespace location rather than
* ECDT ID. But trust ECDT GPE rather than _GPE
* because of ASUS quirks, so do not change
* boot_ec->gpe to ec->gpe.
*/
boot_ec
->
handle
=
ec
->
handle
;
acpi_handle_debug
(
ec
->
handle
,
"duplicated.
\n
"
);
acpi_ec_free
(
ec
);
ec
=
boot_ec
;
}
ret
=
acpi_config_boot_ec
(
ec
,
ec
->
handle
,
true
,
is_ecdt
);
}
else
ret
=
acpi_ec_setup
(
ec
,
true
);
if
(
ret
)
...
...
@@ -1635,8 +1644,10 @@ static int acpi_ec_add(struct acpi_device *device)
ret
=
!!
request_region
(
ec
->
command_addr
,
1
,
"EC cmd"
);
WARN
(
!
ret
,
"Could not request EC cmd io port 0x%lx"
,
ec
->
command_addr
);
/* Reprobe devices depending on the EC */
acpi_walk_dep_device_list
(
ec
->
handle
);
if
(
!
is_ecdt
)
{
/* Reprobe devices depending on the EC */
acpi_walk_dep_device_list
(
ec
->
handle
);
}
acpi_handle_debug
(
ec
->
handle
,
"enumerated.
\n
"
);
return
0
;
...
...
@@ -1692,6 +1703,7 @@ ec_parse_io_ports(struct acpi_resource *resource, void *context)
static
const
struct
acpi_device_id
ec_device_ids
[]
=
{
{
"PNP0C09"
,
0
},
{
ACPI_ECDT_HID
,
0
},
{
""
,
0
},
};
...
...
@@ -1764,11 +1776,14 @@ static int __init acpi_ec_ecdt_start(void)
* Note: ec->handle can be valid if this function is called after
* acpi_ec_add(), hence the fast path.
*/
if
(
boot_ec
->
handle
!=
ACPI_ROOT_OBJECT
)
handle
=
boot_ec
->
handle
;
else
if
(
!
acpi_ec_ecdt_get_handle
(
&
handle
))
return
-
ENODEV
;
return
acpi_config_boot_ec
(
boot_ec
,
handle
,
true
,
true
);
if
(
boot_ec
->
handle
==
ACPI_ROOT_OBJECT
)
{
if
(
!
acpi_ec_ecdt_get_handle
(
&
handle
))
return
-
ENODEV
;
boot_ec
->
handle
=
handle
;
}
/* Register to ACPI bus with PM ops attached */
return
acpi_bus_register_early_device
(
ACPI_BUS_TYPE_ECDT_EC
);
}
#if 0
...
...
@@ -2022,6 +2037,12 @@ int __init acpi_ec_init(void)
/* Drivers must be started after acpi_ec_query_init() */
dsdt_fail
=
acpi_bus_register_driver
(
&
acpi_ec_driver
);
/*
* Register ECDT to ACPI bus only when PNP0C09 probe fails. This is
* useful for platforms (confirmed on ASUS X550ZE) with valid ECDT
* settings but invalid DSDT settings.
* https://bugzilla.kernel.org/show_bug.cgi?id=196847
*/
ecdt_fail
=
acpi_ec_ecdt_start
();
return
ecdt_fail
&&
dsdt_fail
?
-
ENODEV
:
0
;
}
...
...
drivers/acpi/internal.h
浏览文件 @
b6c70268
...
...
@@ -115,6 +115,7 @@ bool acpi_device_is_present(const struct acpi_device *adev);
bool
acpi_device_is_battery
(
struct
acpi_device
*
adev
);
bool
acpi_device_is_first_physical_node
(
struct
acpi_device
*
adev
,
const
struct
device
*
dev
);
int
acpi_bus_register_early_device
(
int
type
);
/* --------------------------------------------------------------------------
Device Matching and Notification
...
...
drivers/acpi/scan.c
浏览文件 @
b6c70268
...
...
@@ -1024,6 +1024,9 @@ static void acpi_device_get_busid(struct acpi_device *device)
case
ACPI_BUS_TYPE_SLEEP_BUTTON
:
strcpy
(
device
->
pnp
.
bus_id
,
"SLPF"
);
break
;
case
ACPI_BUS_TYPE_ECDT_EC
:
strcpy
(
device
->
pnp
.
bus_id
,
"ECDT"
);
break
;
default:
acpi_get_name
(
device
->
handle
,
ACPI_SINGLE_NAME
,
&
buffer
);
/* Clean up trailing underscores (if any) */
...
...
@@ -1304,6 +1307,9 @@ static void acpi_set_pnp_ids(acpi_handle handle, struct acpi_device_pnp *pnp,
case
ACPI_BUS_TYPE_SLEEP_BUTTON
:
acpi_add_id
(
pnp
,
ACPI_BUTTON_HID_SLEEPF
);
break
;
case
ACPI_BUS_TYPE_ECDT_EC
:
acpi_add_id
(
pnp
,
ACPI_ECDT_HID
);
break
;
}
}
...
...
@@ -2046,6 +2052,21 @@ void acpi_bus_trim(struct acpi_device *adev)
}
EXPORT_SYMBOL_GPL
(
acpi_bus_trim
);
int
acpi_bus_register_early_device
(
int
type
)
{
struct
acpi_device
*
device
=
NULL
;
int
result
;
result
=
acpi_add_single_object
(
&
device
,
NULL
,
type
,
ACPI_STA_DEFAULT
);
if
(
result
)
return
result
;
device
->
flags
.
match_driver
=
true
;
return
device_attach
(
&
device
->
dev
);
}
EXPORT_SYMBOL_GPL
(
acpi_bus_register_early_device
);
static
int
acpi_bus_scan_fixed
(
void
)
{
int
result
=
0
;
...
...
include/acpi/acpi_bus.h
浏览文件 @
b6c70268
...
...
@@ -105,6 +105,7 @@ enum acpi_bus_device_type {
ACPI_BUS_TYPE_THERMAL
,
ACPI_BUS_TYPE_POWER_BUTTON
,
ACPI_BUS_TYPE_SLEEP_BUTTON
,
ACPI_BUS_TYPE_ECDT_EC
,
ACPI_BUS_DEVICE_TYPE_COUNT
};
...
...
include/acpi/acpi_drivers.h
浏览文件 @
b6c70268
...
...
@@ -58,6 +58,7 @@
#define ACPI_VIDEO_HID "LNXVIDEO"
#define ACPI_BAY_HID "LNXIOBAY"
#define ACPI_DOCK_HID "LNXDOCK"
#define ACPI_ECDT_HID "LNXEC"
/* Quirk for broken IBM BIOSes */
#define ACPI_SMBUS_IBM_HID "SMBUSIBM"
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录