From: Hongmin Hua Date: Tue, 11 Dec 2018 06:03:04 +0000 (+0800) Subject: cec: add the port map for connect status [1/1] X-Git-Tag: hardkernel-4.9.236-104~2050 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=dd29e4276749082d1b8ee1cd1f14e66a1ab95900;p=platform%2Fkernel%2Flinux-amlogic.git cec: add the port map for connect status [1/1] PD#SWPL-3010 Problem: the arc can't work Solution: add the port map for connect status Verify: verified on darwin Change-Id: I9f886c35de8670acdc431185bb26aa1836a8c150 Signed-off-by: Hongmin Hua --- diff --git a/drivers/amlogic/cec/hdmi_ao_cec.c b/drivers/amlogic/cec/hdmi_ao_cec.c index be05511..a0da89e 100644 --- a/drivers/amlogic/cec/hdmi_ao_cec.c +++ b/drivers/amlogic/cec/hdmi_ao_cec.c @@ -2680,7 +2680,7 @@ static long hdmitx_cec_ioctl(struct file *f, void __user *argp = (void __user *)arg; unsigned int tmp; struct hdmi_port_info *port; - unsigned int a, b, c, d; + unsigned int a, b, c, d, i = 0; struct hdmitx_dev *tx_dev; /*unsigned int tx_hpd;*/ @@ -2815,8 +2815,14 @@ static long hdmitx_cec_ioctl(struct file *f, /* mixed for rx & tx */ /* a is current port idx, 0: tx device */ if (a != 0) { - tmp = hdmirx_get_connect_info(); - if (tmp & (1 << (a - 1))) + tmp = hdmirx_get_connect_info() & 0xF; + for (i = 0; i < CEC_PHY_PORT_NUM; i++) { + if (((cec_dev->port_seq >> i*4) & 0xF) == a) + break; + } + CEC_INFO("phy port:%d, ui port:%d\n", i, a); + + if ((tmp & (1 << i)) && (a != 0xF)) tmp = 1; else tmp = 0; diff --git a/drivers/amlogic/cec/hdmi_ao_cec.h b/drivers/amlogic/cec/hdmi_ao_cec.h index 8d283a7..b6fb58f 100644 --- a/drivers/amlogic/cec/hdmi_ao_cec.h +++ b/drivers/amlogic/cec/hdmi_ao_cec.h @@ -19,14 +19,14 @@ #define __AO_CEC_H__ -#define CEC_DRIVER_VERSION "Ver 2018/12/06\n" +#define CEC_DRIVER_VERSION "Ver 2018/12/11\n" #define CEC_FRAME_DELAY msecs_to_jiffies(400) #define CEC_DEV_NAME "cec" #define CEC_EARLY_SUSPEND (1 << 0) #define CEC_DEEP_SUSPEND (1 << 1) - +#define CEC_PHY_PORT_NUM 4 #define HR_DELAY(n) (ktime_set(0, n * 1000 * 1000)) enum cecbver {