[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1468983721-3627-3-git-send-email-yong.wu@mediatek.com>
Date: Wed, 20 Jul 2016 11:02:01 +0800
From: Yong Wu <yong.wu@...iatek.com>
To: Matthias Brugger <matthias.bgg@...il.com>,
David Airlie <airlied@...ux.ie>,
Philipp Zabel <p.zabel@...gutronix.de>,
Hans Verkuil <hans.verkuil@...co.com>
CC: Mauro Carvalho Chehab <mchehab@....samsung.com>,
Tiffany Lin <tiffany.lin@...iatek.com>,
Honghui Zhang <honghui.zhang@...iatek.com>,
Bibby Hsieh <bibby.hsieh@...iatek.com>,
YT Shen <yt.shen@...iatek.com>, CK Hu <ck.hu@...iatek.com>,
Daniel Kurtz <djkurtz@...gle.com>,
Tomasz Figa <tfiga@...gle.com>, Arnd Bergmann <arnd@...db.de>,
Lucas Stach <l.stach@...gutronix.de>,
<youlin.pei@...iatek.com>, <linux-mediatek@...ts.infradead.org>,
<srv_heupstream@...iatek.com>, <linux-kernel@...r.kernel.org>,
<linux-arm-kernel@...ts.infradead.org>,
<iommu@...ts.linux-foundation.org>, Yong Wu <yong.wu@...iatek.com>
Subject: [PATCH 3/3] vcodec: mediatek: Add probe-defer for MTK IOMMU and SMI
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@...iatek.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
Powered by blists - more mailing lists