Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp665548rdb; Tue, 5 Dec 2023 16:57:54 -0800 (PST) X-Google-Smtp-Source: AGHT+IE13O8ahqIbwH2vlrFtg8taRoqFE1reXtXt+jJtND3w+bRg4k8xYv2SMjqC6I1c8o3hpYxr X-Received: by 2002:a17:90b:1b12:b0:286:cc3d:9df8 with SMTP id nu18-20020a17090b1b1200b00286cc3d9df8mr163818pjb.16.1701824273800; Tue, 05 Dec 2023 16:57:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701824273; cv=none; d=google.com; s=arc-20160816; b=PU42+bocncUKk4E/ThRkAYqMniIftWzBuvJPdGAftaN09Wth3sWkZvSTWyJVP1W5XN Ah/+ADkE0i96vKZJavrJrOtVqDvbqKX+78BK3PUCfuUL4oIU2MEJPcEtoIZmM1Px1osq BimcnaC/+VnYfseLHqnf5YXSZYRxuOHSrGbiP9BpzeYNuZAsLUTxPVd8eiuq/TOlNrDN 5ARGVkYwVQP3RnETayFriSf6Jym+z5DhJpGIAp4b8o0SkOJkVxAEOz78u1ATsQcvMgWs ZPu+zSL9rjIceSQDBXagPsX7hwHhK5EtgHXw+yd5Gnfv9bFpXj/6vaeWW2/KXFmiWJEU nfxg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:to:from:date; bh=YnQkDBSBMeJbc9YYrbQWZJ/dmCkXIqy05IXoTh7gku0=; fh=c42LVhuUkr+o7mWDW8QvYc6yvOZbRLq3bfcFbTPxJEU=; b=fhjlboKP4P6t7L14Vlq7QcYELEQAvQ1xren0hGrd6x1uo9VE5rS8PaWRdCCXqr7d4o r/IMH48dkubG5QV9irORZVwznZnwY4HdfPJ4i4j3FWtxObtPdVc547kWSe3Pcd7/iRUP fya04/fevs1+FcwPe0IEX2VUPZlObQRPqFEeuSLLoeBWCwnUnZl8kacXhVfHQ0RWxQBG y3umjnFJ88ojnuf/QNG6wu5K6Se/zgvf1fKpqEHdu7t4J32j4xYE+O1/g0rFaA834zGQ jPoHYxPWJqIPhYsl3mD/uJavvGuJo4ytAxkk3QBfRATv7kxTrc1fXPLF8jfqLTf9ykHQ mo2w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id b4-20020a17090a800400b00288657cdf5fsi378357pjn.101.2023.12.05.16.57.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Dec 2023 16:57:53 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 3E5ED8048838; Tue, 5 Dec 2023 16:57:51 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376387AbjLFA5b (ORCPT + 99 others); Tue, 5 Dec 2023 19:57:31 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50930 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229802AbjLFA5a (ORCPT ); Tue, 5 Dec 2023 19:57:30 -0500 Received: from pidgin.makrotopia.org (pidgin.makrotopia.org [185.142.180.65]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 99F27D62; Tue, 5 Dec 2023 16:57:33 -0800 (PST) Received: from local by pidgin.makrotopia.org with esmtpsa (TLS1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.96.2) (envelope-from ) id 1rAgE7-0002TW-12; Wed, 06 Dec 2023 00:57:24 +0000 Date: Wed, 6 Dec 2023 00:57:20 +0000 From: Daniel Golle To: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Michael Turquette , Stephen Boyd , Matthias Brugger , AngeloGioacchino Del Regno , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Sabrina Dubroca , Daniel Golle , Jianhui Zhao , Chen-Yu Tsai , "Garmin.Chang" , Sam Shih , Frank Wunderlich , Dan Carpenter , James Liao , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, netdev@vger.kernel.org Subject: [PATCH v3 3/4] clk: mediatek: Add pcw_chg_shift control Message-ID: <40981d0bb722eb509628bcf82c31f632e4cf747a.1701823757.git.daniel@makrotopia.org> References: <23bc89d407e7797e97b703fa939b43bfe79296ce.1701823757.git.daniel@makrotopia.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <23bc89d407e7797e97b703fa939b43bfe79296ce.1701823757.git.daniel@makrotopia.org> X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Tue, 05 Dec 2023 16:57:51 -0800 (PST) From: Sam Shih Introduce pcw_chg_shfit control to optionally use that instead of the hardcoded PCW_CHG_MASK macro. This will needed for clocks on the MT7988 SoC. Signed-off-by: Sam Shih Signed-off-by: Daniel Golle --- v3: use git --from ... v2: no changes drivers/clk/mediatek/clk-pll.c | 5 ++++- drivers/clk/mediatek/clk-pll.h | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/clk/mediatek/clk-pll.c b/drivers/clk/mediatek/clk-pll.c index 513ab6b1b3229..9f08bc5d2a8a2 100644 --- a/drivers/clk/mediatek/clk-pll.c +++ b/drivers/clk/mediatek/clk-pll.c @@ -114,7 +114,10 @@ static void mtk_pll_set_rate_regs(struct mtk_clk_pll *pll, u32 pcw, pll->data->pcw_shift); val |= pcw << pll->data->pcw_shift; writel(val, pll->pcw_addr); - chg = readl(pll->pcw_chg_addr) | PCW_CHG_MASK; + if (pll->data->pcw_chg_shift) + chg = readl(pll->pcw_chg_addr) | BIT(pll->data->pcw_chg_shift); + else + chg = readl(pll->pcw_chg_addr) | PCW_CHG_MASK; writel(chg, pll->pcw_chg_addr); if (pll->tuner_addr) writel(val + 1, pll->tuner_addr); diff --git a/drivers/clk/mediatek/clk-pll.h b/drivers/clk/mediatek/clk-pll.h index f17278ff15d78..d28d317e84377 100644 --- a/drivers/clk/mediatek/clk-pll.h +++ b/drivers/clk/mediatek/clk-pll.h @@ -44,6 +44,7 @@ struct mtk_pll_data { u32 pcw_reg; int pcw_shift; u32 pcw_chg_reg; + int pcw_chg_shift; const struct mtk_pll_div_table *div_table; const char *parent_name; u32 en_reg; -- 2.43.0