Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp2884729pxb; Mon, 17 Jan 2022 07:38:11 -0800 (PST) X-Google-Smtp-Source: ABdhPJz2O9RL20cIuv/Ft9DxWf7i2gfDtcZroHLEZ2amSn5bHvlMYqHE8pmBHxhkX6N4WlhIzG+l X-Received: by 2002:a63:8c49:: with SMTP id q9mr19402790pgn.425.1642433891208; Mon, 17 Jan 2022 07:38:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1642433891; cv=none; d=google.com; s=arc-20160816; b=exKnvs9OjnEaxPq6RrOpXSU8DZT7YKOcwcf8vk2FvgWCUTqAnV5sBLYUqkg3KEzEjM UixFnfdzxFSO/bgu4L76OXsXB0S9Mi9Mvji1DuIFnrL3jjOQ/qAUrQuaVLuYA2PO+MOW l71NavrarDDzlj3F+1WILx8AgRlQP6/1VchXp4VZRXbFEQ+Zqte5FzUh+QkMRuBfj8cd MKdKsUpjjKhhJRdpiIIR06daU2DqfCmVR31HqY2HH7jABSvEv+47ZclafSGRbydQRa6g McuaAvqMoLMY1i7bRO0+vK7VQD70D5KZZkMlveQn8Ofx9dRYAw4RTs/EiTCNKt77pOi/ i94w== 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=e4lGYYdZhHEAcBq8D5gOPlmgjUoSQjBDGepDJ+rjMHw=; b=ut98YkKXTCj4e2FZ9Syg71B5r27UPQd2vQo1qqAANCTAsWlcDE3KLLe5g3Y3ZVYd5h +TL7hMITcaLMmdbkvgyTyoc4qMeYf4CLwOI6HU2EqBmvw4NuWt47JwS8nk1jPW7SAXnd 30yuo0LXHuJBOL8pBQemzjaLX8PaZ3A4SnIE2dVvO8nDxMnuIUl2Qqdy+l/1w2g6QPp4 f/IbgsfgiUnLvSOBbRUOEqdZmOChUnVtIAAq6HwXQ0QttCEoWYhZVh5IKH2lV1cFsbcB ufvMDZ8vvOPdEIN7GLjeSfIC/iSyiJO1/VnjjK5M42kbkmooMC36RSJslYdVKUhgOIrS tP+g== 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 d5si207417plr.458.2022.01.17.07.37.58; Mon, 17 Jan 2022 07:38:11 -0800 (PST) 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 S237309AbiAQHGx (ORCPT + 99 others); Mon, 17 Jan 2022 02:06:53 -0500 Received: from mailgw01.mediatek.com ([60.244.123.138]:33790 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S237312AbiAQHGw (ORCPT ); Mon, 17 Jan 2022 02:06:52 -0500 X-UUID: abf7cd235ff74f2ab06acb21027c1e28-20220117 X-UUID: abf7cd235ff74f2ab06acb21027c1e28-20220117 Received: from mtkmbs10n2.mediatek.inc [(172.21.101.183)] by mailgw01.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 1984007011; Mon, 17 Jan 2022 15:06:50 +0800 Received: from mtkcas11.mediatek.inc (172.21.101.40) 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; Mon, 17 Jan 2022 15:06:49 +0800 Received: from localhost.localdomain (10.17.3.154) by mtkcas11.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Mon, 17 Jan 2022 15:06:47 +0800 From: Yong Wu To: Matthias Brugger , Hans Verkuil , 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 , , , , AngeloGioacchino Del Regno , Minghsiu Tsai , Houlong Wei Subject: [PATCH v10 07/13] media: mtk-mdp: Get rid of mtk_smi_larb_get/put Date: Mon, 17 Jan 2022 15:05:04 +0800 Message-ID: <20220117070510.17642-8-yong.wu@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20220117070510.17642-1-yong.wu@mediatek.com> References: <20220117070510.17642-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 calls 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 Reviewed-by: AngeloGioacchino Del Regno --- 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