cec: add the port map for connect status [1/1]
authorHongmin Hua <hongmin.hua@amlogic.com>
Tue, 11 Dec 2018 06:03:04 +0000 (14:03 +0800)
committerJianxin Pan <jianxin.pan@amlogic.com>
Wed, 12 Dec 2018 01:33:05 +0000 (17:33 -0800)
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 <hongmin.hua@amlogic.com>
drivers/amlogic/cec/hdmi_ao_cec.c
drivers/amlogic/cec/hdmi_ao_cec.h

index be05511..a0da89e 100644 (file)
@@ -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;
index 8d283a7..b6fb58f 100644 (file)
 #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 {