From b83bfd1b0127b0963fcac39280280e365e7e04d8 Mon Sep 17 00:00:00 2001 From: Sean Young Date: Mon, 13 Aug 2012 08:59:47 -0300 Subject: [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 Signed-off-by: Mauro Carvalho Chehab --- drivers/media/rc/fintek-cir.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'drivers/media/rc/fintek-cir.c') diff --git a/drivers/media/rc/fintek-cir.c b/drivers/media/rc/fintek-cir.c index ab30c64f8124..52fd7696b1ba 100644 --- a/drivers/media/rc/fintek-cir.c +++ b/drivers/media/rc/fintek-cir.c @@ -295,6 +295,7 @@ static void fintek_process_rx_ir_data(struct fintek_dev *fintek) { DEFINE_IR_RAW_EVENT(rawir); u8 sample; + bool event = false; int i; for (i = 0; i < fintek->pkts; i++) { @@ -332,7 +333,9 @@ static void fintek_process_rx_ir_data(struct fintek_dev *fintek) fit_dbg("Storing %s with duration %d", rawir.pulse ? "pulse" : "space", rawir.duration); - ir_raw_event_store_with_filter(fintek->rdev, &rawir); + if (ir_raw_event_store_with_filter(fintek->rdev, + &rawir)) + event = true; break; } @@ -342,8 +345,10 @@ static void fintek_process_rx_ir_data(struct fintek_dev *fintek) fintek->pkts = 0; - fit_dbg("Calling ir_raw_event_handle"); - ir_raw_event_handle(fintek->rdev); + if (event) { + fit_dbg("Calling ir_raw_event_handle"); + ir_raw_event_handle(fintek->rdev); + } } /* copy data from hardware rx register into driver buffer */ -- cgit v1.2.3