Skip to content

Commit 6db9b02

Browse files
Hans Verkuilgregkh
authored andcommitted
media: cec-funcs.h: add status_req checks
[ Upstream commit 9b211f9 ] The CEC_MSG_GIVE_DECK_STATUS and CEC_MSG_GIVE_TUNER_DEVICE_STATUS commands both have a status_req argument: ON, OFF, ONCE. If ON or ONCE, then the follower will reply with a STATUS message. Either once or whenever the status changes (status_req == ON). If status_req == OFF, then it will stop sending continuous status updates, but the follower will *not* send a STATUS message in that case. This means that if status_req == OFF, then msg->reply should be 0 as well since no reply is expected in that case. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 6ca12b7 commit 6db9b02

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

‎include/uapi/linux/cec-funcs.h‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -923,7 +923,8 @@ static inline void cec_msg_give_deck_status(struct cec_msg *msg,
923923
msg->len = 3;
924924
msg->msg[1] = CEC_MSG_GIVE_DECK_STATUS;
925925
msg->msg[2] = status_req;
926-
msg->reply = reply ? CEC_MSG_DECK_STATUS : 0;
926+
msg->reply = (reply && status_req != CEC_OP_STATUS_REQ_OFF) ?
927+
CEC_MSG_DECK_STATUS : 0;
927928
}
928929

929930
static inline void cec_ops_give_deck_status(const struct cec_msg *msg,
@@ -1027,7 +1028,8 @@ static inline void cec_msg_give_tuner_device_status(struct cec_msg *msg,
10271028
msg->len = 3;
10281029
msg->msg[1] = CEC_MSG_GIVE_TUNER_DEVICE_STATUS;
10291030
msg->msg[2] = status_req;
1030-
msg->reply = reply ? CEC_MSG_TUNER_DEVICE_STATUS : 0;
1031+
msg->reply = (reply && status_req != CEC_OP_STATUS_REQ_OFF) ?
1032+
CEC_MSG_TUNER_DEVICE_STATUS : 0;
10311033
}
10321034

10331035
static inline void cec_ops_give_tuner_device_status(const struct cec_msg *msg,

0 commit comments

Comments
 (0)