Received: by 2002:a05:7412:b130:b0:e2:908c:2ebd with SMTP id az48csp2383198rdb; Mon, 20 Nov 2023 09:21:26 -0800 (PST) X-Google-Smtp-Source: AGHT+IHL7FtVjpbm3MrmSoMNOy0mW65eslyFXkXf8GWkhgggkBHpYlB9IlUGY83ZNRbogyNJwSgy X-Received: by 2002:a05:6a20:4306:b0:187:5be4:67e2 with SMTP id h6-20020a056a20430600b001875be467e2mr12302371pzk.53.1700500885724; Mon, 20 Nov 2023 09:21:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700500885; cv=none; d=google.com; s=arc-20160816; b=sKY26MiyOkOjpr9267NWjKyxTsZgKG50KjFqcisEKO+zhYp2VUNuJHozwrUskWytfx 1n4llp8Azk+p4zwN7bdEzlfXDXW3TqrG8vpbcCkd+nKu/fnglw0RHBAYkUOJb3GK56sR yg4GMIXOmD/aeLo06kmaFP3lr/s1HwwVDPOzW7gocQ+Th6uhZb+lPPWS1toygRrptJZt rob4OQXunt8YBDjbjzNITxdw33E1I1tuVU+SqoP4AHbchvqg5SPsI4GldYGpiXZp3fhB pyo1H4cChGCaCHDHPBd7sCXcQSSagMPnMliEPKTkJwuEKDv0xwQX97fk984CglDhCVzD jjJQ== 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=pISgyEEbNgckM754GgOyys7xZ+HZ3agTVDRjwAkig0I=; fh=B3Zph78rFuWcOCm/qXBEHRCtpd8DMWv/vsl+j3Z4hjw=; b=ldu37HsSvf2/w2xsXngqMQE33RCnYvKYS86rn4pQBjAK2w0LandZVgo+zykdDuqy95 SXsawayDhqcMNbB7vS8JclAXPUYj078tsVgGLEnvnHitHDEHaW3wVDB+6DqRbMbJQurc Vf8oasIj2lKvut6w1KUsB6ZAf9YcUd1o03OXe72V8r57wG2N8cj9EYzajQzGm9nt/uRL x9gwMH94HLP59qDTtc+HiNjm/52QeO1nr/f9X3OIDRXdHUuLX1bTntrYhAZiM22wEEgA OaX64S4FQ5WMKjPawBYsk4gRf/BBcam7QJ/KZ2pd7v4s5sh6iBG3qJc5diJzYgH1740t M+vw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id k11-20020a6568cb000000b005859b2d8d7asi8642819pgt.4.2023.11.20.09.21.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Nov 2023 09:21:25 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 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 lipwig.vger.email (Postfix) with ESMTP id F310A8077536; Mon, 20 Nov 2023 09:20:26 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233708AbjKTRT3 (ORCPT + 99 others); Mon, 20 Nov 2023 12:19:29 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34178 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233804AbjKTRTY (ORCPT ); Mon, 20 Nov 2023 12:19:24 -0500 Received: from pidgin.makrotopia.org (pidgin.makrotopia.org [185.142.180.65]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BD39D1AA; Mon, 20 Nov 2023 09:19:17 -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 1r57vQ-0008L6-0R; Mon, 20 Nov 2023 17:19:09 +0000 Date: Mon, 20 Nov 2023 17:19:05 +0000 From: Daniel Golle To: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Matthias Brugger , AngeloGioacchino Del Regno , Michael Turquette , Stephen Boyd , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Sabrina Dubroca , Daniel Golle , Jianhui Zhao , Chen-Yu Tsai , "Garmin.Chang" , Edward-JW Yang , Johnson Wang , Sam Shih , Frank Wunderlich , Dan Carpenter , James Liao , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-clk@vger.kernel.org, netdev@vger.kernel.org Subject: [PATCH v2 3/4] clk: mediatek: Add pcw_chg_shift control Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 lipwig.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 (lipwig.vger.email [0.0.0.0]); Mon, 20 Nov 2023 09:20:27 -0800 (PST) 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 --- 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.42.1