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
Kirill Smelkov
linux
Commits
1429b47b
Commit
1429b47b
authored
Aug 20, 2018
by
Jiri Kosina
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'for-4.19/wiimote' into for-linus
Guitar-Hero devices support for hid-wiimote
parents
ffbeeaa4
d4bdf2d2
Changes
3
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
457 additions
and
0 deletions
+457
-0
drivers/hid/hid-wiimote-core.c
drivers/hid/hid-wiimote-core.c
+14
-0
drivers/hid/hid-wiimote-modules.c
drivers/hid/hid-wiimote-modules.c
+440
-0
drivers/hid/hid-wiimote.h
drivers/hid/hid-wiimote.h
+3
-0
No files found.
drivers/hid/hid-wiimote-core.c
View file @
1429b47b
...
...
@@ -455,6 +455,12 @@ static __u8 wiimote_cmd_read_ext(struct wiimote_data *wdata, __u8 *rmem)
return
WIIMOTE_EXT_BALANCE_BOARD
;
if
(
rmem
[
4
]
==
0x01
&&
rmem
[
5
]
==
0x20
)
return
WIIMOTE_EXT_PRO_CONTROLLER
;
if
(
rmem
[
0
]
==
0x01
&&
rmem
[
1
]
==
0x00
&&
rmem
[
4
]
==
0x01
&&
rmem
[
5
]
==
0x03
)
return
WIIMOTE_EXT_DRUMS
;
if
(
rmem
[
0
]
==
0x00
&&
rmem
[
1
]
==
0x00
&&
rmem
[
4
]
==
0x01
&&
rmem
[
5
]
==
0x03
)
return
WIIMOTE_EXT_GUITAR
;
return
WIIMOTE_EXT_UNKNOWN
;
}
...
...
@@ -488,6 +494,8 @@ static bool wiimote_cmd_map_mp(struct wiimote_data *wdata, __u8 exttype)
/* map MP with correct pass-through mode */
switch
(
exttype
)
{
case
WIIMOTE_EXT_CLASSIC_CONTROLLER
:
case
WIIMOTE_EXT_DRUMS
:
case
WIIMOTE_EXT_GUITAR
:
wmem
=
0x07
;
break
;
case
WIIMOTE_EXT_NUNCHUK
:
...
...
@@ -1075,6 +1083,8 @@ static const char *wiimote_exttype_names[WIIMOTE_EXT_NUM] = {
[
WIIMOTE_EXT_CLASSIC_CONTROLLER
]
=
"Nintendo Wii Classic Controller"
,
[
WIIMOTE_EXT_BALANCE_BOARD
]
=
"Nintendo Wii Balance Board"
,
[
WIIMOTE_EXT_PRO_CONTROLLER
]
=
"Nintendo Wii U Pro Controller"
,
[
WIIMOTE_EXT_DRUMS
]
=
"Nintendo Wii Drums"
,
[
WIIMOTE_EXT_GUITAR
]
=
"Nintendo Wii Guitar"
,
};
/*
...
...
@@ -1660,6 +1670,10 @@ static ssize_t wiimote_ext_show(struct device *dev,
return
sprintf
(
buf
,
"balanceboard
\n
"
);
case
WIIMOTE_EXT_PRO_CONTROLLER
:
return
sprintf
(
buf
,
"procontroller
\n
"
);
case
WIIMOTE_EXT_DRUMS
:
return
sprintf
(
buf
,
"drums
\n
"
);
case
WIIMOTE_EXT_GUITAR
:
return
sprintf
(
buf
,
"guitar
\n
"
);
case
WIIMOTE_EXT_UNKNOWN
:
/* fallthrough */
default:
...
...
drivers/hid/hid-wiimote-modules.c
View file @
1429b47b
This diff is collapsed.
Click to expand it.
drivers/hid/hid-wiimote.h
View file @
1429b47b
...
...
@@ -89,6 +89,8 @@ enum wiimote_exttype {
WIIMOTE_EXT_CLASSIC_CONTROLLER
,
WIIMOTE_EXT_BALANCE_BOARD
,
WIIMOTE_EXT_PRO_CONTROLLER
,
WIIMOTE_EXT_DRUMS
,
WIIMOTE_EXT_GUITAR
,
WIIMOTE_EXT_NUM
,
};
...
...
@@ -137,6 +139,7 @@ struct wiimote_state {
/* calibration/cache data */
__u16
calib_bboard
[
4
][
3
];
__s16
calib_pro_sticks
[
4
];
__u8
pressure_drums
[
7
];
__u8
cache_rumble
;
};
...
...
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