summaryrefslogtreecommitdiffstats
path: root/include/media/cec.h
diff options
context:
space:
mode:
authorHans Verkuil <hans.verkuil@cisco.com>2017-07-11 08:30:35 +0200
committerMauro Carvalho Chehab <mchehab@s-opensource.com>2017-07-18 17:47:02 +0200
commit0861ad14c6cfc9dc8bcde44bc23a7a355167eb9f (patch)
tree268a284828236215bd52a68abd9743c296d0305c /include/media/cec.h
parentmedia: cec: improve transmit timeout logging (diff)
downloadlinux-0861ad14c6cfc9dc8bcde44bc23a7a355167eb9f.tar.xz
linux-0861ad14c6cfc9dc8bcde44bc23a7a355167eb9f.zip
media: cec: add *_ts variants for transmit_done/received_msg
Currently the transmit_(attempt_)done and received_msg functions set the timestamp themselves. For the upcoming low-level pin API we need to pass this as an argument instead. So make _ts variants that allow the caller to specify the timestamp. 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/cec.h')
-rw-r--r--include/media/cec.h32
1 files changed, 28 insertions, 4 deletions
diff --git a/include/media/cec.h b/include/media/cec.h
index e32b0e1a81a4..e1e60dbb66c3 100644
--- a/include/media/cec.h
+++ b/include/media/cec.h
@@ -228,15 +228,39 @@ int cec_transmit_msg(struct cec_adapter *adap, struct cec_msg *msg,
bool block);
/* Called by the adapter */
-void cec_transmit_done(struct cec_adapter *adap, u8 status, u8 arb_lost_cnt,
- u8 nack_cnt, u8 low_drive_cnt, u8 error_cnt);
+void cec_transmit_done_ts(struct cec_adapter *adap, u8 status,
+ u8 arb_lost_cnt, u8 nack_cnt, u8 low_drive_cnt,
+ u8 error_cnt, ktime_t ts);
+
+static inline void cec_transmit_done(struct cec_adapter *adap, u8 status,
+ u8 arb_lost_cnt, u8 nack_cnt,
+ u8 low_drive_cnt, u8 error_cnt)
+{
+ cec_transmit_done_ts(adap, status, arb_lost_cnt, nack_cnt,
+ low_drive_cnt, error_cnt, ktime_get());
+}
/*
* Simplified version of cec_transmit_done for hardware that doesn't retry
* failed transmits. So this is always just one attempt in which case
* the status is sufficient.
*/
-void cec_transmit_attempt_done(struct cec_adapter *adap, u8 status);
-void cec_received_msg(struct cec_adapter *adap, struct cec_msg *msg);
+void cec_transmit_attempt_done_ts(struct cec_adapter *adap,
+ u8 status, ktime_t ts);
+
+static inline void cec_transmit_attempt_done(struct cec_adapter *adap,
+ u8 status)
+{
+ cec_transmit_attempt_done_ts(adap, status, ktime_get());
+}
+
+void cec_received_msg_ts(struct cec_adapter *adap,
+ struct cec_msg *msg, ktime_t ts);
+
+static inline void cec_received_msg(struct cec_adapter *adap,
+ struct cec_msg *msg)
+{
+ cec_received_msg_ts(adap, msg, ktime_get());
+}
/**
* cec_get_edid_phys_addr() - find and return the physical address