summaryrefslogtreecommitdiffstats
path: root/include/media/cec-notifier.h
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil@xs4all.nl>2017-07-15 14:32:56 +0200
committerMauro Carvalho Chehab <mchehab@s-opensource.com>2017-07-26 11:46:44 +0200
commitfc1ff45a07abf240aa0c6586c11465c86c8cab8d (patch)
tree0eba84919fe75c472cb44ad97159f5c8b502190d /include/media/cec-notifier.h
parentmedia: pulse8-cec: persistent_config should be off by default (diff)
downloadlinux-fc1ff45a07abf240aa0c6586c11465c86c8cab8d.tar.xz
linux-fc1ff45a07abf240aa0c6586c11465c86c8cab8d.zip
media: cec-notifier: small improvements
Allow calling cec_notifier_set_phys_addr and cec_notifier_set_phys_addr_from_edid with a NULL notifier, in which case these functions do nothing. Add a cec_notifier_phys_addr_invalidate helper function (the notifier equivalent of cec_phys_addr_invalidate). These changes simplify drm CEC driver support. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Diffstat (limited to 'include/media/cec-notifier.h')
-rw-r--r--include/media/cec-notifier.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/include/media/cec-notifier.h b/include/media/cec-notifier.h
index 298f996969df..a4f7429c4ae5 100644
--- a/include/media/cec-notifier.h
+++ b/include/media/cec-notifier.h
@@ -57,6 +57,7 @@ void cec_notifier_put(struct cec_notifier *n);
* @pa: the CEC physical address
*
* Set a new CEC physical address.
+ * Does nothing if @n == NULL.
*/
void cec_notifier_set_phys_addr(struct cec_notifier *n, u16 pa);
@@ -66,6 +67,7 @@ void cec_notifier_set_phys_addr(struct cec_notifier *n, u16 pa);
* @edid: the struct edid pointer
*
* Parses the EDID to obtain the new CEC physical address and set it.
+ * Does nothing if @n == NULL.
*/
void cec_notifier_set_phys_addr_from_edid(struct cec_notifier *n,
const struct edid *edid);
@@ -118,4 +120,17 @@ static inline void cec_notifier_unregister(struct cec_notifier *n)
#endif
+/**
+ * cec_notifier_phys_addr_invalidate() - set the physical address to INVALID
+ *
+ * @n: the CEC notifier
+ *
+ * This is a simple helper function to invalidate the physical
+ * address. Does nothing if @n == NULL.
+ */
+static inline void cec_notifier_phys_addr_invalidate(struct cec_notifier *n)
+{
+ cec_notifier_set_phys_addr(n, CEC_PHYS_ADDR_INVALID);
+}
+
#endif