Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
raspberrypi-kernel
提交
0f23a6b0
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看板
提交
0f23a6b0
编写于
1月 23, 2008
作者:
L
Len Brown
浏览文件
操作
浏览文件
下载
差异文件
Pull bugzilla-8459 into release branch
上级
7456337d
d772b3b3
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
18 addition
and
8 deletion
+18
-8
drivers/acpi/ec.c
drivers/acpi/ec.c
+18
-8
未找到文件。
drivers/acpi/ec.c
浏览文件 @
0f23a6b0
...
...
@@ -26,6 +26,9 @@
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/
/* Uncomment next line to get verbose print outs*/
/* #define DEBUG */
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/init.h>
...
...
@@ -47,9 +50,6 @@
#undef PREFIX
#define PREFIX "ACPI: EC: "
/* Uncomment next line to get verbose print outs*/
/* #define DEBUG */
/* EC status register */
#define ACPI_EC_FLAG_OBF 0x01
/* Output buffer full */
#define ACPI_EC_FLAG_IBF 0x02
/* Input buffer full */
...
...
@@ -82,6 +82,7 @@ enum {
EC_FLAGS_ADDRESS
,
/* Address is being written */
EC_FLAGS_NO_WDATA_GPE
,
/* Don't expect WDATA GPE event */
EC_FLAGS_WDATA
,
/* Data is being written */
EC_FLAGS_NO_OBF1_GPE
,
/* Don't expect GPE before read */
};
static
int
acpi_ec_remove
(
struct
acpi_device
*
device
,
int
type
);
...
...
@@ -138,26 +139,26 @@ static struct acpi_ec {
static
inline
u8
acpi_ec_read_status
(
struct
acpi_ec
*
ec
)
{
u8
x
=
inb
(
ec
->
command_addr
);
pr_debug
(
PREFIX
"---> status = 0x%2x
\n
"
,
x
);
pr_debug
(
PREFIX
"---> status = 0x%2
.2
x
\n
"
,
x
);
return
x
;
}
static
inline
u8
acpi_ec_read_data
(
struct
acpi_ec
*
ec
)
{
u8
x
=
inb
(
ec
->
data_addr
);
pr_debug
(
PREFIX
"---> data = 0x%2x
\n
"
,
x
);
pr_debug
(
PREFIX
"---> data = 0x%2
.2
x
\n
"
,
x
);
return
inb
(
ec
->
data_addr
);
}
static
inline
void
acpi_ec_write_cmd
(
struct
acpi_ec
*
ec
,
u8
command
)
{
pr_debug
(
PREFIX
"<--- command = 0x%2x
\n
"
,
command
);
pr_debug
(
PREFIX
"<--- command = 0x%2
.2
x
\n
"
,
command
);
outb
(
command
,
ec
->
command_addr
);
}
static
inline
void
acpi_ec_write_data
(
struct
acpi_ec
*
ec
,
u8
data
)
{
pr_debug
(
PREFIX
"<--- data = 0x%2x
\n
"
,
data
);
pr_debug
(
PREFIX
"<--- data = 0x%2
.2
x
\n
"
,
data
);
outb
(
data
,
ec
->
data_addr
);
}
...
...
@@ -179,6 +180,10 @@ static inline int acpi_ec_check_status(struct acpi_ec *ec, enum ec_event event)
static
int
acpi_ec_wait
(
struct
acpi_ec
*
ec
,
enum
ec_event
event
,
int
force_poll
)
{
int
ret
=
0
;
if
(
unlikely
(
event
==
ACPI_EC_EVENT_OBF_1
&&
test_bit
(
EC_FLAGS_NO_OBF1_GPE
,
&
ec
->
flags
)))
force_poll
=
1
;
if
(
unlikely
(
test_bit
(
EC_FLAGS_ADDRESS
,
&
ec
->
flags
)
&&
test_bit
(
EC_FLAGS_NO_ADDRESS_GPE
,
&
ec
->
flags
)))
force_poll
=
1
;
...
...
@@ -192,7 +197,12 @@ static int acpi_ec_wait(struct acpi_ec *ec, enum ec_event event, int force_poll)
goto
end
;
clear_bit
(
EC_FLAGS_WAIT_GPE
,
&
ec
->
flags
);
if
(
acpi_ec_check_status
(
ec
,
event
))
{
if
(
test_bit
(
EC_FLAGS_ADDRESS
,
&
ec
->
flags
))
{
if
(
event
==
ACPI_EC_EVENT_OBF_1
)
{
/* miss OBF_1 GPE, don't expect it */
pr_info
(
PREFIX
"missing OBF confirmation, "
"don't expect it any longer.
\n
"
);
set_bit
(
EC_FLAGS_NO_OBF1_GPE
,
&
ec
->
flags
);
}
else
if
(
test_bit
(
EC_FLAGS_ADDRESS
,
&
ec
->
flags
))
{
/* miss address GPE, don't expect it anymore */
pr_info
(
PREFIX
"missing address confirmation, "
"don't expect it any longer.
\n
"
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录