linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: yong.wu@mediatek.com (Yong Wu)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 3/3] vcodec: mediatek: Add probe-defer for MTK IOMMU and SMI
Date: Wed, 20 Jul 2016 11:02:01 +0800	[thread overview]
Message-ID: <1468983721-3627-3-git-send-email-yong.wu@mediatek.com> (raw)
In-Reply-To: <1468983721-3627-1-git-send-email-yong.wu@mediatek.com>

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

  parent reply	other threads:[~2016-07-20  3:02 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-20  3:01 [PATCH 1/3] memory: mediatek: Add a new interface mtk_smi_larb_is_ready Yong Wu
2016-07-20  3:02 ` [PATCH 2/3] drm/mediatek: Add probe-defer for MTK IOMMU and SMI Yong Wu
2016-07-20  3:02 ` Yong Wu [this message]
2016-07-25  8:39 ` [PATCH 1/3] memory: mediatek: Add a new interface mtk_smi_larb_is_ready Matthias Brugger
2016-07-26  1:31   ` Yong Wu
2016-07-26  2:30   ` Tomasz Figa

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1468983721-3627-3-git-send-email-yong.wu@mediatek.com \
    --to=yong.wu@mediatek.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).