mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-06 02:50:49 +09:00
ASoC: rockchip: sai: Fix register access in probe
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. Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com> Change-Id: Ife9b1a0e6f75e714bfb6e7c0d472e4603fa8cd8f
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user