Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp593059pxb; Tue, 14 Sep 2021 04:43:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwSxaiWU1ZzcNTV5lODbwJ3yk4zoSaf8Ph4tUiuoFeq2aWQyc8gaSKB5YTvtUDDGZF3bBWS X-Received: by 2002:a17:906:6691:: with SMTP id z17mr18283398ejo.207.1631619789791; Tue, 14 Sep 2021 04:43:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631619789; cv=none; d=google.com; s=arc-20160816; b=kGtmWf12OEeQnEUZnDtUhX7M++oFhSpE6dAVXWjQtvfjX040k4O2SqseIuCzw/s5C7 P7hWDCUyBXui++h+WUmH6vEzbyiEf11WFamM/xwAHcelvXgM/wJzYGa2CMJIeKxlBncF RtlSdC7ICHu3apFGvi2+lzqnkELjjDydZaonYjy3zcPAGDPPsKOnI4XwtRiTaNJHl9wi uRRdVnAsOQosVuRdsWJItKY34/qNGXcB6gf033gigXP0Gk5j6ERX/3/hcgG/0qTX0v0+ nYtxWH3u2TNHz+AbmIQFuIDTSv8zbHc3abJiy4LwdbmBylMj8xZzfMiW5czSqEIoExyU 9vfw== 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=iZVLcLpD3Sure+vBlJ3gAmFIITxfGgxrb0Z5teLKu7L3eLcOTxNaluY2RDR4FPXyT9 mxuajfXuK31thF9W6zFWsK/dRnxsyQ78PGiy9QwuQA+mf7t1IIdkySNdqF7jpgmy7rKf mrTNCyhW3LdDDaaj8rGjwqPc3QLYPdkbQNhhiYkPhFY0+fKUuutWBdsqc43eQrwTqVGG grK04QV/APlWYR48G16kxdhN+FhAjI2Uri3lxthzw77kwmI8fOU1XIuLYsd9t3PLwQsr trUNf1RwU6UGlr+BjSAqdzyn4U5ezjOFU8LOhUvGo0uTDBbBLxqv6HnZN+lCj7F0RYk1 nDtw== 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 v14si10365348eds.576.2021.09.14.04.42.45; Tue, 14 Sep 2021 04:43:09 -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 S232288AbhINLjy (ORCPT + 99 others); Tue, 14 Sep 2021 07:39:54 -0400 Received: from mailgw01.mediatek.com ([60.244.123.138]:33998 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S232315AbhINLjv (ORCPT ); Tue, 14 Sep 2021 07:39:51 -0400 X-UUID: 9d4fdacea83f420abf6148afd9c6bb49-20210914 X-UUID: 9d4fdacea83f420abf6148afd9c6bb49-20210914 Received: from mtkcas06.mediatek.inc [(172.21.101.30)] by mailgw01.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 1173733147; Tue, 14 Sep 2021 19:38:31 +0800 Received: from mtkcas07.mediatek.inc (172.21.101.84) by mtkmbs07n2.mediatek.inc (172.21.101.141) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 14 Sep 2021 19:38:30 +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; Tue, 14 Sep 2021 19:38:29 +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 v4 08/13] memory: mtk-smi: Add clocks for smi-sub-common Date: Tue, 14 Sep 2021 19:36:58 +0800 Message-ID: <20210914113703.31466-9-yong.wu@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20210914113703.31466-1-yong.wu@mediatek.com> References: <20210914113703.31466-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