Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
6660de56
cloud-kernel
项目概览
openanolis
/
cloud-kernel
1 年多 前同步成功
通知
160
Star
36
Fork
7
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
10
列表
看板
标记
里程碑
合并请求
2
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
cloud-kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
10
Issue
10
列表
看板
标记
里程碑
合并请求
2
合并请求
2
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
6660de56
编写于
3月 21, 2010
作者:
M
Mauro Carvalho Chehab
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
V4L/DVB: ir-core: add two functions to report keyup/keydown events
Signed-off-by:
N
Mauro Carvalho Chehab
<
mchehab@redhat.com
>
上级
a3572c34
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
60 addition
and
1 deletion
+60
-1
drivers/media/IR/ir-keytable.c
drivers/media/IR/ir-keytable.c
+56
-1
include/media/ir-core.h
include/media/ir-core.h
+4
-0
未找到文件。
drivers/media/IR/ir-keytable.c
浏览文件 @
6660de56
...
...
@@ -365,7 +365,7 @@ static int ir_setkeycode(struct input_dev *dev,
*
* This routine is used by the input routines when a key is pressed at the
* IR. The scancode is received and needs to be converted into a keycode.
* If the key is not found, it returns KEY_
UNKNOWN
. Otherwise, returns the
* If the key is not found, it returns KEY_
RESERVED
. Otherwise, returns the
* corresponding keycode from the table.
*/
u32
ir_g_keycode_from_table
(
struct
input_dev
*
dev
,
u32
scancode
)
...
...
@@ -391,6 +391,61 @@ u32 ir_g_keycode_from_table(struct input_dev *dev, u32 scancode)
}
EXPORT_SYMBOL_GPL
(
ir_g_keycode_from_table
);
/**
* ir_keyup() - generates input event to cleanup a key press
* @input_dev: the struct input_dev descriptor of the device
*
* This routine is used by the input routines when a key is pressed at the
* IR. It reports a keyup input event via input_report_key().
*/
void
ir_keyup
(
struct
input_dev
*
dev
)
{
struct
ir_input_dev
*
ir
=
input_get_drvdata
(
dev
);
if
(
!
ir
->
keypressed
)
return
;
input_report_key
(
dev
,
ir
->
keycode
,
0
);
input_sync
(
dev
);
ir
->
keypressed
=
0
;
}
EXPORT_SYMBOL_GPL
(
ir_keyup
);
/**
* ir_keydown() - generates input event for a key press
* @input_dev: the struct input_dev descriptor of the device
* @scancode: the scancode that we're seeking
*
* This routine is used by the input routines when a key is pressed at the
* IR. It gets the keycode for a scancode and reports an input event via
* input_report_key().
*/
void
ir_keydown
(
struct
input_dev
*
dev
,
int
scancode
)
{
struct
ir_input_dev
*
ir
=
input_get_drvdata
(
dev
);
u32
keycode
=
ir_g_keycode_from_table
(
dev
,
scancode
);
/* If already sent a keydown, do a keyup */
if
(
ir
->
keypressed
)
ir_keyup
(
dev
);
if
(
KEY_RESERVED
==
keycode
)
return
;
ir
->
keycode
=
keycode
;
ir
->
keypressed
=
1
;
IR_dprintk
(
1
,
"%s: key down event, key 0x%04x, scancode 0x%04x
\n
"
,
dev
->
name
,
keycode
,
scancode
);
input_report_key
(
dev
,
ir
->
keycode
,
1
);
input_sync
(
dev
);
}
EXPORT_SYMBOL_GPL
(
ir_keydown
);
/**
* ir_input_register() - sets the IR keycode table and add the handlers
* for keymap table get/set
...
...
include/media/ir-core.h
浏览文件 @
6660de56
...
...
@@ -72,6 +72,10 @@ struct ir_input_dev {
unsigned
long
devno
;
/* device number */
const
struct
ir_dev_props
*
props
;
/* Device properties */
struct
ir_raw_event_ctrl
*
raw
;
/* for raw pulse/space events */
/* key info - needed by IR keycode handlers */
u32
keycode
;
/* linux key code */
int
keypressed
;
/* current state */
};
#define to_ir_input_dev(_attr) container_of(_attr, struct ir_input_dev, attr)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录