summaryrefslogtreecommitdiffstats
path: root/include/media
diff options
context:
space:
mode:
authorHans Verkuil <hans.verkuil@cisco.com>2017-07-11 08:30:39 +0200
committerMauro Carvalho Chehab <mchehab@s-opensource.com>2017-07-18 17:49:36 +0200
commit6b2bbb08747a56dcf4ee33606a06025eca571260 (patch)
tree00fe39f2fca026746238ddd8e1f625ce81a0649a /include/media
parentmedia: linux/cec.h: add pin monitoring API support (diff)
downloadlinux-6b2bbb08747a56dcf4ee33606a06025eca571260.tar.xz
linux-6b2bbb08747a56dcf4ee33606a06025eca571260.zip
media: cec: rework the cec event handling
Event handling was always fairly simplistic since there were only two events. With the addition of pin events this needed to be redesigned. The state_change and lost_msgs events are now core events with the guarantee that the last state is always available. The new pin events are a queue of events (up to 64 for each event) and the oldest event will be dropped if the application cannot keep up. Lost events are marked with a new event flag. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Reviewed-by: Maxime Ripard <maxime.ripard@free-electrons.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Diffstat (limited to 'include/media')
-rw-r--r--include/media/cec.h14
1 files changed, 11 insertions, 3 deletions
diff --git a/include/media/cec.h b/include/media/cec.h
index 37768203572d..6cc862af74e5 100644
--- a/include/media/cec.h
+++ b/include/media/cec.h
@@ -81,7 +81,13 @@ struct cec_msg_entry {
struct cec_msg msg;
};
-#define CEC_NUM_EVENTS CEC_EVENT_LOST_MSGS
+struct cec_event_entry {
+ struct list_head list;
+ struct cec_event ev;
+};
+
+#define CEC_NUM_CORE_EVENTS 2
+#define CEC_NUM_EVENTS CEC_EVENT_PIN_HIGH
struct cec_fh {
struct list_head list;
@@ -92,9 +98,11 @@ struct cec_fh {
/* Events */
wait_queue_head_t wait;
- unsigned int pending_events;
- struct cec_event events[CEC_NUM_EVENTS];
struct mutex lock;
+ struct list_head events[CEC_NUM_EVENTS]; /* queued events */
+ u8 queued_events[CEC_NUM_EVENTS];
+ unsigned int total_queued_events;
+ struct cec_event_entry core_events[CEC_NUM_CORE_EVENTS];
struct list_head msgs; /* queued messages */
unsigned int queued_msgs;
};