linux-mediatek.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Yong Wu <yong.wu@mediatek.com>
To: Matthias Brugger <matthias.bgg@gmail.com>,
	Joerg Roedel <joro@8bytes.org>,  Rob Herring <robh+dt@kernel.org>,
	Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>,
	David Airlie <airlied@linux.ie>,
	"Mauro Carvalho Chehab" <mchehab@kernel.org>
Cc: Dafna Hirschfeld <dafna.hirschfeld@collabora.com>,
	Chun-Kuang Hu <chunkuang.hu@kernel.org>,
	Will Deacon <will.deacon@arm.com>,
	dri-devel@lists.freedesktop.org, yf.wang@mediatek.com,
	anthony.huang@mediatek.com, youlin.pei@mediatek.com,
	Evan Green <evgreen@chromium.org>,
	Eizan Miyamoto <eizan@chromium.org>,
	Matthias Kaehlcke <mka@chromium.org>,
	linux-arm-kernel@lists.infradead.org, mingyuan.ma@mediatek.com,
	linux-media@vger.kernel.org, devicetree@vger.kernel.org,
	Philipp Zabel <p.zabel@pengutronix.de>,
	libo.kang@mediatek.com, yi.kuo@mediatek.com,
	linux-mediatek@lists.infradead.org,
	Houlong Wei <houlong.wei@mediatek.com>,
	Hsin-Yi Wang <hsinyi@chromium.org>,
	Tiffany Lin <tiffany.lin@mediatek.com>,
	yong.wu@mediatek.com, anan.sun@mediatek.com,
	srv_heupstream@mediatek.com, acourbot@chromium.org,
	Minghsiu Tsai <minghsiu.tsai@mediatek.com>,
	linux-kernel@vger.kernel.org, Tomasz Figa <tfiga@chromium.org>,
	iommu@lists.linux-foundation.org, Daniel Vetter <daniel@ffwll.ch>,
	Robin Murphy <robin.murphy@arm.com>
Subject: [PATCH v9 07/15] media: mtk-mdp: Get rid of mtk_smi_larb_get/put
Date: Fri, 12 Nov 2021 18:55:01 +0800	[thread overview]
Message-ID: <20211112105509.12010-8-yong.wu@mediatek.com> (raw)
In-Reply-To: <20211112105509.12010-1-yong.wu@mediatek.com>

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 <minghsiu.tsai@mediatek.com>
CC: Houlong Wei <houlong.wei@mediatek.com>
Signed-off-by: Yong Wu <yong.wu@mediatek.com>
Reviewed-by: Evan Green <evgreen@chromium.org>
Reviewed-by: Houlong Wei <houlong.wei@mediatek.com>
Reviewed-by: Dafna Hirschfeld <dafna.hirschfeld@collabora.com>
---
 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 <linux/of.h>
 #include <linux/of_address.h>
 #include <linux/of_platform.h>
-#include <soc/mediatek/smi.h>
 
 #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 <linux/platform_device.h>
 #include <linux/pm_runtime.h>
 #include <linux/workqueue.h>
-#include <soc/mediatek/smi.h>
 
 #include "mtk_mdp_core.h"
 #include "mtk_mdp_m2m.h"
-- 
2.18.0


_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek

  parent reply	other threads:[~2021-11-12 11:08 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-12 10:54 [PATCH v9 00/15] Clean up "mediatek,larb" Yong Wu
2021-11-12 10:54 ` [PATCH v9 01/15] dt-binding: mediatek: Get rid of mediatek, larb for multimedia HW Yong Wu
2022-01-11 10:57   ` AngeloGioacchino Del Regno
2021-11-12 10:54 ` [PATCH v9 02/15] iommu/mediatek-v1: Free the existed fwspec if the master dev already has Yong Wu
2022-01-11 10:57   ` AngeloGioacchino Del Regno
2021-11-12 10:54 ` [PATCH v9 03/15] iommu/mediatek: Return ENODEV if the device is NULL Yong Wu
2022-01-11 10:57   ` AngeloGioacchino Del Regno
2021-11-12 10:54 ` [PATCH v9 04/15] iommu/mediatek: Add probe_defer for smi-larb Yong Wu
2022-01-11 10:57   ` AngeloGioacchino Del Regno
2021-11-12 10:54 ` [PATCH v9 05/15] iommu/mediatek: Add device_link between the consumer and the larb devices Yong Wu
2022-01-11 10:57   ` AngeloGioacchino Del Regno
2021-11-12 10:55 ` [PATCH v9 06/15] media: mtk-jpeg: Get rid of mtk_smi_larb_get/put Yong Wu
2022-01-11 10:57   ` AngeloGioacchino Del Regno
2021-11-12 10:55 ` Yong Wu [this message]
2022-01-11 10:57   ` [PATCH v9 07/15] media: mtk-mdp: " AngeloGioacchino Del Regno
2021-11-12 10:55 ` [PATCH v9 08/15] drm/mediatek: Add pm runtime support for ovl and rdma Yong Wu
2022-01-11 10:57   ` AngeloGioacchino Del Regno
2021-11-12 10:55 ` [PATCH v9 09/15] drm/mediatek: Get rid of mtk_smi_larb_get/put Yong Wu
2022-01-11 10:57   ` AngeloGioacchino Del Regno
2021-11-12 10:55 ` [PATCH v9 10/15] media: mtk-vcodec: " Yong Wu
2022-01-11 10:57   ` AngeloGioacchino Del Regno
2021-11-12 10:55 ` [PATCH v9 11/15] media: mtk-vcodec: dec: Remove mtk_vcodec_release_dec_pm Yong Wu
2022-01-11 10:57   ` AngeloGioacchino Del Regno
2021-11-12 10:55 ` [PATCH v9 12/15] media: mtk-vcodec: enc: Remove mtk_vcodec_release_enc_pm Yong Wu
2022-01-11 10:57   ` AngeloGioacchino Del Regno
2022-01-13 10:11     ` AngeloGioacchino Del Regno
2022-01-13 10:15       ` Hans Verkuil
2022-01-13 10:17         ` AngeloGioacchino Del Regno
2022-01-13 16:10         ` Matthias Brugger
2022-01-17  9:41           ` Yong Wu
2022-01-21 11:56           ` Hans Verkuil
2021-11-12 10:55 ` [PATCH v9 13/15] memory: mtk-smi: Get rid of mtk_smi_larb_get/put Yong Wu
2022-01-11 10:57   ` AngeloGioacchino Del Regno
2021-11-12 10:55 ` [PATCH v9 14/15] arm: dts: mediatek: Get rid of mediatek, larb for MM nodes Yong Wu
2021-11-12 10:55 ` [PATCH v9 15/15] arm64: " Yong Wu
2022-01-11 10:57   ` AngeloGioacchino Del Regno
2021-12-06 11:52 ` [PATCH v9 00/15] Clean up "mediatek,larb" Joerg Roedel
2021-12-06 12:33   ` Hans Verkuil
2021-12-06 13:48     ` Joerg Roedel
2021-12-06 12:23 ` Hans Verkuil
2021-12-06 13:06   ` Hsin-Yi Wang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211112105509.12010-8-yong.wu@mediatek.com \
    --to=yong.wu@mediatek.com \
    --cc=acourbot@chromium.org \
    --cc=airlied@linux.ie \
    --cc=anan.sun@mediatek.com \
    --cc=anthony.huang@mediatek.com \
    --cc=chunkuang.hu@kernel.org \
    --cc=dafna.hirschfeld@collabora.com \
    --cc=daniel@ffwll.ch \
    --cc=devicetree@vger.kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=eizan@chromium.org \
    --cc=evgreen@chromium.org \
    --cc=houlong.wei@mediatek.com \
    --cc=hsinyi@chromium.org \
    --cc=iommu@lists.linux-foundation.org \
    --cc=joro@8bytes.org \
    --cc=krzysztof.kozlowski@canonical.com \
    --cc=libo.kang@mediatek.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=matthias.bgg@gmail.com \
    --cc=mchehab@kernel.org \
    --cc=minghsiu.tsai@mediatek.com \
    --cc=mingyuan.ma@mediatek.com \
    --cc=mka@chromium.org \
    --cc=p.zabel@pengutronix.de \
    --cc=robh+dt@kernel.org \
    --cc=robin.murphy@arm.com \
    --cc=srv_heupstream@mediatek.com \
    --cc=tfiga@chromium.org \
    --cc=tiffany.lin@mediatek.com \
    --cc=will.deacon@arm.com \
    --cc=yf.wang@mediatek.com \
    --cc=yi.kuo@mediatek.com \
    --cc=youlin.pei@mediatek.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).