hc
2024-05-13 9d77db3c730780c8ef5ccd4b66403ff5675cfe4e
kernel/include/media/cec-pin.h
....@@ -13,7 +13,8 @@
1313
1414 /**
1515 * struct cec_pin_ops - low-level CEC pin operations
16
- * @read: read the CEC pin. Return true if high, false if low.
16
+ * @read: read the CEC pin. Returns > 0 if high, 0 if low, or an error
17
+ * if negative.
1718 * @low: drive the CEC pin low.
1819 * @high: stop driving the CEC pin. The pull-up will drive the pin
1920 * high, unless someone else is driving the pin low.
....@@ -22,18 +23,18 @@
2223 * @free: optional. Free any allocated resources. Called when the
2324 * adapter is deleted.
2425 * @status: optional, log status information.
25
- * @read_hpd: read the HPD pin. Return true if high, false if low or
26
- * an error if negative. If NULL or -ENOTTY is returned,
27
- * then this is not supported.
28
- * @read_5v: read the 5V pin. Return true if high, false if low or
29
- * an error if negative. If NULL or -ENOTTY is returned,
30
- * then this is not supported.
26
+ * @read_hpd: optional. Read the HPD pin. Returns > 0 if high, 0 if low or
27
+ * an error if negative.
28
+ * @read_5v: optional. Read the 5V pin. Returns > 0 if high, 0 if low or
29
+ * an error if negative.
30
+ * @received: optional. High-level CEC message callback. Allows the driver
31
+ * to process CEC messages.
3132 *
32
- * These operations are used by the cec pin framework to manipulate
33
- * the CEC pin.
33
+ * These operations (except for the @received op) are used by the
34
+ * cec pin framework to manipulate the CEC pin.
3435 */
3536 struct cec_pin_ops {
36
- bool (*read)(struct cec_adapter *adap);
37
+ int (*read)(struct cec_adapter *adap);
3738 void (*low)(struct cec_adapter *adap);
3839 void (*high)(struct cec_adapter *adap);
3940 bool (*enable_irq)(struct cec_adapter *adap);
....@@ -42,6 +43,9 @@
4243 void (*status)(struct cec_adapter *adap, struct seq_file *file);
4344 int (*read_hpd)(struct cec_adapter *adap);
4445 int (*read_5v)(struct cec_adapter *adap);
46
+
47
+ /* High-level CEC message callback */
48
+ int (*received)(struct cec_adapter *adap, struct cec_msg *msg);
4549 };
4650
4751 /**