Loading Documentation/media/kapi/cec-core.rst +10 −0 Original line number Diff line number Diff line Loading @@ -194,6 +194,11 @@ When a transmit finished (successfully or otherwise): void cec_transmit_done(struct cec_adapter *adap, u8 status, u8 arb_lost_cnt, u8 nack_cnt, u8 low_drive_cnt, u8 error_cnt); or: .. c:function:: void cec_transmit_attempt_done(struct cec_adapter *adap, u8 status); The status can be one of: CEC_TX_STATUS_OK: Loading Loading @@ -231,6 +236,11 @@ to 1, if the hardware does support retry then either set these counters to 0 if the hardware provides no feedback of which errors occurred and how many times, or fill in the correct values as reported by the hardware. The cec_transmit_attempt_done() function is a helper for cases where the hardware never retries, so the transmit is always for just a single attempt. It will call cec_transmit_done() in turn, filling in 1 for the count argument corresponding to the status. Or all 0 if the status was OK. When a CEC message was received: .. c:function:: Loading drivers/staging/media/cec/cec-adap.c +26 −0 Original line number Diff line number Diff line Loading @@ -542,6 +542,32 @@ void cec_transmit_done(struct cec_adapter *adap, u8 status, u8 arb_lost_cnt, } EXPORT_SYMBOL_GPL(cec_transmit_done); void cec_transmit_attempt_done(struct cec_adapter *adap, u8 status) { switch (status) { case CEC_TX_STATUS_OK: cec_transmit_done(adap, status, 0, 0, 0, 0); return; case CEC_TX_STATUS_ARB_LOST: cec_transmit_done(adap, status, 1, 0, 0, 0); return; case CEC_TX_STATUS_NACK: cec_transmit_done(adap, status, 0, 1, 0, 0); return; case CEC_TX_STATUS_LOW_DRIVE: cec_transmit_done(adap, status, 0, 0, 1, 0); return; case CEC_TX_STATUS_ERROR: cec_transmit_done(adap, status, 0, 0, 0, 1); return; default: /* Should never happen */ WARN(1, "cec-%s: invalid status 0x%02x\n", adap->name, status); return; } } EXPORT_SYMBOL_GPL(cec_transmit_attempt_done); /* * Called when waiting for a reply times out. */ Loading include/media/cec.h +19 −0 Original line number Diff line number Diff line Loading @@ -223,6 +223,12 @@ int cec_transmit_msg(struct cec_adapter *adap, struct cec_msg *msg, /* 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); /* * 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); #else Loading Loading @@ -252,4 +258,17 @@ static inline void cec_s_phys_addr_from_edid(struct cec_adapter *adap, #endif /** * cec_phys_addr_invalidate() - set the physical address to INVALID * * @adap: the CEC adapter * * This is a simple helper function to invalidate the physical * address. */ static inline void cec_phys_addr_invalidate(struct cec_adapter *adap) { cec_s_phys_addr(adap, CEC_PHYS_ADDR_INVALID, false); } #endif /* _MEDIA_CEC_H */ Loading
Documentation/media/kapi/cec-core.rst +10 −0 Original line number Diff line number Diff line Loading @@ -194,6 +194,11 @@ When a transmit finished (successfully or otherwise): void cec_transmit_done(struct cec_adapter *adap, u8 status, u8 arb_lost_cnt, u8 nack_cnt, u8 low_drive_cnt, u8 error_cnt); or: .. c:function:: void cec_transmit_attempt_done(struct cec_adapter *adap, u8 status); The status can be one of: CEC_TX_STATUS_OK: Loading Loading @@ -231,6 +236,11 @@ to 1, if the hardware does support retry then either set these counters to 0 if the hardware provides no feedback of which errors occurred and how many times, or fill in the correct values as reported by the hardware. The cec_transmit_attempt_done() function is a helper for cases where the hardware never retries, so the transmit is always for just a single attempt. It will call cec_transmit_done() in turn, filling in 1 for the count argument corresponding to the status. Or all 0 if the status was OK. When a CEC message was received: .. c:function:: Loading
drivers/staging/media/cec/cec-adap.c +26 −0 Original line number Diff line number Diff line Loading @@ -542,6 +542,32 @@ void cec_transmit_done(struct cec_adapter *adap, u8 status, u8 arb_lost_cnt, } EXPORT_SYMBOL_GPL(cec_transmit_done); void cec_transmit_attempt_done(struct cec_adapter *adap, u8 status) { switch (status) { case CEC_TX_STATUS_OK: cec_transmit_done(adap, status, 0, 0, 0, 0); return; case CEC_TX_STATUS_ARB_LOST: cec_transmit_done(adap, status, 1, 0, 0, 0); return; case CEC_TX_STATUS_NACK: cec_transmit_done(adap, status, 0, 1, 0, 0); return; case CEC_TX_STATUS_LOW_DRIVE: cec_transmit_done(adap, status, 0, 0, 1, 0); return; case CEC_TX_STATUS_ERROR: cec_transmit_done(adap, status, 0, 0, 0, 1); return; default: /* Should never happen */ WARN(1, "cec-%s: invalid status 0x%02x\n", adap->name, status); return; } } EXPORT_SYMBOL_GPL(cec_transmit_attempt_done); /* * Called when waiting for a reply times out. */ Loading
include/media/cec.h +19 −0 Original line number Diff line number Diff line Loading @@ -223,6 +223,12 @@ int cec_transmit_msg(struct cec_adapter *adap, struct cec_msg *msg, /* 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); /* * 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); #else Loading Loading @@ -252,4 +258,17 @@ static inline void cec_s_phys_addr_from_edid(struct cec_adapter *adap, #endif /** * cec_phys_addr_invalidate() - set the physical address to INVALID * * @adap: the CEC adapter * * This is a simple helper function to invalidate the physical * address. */ static inline void cec_phys_addr_invalidate(struct cec_adapter *adap) { cec_s_phys_addr(adap, CEC_PHYS_ADDR_INVALID, false); } #endif /* _MEDIA_CEC_H */