Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp175809pxb; Tue, 28 Sep 2021 18:40:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzyxJpAhgAKyb1fYFl25UuRZlvgiVtCYmJvtHeawh4ZT29+Vmxgghpqyt/sQ94ppFCbgSSa X-Received: by 2002:a17:906:1601:: with SMTP id m1mr10709113ejd.485.1632879653365; Tue, 28 Sep 2021 18:40:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632879653; cv=none; d=google.com; s=arc-20160816; b=tiIJzOUcoRdKybVGapUoEZVVMThfY2qaEIEnHXcDa4oj5MS+B3PH2+rpHcHq+MeZU7 2oJqi2VPWolJc9haekkeMQevymw4mPny+oLADvFkMJBm3dePS/wDchg/3pD5OLNtZhVw ADwfIERpKWYnURzrJfNdMQ3jXmwjV9nJ7bD/k1pWb/dwpO5I893UJoCIcrjKo6RcCkiw lUwSyLvHDkgyYtfc48o2p6xQRVVkoabpMJIMTRmhFEndIuO4Rji4nsPMXrPybheSmbBC vZkUBaegGFXZjktIMqPRXKChj+h7xzIE68Xhtj6Dp3MAD2cGhdiNNNd97POS+mTBu++p l/uA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from; bh=GDv92bgW4tknldEuIiVOiNTE2FAJ7OFE4OjytgsUeSE=; b=hiD8j/oeuULgDKM19cGsPTRS1JIRBcsKiXIyUpoSCaOSKGdzUHr0zfgKDZLRlJj/vN 68Y6si586+xQoa3l4K5mGoccodGJB41wfh53JG8P6JjF2CMp+bVpZDLuEA81dOMRpUff iwSTwguWnAJgF/+lbxNzRwFrlTimWO3AcWEz0NiU/GHsWws2fB50tJ3FOneO22aUchas V5Yoe3DX1H/vubPpEE7BrB09wPxM18u1cXIekyELrFmorkPNx5keu8mRROzqw/IMMOFe eJxW+gLPw82Bb0dQLHLQn3JHytRDjRdWvKa7wOqs6d1QY3K/R3aqNbqBp5kGyG2UUwG/ B+QQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id h10si971019ejl.180.2021.09.28.18.40.29; Tue, 28 Sep 2021 18:40:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S243700AbhI2BkM (ORCPT + 99 others); Tue, 28 Sep 2021 21:40:12 -0400 Received: from mailgw01.mediatek.com ([60.244.123.138]:49708 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S243678AbhI2BkL (ORCPT ); Tue, 28 Sep 2021 21:40:11 -0400 X-UUID: 06f58a5907354dd7abbd40ca7aff1750-20210929 X-UUID: 06f58a5907354dd7abbd40ca7aff1750-20210929 Received: from mtkcas06.mediatek.inc [(172.21.101.30)] by mailgw01.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 2038775087; Wed, 29 Sep 2021 09:38:28 +0800 Received: from mtkcas07.mediatek.inc (172.21.101.84) by mtkmbs10n1.mediatek.inc (172.21.101.34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.2.792.15; Wed, 29 Sep 2021 09:38:26 +0800 Received: from localhost.localdomain (10.17.3.154) by mtkcas07.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Wed, 29 Sep 2021 09:38:24 +0800 From: Yong Wu To: Matthias Brugger , Joerg Roedel , Rob Herring , Krzysztof Kozlowski , David Airlie , "Mauro Carvalho Chehab" CC: Evan Green , Robin Murphy , Tomasz Figa , Will Deacon , , , , , , , , , Matthias Kaehlcke , , , , , , Daniel Vetter , Chun-Kuang Hu , Philipp Zabel , Tiffany Lin , "Dafna Hirschfeld" , Hsin-Yi Wang , Eizan Miyamoto , , Frank Wunderlich , Minghsiu Tsai , Houlong Wei Subject: [PATCH v8 06/12] media: mtk-mdp: Get rid of mtk_smi_larb_get/put Date: Wed, 29 Sep 2021 09:37:13 +0800 Message-ID: <20210929013719.25120-7-yong.wu@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20210929013719.25120-1-yong.wu@mediatek.com> References: <20210929013719.25120-1-yong.wu@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain X-MTK: N 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 CC: Houlong Wei Signed-off-by: Yong Wu Reviewed-by: Evan Green Reviewed-by: Houlong Wei Reviewed-by: Dafna Hirschfeld --- drivers/media/platform/mtk-mdp/mtk_mdp_comp.c | 40 ------------------- drivers/media/platform/mtk-mdp/mtk_mdp_comp.h | 2 - drivers/media/platform/mtk-mdp/mtk_mdp_core.c | 1 - 3 files changed, 43 deletions(-) diff --git a/drivers/media/platform/mtk-mdp/mtk_mdp_comp.c b/drivers/media/platform/mtk-mdp/mtk_mdp_comp.c index b3426a551bea..1e3833f1c9ae 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" @@ -18,14 +17,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\n", - err, comp->type); - } - for (i = 0; i < ARRAY_SIZE(comp->clk); i++) { if (IS_ERR(comp->clk[i])) continue; @@ -46,17 +37,12 @@ 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_type comp_type) { - struct device_node *larb_node; - struct platform_device *larb_pdev; int ret; int i; @@ -77,32 +63,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); - ret = -EINVAL; - goto put_dev; - } - - 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); - ret = -EPROBE_DEFER; - goto put_dev; - } - of_node_put(larb_node); - - comp->larb_dev = &larb_pdev->dev; - return 0; put_dev: diff --git a/drivers/media/platform/mtk-mdp/mtk_mdp_comp.h b/drivers/media/platform/mtk-mdp/mtk_mdp_comp.h index 7897766c96bb..ae41dd3cd72a 100644 --- a/drivers/media/platform/mtk-mdp/mtk_mdp_comp.h +++ b/drivers/media/platform/mtk-mdp/mtk_mdp_comp.h @@ -26,14 +26,12 @@ enum mtk_mdp_comp_type { * @node: list node to track sibing MDP components * @dev_node: component device node * @clk: clocks required for component - * @larb_dev: SMI device required for component * @type: component type */ struct mtk_mdp_comp { struct list_head node; struct device_node *dev_node; struct clk *clk[2]; - struct device *larb_dev; enum mtk_mdp_comp_type type; }; diff --git a/drivers/media/platform/mtk-mdp/mtk_mdp_core.c b/drivers/media/platform/mtk-mdp/mtk_mdp_core.c index 976aa1f4829b..70a8eab16863 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" -- 2.18.0