msm: cec: simplify TX message processing

Simplify the message processing of CEC adapter driver's transmit
function. Don't need to decompose CEC message's header block and
data block 0 before programming to the registers.

Change-Id: Icf2b2f123bda560ef4e3c8c4c6a2eaf828b7ce9a
CRs-Fixed: 2117559
Signed-off-by: Zhiming Weng <czweng@codeaurora.org>
This commit is contained in:
Zhiming Weng 2017-10-20 15:58:25 +08:00
parent 9d01188232
commit df46a12ca7

View file

@ -159,17 +159,7 @@ static int sde_hdmi_cec_adap_transmit(struct cec_adapter *adap, u8 attempts,
frame_type = cec_msg_is_broadcast(msg) ? BIT(0) : 0; frame_type = cec_msg_is_broadcast(msg) ? BIT(0) : 0;
/* header block */ for (i = 0; i < msg->len; i++)
CEC_REG_WRITE(hw, HDMI_CEC_WR_DATA,
(((cec_msg_initiator(msg) << 4) |
cec_msg_destination(msg)) << 8) | frame_type);
/* data block 0 : opcode */
CEC_REG_WRITE(hw, HDMI_CEC_WR_DATA,
((msg->len < 2 ? 0 : cec_msg_opcode(msg)) << 8) | frame_type);
/* data block 1-14 : operand 0-13 */
for (i = 2; i < msg->len; i++)
CEC_REG_WRITE(hw, HDMI_CEC_WR_DATA, CEC_REG_WRITE(hw, HDMI_CEC_WR_DATA,
(msg->msg[i] << 8) | frame_type); (msg->msg[i] << 8) | frame_type);