diff options
author | Maxim Levitsky <maximlevitsky@gmail.com> | 2010-10-16 18:56:28 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2010-10-21 08:59:47 -0400 |
commit | 4651918a4afdd49bdea21d2f919b189ef17a6399 (patch) | |
tree | 73a4e3b5f7da1d655a059bb9b69135cf6f395e02 /drivers/media/IR/nuvoton-cir.c | |
parent | fb249ca61d469a9cb666ba7e1d992787dc6bad82 (diff) |
[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 <maximlevitsky@gmail.com>
Acked-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/IR/nuvoton-cir.c')
-rw-r--r-- | drivers/media/IR/nuvoton-cir.c | 5 |
1 files changed, 4 insertions, 1 deletions
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) | |||
586 | */ | 586 | */ |
587 | static void nvt_process_rx_ir_data(struct nvt_dev *nvt) | 587 | static void nvt_process_rx_ir_data(struct nvt_dev *nvt) |
588 | { | 588 | { |
589 | struct ir_raw_event rawir = { .pulse = false, .duration = 0 }; | 589 | DEFINE_IR_RAW_EVENT(rawir); |
590 | unsigned int count; | 590 | unsigned int count; |
591 | u32 carrier; | 591 | u32 carrier; |
592 | u8 sample; | 592 | u8 sample; |
@@ -622,6 +622,8 @@ static void nvt_process_rx_ir_data(struct nvt_dev *nvt) | |||
622 | } | 622 | } |
623 | 623 | ||
624 | rawir.duration += nvt->rawir.duration; | 624 | rawir.duration += nvt->rawir.duration; |
625 | |||
626 | init_ir_raw_event(&nvt->rawir); | ||
625 | nvt->rawir.duration = 0; | 627 | nvt->rawir.duration = 0; |
626 | nvt->rawir.pulse = rawir.pulse; | 628 | nvt->rawir.pulse = rawir.pulse; |
627 | 629 | ||
@@ -1016,6 +1018,7 @@ static int nvt_probe(struct pnp_dev *pdev, const struct pnp_device_id *dev_id) | |||
1016 | 1018 | ||
1017 | spin_lock_init(&nvt->nvt_lock); | 1019 | spin_lock_init(&nvt->nvt_lock); |
1018 | spin_lock_init(&nvt->tx.lock); | 1020 | spin_lock_init(&nvt->tx.lock); |
1021 | init_ir_raw_event(&nvt->rawir); | ||
1019 | 1022 | ||
1020 | ret = -EBUSY; | 1023 | ret = -EBUSY; |
1021 | /* now claim resources */ | 1024 | /* now claim resources */ |