Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
kernel_linux
提交
aa9df930
K
kernel_linux
项目概览
OpenHarmony
/
kernel_linux
上一次同步 4 年多
通知
15
Star
8
Fork
2
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
K
kernel_linux
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
aa9df930
编写于
1月 13, 2010
作者:
C
Corentin Chary
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
asus-laptop: stop using read_status for bluetooth and wlan
Signed-off-by:
N
Corentin Chary
<
corentincj@iksaif.net
>
上级
be4ee82d
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
29 addition
and
26 deletion
+29
-26
drivers/platform/x86/asus-laptop.c
drivers/platform/x86/asus-laptop.c
+29
-26
未找到文件。
drivers/platform/x86/asus-laptop.c
浏览文件 @
aa9df930
...
@@ -239,6 +239,9 @@ struct asus_laptop {
...
@@ -239,6 +239,9 @@ struct asus_laptop {
struct
asus_laptop_leds
leds
;
struct
asus_laptop_leds
leds
;
int
wireless_status
;
bool
have_rsts
;
acpi_handle
handle
;
/* the handle of the hotk device */
acpi_handle
handle
;
/* the handle of the hotk device */
char
status
;
/* status of the hotk, for LEDs, ... */
char
status
;
/* status of the hotk, for LEDs, ... */
u32
ledd_status
;
/* status of the LED display */
u32
ledd_status
;
/* status of the LED display */
...
@@ -328,23 +331,6 @@ static int write_acpi_int(acpi_handle handle, const char *method, int val)
...
@@ -328,23 +331,6 @@ static int write_acpi_int(acpi_handle handle, const char *method, int val)
return
write_acpi_int_ret
(
handle
,
method
,
val
,
NULL
);
return
write_acpi_int_ret
(
handle
,
method
,
val
,
NULL
);
}
}
static
int
read_wireless_status
(
struct
asus_laptop
*
asus
,
int
mask
)
{
unsigned
long
long
status
;
acpi_status
rv
=
AE_OK
;
if
(
!
wireless_status_handle
)
return
(
asus
->
status
&
mask
)
?
1
:
0
;
rv
=
acpi_evaluate_integer
(
wireless_status_handle
,
NULL
,
NULL
,
&
status
);
if
(
ACPI_FAILURE
(
rv
))
pr_warning
(
"Error reading Wireless status
\n
"
);
else
return
(
status
&
mask
)
?
1
:
0
;
return
(
asus
->
status
&
mask
)
?
1
:
0
;
}
static
int
read_gps_status
(
struct
asus_laptop
*
asus
)
static
int
read_gps_status
(
struct
asus_laptop
*
asus
)
{
{
unsigned
long
long
status
;
unsigned
long
long
status
;
...
@@ -362,10 +348,7 @@ static int read_gps_status(struct asus_laptop *asus)
...
@@ -362,10 +348,7 @@ static int read_gps_status(struct asus_laptop *asus)
/* Generic LED functions */
/* Generic LED functions */
static
int
read_status
(
struct
asus_laptop
*
asus
,
int
mask
)
static
int
read_status
(
struct
asus_laptop
*
asus
,
int
mask
)
{
{
/* There is a special method for both wireless devices */
if
(
mask
==
GPS_ON
)
if
(
mask
==
BT_ON
||
mask
==
WL_ON
)
return
read_wireless_status
(
asus
,
mask
);
else
if
(
mask
==
GPS_ON
)
return
read_gps_status
(
asus
);
return
read_gps_status
(
asus
);
return
(
asus
->
status
&
mask
)
?
1
:
0
;
return
(
asus
->
status
&
mask
)
?
1
:
0
;
...
@@ -811,6 +794,25 @@ static ssize_t store_ledd(struct device *dev, struct device_attribute *attr,
...
@@ -811,6 +794,25 @@ static ssize_t store_ledd(struct device *dev, struct device_attribute *attr,
return
rv
;
return
rv
;
}
}
/*
* Wireless
*/
static
int
asus_wireless_status
(
struct
asus_laptop
*
asus
,
int
mask
)
{
unsigned
long
long
status
;
acpi_status
rv
=
AE_OK
;
if
(
!
asus
->
have_rsts
)
return
(
asus
->
wireless_status
&
mask
)
?
1
:
0
;
rv
=
acpi_evaluate_integer
(
wireless_status_handle
,
NULL
,
NULL
,
&
status
);
if
(
ACPI_FAILURE
(
rv
))
{
pr_warning
(
"Error reading Wireless status
\n
"
);
return
-
EINVAL
;
}
return
!!
(
status
&
mask
);
}
/*
/*
* WLAN
* WLAN
*/
*/
...
@@ -819,7 +821,7 @@ static ssize_t show_wlan(struct device *dev,
...
@@ -819,7 +821,7 @@ static ssize_t show_wlan(struct device *dev,
{
{
struct
asus_laptop
*
asus
=
dev_get_drvdata
(
dev
);
struct
asus_laptop
*
asus
=
dev_get_drvdata
(
dev
);
return
sprintf
(
buf
,
"%d
\n
"
,
read
_status
(
asus
,
WL_ON
));
return
sprintf
(
buf
,
"%d
\n
"
,
asus_wireless
_status
(
asus
,
WL_ON
));
}
}
static
ssize_t
store_wlan
(
struct
device
*
dev
,
struct
device_attribute
*
attr
,
static
ssize_t
store_wlan
(
struct
device
*
dev
,
struct
device_attribute
*
attr
,
...
@@ -838,7 +840,7 @@ static ssize_t show_bluetooth(struct device *dev,
...
@@ -838,7 +840,7 @@ static ssize_t show_bluetooth(struct device *dev,
{
{
struct
asus_laptop
*
asus
=
dev_get_drvdata
(
dev
);
struct
asus_laptop
*
asus
=
dev_get_drvdata
(
dev
);
return
sprintf
(
buf
,
"%d
\n
"
,
read
_status
(
asus
,
BT_ON
));
return
sprintf
(
buf
,
"%d
\n
"
,
asus_wireless
_status
(
asus
,
BT_ON
));
}
}
static
ssize_t
store_bluetooth
(
struct
device
*
dev
,
static
ssize_t
store_bluetooth
(
struct
device
*
dev
,
...
@@ -1371,7 +1373,8 @@ static int asus_laptop_get_info(struct asus_laptop *asus)
...
@@ -1371,7 +1373,8 @@ static int asus_laptop_get_info(struct asus_laptop *asus)
if
(
hwrs_result
&
BT_HWRS
)
if
(
hwrs_result
&
BT_HWRS
)
ASUS_HANDLE_INIT
(
bt_switch
);
ASUS_HANDLE_INIT
(
bt_switch
);
ASUS_HANDLE_INIT
(
wireless_status
);
if
(
!
ASUS_HANDLE_INIT
(
wireless_status
))
asus
->
have_rsts
=
true
;
ASUS_HANDLE_INIT
(
brightness_set
);
ASUS_HANDLE_INIT
(
brightness_set
);
ASUS_HANDLE_INIT
(
brightness_get
);
ASUS_HANDLE_INIT
(
brightness_get
);
...
@@ -1424,8 +1427,8 @@ static int __devinit asus_acpi_init(struct asus_laptop *asus)
...
@@ -1424,8 +1427,8 @@ static int __devinit asus_acpi_init(struct asus_laptop *asus)
write_status
(
asus
,
wl_switch_handle
,
!!
wireless_status
,
WL_ON
);
write_status
(
asus
,
wl_switch_handle
,
!!
wireless_status
,
WL_ON
);
/* If the h/w switch is off, we need to check the real status */
/* If the h/w switch is off, we need to check the real status */
write_status
(
asus
,
NULL
,
read
_status
(
asus
,
BT_ON
),
BT_ON
);
write_status
(
asus
,
NULL
,
asus_wireless
_status
(
asus
,
BT_ON
),
BT_ON
);
write_status
(
asus
,
NULL
,
read
_status
(
asus
,
WL_ON
),
WL_ON
);
write_status
(
asus
,
NULL
,
asus_wireless
_status
(
asus
,
WL_ON
),
WL_ON
);
/* LCD Backlight is on by default */
/* LCD Backlight is on by default */
write_status
(
asus
,
NULL
,
1
,
LCD_ON
);
write_status
(
asus
,
NULL
,
1
,
LCD_ON
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录