diff --git a/drivers/media/dtv_demod/amlfrontend.c b/drivers/media/dtv_demod/amlfrontend.c index 26128c828..9379810b7 100644 --- a/drivers/media/dtv_demod/amlfrontend.c +++ b/drivers/media/dtv_demod/amlfrontend.c @@ -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); diff --git a/drivers/media/dtv_demod/include/amlfrontend.h b/drivers/media/dtv_demod/include/amlfrontend.h index 724a1ffcb..5c370b50e 100644 --- a/drivers/media/dtv_demod/include/amlfrontend.h +++ b/drivers/media/dtv_demod/include/amlfrontend.h @@ -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"