cec: early suspend no report power sts [2/2]
authorYong Qin <yong.qin@amlogic.com>
Mon, 25 Feb 2019 09:19:48 +0000 (17:19 +0800)
committerNick Xie <nick@khadas.com>
Mon, 5 Aug 2019 06:59:36 +0000 (14:59 +0800)
PD#SWPL-5037

Problem:
system enter early suspend, not ack "report power sts"

Solution:
early suspend not called.
not use CONFIG_AMLOGIC_LEGACY_EARLY_SUSPEND

Verify:
g12a s905x2 android P

Change-Id: I0e2d691b927575b3a6b5e7c13668de9bbf6519f7
Signed-off-by: Yong Qin <yong.qin@amlogic.com>
Signed-off-by: Luan Yuan <luan.yuan@amlogic.com>
drivers/amlogic/cec/hdmi_ao_cec.c
drivers/amlogic/cec/hdmi_ao_cec.h

index 47173ef..ea41c7a 100644 (file)
 #include <linux/amlogic/cpu_version.h>
 #include <linux/amlogic/jtag.h>
 #include <linux/amlogic/scpi_protocol.h>
-
-#ifdef CONFIG_HAS_EARLYSUSPEND
-#include <linux/earlysuspend.h>
-static struct early_suspend aocec_suspend_handler;
-#endif
+#include <linux/amlogic/pm.h>
 #include "hdmi_ao_cec.h"
 
 
@@ -75,6 +71,10 @@ static struct early_suspend aocec_suspend_handler;
 #define HR_DELAY(n)            (ktime_set(0, n * 1000 * 1000))
 #define MAX_INT    0x7ffffff
 
+#ifdef CONFIG_AMLOGIC_LEGACY_EARLY_SUSPEND
+static struct early_suspend aocec_suspend_handler;
+#endif
+
 struct cec_platform_data_s {
        /*unsigned int chip_id;*/
        unsigned char line_reg;/*cec gpio_i reg:0  ao;1 periph*/
@@ -1992,9 +1992,9 @@ static void cec_rx_process(void)
                if (cec_dev->cec_suspend == CEC_DEEP_SUSPEND)
                        cec_report_power_status(initiator, POWER_STANDBY);
                else if (cec_dev->cec_suspend == CEC_EARLY_SUSPEND)
-                       cec_report_power_status(initiator, TRANS_ON_TO_STANDBY);
+                       cec_report_power_status(initiator, POWER_STANDBY);
                else if (cec_dev->cec_suspend == CEC_POWER_RESUME)
-                       cec_report_power_status(initiator, TRANS_STANDBY_TO_ON);
+                       cec_report_power_status(initiator, POWER_ON);
                else
                        cec_report_power_status(initiator, POWER_ON);
                break;
@@ -3028,7 +3028,7 @@ static const struct file_operations hdmitx_cec_fops = {
 };
 
 /************************ cec high level code *****************************/
-#ifdef CONFIG_HAS_EARLYSUSPEND
+#ifdef CONFIG_AMLOGIC_LEGACY_EARLY_SUSPEND
 static void aocec_early_suspend(struct early_suspend *h)
 {
        cec_dev->cec_suspend = CEC_EARLY_SUSPEND;
@@ -3448,13 +3448,14 @@ static int aml_cec_probe(struct platform_device *pdev)
                goto tag_cec_msg_alloc_err;
        }
 
-#ifdef CONFIG_HAS_EARLYSUSPEND
+#ifdef CONFIG_AMLOGIC_LEGACY_EARLY_SUSPEND
        aocec_suspend_handler.level   = EARLY_SUSPEND_LEVEL_BLANK_SCREEN - 20;
        aocec_suspend_handler.suspend = aocec_early_suspend;
        aocec_suspend_handler.resume  = aocec_late_resume;
        aocec_suspend_handler.param   = cec_dev;
        register_early_suspend(&aocec_suspend_handler);
 #endif
+
        hrtimer_init(&start_bit_check, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
        start_bit_check.function = cec_line_check;
        cec_dev->cec_thread = create_workqueue("cec_work");
index e76e648..947a1d0 100644 (file)
@@ -19,7 +19,7 @@
 #define __AO_CEC_H__
 
 
-#define CEC_DRIVER_VERSION     "Ver 2019/3/25\n"
+#define CEC_DRIVER_VERSION     "2019/6/13:early suspend not report pw status\n"
 
 #define CEC_FRAME_DELAY                msecs_to_jiffies(400)
 #define CEC_DEV_NAME           "aocec"