diff mbox

[05/16] HID: wiimote: Reduce input syncs

Message ID 1311869316-17128-6-git-send-email-dh.herrmann@googlemail.com (mailing list archive)
State New, archived
Delegated to: Jiri Kosina
Headers show

Commit Message

David Herrmann July 28, 2011, 4:08 p.m. UTC
To avoid multiple input syncs to be sent when parsing multiple
peripheral inputs from the wiimote in future, we send the input-sync
after handling all input events and not after parsing each value. This avoids
waking up user-space handlers multiple times on a single incoming package.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
---
 drivers/hid/hid-wiimote.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff mbox

Patch

diff --git a/drivers/hid/hid-wiimote.c b/drivers/hid/hid-wiimote.c
index 859950e..bac4410 100644
--- a/drivers/hid/hid-wiimote.c
+++ b/drivers/hid/hid-wiimote.c
@@ -380,7 +380,6 @@  static void handler_keys(struct wiimote_data *wdata, const __u8 *payload)
 							!!(payload[1] & 0x10));
 	input_report_key(wdata->input, wiiproto_keymap[WIIPROTO_KEY_HOME],
 							!!(payload[1] & 0x80));
-	input_sync(wdata->input);
 }
 
 static void handler_status(struct wiimote_data *wdata, const __u8 *payload)
@@ -440,6 +439,7 @@  static int wiimote_hid_event(struct hid_device *hdev, struct hid_report *report,
 			h->func(wdata, &raw_data[1]);
 	}
 
+	input_sync(wdata->input);
 	spin_unlock_irqrestore(&wdata->state.lock, flags);
 
 	return 0;