public inbox for linux-mediatek@lists.infradead.org
 help / color / mirror / Atom feed
From: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
To: "Nicolas Frattaroli" <nicolas.frattaroli@collabora.com>,
	"Michael Turquette" <mturquette@baylibre.com>,
	"Stephen Boyd" <sboyd@kernel.org>,
	"Rob Herring" <robh@kernel.org>,
	"Krzysztof Kozlowski" <krzk+dt@kernel.org>,
	"Conor Dooley" <conor+dt@kernel.org>,
	"Matthias Brugger" <matthias.bgg@gmail.com>,
	"Guangjie Song" <guangjie.song@mediatek.com>,
	"Laura Nao" <laura.nao@collabora.com>,
	"Nícolas F. R. A. Prado" <nfraprado@collabora.com>,
	"Yassine Oudjana" <y.oudjana@protonmail.com>
Cc: kernel@collabora.com,
	Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>,
	linux-clk@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-mediatek@lists.infradead.org
Subject: Re: [PATCH 3/4] clk: mediatek: Pass device to clk_hw_register for PLLs
Date: Wed, 1 Oct 2025 13:40:52 +0200	[thread overview]
Message-ID: <bddf658c-c9b1-48c7-b39c-0720e9d4c934@collabora.com> (raw)
In-Reply-To: <20250929-mtk-pll-rpm-v1-3-49541777878d@collabora.com>

Il 29/09/25 14:13, Nicolas Frattaroli ha scritto:
> Passing the struct device pointer to clk_hw_register allows for runtime
> power management to work for the registered clocks. However, the
> mediatek PLL clocks do not do this.
> 
> Change this by adding a struct device pointer argument to
> mtk_clk_register_pll, and fix up the only other user of it. Also add a
> new member to the struct mtk_clk_pll for the struct device pointer,
> which is set by mtk_clk_register_pll and is used by
> mtk_clk_register_pll_ops.
> 
> If mtk_clk_register_pll is called with a NULL struct device pointer,
> then everything still works as expected; the clock core will simply
> treat them as previously, i.e. without runtime power management.
> 
> Signed-off-by: Nicolas Frattaroli <nicolas.frattaroli@collabora.com>
> ---
>   drivers/clk/mediatek/clk-pll.c   | 9 ++++++---
>   drivers/clk/mediatek/clk-pll.h   | 4 +++-
>   drivers/clk/mediatek/clk-pllfh.c | 2 +-
>   3 files changed, 10 insertions(+), 5 deletions(-)
> 

..snip..

> diff --git a/drivers/clk/mediatek/clk-pllfh.c b/drivers/clk/mediatek/clk-pllfh.c
> index 83630ee07ee976bf980c8cf2dd35ea24c1b40821..62bfe4a480f14a0a742fb094aff0e6d1a79fe0c3 100644
> --- a/drivers/clk/mediatek/clk-pllfh.c
> +++ b/drivers/clk/mediatek/clk-pllfh.c
> @@ -220,7 +220,7 @@ int mtk_clk_register_pllfhs(struct device_node *node,
>   		if (use_fhctl)
>   			hw = mtk_clk_register_pllfh(pll, pllfh, base);
>   		else
> -			hw = mtk_clk_register_pll(pll, base);
> +			hw = mtk_clk_register_pll(NULL, pll, base);
>   

Seriously, you've done all that work in patch [2/4], and now you're doing that
just only with PLLFH?

Nicolas, c'mon. It's just 5 minutes ahead. :-D

Cheers,
Angelo

>   		if (IS_ERR(hw)) {
>   			pr_err("Failed to register %s clk %s: %ld\n",
> 



  reply	other threads:[~2025-10-01 11:41 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-29 12:13 [PATCH 0/4] MediaTek Runtime Power Management Clocks for PLL Nicolas Frattaroli
2025-09-29 12:13 ` [PATCH 1/4] dt-bindings: clock: mediatek: Add clocks for MT8196 mfgpll Nicolas Frattaroli
2025-09-29 17:31   ` Conor Dooley
2025-09-30 15:57     ` Nicolas Frattaroli
2025-09-30 18:36       ` Conor Dooley
2025-09-29 12:13 ` [PATCH 2/4] clk: mediatek: Refactor pll registration to pass device Nicolas Frattaroli
2025-10-01 11:43   ` AngeloGioacchino Del Regno
2025-09-29 12:13 ` [PATCH 3/4] clk: mediatek: Pass device to clk_hw_register for PLLs Nicolas Frattaroli
2025-10-01 11:40   ` AngeloGioacchino Del Regno [this message]
2025-09-29 12:13 ` [PATCH 4/4] clk: mediatek: Add rpm clocks to clk-mt8196-mfg Nicolas Frattaroli
2025-10-01 11:49   ` AngeloGioacchino Del Regno
2025-10-01 13:17     ` Nicolas Frattaroli
2025-10-06 19:01       ` Nicolas Frattaroli
2025-10-07  7:36         ` AngeloGioacchino Del Regno

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bddf658c-c9b1-48c7-b39c-0720e9d4c934@collabora.com \
    --to=angelogioacchino.delregno@collabora.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=guangjie.song@mediatek.com \
    --cc=kernel@collabora.com \
    --cc=krzk+dt@kernel.org \
    --cc=krzysztof.kozlowski@linaro.org \
    --cc=laura.nao@collabora.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=matthias.bgg@gmail.com \
    --cc=mturquette@baylibre.com \
    --cc=nfraprado@collabora.com \
    --cc=nicolas.frattaroli@collabora.com \
    --cc=robh@kernel.org \
    --cc=sboyd@kernel.org \
    --cc=y.oudjana@protonmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox