Thread (26 messages) 26 messages, 3 authors, 2011-08-10
STALE5418d
Revisions (3)
  1. v1 current
  2. v1 [diff vs current]
  3. v2 [diff vs current]

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

From: David Herrmann <hidden>
Date: 2011-07-28 16:09:10
Subsystem: hid core layer, the rest, wiimote hid driver · Maintainers: Jiri Kosina, Benjamin Tissoires, Linus Torvalds, David Rheinsberg

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 <redacted>
---
 drivers/hid/hid-wiimote.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
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;
-- 
1.7.6
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help