lkml.org 
[lkml]   [2016]   [Jul]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 3/3] vcodec: mediatek: Add probe-defer for MTK IOMMU and SMI
Date
Mediatek V4l2 depend on the IOMMU and SMI. we should add probe-defer
to wait for the IOMMU and SMI is ready.

Signed-off-by: Yong Wu <yong.wu@mediatek.com>
---
drivers/media/platform/mtk-vcodec/mtk_vcodec_enc_pm.c | 5 +++++
1 file changed, 5 insertions(+)

diff --git a/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc_pm.c b/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc_pm.c
index 4c977b2..9e6203e 100644
--- a/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc_pm.c
+++ b/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc_pm.c
@@ -66,6 +66,11 @@ int mtk_vcodec_init_enc_pm(struct mtk_vcodec_dev *mtkdev)
pdev = mtkdev->plat_dev;
pm->dev = &pdev->dev;

+ /* Wait until MTK IOMMU and SMI probe done.*/
+ if (!mtk_smi_larb_is_ready(pm->larbvenc) ||
+ !mtk_smi_larb_is_ready(pm->larbvenclt))
+ return -EPROBE_DEFER;
+
pm->vencpll_d2 = devm_clk_get(&pdev->dev, "venc_sel_src");
if (IS_ERR(pm->vencpll_d2)) {
mtk_v4l2_err("devm_clk_get vencpll_d2 fail");
--
1.8.1.1.dirty
\
 
 \ /
  Last update: 2016-07-20 05:41    [W:0.051 / U:0.168 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site