Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
Kernel
提交
78a5331d
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看板
提交
78a5331d
编写于
12月 24, 2009
作者:
L
Len Brown
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'tc1100-wmi' into release
上级
fe7fa9c5
8e698a3c
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
55 addition
and
60 deletion
+55
-60
drivers/platform/x86/tc1100-wmi.c
drivers/platform/x86/tc1100-wmi.c
+55
-60
未找到文件。
drivers/platform/x86/tc1100-wmi.c
浏览文件 @
78a5331d
...
...
@@ -47,22 +47,6 @@ MODULE_DESCRIPTION("HP Compaq TC1100 Tablet WMI Extras");
MODULE_LICENSE
(
"GPL"
);
MODULE_ALIAS
(
"wmi:C364AC71-36DB-495A-8494-B439D472A505"
);
static
int
tc1100_probe
(
struct
platform_device
*
device
);
static
int
tc1100_remove
(
struct
platform_device
*
device
);
static
int
tc1100_suspend
(
struct
platform_device
*
device
,
pm_message_t
state
);
static
int
tc1100_resume
(
struct
platform_device
*
device
);
static
struct
platform_driver
tc1100_driver
=
{
.
driver
=
{
.
name
=
"tc1100-wmi"
,
.
owner
=
THIS_MODULE
,
},
.
probe
=
tc1100_probe
,
.
remove
=
tc1100_remove
,
.
suspend
=
tc1100_suspend
,
.
resume
=
tc1100_resume
,
};
static
struct
platform_device
*
tc1100_device
;
struct
tc1100_data
{
...
...
@@ -183,51 +167,35 @@ static DEVICE_ATTR(value, S_IWUGO | S_IRUGO | S_IWUSR, \
show_set_bool
(
wireless
,
TC1100_INSTANCE_WIRELESS
);
show_set_bool
(
jogdial
,
TC1100_INSTANCE_JOGDIAL
);
static
void
remove_fs
(
void
)
{
device_remove_file
(
&
tc1100_device
->
dev
,
&
dev_attr_wireless
);
device_remove_file
(
&
tc1100_device
->
dev
,
&
dev_attr_jogdial
);
}
static
int
add_fs
(
void
)
{
int
ret
;
ret
=
device_create_file
(
&
tc1100_device
->
dev
,
&
dev_attr_wireless
);
if
(
ret
)
goto
add_sysfs_error
;
ret
=
device_create_file
(
&
tc1100_device
->
dev
,
&
dev_attr_jogdial
);
if
(
ret
)
goto
add_sysfs_error
;
return
ret
;
static
struct
attribute
*
tc1100_attributes
[]
=
{
&
dev_attr_wireless
.
attr
,
&
dev_attr_jogdial
.
attr
,
NULL
};
add_sysfs_error:
remove_fs
();
return
ret
;
}
static
struct
attribute_group
tc1100_attribute_group
=
{
.
attrs
=
tc1100_attributes
,
};
/* --------------------------------------------------------------------------
Driver Model
-------------------------------------------------------------------------- */
static
int
tc1100_probe
(
struct
platform_device
*
device
)
static
int
__init
tc1100_probe
(
struct
platform_device
*
device
)
{
int
result
=
0
;
result
=
add_fs
();
return
result
;
return
sysfs_create_group
(
&
device
->
dev
.
kobj
,
&
tc1100_attribute_group
);
}
static
int
tc1100_remove
(
struct
platform_device
*
device
)
static
int
__devexit
tc1100_remove
(
struct
platform_device
*
device
)
{
remove_fs
();
sysfs_remove_group
(
&
device
->
dev
.
kobj
,
&
tc1100_attribute_group
);
return
0
;
}
static
int
tc1100_suspend
(
struct
platform_device
*
dev
,
pm_message_t
state
)
#ifdef CONFIG_PM
static
int
tc1100_suspend
(
struct
device
*
dev
)
{
int
ret
;
...
...
@@ -239,10 +207,10 @@ static int tc1100_suspend(struct platform_device *dev, pm_message_t state)
if
(
ret
)
return
ret
;
return
ret
;
return
0
;
}
static
int
tc1100_resume
(
struct
platform_
device
*
dev
)
static
int
tc1100_resume
(
struct
device
*
dev
)
{
int
ret
;
...
...
@@ -254,34 +222,61 @@ static int tc1100_resume(struct platform_device *dev)
if
(
ret
)
return
ret
;
return
ret
;
return
0
;
}
static
const
struct
dev_pm_ops
tc1100_pm_ops
=
{
.
suspend
=
tc1100_suspend
,
.
resume
=
tc1100_resume
,
.
freeze
=
tc1100_suspend
,
.
restore
=
tc1100_resume
,
};
#endif
static
struct
platform_driver
tc1100_driver
=
{
.
driver
=
{
.
name
=
"tc1100-wmi"
,
.
owner
=
THIS_MODULE
,
#ifdef CONFIG_PM
.
pm
=
&
tc1100_pm_ops
,
#endif
},
.
remove
=
__devexit_p
(
tc1100_remove
),
};
static
int
__init
tc1100_init
(
void
)
{
int
result
=
0
;
int
error
;
if
(
!
wmi_has_guid
(
GUID
))
return
-
ENODEV
;
result
=
platform_driver_register
(
&
tc1100_driver
);
if
(
result
)
return
result
;
tc1100_device
=
platform_device_alloc
(
"tc1100-wmi"
,
-
1
);
platform_device_add
(
tc1100_device
);
if
(
!
tc1100_device
)
return
-
ENOMEM
;
error
=
platform_device_add
(
tc1100_device
);
if
(
error
)
goto
err_device_put
;
error
=
platform_driver_probe
(
&
tc1100_driver
,
tc1100_probe
);
if
(
error
)
goto
err_device_del
;
printk
(
TC1100_INFO
"HP Compaq TC1100 Tablet WMI Extras loaded
\n
"
);
return
0
;
return
result
;
err_device_del:
platform_device_del
(
tc1100_device
);
err_device_put:
platform_device_put
(
tc1100_device
);
return
error
;
}
static
void
__exit
tc1100_exit
(
void
)
{
platform_device_
del
(
tc1100_device
);
platform_device_
unregister
(
tc1100_device
);
platform_driver_unregister
(
&
tc1100_driver
);
printk
(
TC1100_INFO
"HP Compaq TC1100 Tablet WMI Extras unloaded
\n
"
);
}
module_init
(
tc1100_init
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录