Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp177189pxb; Tue, 28 Sep 2021 18:43:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyCXziRenfQqVvLgDnCKnaxm6Qzpk3ikWR5wD7btYRVIYN+t3tAqMGS99JqzhKWpfRryLDD X-Received: by 2002:a05:6402:134d:: with SMTP id y13mr11655597edw.264.1632879797007; Tue, 28 Sep 2021 18:43:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632879797; cv=none; d=google.com; s=arc-20160816; b=MYKfZ8SRTJGEtXPA5D878wstudydKkX/U0gvdrxZIwUp1n+tvyXD4s6ZVyi5qd7i5F rTxBsexaz4AtIoJFfIvVAQQRc6FtNfRCOoLsUeKknfJuvXmxZ2/LfDojyC7Uq27Muhvu CFxsOyddxQqpjR2PXa83z6UU9j0NyLWk57qZLLSPmupbZPe4k1FhXzZS8yALj/qHs6BD cyjYo/xMc9Gftxe00TBbykP9f/XiOaTPFQmklxiNb5b8mbvobYXis+n0ajMDSoax8Gj0 Afy3bT1ia+jIkHXYzBCkfA9b4JTd5MuOC61ghnZR38fYcgKXD/EHn8Ga21wFiTs95DZm 25bw== 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=62AepHSWDhfOL9Vyzr/x6YD2Jf8m5UmpQ12VxE7ygLM=; b=MHgWiADWDhSm5sVVE8zOMds2ZKqvRq448NTQxbAHXopop+znPAcbJVqpwDJ52Dziik NK3jToOORYMZH1EzQRG4fG5p+9ZIH09y0jKdXJl1JS2FFJoZKZ8vo9Z38le937RUIpAC +4ARK81aCaCZbPafwAYMjY2aXnsyP6JTXtHEN3pB+gqEuF5x4kOLOPskBkaDMbEU3MUG nk+mwxM2Xi6vSQ1wulGrox16BQkMXyBr/JNOVCmfc0LhCHRpUaRrR3BlpxTKTSNj2j5z 1w/VwHBSi1evhV0YPzCnTaa804L4fLf/fmvHAOLaYYuu2A9aLfIa7SvDVrR3qX+IkXXU CLcQ== 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 x16si1522808edd.401.2021.09.28.18.42.53; Tue, 28 Sep 2021 18:43:16 -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 S243733AbhI2Bks (ORCPT + 99 others); Tue, 28 Sep 2021 21:40:48 -0400 Received: from mailgw01.mediatek.com ([60.244.123.138]:50590 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S243608AbhI2Bkr (ORCPT ); Tue, 28 Sep 2021 21:40:47 -0400 X-UUID: c0e175eb35ef424b96ba2f9fe2202180-20210929 X-UUID: c0e175eb35ef424b96ba2f9fe2202180-20210929 Received: from mtkmbs10n1.mediatek.inc [(172.21.101.34)] by mailgw01.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 1596382585; Wed, 29 Sep 2021 09:39:05 +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:39:00 +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:58 +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 Subject: [PATCH v8 10/12] memory: mtk-smi: Get rid of mtk_smi_larb_get/put Date: Wed, 29 Sep 2021 09:37:17 +0800 Message-ID: <20210929013719.25120-11-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 After adding device_link between the iommu consumer and smi-larb, the pm_runtime_get(_sync) of smi-larb and smi-common will be called automatically. we can get rid of mtk_smi_larb_get/put. CC: Matthias Brugger Signed-off-by: Yong Wu Reviewed-by: Evan Green Acked-by: Krzysztof Kozlowski Acked-by: Matthias Brugger Reviewed-by: Dafna Hirschfeld Tested-by: Frank Wunderlich # BPI-R2/MT7623 --- drivers/memory/mtk-smi.c | 14 -------------- include/soc/mediatek/smi.h | 20 -------------------- 2 files changed, 34 deletions(-) diff --git a/drivers/memory/mtk-smi.c b/drivers/memory/mtk-smi.c index c5fb51f73b34..7c61c924e220 100644 --- a/drivers/memory/mtk-smi.c +++ b/drivers/memory/mtk-smi.c @@ -134,20 +134,6 @@ static void mtk_smi_clk_disable(const struct mtk_smi *smi) clk_disable_unprepare(smi->clk_apb); } -int mtk_smi_larb_get(struct device *larbdev) -{ - int ret = pm_runtime_resume_and_get(larbdev); - - return (ret < 0) ? ret : 0; -} -EXPORT_SYMBOL_GPL(mtk_smi_larb_get); - -void mtk_smi_larb_put(struct device *larbdev) -{ - pm_runtime_put_sync(larbdev); -} -EXPORT_SYMBOL_GPL(mtk_smi_larb_put); - static int mtk_smi_larb_bind(struct device *dev, struct device *master, void *data) { diff --git a/include/soc/mediatek/smi.h b/include/soc/mediatek/smi.h index 15e3397cec58..11f7d6b59642 100644 --- a/include/soc/mediatek/smi.h +++ b/include/soc/mediatek/smi.h @@ -19,26 +19,6 @@ struct mtk_smi_larb_iommu { unsigned char bank[32]; }; -/* - * mtk_smi_larb_get: Enable the power domain and clocks for this local arbiter. - * It also initialize some basic setting(like iommu). - * mtk_smi_larb_put: Disable the power domain and clocks for this local arbiter. - * Both should be called in non-atomic context. - * - * Returns 0 if successful, negative on failure. - */ -int mtk_smi_larb_get(struct device *larbdev); -void mtk_smi_larb_put(struct device *larbdev); - -#else - -static inline int mtk_smi_larb_get(struct device *larbdev) -{ - return 0; -} - -static inline void mtk_smi_larb_put(struct device *larbdev) { } - #endif #endif -- 2.18.0