summaryrefslogtreecommitdiff
path: root/drivers/media/rc/ir-raw.c
diff options
context:
space:
mode:
authorSean Young <sean@mess.org>2012-08-13 08:59:47 -0300
committerMauro Carvalho Chehab <mchehab@redhat.com>2012-08-13 16:19:12 -0300
commitb83bfd1b0127b0963fcac39280280e365e7e04d8 (patch)
tree3a7d76ffb8844af1ce9ffb5299d6f2726699c3e5 /drivers/media/rc/ir-raw.c
parent0938069fa08970f1c898970c1331a029efe9a1ce (diff)
downloadlwn-b83bfd1b0127b0963fcac39280280e365e7e04d8.tar.gz
lwn-b83bfd1b0127b0963fcac39280280e365e7e04d8.zip
[media] rc: do not wake up rc thread unless there is something to do
The TechnoTrend USB IR Receiver sends 125 ISO URBs per second, even when there is no IR activity. Reduce the number of wake ups from the other drivers too. This saves about 0.25ms/s on a 2.4GHz Core 2 according to powertop. Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/rc/ir-raw.c')
-rw-r--r--drivers/media/rc/ir-raw.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/media/rc/ir-raw.c b/drivers/media/rc/ir-raw.c
index a82025121345..97dc8d13b06b 100644
--- a/drivers/media/rc/ir-raw.c
+++ b/drivers/media/rc/ir-raw.c
@@ -157,7 +157,9 @@ EXPORT_SYMBOL_GPL(ir_raw_event_store_edge);
* This routine (which may be called from an interrupt context) works
* in similar manner to ir_raw_event_store_edge.
* This routine is intended for devices with limited internal buffer
- * It automerges samples of same type, and handles timeouts
+ * It automerges samples of same type, and handles timeouts. Returns non-zero
+ * if the event was added, and zero if the event was ignored due to idle
+ * processing.
*/
int ir_raw_event_store_with_filter(struct rc_dev *dev, struct ir_raw_event *ev)
{
@@ -184,7 +186,7 @@ int ir_raw_event_store_with_filter(struct rc_dev *dev, struct ir_raw_event *ev)
dev->raw->this_ev.duration >= dev->timeout)
ir_raw_event_set_idle(dev, true);
- return 0;
+ return 1;
}
EXPORT_SYMBOL_GPL(ir_raw_event_store_with_filter);