From 78790318ae0e050dd253947dc2dd2ad41b74a469 Mon Sep 17 00:00:00 2001 From: Yong Qin Date: Mon, 25 Feb 2019 17:19:48 +0800 Subject: [PATCH] cec: early suspend no report power sts [2/2] 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 Signed-off-by: Luan Yuan --- drivers/amlogic/cec/hdmi_ao_cec.c | 19 ++++++++++--------- drivers/amlogic/cec/hdmi_ao_cec.h | 2 +- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/drivers/amlogic/cec/hdmi_ao_cec.c b/drivers/amlogic/cec/hdmi_ao_cec.c index 47173ef..ea41c7a 100644 --- a/drivers/amlogic/cec/hdmi_ao_cec.c +++ b/drivers/amlogic/cec/hdmi_ao_cec.c @@ -56,11 +56,7 @@ #include #include #include - -#ifdef CONFIG_HAS_EARLYSUSPEND -#include -static struct early_suspend aocec_suspend_handler; -#endif +#include #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"); diff --git a/drivers/amlogic/cec/hdmi_ao_cec.h b/drivers/amlogic/cec/hdmi_ao_cec.h index e76e648..947a1d0 100644 --- a/drivers/amlogic/cec/hdmi_ao_cec.h +++ b/drivers/amlogic/cec/hdmi_ao_cec.h @@ -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" -- 2.7.4