From b0bdf47617dcbd482d094093babe2bc2da527e7c Mon Sep 17 00:00:00 2001 From: hang cheng Date: Thu, 20 Oct 2022 12:45:42 +0800 Subject: [PATCH] cec: add protection to cover default logic address [1/1] PD#SWPL-95075 Problem: logic address is saved as 0xf, it's default invalid logic address, cause cec not work under uboot Solution: add protection, cover default logic address with address set by framework Verify: am301 Change-Id: I78a2969fccd0e5fa1ecab5ca2d607c8f62e53091 Signed-off-by: hang cheng --- drivers/media/cec/hdmi_aocec_api.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/media/cec/hdmi_aocec_api.c b/drivers/media/cec/hdmi_aocec_api.c index df91a9f31..ff10a3860 100644 --- a/drivers/media/cec/hdmi_aocec_api.c +++ b/drivers/media/cec/hdmi_aocec_api.c @@ -1667,7 +1667,13 @@ unsigned int cec_config2_logaddr(unsigned int value, bool wr_flag) if (wr_flag) { temp = (read_ao(AO_DEBUG_REG1) >> 16) & 0xf; - if (temp == 0) { + /* uboot will check first logic address firstly, if it's + * invalid address, it will set default logic address + * need replace first logic address with valid address. + * if the saved first address value is 0 or 0xf, it means + * it can be replaced. + */ + if (temp == 0 || temp == 0xf) { cec_set_reg_bits(AO_DEBUG_REG1, value, 16, 4); } else if (temp != value) { /* assume platform will only alloc correct logic addr */