From patchwork Tue Oct 1 10:50:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andre Przywara X-Patchwork-Id: 13817770 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B8FB2CE7D0D for ; Tue, 1 Oct 2024 10:51:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-Type: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=fYYYUeSTq05Z3gZd7OMqVdpwHdi6b1+TEbpDiOE1spw=; b=gwh/FYcyGjzZ19PrKcFgNhqUbf dGaFtkdPC0RDx11hK0WqJ8bRxpNo3yi3PlTgoJa7bauPbp4e8BQrqlbiLGbwcyaa6OBvQwCRO8kHI 5/OXwWmIXB1jIY9rJ9nOAsyBWE919qt4xLu9CT+MsUAxjO0eJSp60tj98yNM4aAqr2px+zcSZFHDC x3lb9NprbOdMudseRxBdsigsPcvOtg89NrgVSaI04Qv2+U2oWXgcwq5aGkPxr8SChFND7mCI+8HIp dxPxgHOtx53yvwsJZOgqC6Pj6fvHElgRcQiAARLguSeOx/70JK7XI6kBemybO+2Sqjxdi6JfErK+q d8ZGhMWg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1svaTp-00000002Pfn-0anK; Tue, 01 Oct 2024 10:51:45 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1svaSX-00000002POL-0NVQ for linux-arm-kernel@lists.infradead.org; Tue, 01 Oct 2024 10:50:26 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 47DB0339; Tue, 1 Oct 2024 03:50:52 -0700 (PDT) Received: from donnerap.arm.com (donnerap.manchester.arm.com [10.32.101.20]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 2F21F3F587; Tue, 1 Oct 2024 03:50:21 -0700 (PDT) From: Andre Przywara To: Michael Turquette , Stephen Boyd , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland Cc: Maxime Ripard , linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev Subject: [PATCH] clk: sunxi-ng: d1: Fix PLL_AUDIO0 preset Date: Tue, 1 Oct 2024 11:50:16 +0100 Message-Id: <20241001105016.1068558-1-andre.przywara@arm.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241001_035025_192071_173D0127 X-CRM114-Status: GOOD ( 14.99 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org To work around a limitation in our clock modelling, we try to force two bits in the AUDIO0 PLL to 0, in the CCU probe routine. However the ~ operator only applies to the first expression, and does not cover the second bit, so we end up clearing only bit 1. Group the bit-ORing with parentheses, to make it both clearer to read and actually correct. Fixes: 35b97bb94111 ("clk: sunxi-ng: Add support for the D1 SoC clocks") Signed-off-by: Andre Przywara --- Hi, this should double that PLL's frequency by 0, since we drop the unwanted divider. Not sure if anyone has spotted the problem before, and maybe worked around it? If that extra divider is correct, the comment should be adjusted instead. Cheers, Andre drivers/clk/sunxi-ng/ccu-sun20i-d1.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/clk/sunxi-ng/ccu-sun20i-d1.c b/drivers/clk/sunxi-ng/ccu-sun20i-d1.c index 9b5cfac2ee70c..3f095515f54f9 100644 --- a/drivers/clk/sunxi-ng/ccu-sun20i-d1.c +++ b/drivers/clk/sunxi-ng/ccu-sun20i-d1.c @@ -1371,7 +1371,7 @@ static int sun20i_d1_ccu_probe(struct platform_device *pdev) /* Enforce m1 = 0, m0 = 0 for PLL_AUDIO0 */ val = readl(reg + SUN20I_D1_PLL_AUDIO0_REG); - val &= ~BIT(1) | BIT(0); + val &= ~(BIT(1) | BIT(0)); writel(val, reg + SUN20I_D1_PLL_AUDIO0_REG); /* Force fanout-27M factor N to 0. */