Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp1734678ybe; Tue, 3 Sep 2019 02:41:42 -0700 (PDT) X-Google-Smtp-Source: APXvYqxLTMzRFc0Z+kdMlkiuikrphUEi+8EP8iggxY5eYPalvZuK/4ELktHjxQGQ1RBLYjZYL6tl X-Received: by 2002:a17:90a:37c9:: with SMTP id v67mr16193473pjb.29.1567503702807; Tue, 03 Sep 2019 02:41:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567503702; cv=none; d=google.com; s=arc-20160816; b=ueX8c9nxs1bYCV9cd+Sl0RfVEe2/IGVzpxx2xLw7Ln9IJox9pVkMhhwaawjlMehG9T Ua6E8gt6DtA0AzMYCptQQ/ulGNDoWjSXqKQzA/1eKYy/kaYAxlokqpxSFSZRfb7a7x7k f1f5IbGwaGXSPxY9xA4GRO6W86jdJEebpJQ5VCrgVl0eEWRhc7QB/gix74k2c2xw1V2N EilktAQSSkuAj5zj0R5AuMwEiwxSRqJ4j7uKDNswNQ7BPD82fxeBQnxtmQkUTAZPWdyz RUvXToeCg5zVTi92SmF5NBli8x6xmv4DgQJ/GDTGVhOS8F+Sc1XOwHJlyqblN7nzJ+mz 2UXg== 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=sMDQppfjkqNT2swV1ZhCbEVMxbXpkJ6P2Gv4d2Hp8uE=; b=Ge7z7sum4LQGrOBsfkKOpA/2OHMVfQXlS3Ui+LZMQtdR28rgBoagTiGewdCbMDno3X Ph2tOs3hyiDLFXGAaHvnODagosTNBV8B1kER0mamCTTaKWCn/XIJhc6rfypS8mnOpdOu dtVXUKrkI7CM+Mr0a1zf6Q/bC52fksyyLCVKRsRfevWyXS8qWC9vL3vhUt7eESHCtIlS 5mkXI+7a4JtrcRPEOVNsKp8Nv7LBDVruDMuWQHnXNXz+ECnI63iGcJjbvHGuTyZ70X3v xlcAShPM+IhGNdWiuhhwqg/jvX6xBgvLovYHJ7EDz1VYjuoBEPTx7p8JF8A7RuKYTsQI tf6Q== 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 a14si14347286pjs.69.2019.09.03.02.41.27; Tue, 03 Sep 2019 02:41:42 -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 S1728869AbfICJjL (ORCPT + 99 others); Tue, 3 Sep 2019 05:39:11 -0400 Received: from mailgw01.mediatek.com ([210.61.82.183]:25014 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1728129AbfICJjL (ORCPT ); Tue, 3 Sep 2019 05:39:11 -0400 X-UUID: 06adbe7ef1894ee29898f46a59bcfbc4-20190903 X-UUID: 06adbe7ef1894ee29898f46a59bcfbc4-20190903 Received: from mtkcas06.mediatek.inc [(172.21.101.30)] by mailgw01.mediatek.com (envelope-from ) (Cellopoint E-mail Firewall v4.1.10 Build 0809 with TLS) with ESMTP id 229411202; Tue, 03 Sep 2019 17:39:04 +0800 Received: from mtkcas08.mediatek.inc (172.21.101.126) by mtkmbs07n1.mediatek.inc (172.21.101.16) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Tue, 3 Sep 2019 17:39:03 +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:39:02 +0800 From: Yong Wu To: Matthias Brugger , Joerg Roedel , Rob Herring CC: Evan Green , Robin Murphy , Tomasz Figa , Will Deacon , , , , , , , , , Nicolas Boichat , Matthias Kaehlcke , , , , , Minghsiu Tsai Subject: [PATCH v3 06/14] media: mtk-mdp: Get rid of mtk_smi_larb_get/put Date: Tue, 3 Sep 2019 17:37:28 +0800 Message-ID: <1567503456-24725-7-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 the device_link between the consumer and smi-larb device. If the mdp device call the pm_runtime_get_sync, the smi-larb's pm_runtime_get_sync also be called automatically. CC: Minghsiu Tsai Signed-off-by: Yong Wu Reviewed-by: Evan Green --- drivers/media/platform/mtk-mdp/mtk_mdp_comp.c | 38 --------------------------- drivers/media/platform/mtk-mdp/mtk_mdp_comp.h | 2 -- drivers/media/platform/mtk-mdp/mtk_mdp_core.c | 1 - 3 files changed, 41 deletions(-) diff --git a/drivers/media/platform/mtk-mdp/mtk_mdp_comp.c b/drivers/media/platform/mtk-mdp/mtk_mdp_comp.c index 9afe816..5985a9b 100644 --- a/drivers/media/platform/mtk-mdp/mtk_mdp_comp.c +++ b/drivers/media/platform/mtk-mdp/mtk_mdp_comp.c @@ -9,7 +9,6 @@ #include #include #include -#include #include "mtk_mdp_comp.h" @@ -58,14 +57,6 @@ void mtk_mdp_comp_clock_on(struct device *dev, struct mtk_mdp_comp *comp) { int i, err; - if (comp->larb_dev) { - err = mtk_smi_larb_get(comp->larb_dev); - if (err) - dev_err(dev, - "failed to get larb, err %d. type:%d id:%d\n", - err, comp->type, comp->id); - } - for (i = 0; i < ARRAY_SIZE(comp->clk); i++) { if (IS_ERR(comp->clk[i])) continue; @@ -86,16 +77,11 @@ void mtk_mdp_comp_clock_off(struct device *dev, struct mtk_mdp_comp *comp) continue; clk_disable_unprepare(comp->clk[i]); } - - if (comp->larb_dev) - mtk_smi_larb_put(comp->larb_dev); } int mtk_mdp_comp_init(struct device *dev, struct device_node *node, struct mtk_mdp_comp *comp, enum mtk_mdp_comp_id comp_id) { - struct device_node *larb_node; - struct platform_device *larb_pdev; int i; if (comp_id < 0 || comp_id >= MTK_MDP_COMP_ID_MAX) { @@ -116,30 +102,6 @@ int mtk_mdp_comp_init(struct device *dev, struct device_node *node, break; } - /* Only DMA capable components need the LARB property */ - comp->larb_dev = NULL; - if (comp->type != MTK_MDP_RDMA && - comp->type != MTK_MDP_WDMA && - comp->type != MTK_MDP_WROT) - return 0; - - larb_node = of_parse_phandle(node, "mediatek,larb", 0); - if (!larb_node) { - dev_err(dev, - "Missing mediadek,larb phandle in %pOF node\n", node); - return -EINVAL; - } - - larb_pdev = of_find_device_by_node(larb_node); - if (!larb_pdev) { - dev_warn(dev, "Waiting for larb device %pOF\n", larb_node); - of_node_put(larb_node); - return -EPROBE_DEFER; - } - of_node_put(larb_node); - - comp->larb_dev = &larb_pdev->dev; - return 0; } diff --git a/drivers/media/platform/mtk-mdp/mtk_mdp_comp.h b/drivers/media/platform/mtk-mdp/mtk_mdp_comp.h index 998a4b9..a2da8df 100644 --- a/drivers/media/platform/mtk-mdp/mtk_mdp_comp.h +++ b/drivers/media/platform/mtk-mdp/mtk_mdp_comp.h @@ -39,7 +39,6 @@ enum mtk_mdp_comp_id { * @dev_node: component device node * @clk: clocks required for component * @regs: Mapped address of component registers. - * @larb_dev: SMI device required for component * @type: component type * @id: component ID */ @@ -47,7 +46,6 @@ struct mtk_mdp_comp { struct device_node *dev_node; struct clk *clk[2]; void __iomem *regs; - struct device *larb_dev; enum mtk_mdp_comp_type type; enum mtk_mdp_comp_id id; }; diff --git a/drivers/media/platform/mtk-mdp/mtk_mdp_core.c b/drivers/media/platform/mtk-mdp/mtk_mdp_core.c index fc9faec..c237ed9 100644 --- a/drivers/media/platform/mtk-mdp/mtk_mdp_core.c +++ b/drivers/media/platform/mtk-mdp/mtk_mdp_core.c @@ -17,7 +17,6 @@ #include #include #include -#include #include "mtk_mdp_core.h" #include "mtk_mdp_m2m.h" -- 1.9.1