dtv_demod: TL1 dtmb suspend hangup issue [1/1]
authorzhiwei.yuan <zhiwei.yuan@amlogic.com>
Wed, 6 Mar 2019 07:55:43 +0000 (15:55 +0800)
committerTao Zeng <tao.zeng@amlogic.com>
Thu, 7 Mar 2019 03:30:40 +0000 (19:30 -0800)
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 <zhiwei.yuan@amlogic.com>
drivers/amlogic/media/dtv_demod/amlfrontend.c

index 9894e73..f1bcfad 100644 (file)
@@ -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
 };