Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp1734685ybe; Tue, 3 Sep 2019 02:41:43 -0700 (PDT) X-Google-Smtp-Source: APXvYqw68RbQKi8IUmQSGi8IGt4+88N7K7Vr8VX0U9PDq2/+3aZknZ3jTnu2v0K1TII9UHscGLTn X-Received: by 2002:aa7:8488:: with SMTP id u8mr40018337pfn.229.1567503703039; Tue, 03 Sep 2019 02:41:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567503703; cv=none; d=google.com; s=arc-20160816; b=YCtE2j1DDfRdfB5cd9B0cJyZXh211IcFP5ffzhB10bbawCX4JSenaa/FBhSzgQQfWB Z9PjuxwaN5ZQ8jsnqew2TTI0Qujz7JChrknFjMTz7madnrRUB22FTNYpp0xarnLhl5YL dc0FzKlnDYy3KHsnfDoTxgz1wPYPnstgovmkXlUZSMXQ4JQpRdLtef4wKzLUTcIMEqpn rwHvH8dNZvudc0kbcqeCfnTDlkG0WOhmouaxRTqhuwvvqzEJ67MNPNs0jKJe2ADfwwAH w8F/RrNUcwBufPv8zXfeIuSZNzJ78nyLPJ2D7hgB0G8skEbY3lNacPJbdTLzeQhkoYDj CRfA== 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=bqebxtv9Hms3l4z2/An1FiBBWkIENd+8l4xtlGKDDEA=; b=fgLiK0w3Wr6BDb+ToHH8p5lwt/jtvK1/qow8FZMNEMG44HLErl351lo76CPO+ZrEUc 0NxjRczNyAt2pfC6u+IfgLBKrZCkOrcALp081KMaCHQg5JoWvxd+cxqJTH1KgUJJV+Rm bxe6Slud8wBMv+YoA0CH8GZcC2sF4zl3vFhuG+ppqADlxiQlaZkKAuzVEm4lbEzmdHZr ePOA+2EZidra2Fs4bXSOPNU6gwqp9t2cEyAMZGn3W00CqV9tjALCBCDs6kl9EbC38gOF BwWtZDg84hf8ubon2GIuBx4hPh9EKgPvDf3k2VcVv6Qa81cHiTRg1WOLMsDkKs0KNCoR cnNQ== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f17si13803206pgh.552.2019.09.03.02.41.26; Tue, 03 Sep 2019 02:41:43 -0700 (PDT) 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728848AbfICJjE (ORCPT + 99 others); Tue, 3 Sep 2019 05:39:04 -0400 Received: from mailgw01.mediatek.com ([210.61.82.183]:23106 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1728129AbfICJjD (ORCPT ); Tue, 3 Sep 2019 05:39:03 -0400 X-UUID: 9d95ffdfe38d406598732577f6d3d164-20190903 X-UUID: 9d95ffdfe38d406598732577f6d3d164-20190903 Received: from mtkexhb02.mediatek.inc [(172.21.101.103)] by mailgw01.mediatek.com (envelope-from ) (Cellopoint E-mail Firewall v4.1.10 Build 0809 with TLS) with ESMTP id 481907305; Tue, 03 Sep 2019 17:38:56 +0800 Received: from mtkcas08.mediatek.inc (172.21.101.126) by mtkmbs07n2.mediatek.inc (172.21.101.141) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Tue, 3 Sep 2019 17:38:55 +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, 3 Sep 2019 17:38:54 +0800 From: Yong Wu To: Matthias Brugger , Joerg Roedel , Rob Herring CC: Evan Green , Robin Murphy , Tomasz Figa , Will Deacon , , , , , , , , , Nicolas Boichat , Matthias Kaehlcke , , , , , Rick Chang Subject: [PATCH v3 05/14] media: mtk-jpeg: Get rid of mtk_smi_larb_get/put Date: Tue, 3 Sep 2019 17:37:27 +0800 Message-ID: <1567503456-24725-6-git-send-email-yong.wu@mediatek.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1567503456-24725-1-git-send-email-yong.wu@mediatek.com> References: <1567503456-24725-1-git-send-email-yong.wu@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain 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 Reviewed-by: Evan Green --- 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 ee802fc..3242a8d 100644 --- a/drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c +++ b/drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c @@ -21,7 +21,6 @@ #include #include #include -#include #include "mtk_jpeg_hw.h" #include "mtk_jpeg_core.h" @@ -893,11 +892,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); } @@ -906,7 +900,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) @@ -1051,21 +1044,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 999bd14..8579494 100644 --- a/drivers/media/platform/mtk-jpeg/mtk_jpeg_core.h +++ b/drivers/media/platform/mtk-jpeg/mtk_jpeg_core.h @@ -47,7 +47,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; @@ -61,7 +60,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