| .. | .. |
|---|
| 13 | 13 | |
|---|
| 14 | 14 | /** |
|---|
| 15 | 15 | * 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. |
|---|
| 17 | 18 | * @low: drive the CEC pin low. |
|---|
| 18 | 19 | * @high: stop driving the CEC pin. The pull-up will drive the pin |
|---|
| 19 | 20 | * high, unless someone else is driving the pin low. |
|---|
| .. | .. |
|---|
| 22 | 23 | * @free: optional. Free any allocated resources. Called when the |
|---|
| 23 | 24 | * adapter is deleted. |
|---|
| 24 | 25 | * @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. |
|---|
| 31 | 32 | * |
|---|
| 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. |
|---|
| 34 | 35 | */ |
|---|
| 35 | 36 | struct cec_pin_ops { |
|---|
| 36 | | - bool (*read)(struct cec_adapter *adap); |
|---|
| 37 | + int (*read)(struct cec_adapter *adap); |
|---|
| 37 | 38 | void (*low)(struct cec_adapter *adap); |
|---|
| 38 | 39 | void (*high)(struct cec_adapter *adap); |
|---|
| 39 | 40 | bool (*enable_irq)(struct cec_adapter *adap); |
|---|
| .. | .. |
|---|
| 42 | 43 | void (*status)(struct cec_adapter *adap, struct seq_file *file); |
|---|
| 43 | 44 | int (*read_hpd)(struct cec_adapter *adap); |
|---|
| 44 | 45 | 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); |
|---|
| 45 | 49 | }; |
|---|
| 46 | 50 | |
|---|
| 47 | 51 | /** |
|---|