From patchwork Wed Jul 20 03:02:01 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?WW9uZyBXdSAo5ZC05YuHKQ==?= X-Patchwork-Id: 9238715 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 8C33E602F0 for ; Wed, 20 Jul 2016 03:04:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7F5C326E81 for ; Wed, 20 Jul 2016 03:04:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 737AF2787C; Wed, 20 Jul 2016 03:04:38 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 0D53426E81 for ; Wed, 20 Jul 2016 03:04:38 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1bPhn3-0004kX-Rk; Wed, 20 Jul 2016 03:03:17 +0000 Received: from [210.61.82.184] (helo=mailgw02.mediatek.com) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1bPhmm-0004Si-Nr; Wed, 20 Jul 2016 03:03:02 +0000 Received: from mtkhts09.mediatek.inc [(172.21.101.70)] by mailgw02.mediatek.com (envelope-from ) (mhqrelay.mediatek.com ESMTP with TLS) with ESMTP id 13655770; Wed, 20 Jul 2016 11:02:35 +0800 Received: from mhfsdcap03.mhfswrd (10.17.3.153) by mtkhts09.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 14.3.266.1; Wed, 20 Jul 2016 11:02:33 +0800 From: Yong Wu To: Matthias Brugger , David Airlie , Philipp Zabel , Hans Verkuil Subject: [PATCH 3/3] vcodec: mediatek: Add probe-defer for MTK IOMMU and SMI Date: Wed, 20 Jul 2016 11:02:01 +0800 Message-ID: <1468983721-3627-3-git-send-email-yong.wu@mediatek.com> X-Mailer: git-send-email 1.8.1.1.dirty In-Reply-To: <1468983721-3627-1-git-send-email-yong.wu@mediatek.com> References: <1468983721-3627-1-git-send-email-yong.wu@mediatek.com> MIME-Version: 1.0 X-MTK: N X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160719_200301_193688_6F5EBD9C X-CRM114-Status: GOOD ( 11.52 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: youlin.pei@mediatek.com, srv_heupstream@mediatek.com, Arnd Bergmann , Mauro Carvalho Chehab , linux-kernel@vger.kernel.org, iommu@lists.linux-foundation.org, CK Hu , Tomasz Figa , Daniel Kurtz , Yong Wu , Bibby Hsieh , Honghui Zhang , YT Shen , linux-mediatek@lists.infradead.org, Tiffany Lin , linux-arm-kernel@lists.infradead.org, Lucas Stach Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- 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");