Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
raspberrypi-kernel
提交
3f07d879
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看板
提交
3f07d879
编写于
5月 03, 2007
作者:
D
Dmitry Torokhov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Input: aaed2000_kbd - convert to use polldev library
Signed-off-by:
N
Dmitry Torokhov
<
dtor@mail.ru
>
上级
e37a97d4
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
21 addition
and
42 deletion
+21
-42
drivers/input/keyboard/Kconfig
drivers/input/keyboard/Kconfig
+1
-0
drivers/input/keyboard/aaed2000_kbd.c
drivers/input/keyboard/aaed2000_kbd.c
+20
-42
未找到文件。
drivers/input/keyboard/Kconfig
浏览文件 @
3f07d879
...
...
@@ -215,6 +215,7 @@ config KEYBOARD_PXA27x
config KEYBOARD_AAED2000
tristate "AAED-2000 keyboard"
depends on MACH_AAED2000
select INPUT_POLLDEV
default y
help
Say Y here to enable the keyboard on the Agilent AAED-2000
...
...
drivers/input/keyboard/aaed2000_kbd.c
浏览文件 @
3f07d879
...
...
@@ -14,12 +14,11 @@
#include <linux/delay.h>
#include <linux/platform_device.h>
#include <linux/init.h>
#include <linux/input.h>
#include <linux/input
-polldev
.h>
#include <linux/interrupt.h>
#include <linux/jiffies.h>
#include <linux/module.h>
#include <linux/slab.h>
#include <linux/workqueue.h>
#include <asm/arch/hardware.h>
#include <asm/arch/aaed2000.h>
...
...
@@ -46,8 +45,7 @@ static unsigned char aaedkbd_keycode[NR_SCANCODES] = {
struct
aaedkbd
{
unsigned
char
keycode
[
ARRAY_SIZE
(
aaedkbd_keycode
)];
struct
input_dev
*
input
;
struct
work_struct
workq
;
struct
input_polled_dev
*
poll_dev
;
int
kbdscan_state
[
KB_COLS
];
int
kbdscan_count
[
KB_COLS
];
};
...
...
@@ -64,14 +62,15 @@ static void aaedkbd_report_col(struct aaedkbd *aaedkbd,
scancode
=
SCANCODE
(
row
,
col
);
pressed
=
rowd
&
KB_ROWMASK
(
row
);
input_report_key
(
aaedkbd
->
input
,
aaedkbd
->
keycode
[
scancode
],
pressed
);
input_report_key
(
aaedkbd
->
poll_dev
->
input
,
aaedkbd
->
keycode
[
scancode
],
pressed
);
}
}
/* Scan the hardware keyboard and push any changes up through the input layer */
static
void
aaedkbd_
work
(
void
*
data
)
static
void
aaedkbd_
poll
(
struct
input_polled_dev
*
dev
)
{
struct
aaedkbd
*
aaedkbd
=
d
ata
;
struct
aaedkbd
*
aaedkbd
=
d
ev
->
private
;
unsigned
int
col
,
rowd
;
col
=
0
;
...
...
@@ -90,51 +89,34 @@ static void aaedkbd_work(void *data)
}
while
(
col
<
KB_COLS
);
AAEC_GPIO_KSCAN
=
0x07
;
input_sync
(
aaedkbd
->
input
);
schedule_delayed_work
(
&
aaedkbd
->
workq
,
msecs_to_jiffies
(
SCAN_INTERVAL
));
}
static
int
aaedkbd_open
(
struct
input_dev
*
indev
)
{
struct
aaedkbd
*
aaedkbd
=
input_get_drvdata
(
indev
);
schedule_delayed_work
(
&
aaedkbd
->
workq
,
msecs_to_jiffies
(
SCAN_INTERVAL
));
return
0
;
}
static
void
aaedkbd_close
(
struct
input_dev
*
indev
)
{
struct
aaedkbd
*
aaedkbd
=
input_get_drvdata
(
indev
);
cancel_delayed_work
(
&
aaedkbd
->
workq
);
flush_scheduled_work
();
input_sync
(
dev
->
input
);
}
static
int
__devinit
aaedkbd_probe
(
struct
platform_device
*
pdev
)
{
struct
aaedkbd
*
aaedkbd
;
struct
input_polled_dev
*
poll_dev
;
struct
input_dev
*
input_dev
;
int
i
;
int
error
;
aaedkbd
=
kzalloc
(
sizeof
(
struct
aaedkbd
),
GFP_KERNEL
);
input_dev
=
input_allocate
_device
();
if
(
!
aaedkbd
||
!
input
_dev
)
{
poll_dev
=
input_allocate_polled
_device
();
if
(
!
aaedkbd
||
!
poll
_dev
)
{
error
=
-
ENOMEM
;
goto
fail
;
}
platform_set_drvdata
(
pdev
,
aaedkbd
);
aaedkbd
->
input
=
input_dev
;
/* Init keyboard rescan workqueue */
INIT_WORK
(
&
aaedkbd
->
workq
,
aaedkbd_work
,
aaedkbd
);
aaedkbd
->
poll_dev
=
poll_dev
;
memcpy
(
aaedkbd
->
keycode
,
aaedkbd_keycode
,
sizeof
(
aaedkbd
->
keycode
));
poll_dev
->
private
=
aaedkbd
;
poll_dev
->
poll
=
aaedkbd_poll
;
poll_dev
->
poll_interval
=
SCAN_INTERVAL
;
input_dev
=
poll_dev
->
input
;
input_dev
->
name
=
"AAED-2000 Keyboard"
;
input_dev
->
phys
=
"aaedkbd/input0"
;
input_dev
->
id
.
bustype
=
BUS_HOST
;
...
...
@@ -143,8 +125,6 @@ static int __devinit aaedkbd_probe(struct platform_device *pdev)
input_dev
->
id
.
version
=
0x0100
;
input_dev
->
dev
.
parent
=
&
pdev
->
dev
;
input_set_drvdata
(
input_dev
,
aaedkbd
);
input_dev
->
evbit
[
0
]
=
BIT
(
EV_KEY
)
|
BIT
(
EV_REP
);
input_dev
->
keycode
=
aaedkbd
->
keycode
;
input_dev
->
keycodesize
=
sizeof
(
unsigned
char
);
...
...
@@ -154,17 +134,14 @@ static int __devinit aaedkbd_probe(struct platform_device *pdev)
set_bit
(
aaedkbd
->
keycode
[
i
],
input_dev
->
keybit
);
clear_bit
(
0
,
input_dev
->
keybit
);
input_dev
->
open
=
aaedkbd_open
;
input_dev
->
close
=
aaedkbd_close
;
error
=
input_register_device
(
aaedkbd
->
input
);
error
=
input_register_polled_device
(
aaedkbd
->
poll_dev
);
if
(
error
)
goto
fail
;
return
0
;
fail:
kfree
(
aaedkbd
);
input_free_
device
(
input
_dev
);
input_free_
polled_device
(
poll
_dev
);
return
error
;
}
...
...
@@ -172,7 +149,8 @@ static int __devexit aaedkbd_remove(struct platform_device *pdev)
{
struct
aaedkbd
*
aaedkbd
=
platform_get_drvdata
(
pdev
);
input_unregister_device
(
aaedkbd
->
input
);
input_unregister_polled_device
(
aaedkbd
->
poll_dev
);
input_free_polled_device
(
aaedkbd
->
poll_dev
);
kfree
(
aaedkbd
);
return
0
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录