aboutsummaryrefslogtreecommitdiffstats
path: root/include/media
diff options
context:
space:
mode:
authorDavid Härdeman <david@hardeman.nu>2010-04-15 17:46:00 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2010-05-19 11:57:42 -0400
commite40b1127f994a427568319d1be9b9e5ab1f58dd1 (patch)
tree5d4f892dbe90588f8932cd4e1768b953814f3f47 /include/media
parent21677cfc562a27e099719d413287bc8d1d24deb7 (diff)
V4L/DVB: ir-core: change duration to be coded as a u32 integer
This patch implements the agreed upon 1:31 integer encoded pulse/duration struct for ir-core raw decoders. All decoders have been tested after the change. Comments are welcome. Signed-off-by: David Härdeman <david@hardeman.nu> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'include/media')
-rw-r--r--include/media/ir-core.h16
1 files changed, 14 insertions, 2 deletions
diff --git a/include/media/ir-core.h b/include/media/ir-core.h
index 51e8eb3a3f2d..ad1303f20e00 100644
--- a/include/media/ir-core.h
+++ b/include/media/ir-core.h
@@ -128,9 +128,21 @@ u32 ir_g_keycode_from_table(struct input_dev *input_dev, u32 scancode);
128 128
129/* From ir-raw-event.c */ 129/* From ir-raw-event.c */
130 130
131struct ir_raw_event {
132 unsigned pulse:1;
133 unsigned duration:31;
134};
135
136#define IR_MAX_DURATION 0x7FFFFFFF /* a bit more than 2 seconds */
137
131void ir_raw_event_handle(struct input_dev *input_dev); 138void ir_raw_event_handle(struct input_dev *input_dev);
132int ir_raw_event_store(struct input_dev *input_dev, s64 duration); 139int ir_raw_event_store(struct input_dev *input_dev, struct ir_raw_event *ev);
133int ir_raw_event_store_edge(struct input_dev *input_dev, enum raw_event_type type); 140int ir_raw_event_store_edge(struct input_dev *input_dev, enum raw_event_type type);
134 141static inline void ir_raw_event_reset(struct input_dev *input_dev)
142{
143 struct ir_raw_event ev = { .pulse = false, .duration = 0 };
144 ir_raw_event_store(input_dev, &ev);
145 ir_raw_event_handle(input_dev);
146}
135 147
136#endif /* _IR_CORE */ 148#endif /* _IR_CORE */