Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp6599689pxv; Thu, 29 Jul 2021 19:56:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyALkmdARquivnGKGPxeSStrLdqad0lYCHu7IsqLxLtWzPZkt396eHgkyglFvKTgV8wAPKz X-Received: by 2002:a05:6602:1587:: with SMTP id e7mr484006iow.112.1627613807365; Thu, 29 Jul 2021 19:56:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627613807; cv=none; d=google.com; s=arc-20160816; b=g1lH3JjFpLDCxRVWq4pBaabrAQNeZ8uo+C1seEyqKm0u1Tzm9LxrLt7b3sOghZlZXg +7qudVepcF/Qhn6odM9zzAwFmkqlyH0/xpV8vcyOp0xZ0cj8gl4FgYPyK2lUqJb0+0yB xKf+W75rLHypZLxwL8p9Rp9/xy3N+yUTce6vPtuvIE8sY8VKw6S8sAVwI4gGxWVwmYHj gPGoRBKWaMoyTCed6f0HXazkhtYCYouxnvfdFtPHxs8kfZ+nJ9bjKtyY9P4O9E8DvLg5 KUZUVujUDZO07ubInhCoL/WmGOgwMUViPqH/6aPFG8AhfRh7SjWZfd6YA3IAfgsqWayK JTYg== 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=fwnvrhaPA2rEa9YSQyt9QZ/wv+SON4HPDf09DtxZaB4=; b=dPZWp33/yoVX1eNjQ10gdT0D5fNH9+AQcrzlbHkNtYC9531uS05NqQCrcp/83SKt+A B2mEHtXgr0BKrwYnKMBjFVMIgFWZJB6OQeW/F8EOvQ26Whj6pNHfj4ETwAk94MjvdVd1 4LrVPGmR1eWWc1hrq2atIfSaDe9UqHRvufrY3JIuKBW+OzJ5oFc2q/cAs7xCeypkw0+G UU6hkRf0wCq3ZcCetpfiQmPQFGnwE9z5BuQCQX67ylF4FtwwsnqXbcc/nySLNwvTHJzX r4rBEXgL+04xhgFm6385RAxIjAKro0PFBtTa0+Q1b0MA7v5mKXwyMJkBNvj3MihthyA5 q3Cw== 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 g2si156952jat.88.2021.07.29.19.56.36; Thu, 29 Jul 2021 19:56:47 -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 S235929AbhG3CzY (ORCPT + 99 others); Thu, 29 Jul 2021 22:55:24 -0400 Received: from mailgw01.mediatek.com ([60.244.123.138]:50016 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S235531AbhG3CzY (ORCPT ); Thu, 29 Jul 2021 22:55:24 -0400 X-UUID: 6d94210d00414fb2a086e6ccc9a6951a-20210730 X-UUID: 6d94210d00414fb2a086e6ccc9a6951a-20210730 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 254899857; Fri, 30 Jul 2021 10:55:16 +0800 Received: from MTKCAS06.mediatek.inc (172.21.101.30) by mtkmbs07n2.mediatek.inc (172.21.101.141) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Fri, 30 Jul 2021 10:55:14 +0800 Received: from localhost.localdomain (10.17.3.153) by MTKCAS06.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Fri, 30 Jul 2021 10:55:09 +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 , , , , , , , , , Nicolas Boichat , Matthias Kaehlcke , , , , , , , Daniel Vetter , Chun-Kuang Hu , Philipp Zabel , Xia Jiang , Tiffany Lin , Dafna Hirschfeld , Hsin-Yi Wang , Eizan Miyamoto , , Frank Wunderlich Subject: [PATCH v7 10/12] memory: mtk-smi: Get rid of mtk_smi_larb_get/put Date: Fri, 30 Jul 2021 10:52:36 +0800 Message-ID: <20210730025238.22456-11-yong.wu@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20210730025238.22456-1-yong.wu@mediatek.com> References: <20210730025238.22456-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: Dafna Hirschfeld # on mt8173 --- 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