From 4786b0d6f3ca6da8db02b0a58cd2b785cb0b80ab Mon Sep 17 00:00:00 2001 From: Hans Verkuil Date: Thu, 28 Jun 2018 07:43:46 -0400 Subject: media: cec: add support for 5V signal testing Add support for the new 5V CEC events Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab --- include/media/cec-pin.h | 4 ++++ include/media/cec.h | 12 +++++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) (limited to 'include/media') diff --git a/include/media/cec-pin.h b/include/media/cec-pin.h index ed16c6d..604e79c 100644 --- a/include/media/cec-pin.h +++ b/include/media/cec-pin.h @@ -25,6 +25,9 @@ * @read_hpd: read the HPD pin. Return true if high, false if low or * an error if negative. If NULL or -ENOTTY is returned, * then this is not supported. + * @read_5v: read the 5V pin. Return true if high, false if low or + * an error if negative. If NULL or -ENOTTY is returned, + * then this is not supported. * * These operations are used by the cec pin framework to manipulate * the CEC pin. @@ -38,6 +41,7 @@ struct cec_pin_ops { void (*free)(struct cec_adapter *adap); void (*status)(struct cec_adapter *adap, struct seq_file *file); int (*read_hpd)(struct cec_adapter *adap); + int (*read_5v)(struct cec_adapter *adap); }; /** diff --git a/include/media/cec.h b/include/media/cec.h index 580ab10..ff9847f 100644 --- a/include/media/cec.h +++ b/include/media/cec.h @@ -79,7 +79,7 @@ struct cec_event_entry { }; #define CEC_NUM_CORE_EVENTS 2 -#define CEC_NUM_EVENTS CEC_EVENT_PIN_HPD_HIGH +#define CEC_NUM_EVENTS CEC_EVENT_PIN_5V_HIGH struct cec_fh { struct list_head list; @@ -309,6 +309,16 @@ void cec_queue_pin_cec_event(struct cec_adapter *adap, bool is_high, void cec_queue_pin_hpd_event(struct cec_adapter *adap, bool is_high, ktime_t ts); /** + * cec_queue_pin_5v_event() - queue a pin event with a given timestamp. + * + * @adap: pointer to the cec adapter + * @is_high: when true the 5V pin is high, otherwise it is low + * @ts: the timestamp for this event + * + */ +void cec_queue_pin_5v_event(struct cec_adapter *adap, bool is_high, ktime_t ts); + +/** * cec_get_edid_phys_addr() - find and return the physical address * * @edid: pointer to the EDID data -- cgit v1.1