Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp11533261imu; Tue, 1 Jan 2019 01:15:50 -0800 (PST) X-Google-Smtp-Source: ALg8bN5HOlEqq94t4LqnW6JCoTf82VlmrBoUNIZqZ3O4Wr1sck/Tm2KfozeHo2IPe0AMKSHVsd3n X-Received: by 2002:a17:902:c05:: with SMTP id 5mr40265956pls.155.1546334150354; Tue, 01 Jan 2019 01:15:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546334150; cv=none; d=google.com; s=arc-20160816; b=Ljx+9qOr1ubUI5dnxmI5ou7Qq8FfwuLqASwJyfO4pkg2JflYf327OjH4A2sLaYy7pW kVuOPYrxSMLqJSnhIcPL6+BMfLNeaymcmdP9dFAx0vIXKWj7apBGGJNY7Vw3S83qn88+ KpkATCwe0HDzB39KtvsVcjKNJ551yVJCWkEsoxdVbTd1vvcASH2rA6nt0t3QNd1oIeXL EoF9BV20OP117EbWThv2R45ca+IhJfvA7k2qmAanx1FRSgXCPdK3pbqBCeIMWghd0Kst 2bumOhUCafzkr7qv0wSnr/Pgmh4jr6yLw4rGlLlQO1fobsiYVaV++mUFqa1Q9c+6ei+g Q76A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=01v7aOpBO9OK/SjPMrDNU3sIjUZi5k9YAsg0Wtm8jG0=; b=OZedJD5FRYPejXTbAgFfKQvPQeFIeN7MwmKZ9ZNJ2zujHxm/c0NcVUvm67zi3paK+5 V9bUmqSeLzB9w26EF+C7NzcLJGZh7HbCxAjp6ooTrvpKr1JaLYfCsLkXdB4qab5NAuMe 7vwxwRvID0pJ7qsNcgNZUMmWs9lg7Sqb7IJ1Md1oxY2p95Bto2MSj7+cUqxKTA5Mygrx ogAnhoY3N0GsPWX6GHu9U/nJNyxsDtTHPd0eTT5ZMi0I4cCqiAv7Nd/q1Oyhv+Q+Fp9q asBpTu9EM8dp028UGSYdXMgRMSmL6XRZebDueb7rpyqvE0KN9nWDix1OJY9j3RGX/d6Y iQxQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m8si29731527pls.400.2019.01.01.01.15.13; Tue, 01 Jan 2019 01:15:50 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728497AbfAAEwc (ORCPT + 99 others); Mon, 31 Dec 2018 23:52:32 -0500 Received: from mailgw02.mediatek.com ([210.61.82.184]:8545 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1728425AbfAAEwb (ORCPT ); Mon, 31 Dec 2018 23:52:31 -0500 X-UUID: 628c0d94224647a2aad435cf35f6990d-20190101 X-UUID: 628c0d94224647a2aad435cf35f6990d-20190101 Received: from mtkcas09.mediatek.inc [(172.21.101.178)] by mailgw02.mediatek.com (envelope-from ) (mhqrelay.mediatek.com ESMTP with TLS) with ESMTP id 39374120; Tue, 01 Jan 2019 12:52:26 +0800 Received: from mtkcas08.mediatek.inc (172.21.101.126) by mtkmbs03n2.mediatek.inc (172.21.101.182) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Tue, 1 Jan 2019 12:52:24 +0800 Received: from localhost.localdomain (10.17.3.153) by mtkcas08.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Tue, 1 Jan 2019 12:52:23 +0800 From: Yong Wu To: Joerg Roedel , Greg Kroah-Hartman , Matthias Brugger , Rob Herring CC: Robin Murphy , Tomasz Figa , Will Deacon , , , , , , , , , , , Nicolas Boichat , Rick Chang Subject: [PATCH 06/13] media: mtk-jpeg: Get rid of mtk_smi_larb_get/put Date: Tue, 1 Jan 2019 12:51:09 +0800 Message-ID: <1546318276-18993-7-git-send-email-yong.wu@mediatek.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1546318276-18993-1-git-send-email-yong.wu@mediatek.com> References: <1546318276-18993-1-git-send-email-yong.wu@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain X-TM-SNTS-SMTP: 3AF47A93A0CB5DC13A8ADBFAC3BE13D8A9F8013C35280552A495621E89F6FE852000:8 X-MTK: N Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org MediaTek IOMMU has already added device_link between the consumer and smi-larb device. If the jpg device call the pm_runtime_get_sync, the smi-larb's pm_runtime_get_sync also be called automatically. CC: Rick Chang Signed-off-by: Yong Wu --- drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c | 22 ---------------------- drivers/media/platform/mtk-jpeg/mtk_jpeg_core.h | 2 -- 2 files changed, 24 deletions(-) diff --git a/drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c b/drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c index 2a5d500..23da32c 100644 --- a/drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c +++ b/drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c @@ -29,7 +29,6 @@ #include #include #include -#include #include "mtk_jpeg_hw.h" #include "mtk_jpeg_core.h" @@ -901,11 +900,6 @@ static int mtk_jpeg_queue_init(void *priv, struct vb2_queue *src_vq, static void mtk_jpeg_clk_on(struct mtk_jpeg_dev *jpeg) { - int ret; - - ret = mtk_smi_larb_get(jpeg->larb); - if (ret) - dev_err(jpeg->dev, "mtk_smi_larb_get larbvdec fail %d\n", ret); clk_prepare_enable(jpeg->clk_jdec_smi); clk_prepare_enable(jpeg->clk_jdec); } @@ -914,7 +908,6 @@ static void mtk_jpeg_clk_off(struct mtk_jpeg_dev *jpeg) { clk_disable_unprepare(jpeg->clk_jdec); clk_disable_unprepare(jpeg->clk_jdec_smi); - mtk_smi_larb_put(jpeg->larb); } static irqreturn_t mtk_jpeg_dec_irq(int irq, void *priv) @@ -1059,21 +1052,6 @@ static int mtk_jpeg_release(struct file *file) static int mtk_jpeg_clk_init(struct mtk_jpeg_dev *jpeg) { - struct device_node *node; - struct platform_device *pdev; - - node = of_parse_phandle(jpeg->dev->of_node, "mediatek,larb", 0); - if (!node) - return -EINVAL; - pdev = of_find_device_by_node(node); - if (WARN_ON(!pdev)) { - of_node_put(node); - return -EINVAL; - } - of_node_put(node); - - jpeg->larb = &pdev->dev; - jpeg->clk_jdec = devm_clk_get(jpeg->dev, "jpgdec"); if (IS_ERR(jpeg->clk_jdec)) return PTR_ERR(jpeg->clk_jdec); diff --git a/drivers/media/platform/mtk-jpeg/mtk_jpeg_core.h b/drivers/media/platform/mtk-jpeg/mtk_jpeg_core.h index 1a6cdfd..e35fb79 100644 --- a/drivers/media/platform/mtk-jpeg/mtk_jpeg_core.h +++ b/drivers/media/platform/mtk-jpeg/mtk_jpeg_core.h @@ -55,7 +55,6 @@ enum mtk_jpeg_ctx_state { * @dec_reg_base: JPEG registers mapping * @clk_jdec: JPEG hw working clock * @clk_jdec_smi: JPEG SMI bus clock - * @larb: SMI device */ struct mtk_jpeg_dev { struct mutex lock; @@ -69,7 +68,6 @@ struct mtk_jpeg_dev { void __iomem *dec_reg_base; struct clk *clk_jdec; struct clk *clk_jdec_smi; - struct device *larb; }; /** -- 1.9.1