Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp4370271rwd; Tue, 23 May 2023 06:59:11 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7BxhEN1gSH/GZPKuWi4Nsf1XzJocEXf/3oKKh0+rLORbExE/cozfbKpeh962hYcbVP3qKQ X-Received: by 2002:a05:6a00:1594:b0:641:558:8e2e with SMTP id u20-20020a056a00159400b0064105588e2emr19969246pfk.15.1684850351006; Tue, 23 May 2023 06:59:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684850350; cv=none; d=google.com; s=arc-20160816; b=FHjP26xEgWSTTAV9X15ld8QXdK/8UOMHUBzfNZvdBK3oHExumf6MSaS+IH8dVk17yj vAMbXWvrkt8RqZGZ9D/KK1UAgiXA0yOp+EuK2P9+Qsqjh/pxo+l7MKhSDuCpxh1jepmG KC2w0iYVDTP+6UCrV+8xdTspSVaRSoQKhdchQLLgCAfaGEFmZtHPI9OxyeZ4aIfm+THZ HNbVk0ygGawaZ66mh2CM9f8TW7WBZj52KecmTMxKb4LYeu8SCL8eZCtPJEsBPo2mSVRV 5w/iiW7i5RDqI6I5Vv2B71mCR84pPXGnX4erYwPXon21F/R4s8iqmlaHzaqvesPAvykJ jenQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=qcIGKcZIb5cUrNAdB7ZZAIiITgzMPRGFSQuzjV413Y4=; b=fcaMNHb8P2grFVxkJ0p+VeqSXrmTuUFqfTvnV1qTEIpX3xawdT5yg+p7J06Wv/xxdd FD8Zt1NEplqZdtVhwQ6iOB62Vv5PZdbMJG2OXGcixiIIveO5XgVvjOIPReWANoXmRuSd sHiz5w76HKRIpIDsMFz2I14/NLpOEsuq0N/CaWnyYWTlF+gUR9n2mZIVle3Xc9ijpmqB sJ36r642EgMSxtzCUnGfCq3bKJ15YNJSgnd4qwCR/6CLhlV7BRNSJ9/NUvc8bZvd/D2X 1Q2Vb8653GGdwPPcqUzyM7rbRCBaW6WVwzS4xYvOoPJMVDEVLTkwPK8XuCXSH+nqClhv b7UA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sberdevices.ru header.s=mail header.b=GISDTv73; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=sberdevices.ru Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c63-20020a633542000000b0051f74e18927si803424pga.184.2023.05.23.06.58.57; Tue, 23 May 2023 06:59:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@sberdevices.ru header.s=mail header.b=GISDTv73; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=sberdevices.ru Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237029AbjEWNyQ (ORCPT + 99 others); Tue, 23 May 2023 09:54:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37898 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237007AbjEWNyH (ORCPT ); Tue, 23 May 2023 09:54:07 -0400 Received: from mx.sberdevices.ru (mx.sberdevices.ru [45.89.227.171]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E98C0E9; Tue, 23 May 2023 06:54:03 -0700 (PDT) Received: from s-lin-edge02.sberdevices.ru (localhost [127.0.0.1]) by mx.sberdevices.ru (Postfix) with ESMTP id 479715FD65; Tue, 23 May 2023 16:54:02 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sberdevices.ru; s=mail; t=1684850042; bh=qcIGKcZIb5cUrNAdB7ZZAIiITgzMPRGFSQuzjV413Y4=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type; b=GISDTv73zFtfRebTlG8zJm4c59zAOD5oaTHD9ca4uNEBiloa8vF+IeBEj+ZKT1D/a lZJW/8IK8SR0MU4u+6IOkC18fRqKM/GiQFU7rbuJyvcf8KJ4SZd7F8wG/RM2kwIb15 D9BpF468uDRmwH4RDnYguT4ogBwe+cWhXXjlgRhIFRarlA8xMp7jauUxwyRvUYGZyY r5bOGaxHN1hSnCqOITVqExIHHml2aVgFmuNF9f1Z0qmSjXc1gy8z/fkMDVGFGxC6+Y /+9Hq1+VZ5Kn6azQX1sJwnJI1YV1fwh9jHBHACKPBKNIBzmB/O9LGC896M+CLq0JhO 3hS73RAkPCoHw== Received: from S-MS-EXCH01.sberdevices.ru (S-MS-EXCH01.sberdevices.ru [172.16.1.4]) by mx.sberdevices.ru (Postfix) with ESMTP; Tue, 23 May 2023 16:54:02 +0300 (MSK) From: Dmitry Rokosov To: , , , , , , , CC: , , , , , , , , Dmitry Rokosov Subject: [PATCH v16 1/6] clk: meson: make pll rst bit as optional Date: Tue, 23 May 2023 16:53:46 +0300 Message-ID: <20230523135351.19133-2-ddrokosov@sberdevices.ru> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20230523135351.19133-1-ddrokosov@sberdevices.ru> References: <20230523135351.19133-1-ddrokosov@sberdevices.ru> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [172.16.1.6] X-ClientProxiedBy: S-MS-EXCH02.sberdevices.ru (172.16.1.5) To S-MS-EXCH01.sberdevices.ru (172.16.1.4) X-KSMG-Rule-ID: 4 X-KSMG-Message-Action: clean X-KSMG-AntiSpam-Status: not scanned, disabled by settings X-KSMG-AntiSpam-Interceptor-Info: not scanned X-KSMG-AntiPhishing: not scanned, disabled by settings X-KSMG-AntiVirus: Kaspersky Secure Mail Gateway, version 1.1.2.30, bases: 2023/05/23 12:15:00 #21372692 X-KSMG-AntiVirus-Status: Clean, skipped X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Compared with the previous SoCs, self-adaption current module is newly added for A1, and there is no reset parameter except the fixed pll. Since we use clk-pll generic driver for A1 pll implementation, rst bit should be optional to support new behavior. Signed-off-by: Jian Hu Acked-by: Martin Blumenstingl Signed-off-by: Dmitry Rokosov --- drivers/clk/meson/clk-pll.c | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/drivers/clk/meson/clk-pll.c b/drivers/clk/meson/clk-pll.c index afefeba6e458..314ca945a4d0 100644 --- a/drivers/clk/meson/clk-pll.c +++ b/drivers/clk/meson/clk-pll.c @@ -295,10 +295,14 @@ static int meson_clk_pll_init(struct clk_hw *hw) struct meson_clk_pll_data *pll = meson_clk_pll_data(clk); if (pll->init_count) { - meson_parm_write(clk->map, &pll->rst, 1); + if (MESON_PARM_APPLICABLE(&pll->rst)) + meson_parm_write(clk->map, &pll->rst, 1); + regmap_multi_reg_write(clk->map, pll->init_regs, pll->init_count); - meson_parm_write(clk->map, &pll->rst, 0); + + if (MESON_PARM_APPLICABLE(&pll->rst)) + meson_parm_write(clk->map, &pll->rst, 0); } return 0; @@ -309,8 +313,11 @@ static int meson_clk_pll_is_enabled(struct clk_hw *hw) struct clk_regmap *clk = to_clk_regmap(hw); struct meson_clk_pll_data *pll = meson_clk_pll_data(clk); - if (meson_parm_read(clk->map, &pll->rst) || - !meson_parm_read(clk->map, &pll->en) || + if (MESON_PARM_APPLICABLE(&pll->rst) && + meson_parm_read(clk->map, &pll->rst)) + return 0; + + if (!meson_parm_read(clk->map, &pll->en) || !meson_parm_read(clk->map, &pll->l)) return 0; @@ -341,13 +348,15 @@ static int meson_clk_pll_enable(struct clk_hw *hw) return 0; /* Make sure the pll is in reset */ - meson_parm_write(clk->map, &pll->rst, 1); + if (MESON_PARM_APPLICABLE(&pll->rst)) + meson_parm_write(clk->map, &pll->rst, 1); /* Enable the pll */ meson_parm_write(clk->map, &pll->en, 1); /* Take the pll out reset */ - meson_parm_write(clk->map, &pll->rst, 0); + if (MESON_PARM_APPLICABLE(&pll->rst)) + meson_parm_write(clk->map, &pll->rst, 0); if (meson_clk_pll_wait_lock(hw)) return -EIO; @@ -361,7 +370,8 @@ static void meson_clk_pll_disable(struct clk_hw *hw) struct meson_clk_pll_data *pll = meson_clk_pll_data(clk); /* Put the pll is in reset */ - meson_parm_write(clk->map, &pll->rst, 1); + if (MESON_PARM_APPLICABLE(&pll->rst)) + meson_parm_write(clk->map, &pll->rst, 1); /* Disable the pll */ meson_parm_write(clk->map, &pll->en, 0); -- 2.36.0