Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp11538579imu; Tue, 1 Jan 2019 01:23:55 -0800 (PST) X-Google-Smtp-Source: ALg8bN4sDyTe6sdiA9/zkxYkpx4YCaluxknGe3JGjPLc9ApwxR7b51yGKH8564+tZoHRXy337kMK X-Received: by 2002:a63:30c8:: with SMTP id w191mr10349867pgw.120.1546334635236; Tue, 01 Jan 2019 01:23:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546334635; cv=none; d=google.com; s=arc-20160816; b=xoN822jqKam+e0PcEp1o/ucibwuODRygqmij2KRqOfcZMRUYB1Rw7Wo19cEFhen2F4 TEmh9SvORd3yicDXioZ6DuBu3hzr8vFU68k4qAVGecFYkZy3uUN48lRxAPrKbfETLCRQ fqoo6rSJyifY7VDiSLkR/BK0zNz0B1S7ghrJiMzGjpeiVcH3s6wHOCxM+yRKe83hQki/ hWi6Nest1jhT73J2O74uIeoR1Nd2xoswsugxB0zM7eCnknYIKguo3x5Fj4sLzfIUOIAQ hOrfjbYQZTV2uTvdG7Y5Favowa1LAtK0mlKy7Z23EgF362cyuDF+4k/eFWUg8Stq5hnt B2UQ== 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=VqxUtw3wHJKmg8h9bWOdCvLB7mz4QVPBUWZH0Zy76AI=; b=JIFXwBq9mHmS8PEe41pcviBOQlI+WG+HjffUz6LsoZptbzItyAl9zwByv5pOaEApQ9 LMBS9dN2MlhLGnjxiZDvSPruqVmLqq53Jvn4BSLl56H9dfsFx3Dmq9bakDJBIghFsxk1 3EkKsW0CU7NuT1TPpNOTdNmKRKvw8Slp8IYE0EfEzPfwsxti0PqD3JEcLH8t3wFH7r97 kqkdJVy69BffLy8z6l8Yoyjmya9pXalg1GzqTwA+WNFQ/uwavHEAAq5rLD8zxdIHuebP DfIu14V50U0gvdpmtMQd1mmhPJR5rFuDVBXutTxWwfLABBd5DV3FwnT423v55mS/pNn1 MA4Q== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j14si8812168pgg.44.2019.01.01.01.23.38; Tue, 01 Jan 2019 01:23:55 -0800 (PST) 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728528AbfAAEws (ORCPT + 99 others); Mon, 31 Dec 2018 23:52:48 -0500 Received: from mailgw02.mediatek.com ([210.61.82.184]:35546 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1728425AbfAAEwr (ORCPT ); Mon, 31 Dec 2018 23:52:47 -0500 X-UUID: 926d049c97d5449cac60646be8db4107-20190101 X-UUID: 926d049c97d5449cac60646be8db4107-20190101 Received: from mtkcas06.mediatek.inc [(172.21.101.30)] by mailgw02.mediatek.com (envelope-from ) (mhqrelay.mediatek.com ESMTP with TLS) with ESMTP id 345160631; Tue, 01 Jan 2019 12:52:42 +0800 Received: from mtkcas08.mediatek.inc (172.21.101.126) by mtkmbs08n1.mediatek.inc (172.21.101.55) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Tue, 1 Jan 2019 12:52:40 +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, 1 Jan 2019 12:52:40 +0800 From: Yong Wu To: Joerg Roedel , Greg Kroah-Hartman , Matthias Brugger , Rob Herring CC: Robin Murphy , Tomasz Figa , Will Deacon , , , , , , , , , , , Nicolas Boichat , Tiffany Lin Subject: [PATCH 08/13] media: mtk-vcodec: Get rid of mtk_smi_larb_get/put Date: Tue, 1 Jan 2019 12:51:11 +0800 Message-ID: <1546318276-18993-9-git-send-email-yong.wu@mediatek.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1546318276-18993-1-git-send-email-yong.wu@mediatek.com> References: <1546318276-18993-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 vcodec device call the pm_runtime_get_sync, the smi-larb's pm_runtime_get_sync also be called automatically. CC: Tiffany Lin Signed-off-by: Yong Wu --- .../media/platform/mtk-vcodec/mtk_vcodec_dec_pm.c | 19 ----------- drivers/media/platform/mtk-vcodec/mtk_vcodec_drv.h | 3 -- drivers/media/platform/mtk-vcodec/mtk_vcodec_enc.c | 1 - .../media/platform/mtk-vcodec/mtk_vcodec_enc_pm.c | 38 ---------------------- 4 files changed, 61 deletions(-) diff --git a/drivers/media/platform/mtk-vcodec/mtk_vcodec_dec_pm.c b/drivers/media/platform/mtk-vcodec/mtk_vcodec_dec_pm.c index 79ca03a..90e1641 100644 --- a/drivers/media/platform/mtk-vcodec/mtk_vcodec_dec_pm.c +++ b/drivers/media/platform/mtk-vcodec/mtk_vcodec_dec_pm.c @@ -16,7 +16,6 @@ #include #include #include -#include #include "mtk_vcodec_dec_pm.h" #include "mtk_vcodec_util.h" @@ -24,7 +23,6 @@ int mtk_vcodec_init_dec_pm(struct mtk_vcodec_dev *mtkdev) { - struct device_node *node; struct platform_device *pdev; struct mtk_vcodec_pm *pm; int ret = 0; @@ -32,18 +30,7 @@ int mtk_vcodec_init_dec_pm(struct mtk_vcodec_dev *mtkdev) pdev = mtkdev->plat_dev; pm = &mtkdev->pm; pm->mtkdev = mtkdev; - node = of_parse_phandle(pdev->dev.of_node, "mediatek,larb", 0); - if (!node) { - mtk_v4l2_err("of_parse_phandle mediatek,larb fail!"); - return -1; - } - pdev = of_find_device_by_node(node); - if (WARN_ON(!pdev)) { - of_node_put(node); - return -1; - } - pm->larbvdec = &pdev->dev; pdev = mtkdev->plat_dev; pm->dev = &pdev->dev; @@ -181,16 +168,10 @@ void mtk_vcodec_dec_clock_on(struct mtk_vcodec_pm *pm) ret = clk_set_parent(pm->vdec_sel, pm->vdecpll); if (ret) mtk_v4l2_err("clk_set_parent vdec_sel vdecpll fail %d", ret); - - ret = mtk_smi_larb_get(pm->larbvdec); - if (ret) - mtk_v4l2_err("mtk_smi_larb_get larbvdec fail %d", ret); - } void mtk_vcodec_dec_clock_off(struct mtk_vcodec_pm *pm) { - mtk_smi_larb_put(pm->larbvdec); clk_disable_unprepare(pm->vdec_sel); clk_disable_unprepare(pm->vdecpll); clk_disable_unprepare(pm->univpll_d2); diff --git a/drivers/media/platform/mtk-vcodec/mtk_vcodec_drv.h b/drivers/media/platform/mtk-vcodec/mtk_vcodec_drv.h index 3cffb38..2696e14 100644 --- a/drivers/media/platform/mtk-vcodec/mtk_vcodec_drv.h +++ b/drivers/media/platform/mtk-vcodec/mtk_vcodec_drv.h @@ -191,9 +191,6 @@ struct mtk_vcodec_pm { struct clk *venc_sel; struct clk *univpll1_d2; struct clk *venc_lt_sel; - struct device *larbvdec; - struct device *larbvenc; - struct device *larbvenclt; struct device *dev; struct mtk_vcodec_dev *mtkdev; }; diff --git a/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc.c b/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc.c index 54631ad..7401619 100644 --- a/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc.c +++ b/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc.c @@ -16,7 +16,6 @@ #include #include #include -#include #include "mtk_vcodec_drv.h" #include "mtk_vcodec_enc.h" diff --git a/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc_pm.c b/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc_pm.c index 3e73e9d..a3abd3d 100644 --- a/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc_pm.c +++ b/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc_pm.c @@ -16,7 +16,6 @@ #include #include #include -#include #include "mtk_vcodec_enc_pm.h" #include "mtk_vcodec_util.h" @@ -25,7 +24,6 @@ int mtk_vcodec_init_enc_pm(struct mtk_vcodec_dev *mtkdev) { - struct device_node *node; struct platform_device *pdev; struct device *dev; struct mtk_vcodec_pm *pm; @@ -38,31 +36,6 @@ int mtk_vcodec_init_enc_pm(struct mtk_vcodec_dev *mtkdev) pm->dev = &pdev->dev; dev = &pdev->dev; - node = of_parse_phandle(dev->of_node, "mediatek,larb", 0); - if (!node) { - mtk_v4l2_err("no mediatek,larb found"); - return -1; - } - pdev = of_find_device_by_node(node); - if (!pdev) { - mtk_v4l2_err("no mediatek,larb device found"); - return -1; - } - pm->larbvenc = &pdev->dev; - - node = of_parse_phandle(dev->of_node, "mediatek,larb", 1); - if (!node) { - mtk_v4l2_err("no mediatek,larb found"); - return -1; - } - - pdev = of_find_device_by_node(node); - if (!pdev) { - mtk_v4l2_err("no mediatek,larb device found"); - return -1; - } - - pm->larbvenclt = &pdev->dev; pdev = mtkdev->plat_dev; pm->dev = &pdev->dev; @@ -117,21 +90,10 @@ void mtk_vcodec_enc_clock_on(struct mtk_vcodec_pm *pm) ret = clk_set_parent(pm->venc_lt_sel, pm->univpll1_d2); if (ret) mtk_v4l2_err("clk_set_parent fail %d", ret); - - ret = mtk_smi_larb_get(pm->larbvenc); - if (ret) - mtk_v4l2_err("mtk_smi_larb_get larb3 fail %d", ret); - - ret = mtk_smi_larb_get(pm->larbvenclt); - if (ret) - mtk_v4l2_err("mtk_smi_larb_get larb4 fail %d", ret); - } void mtk_vcodec_enc_clock_off(struct mtk_vcodec_pm *pm) { - mtk_smi_larb_put(pm->larbvenc); - mtk_smi_larb_put(pm->larbvenclt); clk_disable_unprepare(pm->venc_lt_sel); clk_disable_unprepare(pm->venc_sel); } -- 1.9.1