diff options
author | Sean Young <sean@mess.org> | 2012-08-13 08:59:47 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2012-08-13 16:19:12 -0300 |
commit | b83bfd1b0127b0963fcac39280280e365e7e04d8 (patch) | |
tree | 3a7d76ffb8844af1ce9ffb5299d6f2726699c3e5 /drivers/media/rc/mceusb.c | |
parent | 0938069fa08970f1c898970c1331a029efe9a1ce (diff) |
[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/mceusb.c')
-rw-r--r-- | drivers/media/rc/mceusb.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/media/rc/mceusb.c b/drivers/media/rc/mceusb.c index f38d9a8c6880..d289fd42729f 100644 --- a/drivers/media/rc/mceusb.c +++ b/drivers/media/rc/mceusb.c @@ -974,6 +974,7 @@ static void mceusb_handle_command(struct mceusb_dev *ir, int index) static void mceusb_process_ir_data(struct mceusb_dev *ir, int buf_len) { DEFINE_IR_RAW_EVENT(rawir); + bool event = false; int i = 0; /* skip meaningless 0xb1 0x60 header bytes on orig receiver */ @@ -1004,7 +1005,8 @@ static void mceusb_process_ir_data(struct mceusb_dev *ir, int buf_len) rawir.pulse ? "pulse" : "space", rawir.duration); - ir_raw_event_store_with_filter(ir->rc, &rawir); + if (ir_raw_event_store_with_filter(ir->rc, &rawir)) + event = true; break; case CMD_DATA: ir->rem--; @@ -1032,8 +1034,10 @@ static void mceusb_process_ir_data(struct mceusb_dev *ir, int buf_len) if (ir->parser_state != CMD_HEADER && !ir->rem) ir->parser_state = CMD_HEADER; } - mce_dbg(ir->dev, "processed IR data, calling ir_raw_event_handle\n"); - ir_raw_event_handle(ir->rc); + if (event) { + mce_dbg(ir->dev, "processed IR data, calling ir_raw_event_handle\n"); + ir_raw_event_handle(ir->rc); + } } static void mceusb_dev_recv(struct urb *urb) |