]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
media: cec: add CEC_MSG_FL_RAW flag and msg_is_raw helper function
authorHans Verkuil <hverkuil-cisco@xs4all.nl>
Tue, 23 Apr 2019 12:44:59 +0000 (08:44 -0400)
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Thu, 23 May 2019 09:32:40 +0000 (05:32 -0400)
This adds the userspace API to send raw unchecked CEC messages.
This will require root permissions.

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
drivers/media/cec/cec-priv.h
include/uapi/linux/cec.h

index 804e38f849c7b76abf698dee14eb4b0e7f4aceb9..7bdf855aaecd73353a70ccbb38f4921d12166b23 100644 (file)
 /* devnode to cec_adapter */
 #define to_cec_adapter(node) container_of(node, struct cec_adapter, devnode)
 
+static inline bool msg_is_raw(const struct cec_msg *msg)
+{
+       return msg->flags & CEC_MSG_FL_RAW;
+}
+
 /* cec-core.c */
 extern int cec_debug;
 int cec_get_device(struct cec_devnode *devnode);
index 3094af68b6e76cdf24855c77553de8c3bb599c91..5704fa0292b56afe55ddb9fb0a0219c8ff7239f2 100644 (file)
@@ -144,6 +144,7 @@ static inline void cec_msg_set_reply_to(struct cec_msg *msg,
 
 /* cec_msg flags field */
 #define CEC_MSG_FL_REPLY_TO_FOLLOWERS  (1 << 0)
+#define CEC_MSG_FL_RAW                 (1 << 1)
 
 /* cec_msg tx/rx_status field */
 #define CEC_TX_STATUS_OK               (1 << 0)