From: rongrong zhou Date: Mon, 7 Jan 2019 08:14:56 +0000 (+0800) Subject: video: disable video in early suspend [1/1] X-Git-Tag: hardkernel-4.9.236-104~1891 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c18fc768d3b9648c8058c8bdba8772c254ebe7fd;p=platform%2Fkernel%2Flinux-amlogic.git 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 --- diff --git a/drivers/amlogic/media/video_sink/video.c b/drivers/amlogic/media/video_sink/video.c index 689d61f..5d067cd 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; @@ -10446,6 +10449,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; @@ -10465,11 +10487,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; }