From 4651918a4afdd49bdea21d2f919b189ef17a6399 Mon Sep 17 00:00:00 2001 From: Maxim Levitsky Date: Sat, 16 Oct 2010 19:56:28 -0300 Subject: [media] IR: extend ir_raw_event and do refactoring Add new event types for timeout & carrier report Move timeout handling from ir_raw_event_store_with_filter to ir-lirc-codec, where it is really needed. Now lirc bridge ensures proper gap handling. Extend lirc bridge for carrier & timeout reports Note: all new ir_raw_event variables now should be initialized like that: DEFINE_IR_RAW_EVENT(ev); To clean an existing event, use init_ir_raw_event(&ev); Signed-off-by: Maxim Levitsky Acked-by: Jarod Wilson Signed-off-by: Mauro Carvalho Chehab --- drivers/media/IR/nuvoton-cir.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'drivers/media/IR/nuvoton-cir.c') diff --git a/drivers/media/IR/nuvoton-cir.c b/drivers/media/IR/nuvoton-cir.c index 2f0f78078b57..301be53aee85 100644 --- a/drivers/media/IR/nuvoton-cir.c +++ b/drivers/media/IR/nuvoton-cir.c @@ -586,7 +586,7 @@ static void nvt_dump_rx_buf(struct nvt_dev *nvt) */ static void nvt_process_rx_ir_data(struct nvt_dev *nvt) { - struct ir_raw_event rawir = { .pulse = false, .duration = 0 }; + DEFINE_IR_RAW_EVENT(rawir); unsigned int count; u32 carrier; u8 sample; @@ -622,6 +622,8 @@ static void nvt_process_rx_ir_data(struct nvt_dev *nvt) } rawir.duration += nvt->rawir.duration; + + init_ir_raw_event(&nvt->rawir); nvt->rawir.duration = 0; nvt->rawir.pulse = rawir.pulse; @@ -1016,6 +1018,7 @@ static int nvt_probe(struct pnp_dev *pdev, const struct pnp_device_id *dev_id) spin_lock_init(&nvt->nvt_lock); spin_lock_init(&nvt->tx.lock); + init_ir_raw_event(&nvt->rawir); ret = -EBUSY; /* now claim resources */ -- cgit v1.2.2