Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
linux-davinci
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
linux
linux-davinci
Commits
0a6b8a85
Commit
0a6b8a85
authored
Nov 12, 2008
by
Mauro Carvalho Chehab
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
V4L/DVB (9612): Fix key repetition with
HVR-950
IR
Signed-off-by:
Mauro Carvalho Chehab
<
mchehab@redhat.com
>
parent
91812fa7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
4 deletions
+17
-4
drivers/media/video/em28xx/em28xx-input.c
drivers/media/video/em28xx/em28xx-input.c
+17
-4
No files found.
drivers/media/video/em28xx/em28xx-input.c
View file @
0a6b8a85
...
@@ -67,6 +67,7 @@ struct em28xx_IR {
...
@@ -67,6 +67,7 @@ struct em28xx_IR {
u32
mask_keycode
;
u32
mask_keycode
;
u32
mask_keydown
;
u32
mask_keydown
;
u32
mask_keyup
;
u32
mask_keyup
;
u32
mask_repeat
;
int
(
*
get_key
)(
struct
em28xx_IR
*
);
int
(
*
get_key
)(
struct
em28xx_IR
*
);
};
};
...
@@ -165,15 +166,17 @@ static int default_polling_getkey(struct em28xx_IR *ir)
...
@@ -165,15 +166,17 @@ static int default_polling_getkey(struct em28xx_IR *ir)
{
{
struct
em28xx
*
dev
=
ir
->
dev
;
struct
em28xx
*
dev
=
ir
->
dev
;
int
rc
;
int
rc
;
u
32
msg
;
u
8
msg
[
4
]
=
{
0
,
0
,
0
,
0
}
;
/* Read key toggle, brand, and key code */
/* Read key toggle, brand, and key code
on registers 0x45, 0x46 and 0x47
*/
rc
=
dev
->
em28xx_read_reg_req_len
(
dev
,
0
,
EM28XX_R45_IR
,
rc
=
dev
->
em28xx_read_reg_req_len
(
dev
,
0
,
EM28XX_R45_IR
,
(
u8
*
)
&
msg
,
sizeof
(
msg
));
msg
,
sizeof
(
msg
));
if
(
rc
<
0
)
if
(
rc
<
0
)
return
rc
;
return
rc
;
return
(
int
)(
msg
&
0x7fffffffl
);
return
(
int
)(
le32_to_cpu
(
*
(
u32
*
)
msg
)
);
}
}
/**********************************************************
/**********************************************************
...
@@ -192,6 +195,7 @@ static void em28xx_ir_handle_key(struct em28xx_IR *ir)
...
@@ -192,6 +195,7 @@ static void em28xx_ir_handle_key(struct em28xx_IR *ir)
if
(
gpio
==
ir
->
last_gpio
)
if
(
gpio
==
ir
->
last_gpio
)
return
;
return
;
ir
->
last_gpio
=
gpio
;
ir
->
last_gpio
=
gpio
;
/* extract data */
/* extract data */
...
@@ -214,6 +218,14 @@ static void em28xx_ir_handle_key(struct em28xx_IR *ir)
...
@@ -214,6 +218,14 @@ static void em28xx_ir_handle_key(struct em28xx_IR *ir)
ir_input_keydown
(
ir
->
input
,
&
ir
->
ir
,
data
,
data
);
ir_input_keydown
(
ir
->
input
,
&
ir
->
ir
,
data
,
data
);
else
else
ir_input_nokey
(
ir
->
input
,
&
ir
->
ir
);
ir_input_nokey
(
ir
->
input
,
&
ir
->
ir
);
}
else
if
(
ir
->
mask_repeat
)
{
int
count
=
ir
->
mask_repeat
&
gpio
;
/* Avoid keyboard bouncing */
if
((
count
==
1
)
||
(
count
>=
5
))
{
ir_input_keydown
(
ir
->
input
,
&
ir
->
ir
,
data
,
data
);
ir_input_nokey
(
ir
->
input
,
&
ir
->
ir
);
}
}
else
{
}
else
{
/* can't distinguish keydown/up :-/ */
/* can't distinguish keydown/up :-/ */
ir_input_keydown
(
ir
->
input
,
&
ir
->
ir
,
data
,
data
);
ir_input_keydown
(
ir
->
input
,
&
ir
->
ir
,
data
,
data
);
...
@@ -274,6 +286,7 @@ int em28xx_ir_init(struct em28xx *dev)
...
@@ -274,6 +286,7 @@ int em28xx_ir_init(struct em28xx *dev)
ir_type
=
IR_TYPE_OTHER
;
ir_type
=
IR_TYPE_OTHER
;
ir_codes
=
ir_codes_hauppauge_new
;
ir_codes
=
ir_codes_hauppauge_new
;
ir
->
mask_keycode
=
0x007f0000
;
ir
->
mask_keycode
=
0x007f0000
;
ir
->
mask_repeat
=
0x0000007f
;
break
;
break
;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment