Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Linux-御风守护者
linux
提交
f685648e
L
linux
项目概览
Linux-御风守护者
/
linux
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
L
linux
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
f685648e
编写于
5月 10, 2007
作者:
L
Len Brown
浏览文件
操作
浏览文件
下载
差异文件
Pull misc-for-upstream into release branch
上级
f1420515
00eb43a1
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
31 addition
and
23 deletion
+31
-23
drivers/acpi/ec.c
drivers/acpi/ec.c
+23
-16
drivers/misc/msi-laptop.c
drivers/misc/msi-laptop.c
+6
-6
include/linux/acpi.h
include/linux/acpi.h
+2
-1
未找到文件。
drivers/acpi/ec.c
浏览文件 @
f685648e
...
...
@@ -147,9 +147,10 @@ static inline int acpi_ec_check_status(struct acpi_ec *ec, enum ec_event event,
return
0
;
}
static
int
acpi_ec_wait
(
struct
acpi_ec
*
ec
,
enum
ec_event
event
,
unsigned
count
)
static
int
acpi_ec_wait
(
struct
acpi_ec
*
ec
,
enum
ec_event
event
,
unsigned
count
,
int
force_poll
)
{
if
(
acpi_ec_mode
==
EC_POLL
)
{
if
(
unlikely
(
force_poll
)
||
acpi_ec_mode
==
EC_POLL
)
{
unsigned
long
delay
=
jiffies
+
msecs_to_jiffies
(
ACPI_EC_DELAY
);
while
(
time_before
(
jiffies
,
delay
))
{
if
(
acpi_ec_check_status
(
ec
,
event
,
0
))
...
...
@@ -173,14 +174,15 @@ static int acpi_ec_wait(struct acpi_ec *ec, enum ec_event event, unsigned count)
static
int
acpi_ec_transaction_unlocked
(
struct
acpi_ec
*
ec
,
u8
command
,
const
u8
*
wdata
,
unsigned
wdata_len
,
u8
*
rdata
,
unsigned
rdata_len
)
u8
*
rdata
,
unsigned
rdata_len
,
int
force_poll
)
{
int
result
=
0
;
unsigned
count
=
atomic_read
(
&
ec
->
event_count
);
acpi_ec_write_cmd
(
ec
,
command
);
for
(;
wdata_len
>
0
;
--
wdata_len
)
{
result
=
acpi_ec_wait
(
ec
,
ACPI_EC_EVENT_IBF_0
,
count
);
result
=
acpi_ec_wait
(
ec
,
ACPI_EC_EVENT_IBF_0
,
count
,
force_poll
);
if
(
result
)
{
printk
(
KERN_ERR
PREFIX
"write_cmd timeout, command = %d
\n
"
,
command
);
...
...
@@ -191,7 +193,7 @@ static int acpi_ec_transaction_unlocked(struct acpi_ec *ec, u8 command,
}
if
(
!
rdata_len
)
{
result
=
acpi_ec_wait
(
ec
,
ACPI_EC_EVENT_IBF_0
,
count
);
result
=
acpi_ec_wait
(
ec
,
ACPI_EC_EVENT_IBF_0
,
count
,
force_poll
);
if
(
result
)
{
printk
(
KERN_ERR
PREFIX
"finish-write timeout, command = %d
\n
"
,
command
);
...
...
@@ -202,7 +204,7 @@ static int acpi_ec_transaction_unlocked(struct acpi_ec *ec, u8 command,
}
for
(;
rdata_len
>
0
;
--
rdata_len
)
{
result
=
acpi_ec_wait
(
ec
,
ACPI_EC_EVENT_OBF_1
,
count
);
result
=
acpi_ec_wait
(
ec
,
ACPI_EC_EVENT_OBF_1
,
count
,
force_poll
);
if
(
result
)
{
printk
(
KERN_ERR
PREFIX
"read timeout, command = %d
\n
"
,
command
);
...
...
@@ -217,7 +219,8 @@ static int acpi_ec_transaction_unlocked(struct acpi_ec *ec, u8 command,
static
int
acpi_ec_transaction
(
struct
acpi_ec
*
ec
,
u8
command
,
const
u8
*
wdata
,
unsigned
wdata_len
,
u8
*
rdata
,
unsigned
rdata_len
)
u8
*
rdata
,
unsigned
rdata_len
,
int
force_poll
)
{
int
status
;
u32
glk
;
...
...
@@ -240,7 +243,7 @@ static int acpi_ec_transaction(struct acpi_ec *ec, u8 command,
/* Make sure GPE is enabled before doing transaction */
acpi_enable_gpe
(
NULL
,
ec
->
gpe
,
ACPI_NOT_ISR
);
status
=
acpi_ec_wait
(
ec
,
ACPI_EC_EVENT_IBF_0
,
0
);
status
=
acpi_ec_wait
(
ec
,
ACPI_EC_EVENT_IBF_0
,
0
,
0
);
if
(
status
)
{
printk
(
KERN_DEBUG
PREFIX
"input buffer is not empty, aborting transaction
\n
"
);
...
...
@@ -249,7 +252,8 @@ static int acpi_ec_transaction(struct acpi_ec *ec, u8 command,
status
=
acpi_ec_transaction_unlocked
(
ec
,
command
,
wdata
,
wdata_len
,
rdata
,
rdata_len
);
rdata
,
rdata_len
,
force_poll
);
end:
...
...
@@ -267,12 +271,12 @@ static int acpi_ec_transaction(struct acpi_ec *ec, u8 command,
int
acpi_ec_burst_enable
(
struct
acpi_ec
*
ec
)
{
u8
d
;
return
acpi_ec_transaction
(
ec
,
ACPI_EC_BURST_ENABLE
,
NULL
,
0
,
&
d
,
1
);
return
acpi_ec_transaction
(
ec
,
ACPI_EC_BURST_ENABLE
,
NULL
,
0
,
&
d
,
1
,
0
);
}
int
acpi_ec_burst_disable
(
struct
acpi_ec
*
ec
)
{
return
acpi_ec_transaction
(
ec
,
ACPI_EC_BURST_DISABLE
,
NULL
,
0
,
NULL
,
0
);
return
acpi_ec_transaction
(
ec
,
ACPI_EC_BURST_DISABLE
,
NULL
,
0
,
NULL
,
0
,
0
);
}
static
int
acpi_ec_read
(
struct
acpi_ec
*
ec
,
u8
address
,
u8
*
data
)
...
...
@@ -281,7 +285,7 @@ static int acpi_ec_read(struct acpi_ec *ec, u8 address, u8 * data)
u8
d
;
result
=
acpi_ec_transaction
(
ec
,
ACPI_EC_COMMAND_READ
,
&
address
,
1
,
&
d
,
1
);
&
address
,
1
,
&
d
,
1
,
0
);
*
data
=
d
;
return
result
;
}
...
...
@@ -290,7 +294,7 @@ static int acpi_ec_write(struct acpi_ec *ec, u8 address, u8 data)
{
u8
wdata
[
2
]
=
{
address
,
data
};
return
acpi_ec_transaction
(
ec
,
ACPI_EC_COMMAND_WRITE
,
wdata
,
2
,
NULL
,
0
);
wdata
,
2
,
NULL
,
0
,
0
);
}
/*
...
...
@@ -349,13 +353,15 @@ EXPORT_SYMBOL(ec_write);
int
ec_transaction
(
u8
command
,
const
u8
*
wdata
,
unsigned
wdata_len
,
u8
*
rdata
,
unsigned
rdata_len
)
u8
*
rdata
,
unsigned
rdata_len
,
int
force_poll
)
{
if
(
!
first_ec
)
return
-
ENODEV
;
return
acpi_ec_transaction
(
first_ec
,
command
,
wdata
,
wdata_len
,
rdata
,
rdata_len
);
wdata_len
,
rdata
,
rdata_len
,
force_poll
);
}
EXPORT_SYMBOL
(
ec_transaction
);
...
...
@@ -374,7 +380,7 @@ static int acpi_ec_query(struct acpi_ec *ec, u8 * data)
* bit to be cleared (and thus clearing the interrupt source).
*/
result
=
acpi_ec_transaction
(
ec
,
ACPI_EC_COMMAND_QUERY
,
NULL
,
0
,
&
d
,
1
);
result
=
acpi_ec_transaction
(
ec
,
ACPI_EC_COMMAND_QUERY
,
NULL
,
0
,
&
d
,
1
,
0
);
if
(
result
)
return
result
;
...
...
@@ -410,6 +416,7 @@ static u32 acpi_ec_gpe_handler(void *data)
acpi_status
status
=
AE_OK
;
u8
value
;
struct
acpi_ec
*
ec
=
data
;
atomic_inc
(
&
ec
->
event_count
);
if
(
acpi_ec_mode
==
EC_INTR
)
{
...
...
drivers/misc/msi-laptop.c
浏览文件 @
f685648e
...
...
@@ -85,7 +85,7 @@ static int set_lcd_level(int level)
buf
[
0
]
=
0x80
;
buf
[
1
]
=
(
u8
)
(
level
*
31
);
return
ec_transaction
(
MSI_EC_COMMAND_LCD_LEVEL
,
buf
,
sizeof
(
buf
),
NULL
,
0
);
return
ec_transaction
(
MSI_EC_COMMAND_LCD_LEVEL
,
buf
,
sizeof
(
buf
),
NULL
,
0
,
1
);
}
static
int
get_lcd_level
(
void
)
...
...
@@ -93,7 +93,7 @@ static int get_lcd_level(void)
u8
wdata
=
0
,
rdata
;
int
result
;
result
=
ec_transaction
(
MSI_EC_COMMAND_LCD_LEVEL
,
&
wdata
,
1
,
&
rdata
,
1
);
result
=
ec_transaction
(
MSI_EC_COMMAND_LCD_LEVEL
,
&
wdata
,
1
,
&
rdata
,
1
,
1
);
if
(
result
<
0
)
return
result
;
...
...
@@ -105,7 +105,7 @@ static int get_auto_brightness(void)
u8
wdata
=
4
,
rdata
;
int
result
;
result
=
ec_transaction
(
MSI_EC_COMMAND_LCD_LEVEL
,
&
wdata
,
1
,
&
rdata
,
1
);
result
=
ec_transaction
(
MSI_EC_COMMAND_LCD_LEVEL
,
&
wdata
,
1
,
&
rdata
,
1
,
1
);
if
(
result
<
0
)
return
result
;
...
...
@@ -119,14 +119,14 @@ static int set_auto_brightness(int enable)
wdata
[
0
]
=
4
;
result
=
ec_transaction
(
MSI_EC_COMMAND_LCD_LEVEL
,
wdata
,
1
,
&
rdata
,
1
);
result
=
ec_transaction
(
MSI_EC_COMMAND_LCD_LEVEL
,
wdata
,
1
,
&
rdata
,
1
,
1
);
if
(
result
<
0
)
return
result
;
wdata
[
0
]
=
0x84
;
wdata
[
1
]
=
(
rdata
&
0xF7
)
|
(
enable
?
8
:
0
);
return
ec_transaction
(
MSI_EC_COMMAND_LCD_LEVEL
,
wdata
,
2
,
NULL
,
0
);
return
ec_transaction
(
MSI_EC_COMMAND_LCD_LEVEL
,
wdata
,
2
,
NULL
,
0
,
1
);
}
static
int
get_wireless_state
(
int
*
wlan
,
int
*
bluetooth
)
...
...
@@ -134,7 +134,7 @@ static int get_wireless_state(int *wlan, int *bluetooth)
u8
wdata
=
0
,
rdata
;
int
result
;
result
=
ec_transaction
(
MSI_EC_COMMAND_WIRELESS
,
&
wdata
,
1
,
&
rdata
,
1
);
result
=
ec_transaction
(
MSI_EC_COMMAND_WIRELESS
,
&
wdata
,
1
,
&
rdata
,
1
,
1
);
if
(
result
<
0
)
return
-
1
;
...
...
include/linux/acpi.h
浏览文件 @
f685648e
...
...
@@ -182,7 +182,8 @@ extern int ec_read(u8 addr, u8 *val);
extern
int
ec_write
(
u8
addr
,
u8
val
);
extern
int
ec_transaction
(
u8
command
,
const
u8
*
wdata
,
unsigned
wdata_len
,
u8
*
rdata
,
unsigned
rdata_len
);
u8
*
rdata
,
unsigned
rdata_len
,
int
force_poll
);
#endif
/*CONFIG_ACPI_EC*/
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录