cec: remove the delay time when get phy addr [1/1]
authorYong Qin <yong.qin@amlogic.com>
Fri, 27 Sep 2019 01:54:34 +0000 (09:54 +0800)
committerTao Zeng <tao.zeng@amlogic.com>
Wed, 16 Oct 2019 10:19:09 +0000 (03:19 -0700)
PD#OTT-6364

Problem:
When no hdmi cable connect, framework call get phy address,
will case 2s delay.

Solution:
1.If there is no HPD,needn't waitting TX finished reading the EDID
2.Reduce time out sleep time.

Verify:
W400

Change-Id: I2749e877e8b214355094390364e3711e6f1bbf12
Signed-off-by: Yong Qin <yong.qin@amlogic.com>
drivers/amlogic/cec/hdmi_ao_cec.c
drivers/amlogic/cec/hdmi_ao_cec.h

index 949c650..fd7384e 100644 (file)
@@ -1478,11 +1478,13 @@ static bool check_physical_addr_valid(int timeout)
                if (phy_addr_test)
                        break;
                /* physical address for box */
-               if (cec_dev->tx_dev->hdmi_info.vsdb_phy_addr.valid == 0) {
-                       msleep(100);
+               if (cec_dev->tx_dev->hpd_state &&
+                   (cec_dev->tx_dev->hdmi_info.vsdb_phy_addr.valid == 0)) {
+                       msleep(40);
                        timeout--;
-               } else
+               } else {
                        break;
+               }
        }
        if (timeout <= 0)
                return false;
@@ -3086,7 +3088,7 @@ static long hdmitx_cec_ioctl(struct file *f,
        mutex_lock(&cec_dev->cec_ioctl_mutex);
        switch (cmd) {
        case CEC_IOC_GET_PHYSICAL_ADDR:
-               check_physical_addr_valid(20);
+               /*check_physical_addr_valid(20);*/
                /* physical address for TV or repeator */
                tx_dev = cec_dev->tx_dev;
                if (!tx_dev || cec_dev->dev_type == CEC_TV_ADDR) {
@@ -3307,7 +3309,7 @@ static long hdmitx_cec_ioctl(struct file *f,
                break;
 
        default:
-               CEC_ERR("error ioctrl\n");
+               CEC_ERR("error ioctrl: 0x%x\n", cmd);
                break;
        }
        mutex_unlock(&cec_dev->cec_ioctl_mutex);
index e838fbf..2d85d73 100644 (file)
@@ -18,7 +18,7 @@
 #ifndef __AO_CEC_H__
 #define __AO_CEC_H__
 
-#define CEC_DRIVER_VERSION     "2019/10/11:add freeze mode wake up func-2\n"
+#define CEC_DRIVER_VERSION     "2019/10/16: reduce box get phy addr timeout time\n"
 
 #define CEC_FRAME_DELAY                msecs_to_jiffies(400)
 #define CEC_DEV_NAME           "cec"