diff options
author | David Herrmann <[email protected]> | 2013-02-18 01:47:15 +0100 |
---|---|---|
committer | Jiri Kosina <[email protected]> | 2013-02-18 10:41:52 +0100 |
commit | 89bdd0c6f38ccf0de43d5a36ede384a730f3394e (patch) | |
tree | 09957ec9b910aecbfb0796b8bea2e3858d2991ea | |
parent | 30b6b7d8d340f41d11eb75e5238d33dbc438fde4 (diff) |
HID: wiimote: fix nunchuck button parser
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.
Cc: [email protected]
Reported-by: Victor Quicksilver <[email protected]>
Signed-off-by: David Herrmann <[email protected]>
Signed-off-by: Jiri Kosina <[email protected]>
-rw-r--r-- | drivers/hid/hid-wiimote-ext.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/hid/hid-wiimote-ext.c b/drivers/hid/hid-wiimote-ext.c index 38ae87772e96..0472191d4a72 100644 --- a/drivers/hid/hid-wiimote-ext.c +++ b/drivers/hid/hid-wiimote-ext.c @@ -403,14 +403,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); |