Re: [PATCH v1 2/6] clk: starfive: jh71x0: Move reset controller registration to jh71x0 common code
From: Jerome Brunet
Date: Sun Nov 15 2026 - 09:18:38 EST
> jh7110_reset_controller_register() is only tied to the JH7110 system
> clock driver by its location. Its logic is generic: hand the CRG
> register base to the reset driver through an auxiliary device.
>
> Move it to clk-starfive-jh71x0.c as jh71x0_reset_controller_register()
> so that the clock drivers of other StarFive SoCs can reuse it, and make
> CLK_STARFIVE_JH71X0 select AUXILIARY_BUS accordingly.
>
> While at it, replace the open-coded auxiliary device allocation, init,
> add and release handling with devm_auxiliary_device_create(), which
> already implements all of it. The register base is now passed to the
> reset driver as platform data of the auxiliary device, so struct
> jh71x0_reset_adev and the embedded auxiliary device go away.
>
> The auxiliary device ID is dropped: every CRG already uses a distinct
> auxiliary device name, so the ID is not needed to keep the device names
> unique, and it is always 0 now.
>
> Since the helper now lives in clk-starfive-jh71x0.c, the auxiliary
> device names are prefixed with "clk_starfive_jh71x0" instead of
> "clk_starfive_jh7110_sys". Update the auxiliary_device_id table of the
> JH7110 reset driver in the same patch to keep the tree bisectable.
>
> Signed-off-by: Changhuang Liang <changhuang.liang@xxxxxxxxxxxxxxxx>
> ---
> drivers/clk/starfive/Kconfig | 2 +-
> .../clk/starfive/clk-starfive-jh7110-aon.c | 2 +-
> .../clk/starfive/clk-starfive-jh7110-isp.c | 2 +-
> .../clk/starfive/clk-starfive-jh7110-stg.c | 2 +-
> .../clk/starfive/clk-starfive-jh7110-sys.c | 59 +------------------
> .../clk/starfive/clk-starfive-jh7110-vout.c | 2 +-
> drivers/clk/starfive/clk-starfive-jh7110.h | 4 --
> drivers/clk/starfive/clk-starfive-jh71x0.c | 24 ++++++++
> drivers/clk/starfive/clk-starfive-jh71x0.h | 2 +
> .../reset/starfive/reset-starfive-jh7110.c | 19 +++---
> include/soc/starfive/reset-starfive-jh71x0.h | 10 ++--
> 11 files changed, 45 insertions(+), 83 deletions(-)
>
> diff --git a/drivers/clk/starfive/Kconfig b/drivers/clk/starfive/Kconfig
> index bd29358ffeec..51716655554f 100644
> --- a/drivers/clk/starfive/Kconfig
> +++ b/drivers/clk/starfive/Kconfig
> @@ -2,6 +2,7 @@
>
> config CLK_STARFIVE_JH71X0
> bool
> + select AUXILIARY_BUS
>
> config CLK_STARFIVE_JH7100
> bool "StarFive JH7100 clock support"
> @@ -32,7 +33,6 @@ config CLK_STARFIVE_JH7110_PLL
> config CLK_STARFIVE_JH7110_SYS
> bool "StarFive JH7110 system clock support"
> depends on ARCH_STARFIVE || COMPILE_TEST
> - select AUXILIARY_BUS
> select CLK_STARFIVE_JH71X0
> select RESET_STARFIVE_JH7110 if RESET_CONTROLLER
You've switched to imply for the new controller you are introducing later in this series.
You should probably be consistent and align this one too. Not in this change though, it would
be unrelated.
This change otherwise looks good to me. It requires Philipp's opinion as it is touching reset too.
--
Jerome