From 5135c1db118409a6b9acfa78c75f382cbcb84fb2 Mon Sep 17 00:00:00 2001 From: "zhiwei.yuan" Date: Wed, 6 Mar 2019 15:55:43 +0800 Subject: [PATCH] dtv_demod: TL1 dtmb suspend hangup issue [1/1] PD#SWPL-5202 Problem: cma memory is not released when suspend Solution: provide suspend interface to release cma memory Verify: verified by t962x2_x301 Change-Id: I1d808a8a6119a2f385961c4c5bded5ab71c9c9d1 Signed-off-by: zhiwei.yuan --- drivers/amlogic/media/dtv_demod/amlfrontend.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/drivers/amlogic/media/dtv_demod/amlfrontend.c b/drivers/amlogic/media/dtv_demod/amlfrontend.c index 9894e73..f1bcfad 100644 --- a/drivers/amlogic/media/dtv_demod/amlfrontend.c +++ b/drivers/amlogic/media/dtv_demod/amlfrontend.c @@ -3656,6 +3656,25 @@ static void aml_dtvdemod_shutdown(struct platform_device *pdev) } +static int aml_dtvdemod_suspend(struct platform_device *pdev, + pm_message_t state) +{ + enum aml_fe_n_mode_t nmode = dtvdd_devp->n_mode; + + PR_INFO("%s, mode = %d\n", __func__, nmode); + + if (nmode != AM_FE_UNKNOWN_N) + leave_mode(nmode); + + return 0; +} + +static int aml_dtvdemod_resume(struct platform_device *pdev) +{ + PR_INFO("%s is called\n", __func__); + return 0; +} + static struct platform_driver aml_dtvdemod_driver = { .driver = { .name = "aml_dtv_demod", @@ -3666,6 +3685,10 @@ static struct platform_driver aml_dtvdemod_driver = { .shutdown = aml_dtvdemod_shutdown, .probe = aml_dtvdemod_probe, .remove = __exit_p(aml_dtvdemod_remove), +#ifdef CONFIG_PM + .suspend = aml_dtvdemod_suspend, + .resume = aml_dtvdemod_resume, +#endif }; -- 2.7.4