Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
raspberrypi-kernel
提交
6358bf2c
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看板
提交
6358bf2c
编写于
1月 13, 2010
作者:
C
Corentin Chary
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
asus-laptop: stop using read_status and store_status for GPS
Signed-off-by:
N
Corentin Chary
<
corentincj@iksaif.net
>
上级
aa9df930
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
35 addition
and
21 deletion
+35
-21
drivers/platform/x86/asus-laptop.c
drivers/platform/x86/asus-laptop.c
+35
-21
未找到文件。
drivers/platform/x86/asus-laptop.c
浏览文件 @
6358bf2c
...
...
@@ -331,26 +331,9 @@ static int write_acpi_int(acpi_handle handle, const char *method, int val)
return
write_acpi_int_ret
(
handle
,
method
,
val
,
NULL
);
}
static
int
read_gps_status
(
struct
asus_laptop
*
asus
)
{
unsigned
long
long
status
;
acpi_status
rv
=
AE_OK
;
rv
=
acpi_evaluate_integer
(
gps_status_handle
,
NULL
,
NULL
,
&
status
);
if
(
ACPI_FAILURE
(
rv
))
pr_warning
(
"Error reading GPS status
\n
"
);
else
return
status
?
1
:
0
;
return
(
asus
->
status
&
GPS_ON
)
?
1
:
0
;
}
/* Generic LED functions */
static
int
read_status
(
struct
asus_laptop
*
asus
,
int
mask
)
{
if
(
mask
==
GPS_ON
)
return
read_gps_status
(
asus
);
return
(
asus
->
status
&
mask
)
?
1
:
0
;
}
...
...
@@ -979,21 +962,52 @@ static ssize_t store_lslvl(struct device *dev, struct device_attribute *attr,
/*
* GPS
* TODO: use rfkill
*/
static
int
asus_gps_status
(
struct
asus_laptop
*
asus
)
{
unsigned
long
long
status
;
acpi_status
rv
=
AE_OK
;
rv
=
acpi_evaluate_integer
(
gps_status_handle
,
NULL
,
NULL
,
&
status
);
if
(
ACPI_FAILURE
(
rv
))
{
pr_warning
(
"Error reading GPS status
\n
"
);
return
-
ENODEV
;
}
return
!!
status
;
}
static
int
asus_gps_switch
(
struct
asus_laptop
*
asus
,
int
status
)
{
acpi_handle
handle
=
status
?
gps_on_handle
:
gps_off_handle
;
if
(
write_acpi_int
(
handle
,
NULL
,
0x02
))
return
-
ENODEV
;
return
0
;
}
static
ssize_t
show_gps
(
struct
device
*
dev
,
struct
device_attribute
*
attr
,
char
*
buf
)
{
struct
asus_laptop
*
asus
=
dev_get_drvdata
(
dev
);
return
sprintf
(
buf
,
"%d
\n
"
,
read_status
(
asus
,
GPS_ON
));
return
sprintf
(
buf
,
"%d
\n
"
,
asus_gps_status
(
asus
));
}
static
ssize_t
store_gps
(
struct
device
*
dev
,
struct
device_attribute
*
attr
,
const
char
*
buf
,
size_t
count
)
{
struct
asus_laptop
*
asus
=
dev_get_drvdata
(
dev
);
struct
asus_laptop
*
asus
=
dev_get_drvdata
(
dev
);
int
rv
,
value
;
int
ret
;
return
store_status
(
asus
,
buf
,
count
,
NULL
,
GPS_ON
);
rv
=
parse_arg
(
buf
,
count
,
&
value
);
if
(
rv
<=
0
)
return
-
EINVAL
;
ret
=
asus_gps_switch
(
asus
,
!!
value
);
if
(
ret
)
return
ret
;
return
rv
;
}
/*
...
...
@@ -1451,7 +1465,7 @@ static int __devinit asus_acpi_init(struct asus_laptop *asus)
set_light_sens_level
(
asus
,
asus
->
light_level
);
/* GPS is on by default */
write_status
(
asus
,
NULL
,
1
,
GPS_ON
);
asus_gps_switch
(
asus
,
1
);
return
result
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录