From cf903b6d55df5d80500d7d1d3e55d5ce4d28cbde Mon Sep 17 00:00:00 2001 From: rongrong zhou Date: Mon, 7 Jan 2019 16:14:56 +0800 Subject: [PATCH] video: disable video in early suspend [1/1] PD#SWPL-2736 Problem: suspend green screen Solution: disable video in early suspend Verify: Ampere Change-Id: If5ad13d2964b1541791d95ffb239293ab1e4ffb6 Signed-off-by: rongrong zhou --- drivers/amlogic/media/video_sink/video.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/drivers/amlogic/media/video_sink/video.c b/drivers/amlogic/media/video_sink/video.c index 75d8253..d22164e 100644 --- a/drivers/amlogic/media/video_sink/video.c +++ b/drivers/amlogic/media/video_sink/video.c @@ -88,6 +88,9 @@ MODULE_AMLOG(LOG_LEVEL_ERROR, 0, LOG_DEFAULT_LEVEL_DESC, LOG_MASK_DESC); #include "../common/vfm/vfm.h" #include +#ifdef CONFIG_AMLOGIC_LEGACY_EARLY_SUSPEND +#include +#endif static u32 osd_vpp_misc; static u32 osd_vpp_misc_mask; static bool update_osd_vpp_misc; @@ -10337,6 +10340,25 @@ static struct mconfig video_configs[] = { #endif }; +#ifdef CONFIG_AMLOGIC_LEGACY_EARLY_SUSPEND +static void video_early_suspend(struct early_suspend *h) +{ + DisableVideoLayer(); + DisableVideoLayer2(); + pr_info("video_early_suspend ok\n"); +} + +static void video_late_resume(struct early_suspend *h) +{ + pr_info("video_late_resume ok\n"); +}; + +static struct early_suspend video_early_suspend_handler = { + .suspend = video_early_suspend, + .resume = video_late_resume, +}; +#endif + static int amvideom_probe(struct platform_device *pdev) { int ret = 0; @@ -10356,11 +10378,17 @@ static int amvideom_probe(struct platform_device *pdev) pr_info("amvideom vsync irq: %d\n", video_vsync); +#ifdef CONFIG_AMLOGIC_LEGACY_EARLY_SUSPEND + register_early_suspend(&video_early_suspend_handler); +#endif return ret; } static int amvideom_remove(struct platform_device *pdev) { +#ifdef CONFIG_AMLOGIC_LEGACY_EARLY_SUSPEND + unregister_early_suspend(&video_early_suspend_handler); +#endif return 0; } -- 2.7.4