Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp537746rwr; Wed, 26 Apr 2023 02:59:16 -0700 (PDT) X-Google-Smtp-Source: AKy350aijMQqSz7JeYyroQE28ktJ/k6Z34ZU4HwNE7s+SuE7iUKrych0lZ3kqJv0udm8vNh9eCnI X-Received: by 2002:a17:903:2341:b0:1a1:b528:9bea with SMTP id c1-20020a170903234100b001a1b5289beamr25462979plh.50.1682503156446; Wed, 26 Apr 2023 02:59:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682503156; cv=none; d=google.com; s=arc-20160816; b=g1govgrDnRU6ysqOFcOAWzaYaNhpceadwBC3S7BkrDilJSfq+CrsJuWgAjHXruZmln Po50bkWM/g2qShA9c+IcUNzozOBpbyAX188eNuS/5wasEFkGLrfzlPrMIL4cO53T+2fz DcGFDaFw38jDXJEPKyrK0MgCBPIP49VhTnB7c1a4vHOEku76Om+RrPpKKAmp8S5t3fjp 4Zi7tdqHDBT0YoGWKVwRQey8j/2+8x9kEpoq5ruEtK4M5XV95jPwL8D0wisBTKclWLsn aqExbfcE6oVJni6fobjiOIX75wK015w58iueAlxkpAtQhPgqTd7XOqQV/SlD/DjoYp5Y B8PQ== 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=T1r/eKJKMQh7VwyH8l95zFzdxH05a3yKP+vSb6Pjx+F/4Th6idEsxRzusbPBdqVrW4 uSClpurKJXFgPrvWFmnqhq22W7GKOabDIEnqThdBmzswMOqximpjb2o40JFJnYmdANkn kQW6OphSdP8c02SklOrzRdbyS5PY2GxsL7Rs06vEgXb1yFhABzuD5r26NXsSrW+/lcS2 Me2Tk2hy24XHLclc3ErDodrMJWfAKYVDnob5s4GsG54mCBiuE0i2i5LomkmdbNAI9UUO mYrTSVGFMCcJ4Uk9/ZP5NRHkIjnno5pUFn9RsI+9PS0NLtQ+tQH7k1BbtRpwTCf/kus6 0Y1w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sberdevices.ru header.s=mail header.b=aXXG1eyX; 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 w8-20020a170902e88800b001a6a015c7d9si16644047plg.623.2023.04.26.02.59.02; Wed, 26 Apr 2023 02:59:16 -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=aXXG1eyX; 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 S240370AbjDZJ60 (ORCPT + 99 others); Wed, 26 Apr 2023 05:58:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40542 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239687AbjDZJ6T (ORCPT ); Wed, 26 Apr 2023 05:58:19 -0400 Received: from mx.sberdevices.ru (mx.sberdevices.ru [45.89.227.171]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F4069195; Wed, 26 Apr 2023 02:58:15 -0700 (PDT) Received: from s-lin-edge02.sberdevices.ru (localhost [127.0.0.1]) by mx.sberdevices.ru (Postfix) with ESMTP id 16EF45FD77; Wed, 26 Apr 2023 12:58:14 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sberdevices.ru; s=mail; t=1682503094; bh=qcIGKcZIb5cUrNAdB7ZZAIiITgzMPRGFSQuzjV413Y4=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type; b=aXXG1eyXPb7xQslBoCKpWpcqLUhB7w34c0+MiM4G8tldrPyl4gCqvAZpDm2u/SStV AIMPGuUxoppYnDGspWFuL/mS2AKP+2x3vx4Khi56TwaSqaz/nng+0g79SGr6tfEdk7 FTXPXoDqegZQqH77EjVyA9gU7H6itme18oKjV3EHByRDbmIFBR9RurT0TXKJSNcJHT 1lODbFBDLU2eiRyZZfJvAWAZt8FKP7CY/iqgTtkXnnMLPrr415L9hoS2FyMYsN9rSJ BbDg7OuqFKUbJh3Mo0gWeA/LzwF/3NQQ0rxWO+8R3EEN+CHP88yQNJVOSxUJqb6HBN gdePMcXUgPzXQ== Received: from S-MS-EXCH01.sberdevices.ru (S-MS-EXCH01.sberdevices.ru [172.16.1.4]) by mx.sberdevices.ru (Postfix) with ESMTP; Wed, 26 Apr 2023 12:58:14 +0300 (MSK) From: Dmitry Rokosov To: , , , , , , , CC: , , , , , , , , Dmitry Rokosov Subject: [PATCH v14 1/6] clk: meson: make pll rst bit as optional Date: Wed, 26 Apr 2023 12:58:00 +0300 Message-ID: <20230426095805.15338-2-ddrokosov@sberdevices.ru> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20230426095805.15338-1-ddrokosov@sberdevices.ru> References: <20230426095805.15338-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-EXCH01.sberdevices.ru (172.16.1.4) 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/04/26 04:45:00 #21166225 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