Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp3445408pxt; Tue, 10 Aug 2021 03:56:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzCm2SsXC3PAiAEJRRG/Kd4m5cn+y2zgfzqppvNB5tFe8q8aLybu12yJr+2RxojKIrHyR/5 X-Received: by 2002:a05:6402:299:: with SMTP id l25mr4194787edv.283.1628592967310; Tue, 10 Aug 2021 03:56:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628592967; cv=none; d=google.com; s=arc-20160816; b=XIoAzi7GLRrr6AHDApr5fRhozJd6C4uOJ3DREx04koM4c907O7rJlyM//ucPMxTYDG cr+QjWJ9r3leVSNZDBRGhL4WARySaHI63HXRPtFBF/VevyboGxUNEwZasXwtxkGKJaz4 1Ah5/cSKeIkWQD8fNLua5ZDlYt0z/ioeT4NUCSYWgu0Gz2ymryV0WZ7Wl3PBAx9HqeQU No6GUp4zQgSWnYHsqVYf8yF8ML+wPW276Z2dYj2UQr30p2ew9AWlO84rnj4hBl8aJonE DvZwhhyVGUP+72mfGvtshKN5wF4iA/oN67qCR9yKmCYMJWsMBFxPp6LWraa9SpdRBu6V 5vvQ== 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=/eyyIU1oBGWzWE9Tz0yPcDWAJAKEyteL7J4enKQOz1w=; b=r7otgMjIs6GdIqweu4u6zQtH99Y7Wp7dGmOxo4UX0tDpze3m5EqqCPe1NcpFjTxhoj RYZwWZMBBrUZcF64xGLjheeKMKSekx70vWLwyi3uiISo+tG+9O0A95KvCF3i3vj8qKm7 PUp4SSg0oKROAYzmx+bN9+h5O+SGiZQE/4LVsCx1eirh8hXH9x/KI1wJtcC3d/QmHGaS qIsK2PjNtTkTLXP6D87sCemisIn2lD1BGTLKKn3PUhyX1OoRj9NwMScLKNigfYgbJw3R ksx1nkU+zQ/WYY4KFu6DaBMeu8QBblxsonwglXUwQZIPxB3vOYkYCMCgU6QgHS/6PfxE U//w== 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 r17si19675155edv.508.2021.08.10.03.55.40; Tue, 10 Aug 2021 03:56:07 -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 S238058AbhHJILs (ORCPT + 99 others); Tue, 10 Aug 2021 04:11:48 -0400 Received: from mailgw02.mediatek.com ([210.61.82.184]:51442 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S238027AbhHJILJ (ORCPT ); Tue, 10 Aug 2021 04:11:09 -0400 X-UUID: e28db6c3784f4f078437a7abe004c196-20210810 X-UUID: e28db6c3784f4f078437a7abe004c196-20210810 Received: from mtkmbs10n1.mediatek.inc [(172.21.101.34)] by mailgw02.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 1184281761; Tue, 10 Aug 2021 16:10:21 +0800 Received: from mtkcas10.mediatek.inc (172.21.101.39) by mtkmbs05n2.mediatek.inc (172.21.101.140) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 10 Aug 2021 16:10:20 +0800 Received: from localhost.localdomain (10.17.3.154) by mtkcas10.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Tue, 10 Aug 2021 16:10:19 +0800 From: Yong Wu To: Krzysztof Kozlowski , Rob Herring , Matthias Brugger CC: Krzysztof Kozlowski , Joerg Roedel , Will Deacon , Robin Murphy , Tomasz Figa , , , , , , , , , , , , , Ikjoon Jang Subject: [PATCH v3 08/13] memory: mtk-smi: Add clocks for smi-sub-common Date: Tue, 10 Aug 2021 16:08:54 +0800 Message-ID: <20210810080859.29511-9-yong.wu@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20210810080859.29511-1-yong.wu@mediatek.com> References: <20210810080859.29511-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 SMI sub common only have one output port. thus it has only one gals clocks(gals0). then, smi-sub-common require the three clocks(apb/smi/gals0) in has_gals case. Signed-off-by: Yong Wu --- drivers/memory/mtk-smi.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/memory/mtk-smi.c b/drivers/memory/mtk-smi.c index 5c2bd5795cfd..58d9f7667490 100644 --- a/drivers/memory/mtk-smi.c +++ b/drivers/memory/mtk-smi.c @@ -74,10 +74,12 @@ static const char * const mtk_smi_larb_clks[] = {"apb", "smi", "gals"}; /* * common: Require these four clocks in has_gals case. Otherwise, only apb/smi are required. + * sub common: Require apb/smi/gals0 clocks in has_gals case. Otherwise, only apb/smi are required. */ static const char * const mtk_smi_common_clks[] = {"apb", "smi", "gals0", "gals1"}; #define MTK_SMI_COM_REQ_CLK_NR 2 #define MTK_SMI_COM_GALS_REQ_CLK_NR MTK_SMI_CLK_NR_MAX +#define MTK_SMI_SUB_COM_GALS_REQ_CLK_NR 3 struct mtk_smi_common_plat { enum mtk_smi_type type; @@ -467,8 +469,12 @@ static int mtk_smi_common_probe(struct platform_device *pdev) common->dev = dev; common->plat = of_device_get_match_data(dev); - if (common->plat->has_gals) - clk_required = MTK_SMI_COM_GALS_REQ_CLK_NR; + if (common->plat->has_gals) { + if (common->plat->type == MTK_SMI_GEN2) + clk_required = MTK_SMI_COM_GALS_REQ_CLK_NR; + else if (common->plat->type == MTK_SMI_GEN2_SUB_COMM) + clk_required = MTK_SMI_SUB_COM_GALS_REQ_CLK_NR; + } ret = mtk_smi_dts_clk_init(dev, common, mtk_smi_common_clks, clk_required, 0); if (ret) return ret; -- 2.18.0