summaryrefslogtreecommitdiffstats
path: root/drivers/media/IR/ir-core-priv.h
diff options
context:
space:
mode:
authorMaxim Levitsky2010-10-17 00:56:28 +0200
committerMauro Carvalho Chehab2010-10-21 14:59:47 +0200
commit4651918a4afdd49bdea21d2f919b189ef17a6399 (patch)
tree73a4e3b5f7da1d655a059bb9b69135cf6f395e02 /drivers/media/IR/ir-core-priv.h
parent[media] dvb-usb-gp8psk: Fix tuner timeout (against git) (diff)
downloadkernel-qcow2-linux-4651918a4afdd49bdea21d2f919b189ef17a6399.tar.gz
kernel-qcow2-linux-4651918a4afdd49bdea21d2f919b189ef17a6399.tar.xz
kernel-qcow2-linux-4651918a4afdd49bdea21d2f919b189ef17a6399.zip
[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/ir-core-priv.h')
-rw-r--r--drivers/media/IR/ir-core-priv.h13
1 files changed, 12 insertions, 1 deletions
diff --git a/drivers/media/IR/ir-core-priv.h b/drivers/media/IR/ir-core-priv.h
index 6830580ae4db..81c936bd793f 100644
--- a/drivers/media/IR/ir-core-priv.h
+++ b/drivers/media/IR/ir-core-priv.h
@@ -88,6 +88,12 @@ struct ir_raw_event_ctrl {
struct ir_input_dev *ir_dev;
struct lirc_driver *drv;
int carrier_low;
+
+ ktime_t gap_start;
+ u64 gap_duration;
+ bool gap;
+ bool send_timeout_reports;
+
} lirc;
};
@@ -115,9 +121,14 @@ static inline void decrease_duration(struct ir_raw_event *ev, unsigned duration)
ev->duration -= duration;
}
+/* Returns true if event is normal pulse/space event */
+static inline bool is_timing_event(struct ir_raw_event ev)
+{
+ return !ev.carrier_report && !ev.reset;
+}
+
#define TO_US(duration) DIV_ROUND_CLOSEST((duration), 1000)
#define TO_STR(is_pulse) ((is_pulse) ? "pulse" : "space")
-#define IS_RESET(ev) (ev.duration == 0)
/*
* Routines from ir-sysfs.c - Meant to be called only internally inside
* ir-core