From f0ec553988af1c65aea97d9287b98a3bf07bc39a Mon Sep 17 00:00:00 2001 From: hongmin hua Date: Thu, 22 Feb 2018 15:51:41 +0800 Subject: [PATCH] cec: add cec version define in dts & cts 9.3 PD#160943: cec: add cec version define in dts & cts 9.3 Change-Id: Ifd06bf388412d058efd90be3afe6119fc666dacb Signed-off-by: hongmin hua --- arch/arm64/boot/dts/amlogic/gxl_p212_1g.dts | 2 +- arch/arm64/boot/dts/amlogic/gxl_p212_2g.dts | 2 +- arch/arm64/boot/dts/amlogic/gxl_p231_1g.dts | 2 +- arch/arm64/boot/dts/amlogic/gxl_p231_2g.dts | 2 +- drivers/amlogic/cec/hdmi_ao_cec.c | 14 ++++++++++++-- drivers/amlogic/cec/hdmi_ao_cec.h | 2 +- 6 files changed, 17 insertions(+), 7 deletions(-) diff --git a/arch/arm64/boot/dts/amlogic/gxl_p212_1g.dts b/arch/arm64/boot/dts/amlogic/gxl_p212_1g.dts index 49bc519dc5bd..b2e7e8d39da8 100644 --- a/arch/arm64/boot/dts/amlogic/gxl_p212_1g.dts +++ b/arch/arm64/boot/dts/amlogic/gxl_p212_1g.dts @@ -630,7 +630,7 @@ status = "okay"; vendor_id = <0x000000>; cec_osd_string = "MBox"; /* Max Chars: 14 */ - cec_version = <6>; /* 5: 1.4, 6: 2.0 */ + cec_version = <5>; /* 5: 1.4, 6: 2.0 */ port_num = <1>; arc_port_mask = <0x0>; interrupts = <0 199 1>; diff --git a/arch/arm64/boot/dts/amlogic/gxl_p212_2g.dts b/arch/arm64/boot/dts/amlogic/gxl_p212_2g.dts index 2f481fe87bff..45e666c6b69f 100644 --- a/arch/arm64/boot/dts/amlogic/gxl_p212_2g.dts +++ b/arch/arm64/boot/dts/amlogic/gxl_p212_2g.dts @@ -727,7 +727,7 @@ status = "okay"; vendor_id = <0x000000>; cec_osd_string = "MBox"; /* Max Chars: 14 */ - cec_version = <6>; /* 5: 1.4, 6: 2.0 */ + cec_version = <5>; /* 5: 1.4, 6: 2.0 */ port_num = <1>; arc_port_mask = <0x0>; interrupts = <0 199 1>; diff --git a/arch/arm64/boot/dts/amlogic/gxl_p231_1g.dts b/arch/arm64/boot/dts/amlogic/gxl_p231_1g.dts index b9f33a5826fa..451f6d601039 100644 --- a/arch/arm64/boot/dts/amlogic/gxl_p231_1g.dts +++ b/arch/arm64/boot/dts/amlogic/gxl_p231_1g.dts @@ -643,7 +643,7 @@ status = "okay"; vendor_id = <0x000000>; cec_osd_string = "MBox"; /* Max Chars: 14 */ - cec_version = <6>; /* 5: 1.4, 6: 2.0 */ + cec_version = <5>; /* 5: 1.4, 6: 2.0 */ port_num = <1>; arc_port_mask = <0x0>; interrupts = <0 199 1>; diff --git a/arch/arm64/boot/dts/amlogic/gxl_p231_2g.dts b/arch/arm64/boot/dts/amlogic/gxl_p231_2g.dts index 82fe8ddb94be..14e3a3fc5787 100644 --- a/arch/arm64/boot/dts/amlogic/gxl_p231_2g.dts +++ b/arch/arm64/boot/dts/amlogic/gxl_p231_2g.dts @@ -643,7 +643,7 @@ status = "okay"; vendor_id = <0x000000>; cec_osd_string = "MBox"; /* Max Chars: 14 */ - cec_version = <6>; /* 5: 1.4, 6: 2.0 */ + cec_version = <5>; /* 5: 1.4, 6: 2.0 */ port_num = <1>; arc_port_mask = <0x0>; interrupts = <0 199 1>; diff --git a/drivers/amlogic/cec/hdmi_ao_cec.c b/drivers/amlogic/cec/hdmi_ao_cec.c index f120094f4686..baad0cf6fcf3 100644 --- a/drivers/amlogic/cec/hdmi_ao_cec.c +++ b/drivers/amlogic/cec/hdmi_ao_cec.c @@ -775,10 +775,20 @@ static inline bool is_feature_abort_msg(const unsigned char *msg, int len) return false; } +static inline bool is_report_phy_addr_msg(const unsigned char *msg, int len) +{ + if (!msg || len < 4) + return false; + if (msg[1] == CEC_OC_REPORT_PHYSICAL_ADDRESS) + return true; + return false; +} + static bool need_nack_repeat_msg(const unsigned char *msg, int len, int t) { if (len == last_cec_msg->len && - (is_poll_message(msg[0]) || is_feature_abort_msg(msg, len)) && + (is_poll_message(msg[0]) || is_feature_abort_msg(msg, len) || + is_report_phy_addr_msg(msg, len)) && last_cec_msg->last_result == CEC_FAIL_NACK && jiffies - last_cec_msg->last_jiffies < t) { return true; @@ -1039,7 +1049,7 @@ int cec_ll_tx(const unsigned char *msg, unsigned char len) mutex_lock(&cec_dev->cec_mutex); /* make sure we got valid physical address */ if (len >= 2 && msg[1] == CEC_OC_REPORT_PHYSICAL_ADDRESS) - check_physical_addr_valid(20); + check_physical_addr_valid(3); try_again: reinit_completion(&cec_dev->tx_ok); diff --git a/drivers/amlogic/cec/hdmi_ao_cec.h b/drivers/amlogic/cec/hdmi_ao_cec.h index a9d7eb66bb67..551b0892f502 100644 --- a/drivers/amlogic/cec/hdmi_ao_cec.h +++ b/drivers/amlogic/cec/hdmi_ao_cec.h @@ -18,7 +18,7 @@ #ifndef __AO_CEC_H__ #define __AO_CEC_H__ -#define CEC_DRIVER_VERSION "2018/02/05\n" +#define CEC_DRIVER_VERSION "2018/02/22\n" #define CEC_FRAME_DELAY msecs_to_jiffies(400) #define CEC_DEV_NAME "cec"