dtv_demod: fix pm runtime error (V3.5.020) [1/1]

PD#SWPL-139016

Problem:
demod becomes abnormal after the second
pm enable.

Solution:
1.remove before change.
2.add pm force suspend in shutdown interface.

Verify:
verified by T5M

Change-Id: I97535dfb3ad9cefa1304a6653ed4f85719640a7b
Signed-off-by: min.yang <min.yang@amlogic.com>
This commit is contained in:
min.yang
2023-11-03 11:01:07 +08:00
committed by Luan Yuan
parent ec77fa0ee9
commit 68ecd40407
2 changed files with 9 additions and 10 deletions
+6 -8
View File
@@ -1599,6 +1599,8 @@ static int aml_dtvdemod_probe(struct platform_device *pdev)
if (devp->data->hw_ver >= DTVDEMOD_HW_T5D) {
pm_runtime_enable(devp->dev);
if (pm_runtime_get_sync(devp->dev) < 0)
pr_err("failed to set pwr\n");
devp->fw_buf = kzalloc(FW_BUFF_SIZE, GFP_KERNEL);
if (!devp->fw_buf)
@@ -1658,6 +1660,7 @@ static int __exit aml_dtvdemod_remove(struct platform_device *pdev)
if (devp->data->hw_ver >= DTVDEMOD_HW_T5D) {
kfree(devp->fw_buf);
pm_runtime_put_sync(devp->dev);
pm_runtime_disable(devp->dev);
}
@@ -1701,6 +1704,9 @@ static void aml_dtvdemod_shutdown(struct platform_device *pdev)
delsys_exit(demod, demod->last_delsys, SYS_UNDEFINED);
}
if (devp->data->hw_ver >= DTVDEMOD_HW_T5D)
pm_runtime_force_suspend(devp->dev);
PR_INFO("%s OK.\n", __func__);
mutex_unlock(&devp->lock);
@@ -2056,10 +2062,6 @@ static int aml_dtvdm_init(struct dvb_frontend *fe)
demod->last_delsys = SYS_UNDEFINED;
fe->ops.info.type = 0xFF; /* undefined */
if (devp->data->hw_ver >= DTVDEMOD_HW_T5D)
if (pm_runtime_get_sync(devp->dev))
PR_INFO("[%s] pm get sync ERROR.\n", __func__);
PR_INFO("%s [id %d] OK.\n", __func__, demod->id);
mutex_unlock(&devp->lock);
@@ -2084,10 +2086,6 @@ static int aml_dtvdm_sleep(struct dvb_frontend *fe)
delsys_exit(demod, delsys, SYS_UNDEFINED);
}
if (devp->data->hw_ver >= DTVDEMOD_HW_T5D) {
if (pm_runtime_put_sync(devp->dev))
PR_INFO("[%s] pm put sync ERROR !\n", __func__);
}
PR_INFO("%s [id %d] OK.\n", __func__, demod->id);
mutex_unlock(&devp->lock);
@@ -144,6 +144,7 @@
/* V3.5.017 increase the speed of dvbc blind scanning */
/* V3.5.018 optimize dvbs blind scan progress */
/* V3.5.019 fix dvbt lock failed in weak signal */
/* V3.5.020 fix pm runtime error */
/****************************************************/
/****************************************************************/
/* AMLDTVDEMOD_VER Description: */
@@ -160,8 +161,8 @@
/*->The last four digits indicate the release time */
/****************************************************************/
#define KERNEL_4_9_EN 1
#define AMLDTVDEMOD_VER "V3.5.19"
#define DTVDEMOD_VER "2023/11/09: fix dvbt lock failed in weak signal"
#define AMLDTVDEMOD_VER "V3.5.20"
#define DTVDEMOD_VER "2023/11/09: fix pm runtime error"
#define AMLDTVDEMOD_T2_FW_VER "20231019_141000"
#define DEMOD_DEVICE_NAME "dtvdemod"