mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
To: Chuanhong Guo <gch981213@gmail.com>,
	Stephen Boyd <sboyd@kernel.org>,
	Brian Masney <bmasney+clk@redhat.com>,
	Jerome Brunet <jbrunet+clk@baylibre.com>,
	Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Matthias Brugger <matthias.bgg@gmail.com>
Cc: linux-clk@vger.kernel.org, linux-mediatek@lists.infradead.org,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v2 1/3] clk: mediatek: mt7629: move clock counts out of DT bindings
Date: Mon, 23 Nov 2026 11:09:52 +0100	[thread overview]
Message-ID: <05e5b03e-16f7-4e5b-b6ad-f946b2560ccf@collabora.com> (raw)
In-Reply-To: <20261120-b4-mt7629-rtc-v2-1-cd877cd496ae@gmail.com>

On 11/20/26 15:41, Chuanhong Guo wrote:
> The clock counts used by clk-mt7629.c size the clock provider arrays.
> They are driver implementation details rather than clock IDs used by
> device tree consumers.
> 
> Move CLK_TOP_NR_CLK, CLK_INFRA_NR_CLK, CLK_PERI_NR_CLK and
> CLK_APMIXED_NR_CLK into the driver. Keep their values and all clock IDs
> unchanged.
> 
> Signed-off-by: Chuanhong Guo <gch981213@gmail.com>

If you migrate clk-mt7629 to mtk_clk_simple_{probe,remove}, you will realize that
the CLK_xxxx_NR_CLK definitions are completely useless, and you'll be able to
remove those.

Check other MediaTek clock drivers about how to migrate.

In any case, NR_CLK is always the same as ARRAY_SIZE(that_clock_array)....

Cheers,
Angelo

> ---
>   drivers/clk/mediatek/clk-mt7629.c      | 5 +++++
>   include/dt-bindings/clock/mt7629-clk.h | 4 ----
>   2 files changed, 5 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/clk/mediatek/clk-mt7629.c b/drivers/clk/mediatek/clk-mt7629.c
> index e154771b1b8b..517c43b19f18 100644
> --- a/drivers/clk/mediatek/clk-mt7629.c
> +++ b/drivers/clk/mediatek/clk-mt7629.c
> @@ -17,6 +17,11 @@
>   
>   #include <dt-bindings/clock/mt7629-clk.h>
>   
> +#define CLK_TOP_NR_CLK		108
> +#define CLK_INFRA_NR_CLK		6
> +#define CLK_PERI_NR_CLK		22
> +#define CLK_APMIXED_NR_CLK		7
> +
>   #define MT7629_PLL_FMAX		(2500UL * MHZ)
>   #define CON0_MT7629_RST_BAR	BIT(24)
>   
> diff --git a/include/dt-bindings/clock/mt7629-clk.h b/include/dt-bindings/clock/mt7629-clk.h
> index ad8e6d7f0154..cff9a02e8302 100644
> --- a/include/dt-bindings/clock/mt7629-clk.h
> +++ b/include/dt-bindings/clock/mt7629-clk.h
> @@ -115,7 +115,6 @@
>   #define CLK_TOP_CRYPTO_SEL		105
>   #define CLK_TOP_SGMII_REF_1_SEL		106
>   #define CLK_TOP_10M_SEL			107
> -#define CLK_TOP_NR_CLK			108
>   
>   /* INFRACFG */
>   #define CLK_INFRA_MUX1_SEL		0
> @@ -124,7 +123,6 @@
>   #define CLK_INFRA_DEVAPC_PD		3
>   #define CLK_INFRA_APXGPT_PD		4
>   #define CLK_INFRA_SEJ_PD		5
> -#define CLK_INFRA_NR_CLK		6
>   
>   /* PERICFG */
>   #define CLK_PERIBUS_SEL			0
> @@ -149,7 +147,6 @@
>   #define CLK_PERI_NFI_PD			19
>   #define CLK_PERI_NFIECC_PD		20
>   #define CLK_PERI_FLASH_PD		21
> -#define CLK_PERI_NR_CLK			22
>   
>   /* APMIXEDSYS */
>   #define CLK_APMIXED_ARMPLL		0
> @@ -159,7 +156,6 @@
>   #define CLK_APMIXED_ETH2PLL		4
>   #define CLK_APMIXED_SGMIPLL		5
>   #define CLK_APMIXED_MAIN_CORE_EN	6
> -#define CLK_APMIXED_NR_CLK		7
>   
>   /* SSUSBSYS */
>   #define CLK_SSUSB_U2_PHY_1P_EN		0
> 

  reply	other threads:[~2026-11-23 10:09 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-20 14:41 [PATCH v2 0/3] Add MT7629 RTC clock selection Chuanhong Guo
2026-11-20 14:41 ` [PATCH v2 1/3] clk: mediatek: mt7629: move clock counts out of DT bindings Chuanhong Guo
2026-11-23 10:09   ` AngeloGioacchino Del Regno [this message]
2026-11-20 14:41 ` [PATCH v2 2/3] dt-bindings: clock: mediatek: mt7629: add RTC clock IDs Chuanhong Guo
2026-11-20 14:41 ` [PATCH v2 3/3] clk: mediatek: mt7629: add RTC clock selection Chuanhong Guo

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=05e5b03e-16f7-4e5b-b6ad-f946b2560ccf@collabora.com \
    --to=angelogioacchino.delregno@collabora.com \
    --cc=bmasney+clk@redhat.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=gch981213@gmail.com \
    --cc=jbrunet+clk@baylibre.com \
    --cc=krzk+dt@kernel.org \
    --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=robh@kernel.org \
    --cc=sboyd@kernel.org \
    /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

all inboxes | Powered by JetHome®