mirror of
https://github.com/followmsi/android_kernel_google_msm.git
synced 2024-11-06 23:17:41 +00:00
HID: wiimote: fix nunchuck button parser
commit 89bdd0c6f3
upstream.
The buttons of the Wii Remote Nunchuck extension are actually active low.
Fix the parser to forward the inverted values. The comment in the function
always said "0 == pressed" but the implementation was wrong from the
beginning.
Reported-by: Victor Quicksilver <victor.quicksilver@gmail.com>
Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
6a924a7603
commit
a9115fba99
1 changed files with 4 additions and 4 deletions
|
@ -378,14 +378,14 @@ static void handler_nunchuck(struct wiimote_ext *ext, const __u8 *payload)
|
|||
|
||||
if (ext->motionp) {
|
||||
input_report_key(ext->input,
|
||||
wiiext_keymap[WIIEXT_KEY_Z], !!(payload[5] & 0x04));
|
||||
wiiext_keymap[WIIEXT_KEY_Z], !(payload[5] & 0x04));
|
||||
input_report_key(ext->input,
|
||||
wiiext_keymap[WIIEXT_KEY_C], !!(payload[5] & 0x08));
|
||||
wiiext_keymap[WIIEXT_KEY_C], !(payload[5] & 0x08));
|
||||
} else {
|
||||
input_report_key(ext->input,
|
||||
wiiext_keymap[WIIEXT_KEY_Z], !!(payload[5] & 0x01));
|
||||
wiiext_keymap[WIIEXT_KEY_Z], !(payload[5] & 0x01));
|
||||
input_report_key(ext->input,
|
||||
wiiext_keymap[WIIEXT_KEY_C], !!(payload[5] & 0x02));
|
||||
wiiext_keymap[WIIEXT_KEY_C], !(payload[5] & 0x02));
|
||||
}
|
||||
|
||||
input_sync(ext->input);
|
||||
|
|
Loading…
Reference in a new issue