Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp713095rwb; Tue, 27 Sep 2022 03:46:09 -0700 (PDT) X-Google-Smtp-Source: AMsMyM78aGluF2lJ4zkaWNTxG1ru7mcY1ID2/hEoS4DApSODRcIp/vwg7Dy4HmNhZpmpktHioh0I X-Received: by 2002:a17:902:cec9:b0:178:5fa6:f3c3 with SMTP id d9-20020a170902cec900b001785fa6f3c3mr26362751plg.83.1664275569509; Tue, 27 Sep 2022 03:46:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664275569; cv=none; d=google.com; s=arc-20160816; b=Cbvi0q0m0VRpUpaEVt+46TOu3Lch4Ejv4Op0Rk7TAkSfnlO+e7T/WA/rCJocy3LfWA /wDCxkidNfZcALFNktTzGEkxepMFZYSoDlIlcC6wF+2OMsTCA8ma9/uzG6U32D9s2Feu pGU+7USa2pwBRavbERA57kkw8KK0bvhqyd4ZBuPJ7KriQEpsuDYuRmNxSTfWPyoJlq3r /zRGqPngpQ6iCZrvDt+Muf5n6hbORCZTjvBhpUhjqrUqsGQEWgEG6mZJTAZJvdIfm8dm Vs9e/x9h0XI1hnN/iLgxYu2NpbzOQijZYrg3JU7R1/pmDVClABqJkWMy1P4LofolgVnz G8Yw== 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=IST5JdHDsuXaZ7FTLSmREauWyPpbkwX3tj/SEszqsvA=; b=uFdkKviKs9odVhTyTE1Ejp7r4bIrXhraS0yF3iZZinwUABhhrCqRc4tay5pCeqMT8m XV83Y3MSat53PXMzA7GuJH2YH2KVRgXaN0rpEQNQ5HKhcw07hEUxeAA6ZUwsTTliBIzL TUmvWo0ins84zzzHwxvNklgCj5Gtu/IHgK9j2s1/oXnkJd6IMDYfuRaj3dEv/4XMf8Dw nlQSsyzRm/2HKjgSfmgetfqkX8QA9QT1s0XTMWca7K2MG/Z6OaBHAjW/rp0DsTlDaMm2 9lP418IGZe1dmiLX8shFvRkw6WHOj3V/VillmYptuusYbIO2WdeZEYS94N+HglgM8mGi TUEw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=Mn30Af4O; 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=NONE sp=NONE dis=NONE) header.from=collabora.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t13-20020a170902e84d00b00176bccea71esi1915244plg.57.2022.09.27.03.45.57; Tue, 27 Sep 2022 03:46:09 -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=@collabora.com header.s=mail header.b=Mn30Af4O; 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=NONE sp=NONE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231961AbiI0KMD (ORCPT + 99 others); Tue, 27 Sep 2022 06:12:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42674 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231836AbiI0KLl (ORCPT ); Tue, 27 Sep 2022 06:11:41 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [46.235.227.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A159D9F77F; Tue, 27 Sep 2022 03:11:40 -0700 (PDT) Received: from IcarusMOD.eternityproject.eu (2-237-20-237.ip236.fastwebnet.it [2.237.20.237]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: kholk11) by madras.collabora.co.uk (Postfix) with ESMTPSA id 78DF1660226A; Tue, 27 Sep 2022 11:11:38 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1664273499; bh=c6labVOlxHaBOFZ68h/R4tczr9z6s9kpvKf0dE8Nn84=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Mn30Af4O5NTdRp/rdLb5NOwwOHcYSYdQ5r8uJBFsgAjZfhiKCni9vF2iNDherWzQf WJFB9Uha2sWGCbI1BV9CD3yFayxxAYNdhiDMBpIqpXAcohnuvB9NppEGry43EBy87M 9jsSLyYC2vXD/dlXaNukDHdwfNU+6OTiJmOmeACSleSO2ViQTPdiItOx4dBlPfebr2 9aykN7n9sG2tLuux/w2fLlbyQsMTyMtpsiN42GrQ5SKNpL6i+g3z2angTgY1kjHquz M5jgwzgSsWJg0u20LjXNa0uHMkf2K5uzckeex7/cIs438rJZJw2u0/YZZqwGmzwqkM xN836mOHP/iKg== From: AngeloGioacchino Del Regno To: matthias.bgg@gmail.com Cc: mturquette@baylibre.com, sboyd@kernel.org, angelogioacchino.delregno@collabora.com, wenst@chromium.org, miles.chen@mediatek.com, rex-bc.chen@mediatek.com, nfraprado@collabora.com, chun-jie.chen@mediatek.com, jose.exposito89@gmail.com, drinkcat@chromium.org, weiyi.lu@mediatek.com, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org Subject: [PATCH v3 05/10] clk: mediatek: clk-mt8195-mfg: Reparent mfg_bg3d and propagate rate changes Date: Tue, 27 Sep 2022 12:11:23 +0200 Message-Id: <20220927101128.44758-6-angelogioacchino.delregno@collabora.com> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220927101128.44758-1-angelogioacchino.delregno@collabora.com> References: <20220927101128.44758-1-angelogioacchino.delregno@collabora.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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_PASS 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 The MFG_BG3D is a gate to enable/disable clock output to the GPU, but the actual output is decided by multiple muxes; in particular: mfg_ck_fast_ref muxes between "slow" (top_mfg_core_tmp) and "fast" (MFGPLL) clock, while top_mfg_core_tmp muxes between the 26MHz clock and various system PLLs. The clock gate comes after all the muxes, so its parent is mfg_ck_fast_reg, not top_mfg_core_tmp. Reparent MFG_BG3D to the latter to match the hardware and add the CLK_SET_RATE_PARENT flag to it: this way we ensure propagating rate changes that are requested on MFG_BG3D along its entire clock tree. Fixes: 35016f10c0e5 ("clk: mediatek: Add MT8195 mfgcfg clock support") Signed-off-by: AngeloGioacchino Del Regno Reviewed-by: Chen-Yu Tsai --- drivers/clk/mediatek/clk-mt8195-mfg.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/clk/mediatek/clk-mt8195-mfg.c b/drivers/clk/mediatek/clk-mt8195-mfg.c index 9411c556a5a9..c94cb71bd9b9 100644 --- a/drivers/clk/mediatek/clk-mt8195-mfg.c +++ b/drivers/clk/mediatek/clk-mt8195-mfg.c @@ -17,10 +17,12 @@ static const struct mtk_gate_regs mfg_cg_regs = { }; #define GATE_MFG(_id, _name, _parent, _shift) \ - GATE_MTK(_id, _name, _parent, &mfg_cg_regs, _shift, &mtk_clk_gate_ops_setclr) + GATE_MTK_FLAGS(_id, _name, _parent, &mfg_cg_regs, \ + _shift, &mtk_clk_gate_ops_setclr, \ + CLK_SET_RATE_PARENT) static const struct mtk_gate mfg_clks[] = { - GATE_MFG(CLK_MFG_BG3D, "mfg_bg3d", "top_mfg_core_tmp", 0), + GATE_MFG(CLK_MFG_BG3D, "mfg_bg3d", "mfg_ck_fast_ref", 0), }; static const struct mtk_clk_desc mfg_desc = { -- 2.37.2