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
c6698697
Commit
c6698697
authored
Aug 04, 2006
by
Edwin Huffstutler
Committed by
Dmitry Torokhov
Aug 04, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Input: ati_remote - make filter time a module parameter
Signed-off-by:
Dmitry Torokhov
<
dtor@mail.ru
>
parent
3d0f0fa0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
14 deletions
+19
-14
drivers/usb/input/ati_remote.c
drivers/usb/input/ati_remote.c
+19
-14
No files found.
drivers/usb/input/ati_remote.c
View file @
c6698697
...
@@ -111,6 +111,16 @@
...
@@ -111,6 +111,16 @@
#define NAME_BUFSIZE 80
/* size of product name, path buffers */
#define NAME_BUFSIZE 80
/* size of product name, path buffers */
#define DATA_BUFSIZE 63
/* size of URB data buffers */
#define DATA_BUFSIZE 63
/* size of URB data buffers */
/*
* Duplicate event filtering time.
* Sequential, identical KIND_FILTERED inputs with less than
* FILTER_TIME milliseconds between them are considered as repeat
* events. The hardware generates 5 events for the first keypress
* and we have to take this into account for an accurate repeat
* behaviour.
*/
#define FILTER_TIME 60
/* msec */
static
unsigned
long
channel_mask
;
static
unsigned
long
channel_mask
;
module_param
(
channel_mask
,
ulong
,
0444
);
module_param
(
channel_mask
,
ulong
,
0444
);
MODULE_PARM_DESC
(
channel_mask
,
"Bitmask of remote control channels to ignore"
);
MODULE_PARM_DESC
(
channel_mask
,
"Bitmask of remote control channels to ignore"
);
...
@@ -119,6 +129,10 @@ static int debug;
...
@@ -119,6 +129,10 @@ static int debug;
module_param
(
debug
,
int
,
0444
);
module_param
(
debug
,
int
,
0444
);
MODULE_PARM_DESC
(
debug
,
"Enable extra debug messages and information"
);
MODULE_PARM_DESC
(
debug
,
"Enable extra debug messages and information"
);
static
int
repeat_filter
=
FILTER_TIME
;
module_param
(
repeat_filter
,
int
,
0644
);
MODULE_PARM_DESC
(
repeat_filter
,
"Repeat filter time, default = 60 msec"
);
#define dbginfo(dev, format, arg...) do { if (debug) dev_info(dev , format , ## arg); } while (0)
#define dbginfo(dev, format, arg...) do { if (debug) dev_info(dev , format , ## arg); } while (0)
#undef err
#undef err
#define err(format, arg...) printk(KERN_ERR format , ## arg)
#define err(format, arg...) printk(KERN_ERR format , ## arg)
...
@@ -146,15 +160,6 @@ static char init2[] = { 0x01, 0x00, 0x20, 0x14, 0x20, 0x20, 0x20 };
...
@@ -146,15 +160,6 @@ static char init2[] = { 0x01, 0x00, 0x20, 0x14, 0x20, 0x20, 0x20 };
/* Acceleration curve for directional control pad */
/* Acceleration curve for directional control pad */
static
const
char
accel
[]
=
{
1
,
2
,
4
,
6
,
9
,
13
,
20
};
static
const
char
accel
[]
=
{
1
,
2
,
4
,
6
,
9
,
13
,
20
};
/* Duplicate event filtering time.
* Sequential, identical KIND_FILTERED inputs with less than
* FILTER_TIME jiffies between them are considered as repeat
* events. The hardware generates 5 events for the first keypress
* and we have to take this into account for an accurate repeat
* behaviour.
*/
#define FILTER_TIME 60
/* msec */
struct
ati_remote
{
struct
ati_remote
{
struct
input_dev
*
idev
;
struct
input_dev
*
idev
;
struct
usb_device
*
udev
;
struct
usb_device
*
udev
;
...
@@ -464,9 +469,9 @@ static void ati_remote_input_report(struct urb *urb, struct pt_regs *regs)
...
@@ -464,9 +469,9 @@ static void ati_remote_input_report(struct urb *urb, struct pt_regs *regs)
if
(
ati_remote_tbl
[
index
].
kind
==
KIND_FILTERED
)
{
if
(
ati_remote_tbl
[
index
].
kind
==
KIND_FILTERED
)
{
/* Filter duplicate events which happen "too close" together. */
/* Filter duplicate events which happen "too close" together. */
if
(
(
ati_remote
->
old_data
[
0
]
==
data
[
1
])
&&
if
(
ati_remote
->
old_data
[
0
]
==
data
[
1
]
&&
(
ati_remote
->
old_data
[
1
]
==
data
[
2
])
&&
ati_remote
->
old_data
[
1
]
==
data
[
2
]
&&
time_before
(
jiffies
,
ati_remote
->
old_jiffies
+
msecs_to_jiffies
(
FILTER_TIME
)))
{
time_before
(
jiffies
,
ati_remote
->
old_jiffies
+
msecs_to_jiffies
(
repeat_filter
)))
{
ati_remote
->
repeat_count
++
;
ati_remote
->
repeat_count
++
;
}
else
{
}
else
{
ati_remote
->
repeat_count
=
0
;
ati_remote
->
repeat_count
=
0
;
...
@@ -476,8 +481,8 @@ static void ati_remote_input_report(struct urb *urb, struct pt_regs *regs)
...
@@ -476,8 +481,8 @@ static void ati_remote_input_report(struct urb *urb, struct pt_regs *regs)
ati_remote
->
old_data
[
1
]
=
data
[
2
];
ati_remote
->
old_data
[
1
]
=
data
[
2
];
ati_remote
->
old_jiffies
=
jiffies
;
ati_remote
->
old_jiffies
=
jiffies
;
if
(
(
ati_remote
->
repeat_count
>
0
)
if
(
ati_remote
->
repeat_count
>
0
&&
&&
(
ati_remote
->
repeat_count
<
5
)
)
ati_remote
->
repeat_count
<
5
)
return
;
return
;
...
...
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