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
3390e579
Commit
3390e579
authored
May 17, 2016
by
Jiri Kosina
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'for-4.7/upstream' into for-linus
Conflicts: drivers/hid/usbhid/hid-quirks.c
parents
27fd38c5
282bf1fe
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
31 additions
and
24 deletions
+31
-24
drivers/hid/hid-core.c
drivers/hid/hid-core.c
+15
-18
drivers/hid/hid-ids.h
drivers/hid/hid-ids.h
+7
-0
drivers/hid/hid-roccat.c
drivers/hid/hid-roccat.c
+2
-3
drivers/hid/hidraw.c
drivers/hid/hidraw.c
+2
-3
drivers/hid/usbhid/hid-quirks.c
drivers/hid/usbhid/hid-quirks.c
+5
-0
No files found.
drivers/hid/hid-core.c
View file @
3390e579
...
...
@@ -1129,49 +1129,46 @@ EXPORT_SYMBOL_GPL(hid_field_extract);
static
void
__implement
(
u8
*
report
,
unsigned
offset
,
int
n
,
u32
value
)
{
unsigned
int
idx
=
offset
/
8
;
unsigned
int
size
=
offset
+
n
;
unsigned
int
bit_shift
=
offset
%
8
;
int
bits_to_set
=
8
-
bit_shift
;
u8
bit_mask
=
0xff
<<
bit_shift
;
while
(
n
-
bits_to_set
>=
0
)
{
report
[
idx
]
&=
~
bit_mask
;
report
[
idx
]
&=
~
(
0xff
<<
bit_shift
)
;
report
[
idx
]
|=
value
<<
bit_shift
;
value
>>=
bits_to_set
;
n
-=
bits_to_set
;
bits_to_set
=
8
;
bit_mask
=
0xff
;
bit_shift
=
0
;
idx
++
;
}
/* last nibble */
if
(
n
)
{
if
(
size
%
8
)
bit_mask
&=
(
1U
<<
(
size
%
8
))
-
1
;
report
[
idx
]
&=
~
bit_mask
;
report
[
idx
]
|=
(
value
<<
bit_shift
)
&
bit_mask
;
u8
bit_mask
=
((
1U
<<
n
)
-
1
);
report
[
idx
]
&=
~
(
bit_mask
<<
bit_shift
);
report
[
idx
]
|=
value
<<
bit_shift
;
}
}
static
void
implement
(
const
struct
hid_device
*
hid
,
u8
*
report
,
unsigned
offset
,
unsigned
n
,
u32
value
)
{
u64
m
;
if
(
n
>
32
)
{
if
(
unlikely
(
n
>
32
))
{
hid_warn
(
hid
,
"%s() called with n (%d) > 32! (%s)
\n
"
,
__func__
,
n
,
current
->
comm
);
n
=
32
;
}
else
if
(
n
<
32
)
{
u32
m
=
(
1U
<<
n
)
-
1
;
if
(
unlikely
(
value
>
m
))
{
hid_warn
(
hid
,
"%s() called with too large value %d (n: %d)! (%s)
\n
"
,
__func__
,
value
,
n
,
current
->
comm
);
WARN_ON
(
1
);
value
&=
m
;
}
}
m
=
(
1ULL
<<
n
)
-
1
;
if
(
value
>
m
)
hid_warn
(
hid
,
"%s() called with too large value %d! (%s)
\n
"
,
__func__
,
value
,
current
->
comm
);
WARN_ON
(
value
>
m
);
value
&=
m
;
__implement
(
report
,
offset
,
n
,
value
);
}
...
...
drivers/hid/hid-ids.h
View file @
3390e579
...
...
@@ -259,6 +259,13 @@
#define USB_VENDOR_ID_CORSAIR 0x1b1c
#define USB_DEVICE_ID_CORSAIR_K90 0x1b02
#define USB_VENDOR_ID_CORSAIR 0x1b1c
#define USB_DEVICE_ID_CORSAIR_K70R 0x1b09
#define USB_DEVICE_ID_CORSAIR_K95RGB 0x1b11
#define USB_DEVICE_ID_CORSAIR_M65RGB 0x1b12
#define USB_DEVICE_ID_CORSAIR_K70RGB 0x1b13
#define USB_DEVICE_ID_CORSAIR_K65RGB 0x1b17
#define USB_VENDOR_ID_CREATIVELABS 0x041e
#define USB_DEVICE_ID_CREATIVE_SB_OMNI_SURROUND_51 0x322c
#define USB_DEVICE_ID_PRODIKEYS_PCMIDI 0x2801
...
...
drivers/hid/hid-roccat.c
View file @
3390e579
...
...
@@ -421,14 +421,13 @@ static int __init roccat_init(void)
retval
=
alloc_chrdev_region
(
&
dev_id
,
ROCCAT_FIRST_MINOR
,
ROCCAT_MAX_DEVICES
,
"roccat"
);
roccat_major
=
MAJOR
(
dev_id
);
if
(
retval
<
0
)
{
pr_warn
(
"can't get major number
\n
"
);
goto
error
;
}
roccat_major
=
MAJOR
(
dev_id
);
cdev_init
(
&
roccat_cdev
,
&
roccat_ops
);
retval
=
cdev_add
(
&
roccat_cdev
,
dev_id
,
ROCCAT_MAX_DEVICES
);
...
...
drivers/hid/hidraw.c
View file @
3390e579
...
...
@@ -582,14 +582,13 @@ int __init hidraw_init(void)
result
=
alloc_chrdev_region
(
&
dev_id
,
HIDRAW_FIRST_MINOR
,
HIDRAW_MAX_DEVICES
,
"hidraw"
);
hidraw_major
=
MAJOR
(
dev_id
);
if
(
result
<
0
)
{
pr_warn
(
"can't get major number
\n
"
);
goto
out
;
}
hidraw_major
=
MAJOR
(
dev_id
);
hidraw_class
=
class_create
(
THIS_MODULE
,
"hidraw"
);
if
(
IS_ERR
(
hidraw_class
))
{
result
=
PTR_ERR
(
hidraw_class
);
...
...
drivers/hid/usbhid/hid-quirks.c
View file @
3390e579
...
...
@@ -71,6 +71,11 @@ static const struct hid_blacklist {
{
USB_VENDOR_ID_CH
,
USB_DEVICE_ID_CH_3AXIS_5BUTTON_STICK
,
HID_QUIRK_NOGET
},
{
USB_VENDOR_ID_CH
,
USB_DEVICE_ID_CH_AXIS_295
,
HID_QUIRK_NOGET
},
{
USB_VENDOR_ID_CHICONY
,
USB_DEVICE_ID_CHICONY_PIXART_USB_OPTICAL_MOUSE
,
HID_QUIRK_ALWAYS_POLL
},
{
USB_VENDOR_ID_CORSAIR
,
USB_DEVICE_ID_CORSAIR_K70R
,
HID_QUIRK_NO_INIT_REPORTS
},
{
USB_VENDOR_ID_CORSAIR
,
USB_DEVICE_ID_CORSAIR_M65RGB
,
HID_QUIRK_NO_INIT_REPORTS
},
{
USB_VENDOR_ID_CORSAIR
,
USB_DEVICE_ID_CORSAIR_K95RGB
,
HID_QUIRK_NO_INIT_REPORTS
|
HID_QUIRK_ALWAYS_POLL
},
{
USB_VENDOR_ID_CORSAIR
,
USB_DEVICE_ID_CORSAIR_K70RGB
,
HID_QUIRK_NO_INIT_REPORTS
},
{
USB_VENDOR_ID_CORSAIR
,
USB_DEVICE_ID_CORSAIR_K65RGB
,
HID_QUIRK_NO_INIT_REPORTS
},
{
USB_VENDOR_ID_CREATIVELABS
,
USB_DEVICE_ID_CREATIVE_SB_OMNI_SURROUND_51
,
HID_QUIRK_NOGET
},
{
USB_VENDOR_ID_DMI
,
USB_DEVICE_ID_DMI_ENC
,
HID_QUIRK_NOGET
},
{
USB_VENDOR_ID_DRAGONRISE
,
USB_DEVICE_ID_DRAGONRISE_WIIU
,
HID_QUIRK_MULTI_INPUT
},
...
...
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