diff --git a/sound/soc/rockchip/rockchip_sai.c b/sound/soc/rockchip/rockchip_sai.c index 8c43150dd151..0e0f3b78b366 100644 --- a/sound/soc/rockchip/rockchip_sai.c +++ b/sound/soc/rockchip/rockchip_sai.c @@ -1398,6 +1398,20 @@ static int rockchip_sai_probe(struct platform_device *pdev) if (ret) return ret; + ret = rockchip_sai_init_dai(sai, res, &dai); + if (ret) + return ret; + + /* + * MUST: after pm_runtime_enable step, any register R/W + * should be wrapped with pm_runtime_get_sync/put. + * + * Another approach is to enable the regcache true to + * avoid access HW registers. + * + * Alternatively, performing the registers R/W before + * pm_runtime_enable is also a good option. + */ pm_runtime_enable(&pdev->dev); if (!pm_runtime_enabled(&pdev->dev)) { ret = rockchip_sai_runtime_resume(&pdev->dev); @@ -1405,10 +1419,6 @@ static int rockchip_sai_probe(struct platform_device *pdev) goto err_runtime_disable; } - ret = rockchip_sai_init_dai(sai, res, &dai); - if (ret) - goto err_runtime_suspend; - ret = devm_snd_soc_register_component(&pdev->dev, &rockchip_sai_component, dai, 1);