media: platform: mtk-mdp3: Use devicetree phandle to retrieve SCP
Instead of walking the entire parent node for something that has the right compatible, use the scp_get() function provided by the MediaTek SCP remoteproc driver to retrieve a handle to mtk_scp through the devicetree "mediatek,scp" (phandle) property. In case of multi-core SCP, this also allows to select a specific core. Reviewed-by: Chen-Yu Tsai <wenst@chromium.org> Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Reviewed-by: Alexandre Mergnat <amergnat@baylibre.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
This commit is contained in:
parent
a60577cef7
commit
52e1fc9aa8
|
@ -208,13 +208,17 @@ static int mdp_probe(struct platform_device *pdev)
|
|||
goto err_destroy_job_wq;
|
||||
}
|
||||
|
||||
mm_pdev = __get_pdev_by_id(pdev, MDP_INFRA_SCP);
|
||||
if (WARN_ON(!mm_pdev)) {
|
||||
dev_err(&pdev->dev, "Could not get scp device\n");
|
||||
ret = -ENODEV;
|
||||
goto err_destroy_clock_wq;
|
||||
mdp->scp = scp_get(pdev);
|
||||
if (!mdp->scp) {
|
||||
mm_pdev = __get_pdev_by_id(pdev, MDP_INFRA_SCP);
|
||||
if (WARN_ON(!mm_pdev)) {
|
||||
dev_err(&pdev->dev, "Could not get scp device\n");
|
||||
ret = -ENODEV;
|
||||
goto err_destroy_clock_wq;
|
||||
}
|
||||
mdp->scp = platform_get_drvdata(mm_pdev);
|
||||
}
|
||||
mdp->scp = platform_get_drvdata(mm_pdev);
|
||||
|
||||
mdp->rproc_handle = scp_get_rproc(mdp->scp);
|
||||
dev_dbg(&pdev->dev, "MDP rproc_handle: %pK", mdp->rproc_handle);
|
||||
|
||||
|
|
Loading…
Reference in New Issue