Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
72c16d9a
Commit
72c16d9a
authored
Apr 30, 2013
by
Jiri Kosina
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'for-3.10/mt-hybrid-finger-pen' into for-linus
Conflicts: drivers/hid/hid-multitouch.c
parents
4f5a8104
fb4d8d98
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
255 additions
and
60 deletions
+255
-60
drivers/hid/hid-input.c
drivers/hid/hid-input.c
+77
-0
drivers/hid/hid-multitouch.c
drivers/hid/hid-multitouch.c
+177
-60
include/linux/hid.h
include/linux/hid.h
+1
-0
No files found.
drivers/hid/hid-input.c
View file @
72c16d9a
...
...
@@ -1198,6 +1198,67 @@ static struct hid_input *hidinput_allocate(struct hid_device *hid)
return
hidinput
;
}
static
bool
hidinput_has_been_populated
(
struct
hid_input
*
hidinput
)
{
int
i
;
unsigned
long
r
=
0
;
for
(
i
=
0
;
i
<
BITS_TO_LONGS
(
EV_CNT
);
i
++
)
r
|=
hidinput
->
input
->
evbit
[
i
];
for
(
i
=
0
;
i
<
BITS_TO_LONGS
(
KEY_CNT
);
i
++
)
r
|=
hidinput
->
input
->
keybit
[
i
];
for
(
i
=
0
;
i
<
BITS_TO_LONGS
(
REL_CNT
);
i
++
)
r
|=
hidinput
->
input
->
relbit
[
i
];
for
(
i
=
0
;
i
<
BITS_TO_LONGS
(
ABS_CNT
);
i
++
)
r
|=
hidinput
->
input
->
absbit
[
i
];
for
(
i
=
0
;
i
<
BITS_TO_LONGS
(
MSC_CNT
);
i
++
)
r
|=
hidinput
->
input
->
mscbit
[
i
];
for
(
i
=
0
;
i
<
BITS_TO_LONGS
(
LED_CNT
);
i
++
)
r
|=
hidinput
->
input
->
ledbit
[
i
];
for
(
i
=
0
;
i
<
BITS_TO_LONGS
(
SND_CNT
);
i
++
)
r
|=
hidinput
->
input
->
sndbit
[
i
];
for
(
i
=
0
;
i
<
BITS_TO_LONGS
(
FF_CNT
);
i
++
)
r
|=
hidinput
->
input
->
ffbit
[
i
];
for
(
i
=
0
;
i
<
BITS_TO_LONGS
(
SW_CNT
);
i
++
)
r
|=
hidinput
->
input
->
swbit
[
i
];
return
!!
r
;
}
static
void
hidinput_cleanup_hidinput
(
struct
hid_device
*
hid
,
struct
hid_input
*
hidinput
)
{
struct
hid_report
*
report
;
int
i
,
k
;
list_del
(
&
hidinput
->
list
);
input_free_device
(
hidinput
->
input
);
for
(
k
=
HID_INPUT_REPORT
;
k
<=
HID_OUTPUT_REPORT
;
k
++
)
{
if
(
k
==
HID_OUTPUT_REPORT
&&
hid
->
quirks
&
HID_QUIRK_SKIP_OUTPUT_REPORTS
)
continue
;
list_for_each_entry
(
report
,
&
hid
->
report_enum
[
k
].
report_list
,
list
)
{
for
(
i
=
0
;
i
<
report
->
maxfield
;
i
++
)
if
(
report
->
field
[
i
]
->
hidinput
==
hidinput
)
report
->
field
[
i
]
->
hidinput
=
NULL
;
}
}
kfree
(
hidinput
);
}
/*
* Register the input device; print a message.
* Configure the input layer interface
...
...
@@ -1249,6 +1310,10 @@ int hidinput_connect(struct hid_device *hid, unsigned int force)
hidinput_configure_usage
(
hidinput
,
report
->
field
[
i
],
report
->
field
[
i
]
->
usage
+
j
);
if
((
hid
->
quirks
&
HID_QUIRK_NO_EMPTY_INPUT
)
&&
!
hidinput_has_been_populated
(
hidinput
))
continue
;
if
(
hid
->
quirks
&
HID_QUIRK_MULTI_INPUT
)
{
/* This will leave hidinput NULL, so that it
* allocates another one if we have more inputs on
...
...
@@ -1265,6 +1330,18 @@ int hidinput_connect(struct hid_device *hid, unsigned int force)
}
}
if
(
hidinput
&&
(
hid
->
quirks
&
HID_QUIRK_NO_EMPTY_INPUT
)
&&
!
hidinput_has_been_populated
(
hidinput
))
{
/* no need to register an input device not populated */
hidinput_cleanup_hidinput
(
hid
,
hidinput
);
hidinput
=
NULL
;
}
if
(
list_empty
(
&
hid
->
inputs
))
{
hid_err
(
hid
,
"No inputs registered, leaving
\n
"
);
goto
out_unwind
;
}
if
(
hidinput
)
{
if
(
drv
->
input_configured
)
drv
->
input_configured
(
hid
,
hidinput
);
...
...
drivers/hid/hid-multitouch.c
View file @
72c16d9a
This diff is collapsed.
Click to expand it.
include/linux/hid.h
View file @
72c16d9a
...
...
@@ -282,6 +282,7 @@ struct hid_item {
#define HID_QUIRK_BADPAD 0x00000020
#define HID_QUIRK_MULTI_INPUT 0x00000040
#define HID_QUIRK_HIDINPUT_FORCE 0x00000080
#define HID_QUIRK_NO_EMPTY_INPUT 0x00000100
#define HID_QUIRK_SKIP_OUTPUT_REPORTS 0x00010000
#define HID_QUIRK_FULLSPEED_INTERVAL 0x10000000
#define HID_QUIRK_NO_INIT_REPORTS 0x20000000
...
...
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